Add environment variable to set Onion-Location header

This commit is contained in:
Supernova 2020-08-15 16:44:20 +00:00
parent 1758ee90f8
commit afaa102ea3
2 changed files with 13 additions and 0 deletions

View file

@ -36,6 +36,15 @@ md.use(require("markdown-it-anchor"));
md.use(require("markdown-it-table-of-contents"), { "includeLevel": [2, 3], "listType": "ol" });
md.use(require('markdown-it-title'));
if(process.env.ONION_URL)
{
router.get('/*', (req, res, next) => {
res.header('Onion-Location', process.env.ONION_URL);
next();
});
}
router.get('/', (req, res) => {
res.render('index')
});

View file

@ -16,3 +16,7 @@
# Expected format: "XXXXXXXXXXXXXXXXXXXXX"
# If none is provided (default), Twitter accounts are not verified
#TWITTER_API_AUTH=
# Tor Onion URL
# The full http:// onion url to add as an 'Onion-Location' header
#ONION_URL=