no dns in dev mode
This commit is contained in:
parent
b44c4d10fb
commit
88640d7acf
|
|
@ -16,6 +16,7 @@ const host = hostRaw.toString().trim()
|
||||||
let dnsInit = false
|
let dnsInit = false
|
||||||
|
|
||||||
export async function initDNS() {
|
export async function initDNS() {
|
||||||
|
if (process.env.NODE_ENV !== "production") return
|
||||||
dnsInit = true
|
dnsInit = true
|
||||||
|
|
||||||
apps().forEach(publishAppDNS)
|
apps().forEach(publishAppDNS)
|
||||||
|
|
@ -31,8 +32,8 @@ export async function initDNS() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function publishAppDNS(app: string) {
|
export function publishAppDNS(app: string) {
|
||||||
if (!dnsInit) throw "publishAppDNS() must be called after initDNS()"
|
|
||||||
if (process.env.NODE_ENV !== "production") return
|
if (process.env.NODE_ENV !== "production") return
|
||||||
|
if (!dnsInit) throw "publishAppDNS() must be called after initDNS()"
|
||||||
|
|
||||||
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