Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

fix(docker): fall back to IPv4-only nginx when IPv6 is unavailable (#1287)

Miguel Ribeiroa41bae7acdee
diff --git a/includes/version.php b/includes/version.php
index 35be175..0ee3d3e 100644
--- a/includes/version.php
+++ b/includes/version.php
@@ -1,3 +1,3 @@
<?php
-$version = "v5.10.1";
+$version = "v5.10.2";
?>
diff --git a/startup.sh b/startup.sh
index 7db3022..0591b41 100644
--- a/startup.sh
+++ b/startup.sh
@@ -16,6 +16,13 @@ chown -R www-data:www-data /var/www/html
chown -R www-data:www-data /tmp
chmod -R 770 /tmp
+# nginx is configured dual-stack ([::]:80 ipv6only=off). If the kernel has IPv6
+# disabled, that socket cannot be created and nginx exits, so listen on IPv4 only.
+if [ ! -e /proc/net/if_inet6 ]; then
+ echo "IPv6 not available, configuring nginx to listen on IPv4 only"
+ sed -i 's/listen\( *\)\[::\]:80 ipv6only=off;/listen\180;/' /etc/nginx/nginx.conf /etc/nginx/http.d/default.conf
+fi
+
# PIDs we’ll track
PHP_FPM_PID=
NGINX_PID=