diff options
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -29,20 +29,17 @@ var response = require('./lib/response') var models = require('./lib/models') // generate front-end constants by template -var configJson = config.raw var constpath = path.join(__dirname, './public/js/lib/common/constant.ejs') -var googleApiKey = (fs.existsSync('/run/secrets/google_apiKey') && config.handleDockerSecret('google_apiKey')) || process.env.HMD_GOOGLE_API_KEY || (configJson.google && configJson.google.apiKey) || '' -var googleClientID = (fs.existsSync('/run/secrets/google_clientID') && config.handleDockerSecret('google_clientID')) || process.env.HMD_GOOGLE_CLIENT_ID || (configJson.google && configJson.google.clientID) || '' -var dropboxAppKey = (fs.existsSync('/run/secrets/dropbox_appKey') && config.handleDockerSecret('dropbox_appKey')) || process.env.HMD_DROPBOX_APP_KEY || (configJson.dropbox && configJson.dropbox.appKey) || '' var data = { domain: config.domain, urlpath: config.urlpath, debug: config.debug, version: config.version, - GOOGLE_API_KEY: googleApiKey, - GOOGLE_CLIENT_ID: googleClientID, - DROPBOX_APP_KEY: dropboxAppKey + GOOGLE_API_KEY: config.google.clientSecret, + GOOGLE_CLIENT_ID: config.google.clientID, + DROPBOX_APP_KEY: config.dropbox.clientSecret } + ejs.renderFile(constpath, data, {}, function (err, str) { if (err) throw new Error(err) fs.writeFileSync(path.join(__dirname, './public/build/constant.js'), str) @@ -204,7 +201,7 @@ function startListen () { server.listen(config.port, function () { var schema = config.usessl ? 'HTTPS' : 'HTTP' logger.info('%s Server listening at port %d', schema, config.port) - config.maintenance = false + realtime.maintenance = false }) } |