2022-08-18 09:59:48 +00:00
|
|
|
import Nconf from 'nconf-lite'
|
|
|
|
|
|
|
|
const nconf = new Nconf()
|
2019-02-19 11:34:52 +00:00
|
|
|
|
|
|
|
// Helper method for global usage.
|
|
|
|
nconf.inTest = () => nconf.get('NODE_ENV') === 'test'
|
|
|
|
|
|
|
|
// Config follow the following priority check order:
|
|
|
|
// 1. Enviroment variables
|
|
|
|
// 2. package.json
|
|
|
|
// 3. config/config.json
|
|
|
|
// 4. config/config.default.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Load enviroment variables as first priority
|
|
|
|
nconf.env({
|
|
|
|
separator: '__',
|
|
|
|
whitelist: [
|
|
|
|
'NODE_ENV',
|
2022-08-18 09:59:48 +00:00
|
|
|
'mssql__connectionString',
|
|
|
|
'media__secret',
|
|
|
|
'media__iss',
|
|
|
|
'media__path',
|
|
|
|
'media__filePath',
|
|
|
|
'media__removePath',
|
2019-02-19 11:34:52 +00:00
|
|
|
'frontend__url',
|
2022-08-18 09:59:48 +00:00
|
|
|
'jwtsecret',
|
2019-02-19 11:34:52 +00:00
|
|
|
],
|
|
|
|
parseValues: true,
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2022-04-05 16:47:24 +00:00
|
|
|
// Load empty overrides that can be overwritten later
|
|
|
|
nconf.overrides({})
|
|
|
|
|
|
|
|
nconf.defaults({
|
|
|
|
"NODE_ENV": "development",
|
|
|
|
"frontend": {
|
|
|
|
"url": "http://beta01.nfp.moe"
|
|
|
|
},
|
2022-07-20 00:33:06 +00:00
|
|
|
"jwtsecret": "w2bkdWAButfdfEkCs8dpE3L2n6QzCfhna0T4",
|
2022-04-19 17:42:07 +00:00
|
|
|
"mssql": {
|
2022-06-16 22:44:43 +00:00
|
|
|
"conn_timeout": 5,
|
2022-04-19 17:42:07 +00:00
|
|
|
"floor": 1,
|
|
|
|
"ceiling": 2,
|
|
|
|
"heartbeatSecs": 20,
|
|
|
|
"inactivityTimeoutSecs": 60,
|
|
|
|
"connectionString": "Driver={ODBC Driver 17 for SQL Server}; Server=localhost;UID=dev; PWD=dev; Database=nfp_moe",
|
|
|
|
},
|
2022-07-20 00:33:06 +00:00
|
|
|
"media": {
|
|
|
|
"secret": "upload-secret-key-here",
|
|
|
|
"iss": "dev",
|
|
|
|
"path": "https://media.nfp.is/media/resize",
|
2022-08-12 23:33:50 +00:00
|
|
|
"filePath": "https://media.nfp.is/media",
|
2023-11-20 07:11:57 +00:00
|
|
|
"directFilePath": "https://media.nfp.is/media/noprefix",
|
2022-08-18 09:59:48 +00:00
|
|
|
"removePath": "https://media.nfp.is/media/",
|
2022-07-20 00:33:06 +00:00
|
|
|
"preview": {
|
|
|
|
"out": "base64",
|
|
|
|
"format": "avif",
|
|
|
|
"blur": 10,
|
|
|
|
"resize": {
|
2022-08-20 00:46:19 +00:00
|
|
|
"width": 200,
|
|
|
|
"height": 200,
|
2022-07-20 00:33:06 +00:00
|
|
|
"fit": "inside",
|
|
|
|
"withoutEnlargement": true,
|
|
|
|
"kernel": "lanczos3"
|
|
|
|
},
|
|
|
|
"avif": {
|
2022-08-20 00:46:19 +00:00
|
|
|
"quality": 30,
|
|
|
|
"effort": 9
|
2022-07-20 00:33:06 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"small": {
|
|
|
|
"jpeg": {
|
|
|
|
"format": "jpeg",
|
|
|
|
"resize": {
|
|
|
|
"width": 720,
|
|
|
|
"height": 720,
|
|
|
|
"fit": "inside",
|
|
|
|
"withoutEnlargement": true,
|
|
|
|
"kernel": "lanczos3"
|
|
|
|
},
|
|
|
|
"jpeg": {
|
|
|
|
"quality": 93
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"avif": {
|
|
|
|
"format": "avif",
|
|
|
|
"resize": {
|
|
|
|
"width": 720,
|
|
|
|
"height": 720,
|
|
|
|
"fit": "inside",
|
|
|
|
"withoutEnlargement": true,
|
|
|
|
"kernel": "lanczos3"
|
|
|
|
},
|
|
|
|
"avif": {
|
|
|
|
"quality": 60,
|
|
|
|
"effort": 3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"medium": {
|
|
|
|
"jpeg": {
|
|
|
|
"format": "jpeg",
|
|
|
|
"resize": {
|
|
|
|
"width": 1300,
|
|
|
|
"height": 1300,
|
|
|
|
"fit": "inside",
|
|
|
|
"withoutEnlargement": true,
|
|
|
|
"kernel": "lanczos3"
|
|
|
|
},
|
|
|
|
"jpeg": {
|
|
|
|
"quality": 93
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"avif": {
|
|
|
|
"format": "avif",
|
|
|
|
"resize": {
|
|
|
|
"width": 1300,
|
|
|
|
"height": 1300,
|
|
|
|
"fit": "inside",
|
|
|
|
"withoutEnlargement": true,
|
|
|
|
"kernel": "lanczos3"
|
|
|
|
},
|
|
|
|
"avif": {
|
|
|
|
"quality": 75,
|
|
|
|
"effort": 3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"large": {
|
|
|
|
"jpeg": {
|
|
|
|
"format": "jpeg",
|
|
|
|
"resize": {
|
|
|
|
"width": 3000,
|
|
|
|
"height": 3000,
|
|
|
|
"fit": "inside",
|
|
|
|
"withoutEnlargement": true,
|
|
|
|
"kernel": "lanczos3"
|
|
|
|
},
|
|
|
|
"jpeg": {
|
|
|
|
"quality": 95
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"avif": {
|
|
|
|
"format": "avif",
|
|
|
|
"resize": {
|
|
|
|
"width": 3000,
|
|
|
|
"height": 3000,
|
|
|
|
"fit": "inside",
|
|
|
|
"withoutEnlargement": true,
|
|
|
|
"kernel": "lanczos3"
|
|
|
|
},
|
|
|
|
"avif": {
|
|
|
|
"quality": 85,
|
|
|
|
"effort": 3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2022-08-18 09:59:48 +00:00
|
|
|
"fileSize": 524288000
|
2022-04-05 16:47:24 +00:00
|
|
|
})
|
2019-02-19 11:34:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
export default nconf
|