add a flag to disable ocsp globally

fixes #796
This commit is contained in:
Girish Ramakrishnan
2021-09-22 09:13:16 -07:00
parent 5b70c055cc
commit dff2275a9b
2 changed files with 23 additions and 7 deletions

View File

@@ -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]);
});