]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
fix: allow disabling IPv6
authorthomas <me@thomasanderson.cloud>
Fri, 8 Sep 2023 05:44:07 +0000 (01:44 -0400)
committerBastien Wirtz <bastien.wirtz@gmail.com>
Sat, 21 Oct 2023 12:16:20 +0000 (05:16 -0700)
Dockerfile
README.md
ipv6.sh [new file with mode: 0755]
lighttpd.conf

index 2e2e4934bec5930ad713323ae70f4bcf8bfc04e1..9c872f5686d87f957fafce5ebede21d93dc7a67a 100644 (file)
@@ -24,6 +24,7 @@ RUN addgroup -S lighttpd -g ${GID} && adduser -D -S -u ${UID} lighttpd lighttpd
 WORKDIR /www
 
 COPY lighttpd.conf /lighttpd.conf
+COPY ipv6.sh /etc/lighttpd/ipv6.sh
 COPY entrypoint.sh /entrypoint.sh
 COPY --from=build-stage --chown=${UID}:${GID} /app/dist /www/
 COPY --from=build-stage --chown=${UID}:${GID} /app/dist/assets /www/default-assets
index d69796aa3494cc924d7b50cc3df5a7d432810357..db2781d240e5094498d4ac60c0e03ad045c596ba 100644 (file)
--- a/README.md
+++ b/README.md
@@ -97,6 +97,8 @@ If you would like to host Homer in a subfolder, (ex: *http://my-domain/**homer**
 * **`PORT`** (default: `8080`)
 If you would like to change internal port of Homer from default `8080` to your port choice.
 
+* **`IPV6_DISABLE`** (default: null)
+Set to a non-empty value to disable listening on IPv6.
 
 #### With docker-compose
 
diff --git a/ipv6.sh b/ipv6.sh
new file mode 100755 (executable)
index 0000000..c013ed6
--- /dev/null
+++ b/ipv6.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Enable IPV6 if needed
+if test -z "$IPV6_DISABLE"; then
+       echo '$SERVER["socket"] == "[::]:" + env.PORT {  }'
+fi
index 2bf043fba8d6fd991559f87ef1b6fc38e24b0542..a6e9ff5f21d8530fa20f4062f2ba6ef2afd22b8f 100644 (file)
@@ -1,7 +1,7 @@
 include "/etc/lighttpd/mime-types.conf"
+include_shell "/etc/lighttpd/ipv6.sh"
 
 server.port            = env.PORT
-$SERVER["socket"] == "[::]:" + env.PORT {  }
 server.modules         = ( "mod_alias" )
 server.username        = "lighttpd"
 server.groupname       = "lighttpd"