fun
This commit is contained in:
parent
9452d71724
commit
dedb19bd81
|
|
@ -16,6 +16,8 @@ const host = hostRaw.toString().trim()
|
||||||
let dnsInit = false
|
let dnsInit = false
|
||||||
|
|
||||||
export async function initDNS() {
|
export async function initDNS() {
|
||||||
|
dnsInit = true
|
||||||
|
|
||||||
apps().forEach(publishAppDNS)
|
apps().forEach(publishAppDNS)
|
||||||
|
|
||||||
const signals = ["SIGINT", "SIGTERM"]
|
const signals = ["SIGINT", "SIGTERM"]
|
||||||
|
|
@ -26,15 +28,12 @@ export async function initDNS() {
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
dnsInit = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function publishAppDNS(app: string) {
|
export function publishAppDNS(app: string) {
|
||||||
if (!dnsInit) throw "publishAppDNS() must be called after initDNS()"
|
if (!dnsInit) throw "publishAppDNS() must be called after initDNS()"
|
||||||
if (process.env.NODE_ENV !== "production") return
|
if (process.env.NODE_ENV !== "production") return
|
||||||
|
|
||||||
|
|
||||||
if (!dnsEntries[app])
|
if (!dnsEntries[app])
|
||||||
dnsEntries[app] = Bun.spawn(["avahi-publish", "-a", `${app}.${host}.local`, "-R", ip])
|
dnsEntries[app] = Bun.spawn(["avahi-publish", "-a", `${app}.${host}.local`, "-R", ip])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user