mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-24 05:48:08 +08:00
Enhancement: improve dual-stack support (#6070)
Some checks failed
Docker CI / Linting Checks (push) Has been cancelled
Docs / Linting Checks (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Docs / Test Build Docs (push) Has been cancelled
Docs / Build & Deploy Docs (push) Has been cancelled
Some checks failed
Docker CI / Linting Checks (push) Has been cancelled
Docs / Linting Checks (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Docs / Test Build Docs (push) Has been cancelled
Docs / Build & Deploy Docs (push) Has been cancelled
This commit is contained in:
@@ -12,6 +12,15 @@ export PGID=${PGID:-0}
|
||||
|
||||
export HOMEPAGE_BUILDTIME=$(date +%s)
|
||||
|
||||
# Try IPv6 first (dual stack when available), but fall back to IPv4 if the bind fails
|
||||
export HOSTNAME=${HOSTNAME:-::}
|
||||
if [ "$HOSTNAME" = "::" ]; then
|
||||
if ! node -e "const server = require('http').createServer(() => {}); const host = '::'; const port = process.env.PORT || 3000; server.once('error', (err) => { console.error('IPv6 bind failed:', err.message); process.exit(1); }); server.listen(port, host, () => server.close(() => process.exit(0)));"; then
|
||||
echo "Falling back to IPv4 bind at 0.0.0.0"
|
||||
export HOSTNAME=0.0.0.0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check ownership before chown
|
||||
if [ -e /app/config ]; then
|
||||
CURRENT_UID=$(stat -c %u /app/config)
|
||||
|
||||
Reference in New Issue
Block a user