mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-04 17:06:49 +00:00
Update configs for active hosts only on ddns update
Other changes: - Fixed null property read error on clients (when switching to public access) - Use separate `resolvedAddress` field for resolved IP instead of overwriting address - Reduced ddns log verbosity
This commit is contained in:
@ -64,15 +64,13 @@ const ddnsResolver = {
|
||||
* @returns {Promise}
|
||||
*/
|
||||
_queryHost: (host) => {
|
||||
logger.info('Looking up IP for ', host);
|
||||
return utils.execSafe('getent', ['hosts', host])
|
||||
.then((result) => {
|
||||
if (result.length < 8) {
|
||||
logger.error('IP lookup returned invalid output: ', result);
|
||||
logger.error(`IP lookup for ${host} returned invalid output: ${result}`);
|
||||
throw error.ValidationError('Invalid output from getent hosts');
|
||||
}
|
||||
const out = result.split(/\s+/);
|
||||
logger.info(`Resolved ${host} to ${out[0]}`);
|
||||
return out[0];
|
||||
},
|
||||
(error) => {
|
||||
|
@ -113,7 +113,11 @@ const ddnsUpdater = {
|
||||
for (const row of rows) {
|
||||
if (!updatedRows.has(row.id)) {
|
||||
updatedRows.set(row.id, 1);
|
||||
proxy_hosts.push(...row.proxy_hosts);
|
||||
for (const host of row.proxy_hosts) {
|
||||
if (host.enabled) {
|
||||
proxy_hosts.push(host);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user