Logging api key.

This commit is contained in:
Samuel Clay 2019-04-13 16:26:53 -04:00
parent 23bec565f6
commit 755eaba268
3 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
[program:node_text]
command=node --experimental-modules node/original_text.js
command=node node/original_text.js
directory=/srv/newsblur
environment=NODE_ENV=production
user=sclay

View file

@ -26,7 +26,7 @@ app.get /\/rss_feeds\/original_text_fetcher\/?/, (req, res) =>
api_key = req.header 'x-api-key'
if not DEV and (!api_key or api_key.indexOf "djtXZrSIEfDa3Dex9FQ9AR" == -1)
log.debug "Mismatched API key: #{url}"
log.debug "Mismatched API key: #{url} / #{api_key}"
return res.end JSON.stringify error: "Invalid API key. You need to set up your own Original Text server."
Mercury.parse(url).then (result) =>

View file

@ -39,7 +39,7 @@
}
api_key = req.header('x-api-key');
if (!DEV && (!api_key || api_key.indexOf("djtXZrSIEfDa3Dex9FQ9AR" === -1))) {
log.debug("Mismatched API key: " + url);
log.debug("Mismatched API key: " + url + " / " + api_key);
return res.end(JSON.stringify({
error: "Invalid API key. You need to set up your own Original Text server."
}));