Fix IPv6 listen default (#470)
Co-authored-by: KK <kk@KKs-Mac-Studio.local>
This commit is contained in:
committed by
GitHub
parent
0209372a6d
commit
d13423b9dd
@@ -1,8 +1,16 @@
|
||||
import { resolve } from 'path'
|
||||
import { homedir } from 'os'
|
||||
|
||||
export function getListenHost(env: Record<string, string | undefined> = process.env): string | undefined {
|
||||
const host = env.BIND_HOST?.trim()
|
||||
return host || undefined
|
||||
}
|
||||
|
||||
export const config = {
|
||||
port: parseInt(process.env.PORT || '8648', 10),
|
||||
// Leave host undefined by default so Node binds to IPv6 when available,
|
||||
// falling back to IPv4 on systems without IPv6 support.
|
||||
host: getListenHost(),
|
||||
upstream: process.env.UPSTREAM || 'http://127.0.0.1:8642',
|
||||
uploadDir: process.env.UPLOAD_DIR || resolve(homedir(), '.hermes-web-ui', 'upload'),
|
||||
dataDir: resolve(__dirname, '..', 'data'),
|
||||
|
||||
Reference in New Issue
Block a user