Add take-down notice

parent 07dd3781
Pipeline #71369877 failed with stage
in 1 minute and 2 seconds
......@@ -26,6 +26,24 @@ const api = require('./api.js')
// --------------------------------------------------------------------------------------------------------------------
// setup
const msg = [
'Dear users,',
'',
'After multiple phishing links have been added by bots/people',
'over the course of the past year, I have decided that I don\'t',
'have the time or energy to keep taking them down every time',
'I get a notification from my registrar or hosting provider.',
'',
'Unfortunately this means that the bad guys have won in this',
'area of the internet, but if you\'d like to install and use',
'a small URL shortner built in nodejs and using Postgres then',
'feel free to check out https://gitlab.com/webdev.sh/pow.gd',
'',
'Many thanks for using the service over the years.',
'',
'-- Andy (@andychilton) <https://chilts.org>',
].join('\n')
const log = LogFmtr.default()
const faviconFilename = path.join(__dirname, '..', 'public', 'favicon.ico')
......@@ -122,7 +140,9 @@ app.use((req, res, next) => {
app.get(
'/',
(req, res) => {
return res.send('Site has been taken down due to spam.')
res.setHeader('Content-Type', 'text/plain')
res.send(msg)
return
stats.home.inc()
......@@ -138,9 +158,11 @@ app.get(
app.post(
'/',
limiter,
// limiter,
async (req, res) => {
return res.send('Site has been taken down due to spam.')
res.setHeader('Content-Type', 'text/plain')
res.send(msg)
return
// deconstruct all of the input fields
console.log('body:', req.body)
......@@ -292,7 +314,9 @@ app.get(
app.get(
'/:code',
async (req, res, next) => {
return res.send('Site has been taken down due to spam.')
res.setHeader('Content-Type', 'text/plain')
res.send(msg)
return
// firstly, see if we need to knock the last '+' off
let codeOrPage = 'code'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment