Skip to content

Commit de68fc5

Browse files
committed
change ip diff error to warning
1 parent c6fd8ac commit de68fc5

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

packages/unraid-api-plugin-connect/src/service/cloud.service.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ export class CloudService {
7272
return await this.fastCheckCloud();
7373
}
7474
const apiKey = this.connectConfig.getConfig().apikey;
75-
if (!apiKey) {
76-
throw new Error('No API key found');
77-
}
7875
const cachedCloudCheck = CloudService.cache.get('cloudCheck');
7976
if (cachedCloudCheck) {
8077
// this.logger.verbose('Cache hit for cloud check %O', cachedCloudCheck);
@@ -211,12 +208,23 @@ export class CloudService {
211208
resolve(hostname).then(([address]) => address),
212209
]);
213210

214-
if (!local.includes(network))
211+
if (!local.includes(network)) {
212+
// Question: should we actually throw an error, or just log a warning?
213+
//
214+
// This is usually due to cloudflare's load balancing.
215+
// if `dig +short mothership.unraid.net` shows both IPs, then this should be safe to ignore.
216+
// this.logger.warn(
217+
// `Local and network resolvers showing different IP for "${hostname}". [local="${
218+
// local ?? 'NOT FOUND'
219+
// }"] [network="${network ?? 'NOT FOUND'}"].`
220+
// );
221+
215222
throw new Error(
216223
`Local and network resolvers showing different IP for "${hostname}". [local="${
217224
local ?? 'NOT FOUND'
218225
}"] [network="${network ?? 'NOT FOUND'}"]`
219226
);
227+
}
220228

221229
// The user likely has a PI-hole or something similar running.
222230
if (ip.isPrivate(local))

0 commit comments

Comments
 (0)