fix: keep public demo online during optional upstream DNS outages
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user