You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update multiple subdomains, useful for IPv6 where there is no NAT so each individual server publicly exposes their address instead of the router's, and you can't CNAME when another record (like AAAA) exists, so you end up with lots of duplicate A records. New configuration property string[] subdomains, backwards compatible with configuration using string subdomain. Added RuntimeUpgradeNotifier to restart the service if the .NET Runtime gets upgraded out from under the process before it crashes.
async _ =>{// this retry is to handle the case where the service starts before the computer connects to the network on bootup, not where Gandi's API servers are down
},maxAttempts:null,delay: _ =>TimeSpan.FromSeconds(3), ex =>exis not (OutOfMemoryException or GandiException{InnerException:ClientErrorException}),
43
-
beforeRetry:async(i,e)=>
44
-
logger.LogWarning("Failed to fetch existing DNS record from Gandi HTTP API server, retrying (attempt {attempt}): {message}",i+2,e.MessageChain()),ct);
45
-
46
-
logger.LogInformation("On startup, the {fqdn} DNS A record is pointing to {address}",configuration.Value.fqdn,selfWanAddress?.ToString()??"(nothing)");
// this retry is to handle the case where the service starts before the computer connects to the network on bootup, not where Gandi's API servers are down
},maxAttempts:null,delay:Retrier.Delays.Constant(TimeSpan.FromSeconds(3)), ex =>exis not (OutOfMemoryException or GandiException{InnerException:ClientErrorException}),
48
+
beforeRetry:async(i,e)=>
49
+
logger.LogWarning("Failed to fetch existing DNS record from Gandi HTTP API server, retrying (attempt {attempt}): {message}",i+2,e.MessageChain()),ct);
50
+
51
+
logger.LogInformation("On startup, the {subdomain}.{domain} DNS A record is pointing to {address}",subdomain,configuration.Value.domain,
"This computer's public IP address changed from {old} to {new} according to {server} ({serverAddr}) and {extraServerCount:N0} other STUN servers, updating {fqdn} A record in DNS server",
"This computer's public IP address changed from {old} to {new} according to {server} ({serverAddr}) and {extraServerCount:N0} other STUN servers, updating {recordCount} A records in DNS server",
$"This computer's public IP address changed from {selfWanAddress} to {originalResponse.SelfWanAddress}, according to {originalResponse.Server.Host} ({originalResponse.ServerAddress}) and {unanimity-1:N0} others, updating {configuration.Value.fqdn} A record in DNS server",
86
-
EventLogEntryType.Information,1);
95
+
eventLog?.WriteEntry(
96
+
$"This computer's public IP address changed from {selfWanAddress} to {originalResponse.SelfWanAddress}, according to {originalResponse.Server.Host} ({originalResponse.ServerAddress}) and {unanimity-1:N0} others, updating {configuration.Value.subdomains.Count} A records in DNS server",
logger.LogWarning("Not updating DNS A record because there was a disagreement among {serverCount:N0} STUN servers about our public IP address, leaving it set to {value}",
104
+
unanimity,selfWanAddress);
105
+
}
91
106
}else{
92
-
logger.LogWarning("Not updating DNS A record for {fqdn} because there was a disagreement among {serverCount:N0} STUN servers about our public IP address, leaving it set to {value}",
logger.LogDebug("Not updating DNS A records because they are all already set to {value}",selfWanAddress);
94
109
}
95
110
}else{
96
-
logger.LogDebug("Not updating DNS A record for {fqdn} because it is already set to {value}",configuration.Value.fqdn,selfWanAddress);
111
+
logger.LogDebug("STUN request to {server} ({serverAddr}) did not return a public WAN IP address, will try again with a different server next time",originalResponse.Server.Host,
logger.LogError(e,"Failed to update DNS record for {subdomain}.{domain} to {newAddr} due to DNS API server error",subdomain,configuration.Value.domain,currentIPAddress);
136
+
if(eisGandiException.AuthException or {InnerException:ForbiddenException or NotAuthorizedException}){
137
+
throw;
138
+
}
121
139
}
140
+
}else{
141
+
logger.LogInformation("Dry run mode, not updating {subdomain}.{domain} to {newAddr}. To actually make DNS changes, change {dryRun} from true to false in appsettings.json.",subdomain,
logger.LogInformation("Dry run mode, not updating {fqdn} to {newAddr}. To actually make DNS changes, change {dryRun} from true to false in appsettings.json.",configuration.Value.fqdn,
0 commit comments