settings: move trusted ip setting to reverseproxy
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user