summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js31
1 files changed, 30 insertions, 1 deletions
diff --git a/app.js b/app.js
index 46fd041c..33956ce9 100644
--- a/app.js
+++ b/app.js
@@ -125,7 +125,7 @@ app.use(i18n.init)
// routes without sessions
// static files
-app.use('/', express.static(path.join(__dirname, '/public'), { maxAge: config.staticCacheTime }))
+app.use('/', express.static(path.join(__dirname, '/public'), { maxAge: config.staticCacheTime, index: false }))
app.use('/docs', express.static(path.resolve(__dirname, config.docsPath), { maxAge: config.staticCacheTime }))
app.use('/uploads', express.static(path.resolve(__dirname, config.uploadsPath), { maxAge: config.staticCacheTime }))
app.use('/default.md', express.static(path.resolve(__dirname, config.defaultNotePath), { maxAge: config.staticCacheTime }))
@@ -175,6 +175,35 @@ app.set('views', config.viewPath)
app.engine('ejs', ejs.renderFile)
// set view engine
app.set('view engine', 'ejs')
+// set generally available variables for all views
+app.locals.useCDN = config.useCDN
+app.locals.serverURL = config.serverURL
+app.locals.sourceURL = config.sourceURL
+app.locals.allowAnonymous = config.allowAnonymous
+app.locals.allowAnonymousEdits = config.allowAnonymousEdits
+app.locals.allowPDFExport = config.allowPDFExport
+app.locals.authProviders = {
+ facebook: config.isFacebookEnable,
+ twitter: config.isTwitterEnable,
+ github: config.isGitHubEnable,
+ gitlab: config.isGitLabEnable,
+ mattermost: config.isMattermostEnable,
+ dropbox: config.isDropboxEnable,
+ google: config.isGoogleEnable,
+ ldap: config.isLDAPEnable,
+ ldapProviderName: config.ldap.providerName,
+ saml: config.isSAMLEnable,
+ oauth2: config.isOAuth2Enable,
+ oauth2ProviderName: config.oauth2.providerName,
+ openID: config.isOpenIDEnable,
+ email: config.isEmailEnable,
+ allowEmailRegister: config.allowEmailRegister
+}
+
+// Export/Import menu items
+app.locals.enableDropBoxSave = config.isDropboxEnable
+app.locals.enableGitHubGist = config.isGitHubEnable
+app.locals.enableGitlabSnippets = config.isGitlabSnippetsEnable
app.use(require('./lib/web/baseRouter'))
app.use(require('./lib/web/statusRouter'))