From 99edf0f5f440320fb23d222b3d56b172a61d32d3 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 2 Apr 2020 02:57:32 +1000 Subject: [PATCH 1/2] Add ability to change Apache port for network_mode: host (#291) --- Dockerfile | 1 + docker/entrypoint.sh | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 315483f..bde127c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,7 @@ ENV PASSWORD=password ENV TELEMETRY=false ENV ENABLE_ID_OBFUSCATION=false ENV REDACT_IP_ADDRESSES=false +ENV WEBPORT=80 # Final touches diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 3ff07c9..3ef4d3d 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -24,7 +24,6 @@ if [ "$MODE" == "backend" ]; then fi fi - # Set up index.php for frontend-only or standalone modes if [ "$MODE" == "frontend" ]; then cp /speedtest/frontend.php /var/www/html/index.php @@ -52,6 +51,11 @@ if [[ "$TELEMETRY" == "true" && ( "$MODE" == "frontend" || "$MODE" == "standalon chown www-data /database/ fi +# Allow selection of Apache port for network_mode: host +if [ "$WEBPORT" != "80" ]; then + sed -i "s/80/$WEBPORT/g" /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf +fi + echo "Done, Starting APACHE" From 063a6cc371eae1d5774eef3e30e596db575bdb85 Mon Sep 17 00:00:00 2001 From: Zhang Sen Date: Sun, 12 Jul 2020 19:47:17 +0800 Subject: [PATCH 2/2] Fix #334 wrong port config generated (#335) * Fix #334 wrong port config generated * Update docker/entrypoint.sh --- docker/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 3ef4d3d..46fe498 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -53,7 +53,8 @@ fi # Allow selection of Apache port for network_mode: host if [ "$WEBPORT" != "80" ]; then - sed -i "s/80/$WEBPORT/g" /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf + sed -i "s/^Listen 80\$/Listen $WEBPORT/g" /etc/apache2/ports.conf + sed -i "s/*:80>/*:$WEBPORT>/g" /etc/apache2/sites-available/000-default.conf fi