aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2018-09-13 21:16:44 +0200
committerJohannes Zellner <johannes@cloudron.io>2018-09-13 21:16:44 +0200
commit8a5c7d41224e6c232ea6095168f456d1887e112c (patch)
tree5be2308ffc0dd766f8aea5eeb8f07fdca6c019b7
parente34255790fdb950092768e29145bac126f218610 (diff)
downloadSurfer-8a5c7d41224e6c232ea6095168f456d1887e112c.tar.gz
Surfer-8a5c7d41224e6c232ea6095168f456d1887e112c.tar.zst
Surfer-8a5c7d41224e6c232ea6095168f456d1887e112c.zip
disable folder listing by default and do not show welcome screen when enabled
-rwxr-xr-xserver.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/server.js b/server.js
index 60c1bdd..f661e87 100755
--- a/server.js
+++ b/server.js
@@ -29,7 +29,7 @@ var configFile = path.resolve(__dirname, process.argv[3] || '.config.json');
29mkdirp.sync(rootFolder); 29mkdirp.sync(rootFolder);
30 30
31var config = { 31var config = {
32 folderListingEnabled: true 32 folderListingEnabled: false
33}; 33};
34 34
35function getSettings(req, res, next) { 35function getSettings(req, res, next) {
@@ -87,7 +87,7 @@ app.use(router);
87app.use('/_admin', express.static(__dirname + '/frontend')); 87app.use('/_admin', express.static(__dirname + '/frontend'));
88app.use('/', express.static(rootFolder)); 88app.use('/', express.static(rootFolder));
89app.use('/', function welcomePage(req, res, next) { 89app.use('/', function welcomePage(req, res, next) {
90 if (req.path !== '/') return next(); 90 if (config.folderListingEnabled || req.path !== '/') return next();
91 res.status(200).sendFile(path.join(__dirname, '/frontend/welcome.html')); 91 res.status(200).sendFile(path.join(__dirname, '/frontend/welcome.html'));
92}); 92});
93app.use('/', function (req, res, next) { 93app.use('/', function (req, res, next) {