fix: admin/internet: error "port 80" even when test couldn't really be done
Massimo Melina committed
Mar 1, 2024 at 12:10 UTC
71ba15c4ef6ade44e202ddd2f7548eb1e8b491d3
1 file changed
+2
-2
src/acme.ts
+2
-2
@@ -45,13 +45,13 @@ async function generateSSLCert(domain: string, email?: string, altNames?: string
45
try {
46
const checkUrl = `http://${domain}`
47
let check = await selfCheck(checkUrl) // some check services may not consider the domain, but we already verified that
48
- if (check && !check.success && nat.upnp && !nat.mapped80) {
48
+ if (check?.success === false && nat.upnp && !nat.mapped80) {
49
console.debug("setting temporary port forward")
50
tempMap = await upnpClient.createMapping({ private: 80, public: { host: '', port: 80 }, description: 'hfs temporary', ttl: 0 }).catch(() => {})
51
check = await selfCheck(checkUrl) // repeat test
52
}
53
//if (!check) throw new ApiError(HTTP_FAILED_DEPENDENCY, "couldn't test port 80")
54
- if (!check?.success)
54
+ if (check?.success === false)
55
throw new ApiError(HTTP_FAILED_DEPENDENCY, "port 80 is not working on the specified domain")
56
const acmeClient = new acme.Client({
57
accountKey: await acme.crypto.createPrivateKey(),