From ce2d3e945a906e56ef43ef29d329a9f39314fcef Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 8 Sep 2023 01:44:07 -0400 Subject: fix: allow disabling IPv6 --- Dockerfile | 1 + README.md | 2 ++ ipv6.sh | 6 ++++++ lighttpd.conf | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 ipv6.sh diff --git a/Dockerfile b/Dockerfile index 2e2e493..9c872f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index d69796a..db2781d 100644 --- 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 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 diff --git a/lighttpd.conf b/lighttpd.conf index 2bf043f..a6e9ff5 100644 --- a/lighttpd.conf +++ b/lighttpd.conf @@ -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" -- cgit v1.2.3