settings: move trusted ip setting to reverseproxy

This commit is contained in:
Girish Ramakrishnan
2023-08-02 19:14:18 +05:30
parent f2317c2a81
commit 8fe992318e
2 changed files with 6 additions and 19 deletions

View File

@@ -734,7 +734,8 @@ async function handleCertificateProviderChanged(domain) {
}
async function getTrustedIps() {
return await settings.getTrustedIps();
const value = await settings.get(settings.TRUSTED_IPS_KEY);
return value || '';
}
async function setTrustedIps(trustedIps) {
@@ -750,7 +751,7 @@ async function setTrustedIps(trustedIps) {
trustedIpsConfig += `set_real_ip_from ${rangeOrIP};\n`;
}
await settings.setTrustedIps(trustedIps);
await settings.set(settings.TRUSTED_IPS_KEY, trustedIps);
if (!safe.fs.writeFileSync(paths.NGINX_TRUSTED_IPS_FILE, trustedIpsConfig, 'utf8')) throw new BoxError(BoxError.FS_ERROR, safe.error.message);
await reload();
}