settings: move service setting into services.js

this also introduces getJson/setJson
This commit is contained in:
Girish Ramakrishnan
2023-08-03 11:34:33 +05:30
parent 3caf0c3902
commit bbc6ba1a35
10 changed files with 42 additions and 45 deletions

View File

@@ -88,9 +88,8 @@ function getCertificateDatesSync(cert) {
}
async function getReverseProxyConfig() {
const value = await settings.get(settings.REVERSE_PROXY_CONFIG_KEY);
if (value === null) return { ocsp: true };
return JSON.parse(value);
const value = await settings.getJson(settings.REVERSE_PROXY_CONFIG_KEY);
return value || { ocsp: true };
}
async function isOcspEnabled(certFilePath) {