@@ -16,6 +16,8 @@ exports = module.exports = {
|
||||
getDynamicDnsConfig,
|
||||
setDynamicDnsConfig,
|
||||
|
||||
getReverseProxyConfig, // no setter yet since we have no UI for this
|
||||
|
||||
getUnstableAppsConfig,
|
||||
setUnstableAppsConfig,
|
||||
|
||||
@@ -97,6 +99,7 @@ exports = module.exports = {
|
||||
SUPPORT_CONFIG_KEY: 'support_config',
|
||||
DIRECTORY_CONFIG_KEY: 'directory_config',
|
||||
GHOSTS_CONFIG_KEY: 'ghosts_config',
|
||||
REVERSE_PROXY_CONFIG_KEY: 'reverseproxy_config',
|
||||
|
||||
// strings
|
||||
AUTOUPDATE_PATTERN_KEY: 'autoupdate_pattern',
|
||||
@@ -169,6 +172,9 @@ const gDefaults = (function () {
|
||||
retentionPolicy: { keepWithinSecs: 2 * 24 * 60 * 60 }, // 2 days
|
||||
schedulePattern: '00 00 23 * * *' // every day at 11pm
|
||||
};
|
||||
result[exports.REVERSE_PROXY_CONFIG_KEY] = {
|
||||
ocsp: true
|
||||
};
|
||||
result[exports.SERVICES_CONFIG_KEY] = {};
|
||||
result[exports.EXTERNAL_LDAP_KEY] = {
|
||||
provider: 'noop',
|
||||
@@ -557,6 +563,12 @@ async function setDirectoryConfig(directoryConfig) {
|
||||
notifyChange(exports.DIRECTORY_CONFIG_KEY, directoryConfig);
|
||||
}
|
||||
|
||||
async function getReverseProxyConfig() {
|
||||
const value = await get(exports.REVERSE_PROXY_CONFIG_KEY);
|
||||
if (value === null) return gDefaults[exports.REVERSE_PROXY_CONFIG_KEY];
|
||||
return JSON.parse(value);
|
||||
}
|
||||
|
||||
async function getAppstoreListingConfig() {
|
||||
const value = await get(exports.APPSTORE_LISTING_CONFIG_KEY);
|
||||
if (value === null) return gDefaults[exports.APPSTORE_LISTING_CONFIG_KEY];
|
||||
@@ -674,7 +686,7 @@ async function list() {
|
||||
result[exports.DEMO_KEY] = !!result[exports.DEMO_KEY];
|
||||
|
||||
// convert JSON objects
|
||||
[exports.BACKUP_CONFIG_KEY, exports.DIRECTORY_CONFIG_KEY, exports.SERVICES_CONFIG_KEY, exports.EXTERNAL_LDAP_KEY, exports.REGISTRY_CONFIG_KEY, exports.SYSINFO_CONFIG_KEY ].forEach(function (key) {
|
||||
[exports.BACKUP_CONFIG_KEY, exports.DIRECTORY_CONFIG_KEY, exports.SERVICES_CONFIG_KEY, exports.EXTERNAL_LDAP_KEY, exports.REGISTRY_CONFIG_KEY, exports.SYSINFO_CONFIG_KEY, exports.REVERSE_PROXY_CONFIG_KEY ].forEach(function (key) {
|
||||
result[key] = typeof result[key] === 'object' ? result[key] : safe.JSON.parse(result[key]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user