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