Files
kami-parse-server/src/defaults.js
Worathiti Manosroi 7e54265f6d Security: limit Masterkey remote access (#4017)
* update choose_password to have the confirmation

* add comment mark

* First version, no test

* throw error right away instead of just use masterKey false

* fix the logic

* move it up before the masterKey check

* adding some test

* typo

* remove the choose_password

* newline

* add cli options

* remove trailing space

* handle  in case the server is behind proxy

* add getting the first ip in the ip list of xff

* sanity check the ip in config if it is a valid ip address

* split ip extraction to another function

* trailing spaces
2017-07-23 12:26:30 -04:00

41 lines
1.0 KiB
JavaScript

import {nullParser} from './cli/utils/parsers';
const logsFolder = (() => {
let folder = './logs/';
if (typeof process !== 'undefined' && process.env.TESTING === '1') {
folder = './test_logs/'
}
if (process.env.PARSE_SERVER_LOGS_FOLDER) {
folder = nullParser(process.env.PARSE_SERVER_LOGS_FOLDER);
}
return folder;
})();
const { verbose, level } = (() => {
const verbose = process.env.VERBOSE ? true : false;
return { verbose, level: verbose ? 'verbose' : undefined }
})();
export default {
DefaultMongoURI: 'mongodb://localhost:27017/parse',
jsonLogs: process.env.JSON_LOGS || false,
logsFolder,
verbose,
level,
silent: false,
enableAnonymousUsers: true,
allowClientClassCreation: true,
maxUploadSize: '20mb',
verifyUserEmails: false,
preventLoginWithUnverifiedEmail: false,
sessionLength: 31536000,
expireInactiveSessions: true,
revokeSessionOnPasswordReset: true,
schemaCacheTTL: 5000, // in ms
cacheTTL: 5000,
cacheMaxSize: 10000,
userSensitiveFields: ['email'],
objectIdSize: 10,
masterKeyIps: []
}