2020-02-16 09:03:43 -05:00
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS207: Consider shorter variations of null checks
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
|
|
|
const http = require('http');
|
|
|
|
http.globalAgent.maxSockets = 300;
|
2014-04-28 11:45:59 -04:00
|
|
|
|
2020-02-16 09:03:43 -05:00
|
|
|
const Settings = {
|
|
|
|
internal: {
|
|
|
|
docstore: {
|
|
|
|
port: 3016,
|
|
|
|
host: process.env['LISTEN_ADDRESS'] || "localhost"
|
|
|
|
}
|
|
|
|
},
|
2014-04-28 11:45:59 -04:00
|
|
|
|
2020-02-16 09:03:43 -05:00
|
|
|
mongo:{},
|
2015-06-01 17:24:40 -04:00
|
|
|
|
2020-02-16 09:03:43 -05:00
|
|
|
docstore: {
|
|
|
|
healthCheck: {
|
2018-09-28 07:39:11 -04:00
|
|
|
project_id: process.env['HEALTH_CHECK_PROJECT_ID']
|
2020-02-16 09:03:43 -05:00
|
|
|
}
|
|
|
|
},
|
2015-11-06 07:42:44 -05:00
|
|
|
|
2020-02-16 09:03:43 -05:00
|
|
|
max_doc_length: 2 * 1024 * 1024 // 2mb
|
|
|
|
};
|
2016-11-28 11:51:43 -05:00
|
|
|
|
2020-02-16 09:03:43 -05:00
|
|
|
if (process.env['MONGO_CONNECTION_STRING'] != null) {
|
|
|
|
Settings.mongo.url = process.env['MONGO_CONNECTION_STRING'];
|
|
|
|
} else if (process.env['MONGO_HOST'] != null) {
|
|
|
|
Settings.mongo.url = `mongodb://${process.env['MONGO_HOST']}/sharelatex`;
|
|
|
|
} else {
|
|
|
|
Settings.mongo.url = "mongodb://127.0.0.1/sharelatex";
|
|
|
|
}
|
2018-09-28 06:50:38 -04:00
|
|
|
|
2020-02-16 09:03:43 -05:00
|
|
|
if ((process.env['AWS_ACCESS_KEY_ID'] != null) && (process.env['AWS_SECRET_ACCESS_KEY'] != null) && (process.env['AWS_BUCKET'] != null)) {
|
|
|
|
Settings.docstore.s3 = {
|
|
|
|
key: process.env['AWS_ACCESS_KEY_ID'],
|
|
|
|
secret: process.env['AWS_SECRET_ACCESS_KEY'],
|
2018-05-23 07:20:37 -04:00
|
|
|
bucket: process.env['AWS_BUCKET']
|
2020-02-16 09:03:43 -05:00
|
|
|
};
|
|
|
|
}
|
2018-09-28 06:50:38 -04:00
|
|
|
|
2020-02-16 09:03:43 -05:00
|
|
|
module.exports = Settings;
|