From 427d09e643a554a6711b9349f8a6bbc3499dcfb7 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 10 Feb 2025 10:40:06 +0000 Subject: make the listen address configurable - fixes #927 sadly `fastify.listen` doesn't support passing more than 1 address --- packages/backend/src/config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages/backend/src/config.ts') diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 4af1140f36..1a3a916624 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -27,6 +27,7 @@ type RedisOptionsSource = Partial & { type Source = { url?: string; port?: number; + address?: string; socket?: string; chmodSocket?: string; disableHsts?: boolean; @@ -123,6 +124,7 @@ type Source = { export type Config = { url: string; port: number; + address: string; socket: string | undefined; chmodSocket: string | undefined; disableHsts: boolean | undefined; @@ -288,6 +290,7 @@ export function loadConfig(): Config { setupPassword: config.setupPassword, url: url.origin, port: config.port ?? parseInt(process.env.PORT ?? '3000', 10), + address: config.address ?? '0.0.0.0', socket: config.socket, chmodSocket: config.chmodSocket, disableHsts: config.disableHsts, @@ -488,7 +491,7 @@ function applyEnvOverrides(config: Source) { // these are all the settings that can be overridden - _apply_top([['url', 'port', 'socket', 'chmodSocket', 'disableHsts', 'id', 'dbReplications']]); + _apply_top([['url', 'port', 'address', 'socket', 'chmodSocket', 'disableHsts', 'id', 'dbReplications']]); _apply_top(['db', ['host', 'port', 'db', 'user', 'pass', 'disableCache']]); _apply_top(['dbSlaves', Array.from((config.dbSlaves ?? []).keys()), ['host', 'port', 'db', 'user', 'pass']]); _apply_top([ -- cgit v1.2.3-freya