skins: finalize support for multiple skins

The old "static/custom" directory is replaced by "static/skins/<skinName>",
where <skinName> is taken from settings.json.
When no value is found, a default of "no-skin" is assumed, so that backward
compatibility is maintained.

The most evident security concerns have been addressed.

Closes #3471.
This commit is contained in:
muxator 2018-08-26 03:43:53 +02:00 committed by muxator
parent e34c74b24d
commit 9c990ab08a
5 changed files with 14 additions and 14 deletions

View file

@ -26,7 +26,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
//serve robots.txt
args.app.get('/robots.txt', function(req, res)
{
var filePath = path.join(settings.root, "src", "static", "custom", "robots.txt");
var filePath = path.join(settings.root, "src", "static", "skins", settings.skinName, "robots.txt");
res.sendFile(filePath, function(err)
{
//there is no custom favicon, send the default robots.txt which dissallows all
@ -79,7 +79,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
//serve favicon.ico from all path levels except as a pad name
args.app.get( /\/favicon.ico$/, function(req, res)
{
var filePath = path.join(settings.root, "src", "static", "custom", "favicon.ico");
var filePath = path.join(settings.root, "src", "static", "skins", settings.skinName, "favicon.ico");
res.sendFile(filePath, function(err)
{