fix: keep public demo online during optional upstream DNS outages

This commit is contained in:
archipelago
2026-10-05 16:15:41 -04:00
parent 415826f0a6
commit 157c9ec055
2 changed files with 14 additions and 1 deletions
+10
View File
@@ -1,7 +1,17 @@
#!/bin/sh
set -eu
# Copy nginx config template
cp /etc/nginx/nginx.conf.template /etc/nginx/nginx.conf
# Use the container's own DNS (Docker and Podman use different addresses).
# Resolve the optional external demo only on request, so its DNS outage cannot
# prevent the dashboard from starting. Only IP literals enter nginx syntax.
resolvers=$(awk '$1 == "nameserver" && $2 ~ /^[0-9a-fA-F:.]+$/ {
if (index($2, ":")) printf "[%s] ", $2; else printf "%s ", $2
}' /etc/resolv.conf)
[ -n "$resolvers" ] || resolvers="1.1.1.1 8.8.8.8"
sed -i "s/__ARCHY_DNS_RESOLVERS__/$resolvers/g" /etc/nginx/nginx.conf
# Ensure client_max_body_size 0 is present (unlimited uploads)
# This is a safety net in case the config template was cached without the directive
if ! grep -q 'client_max_body_size' /etc/nginx/nginx.conf; then