diff --git a/back/admin.Dockerfile b/back/admin.Dockerfile index 526f6f3..f9cf901 100644 --- a/back/admin.Dockerfile +++ b/back/admin.Dockerfile @@ -3,6 +3,7 @@ FROM debian:latest # Change these ENV LISTEN_PORT=4441 ENV ADMIN_EMAIL='me@example.com' +ENV SERVER_NAME='wg-test-admin.ksn.gf4' # Install deps RUN apt-get update && apt-get install --yes \ @@ -16,18 +17,16 @@ RUN chown -R www-data:www-data /usr/lib/wgapi /var/log/wgapi /var/local/wgapi_to # Configure apache RUN a2enmod cgi rewrite -RUN sed -i "s/^Listen 80$/Listen ${LISTEN_PORT}/" \ - /etc/apache2/ports.conf -RUN sed -i "s/^$//" \ - /etc/apache2/sites-available/000-default.conf -RUN sed -i "s/ServerAdmin .*$/ServerAdmin ${ADMIN_EMAIL}/" \ - /etc/apache2/sites-available/000-default.conf -RUN sed -i "s|DocumentRoot .*$|DocumentRoot /var/www\n\tScriptAlias / /usr/lib/cgi-bin/|" \ +RUN sed -i "s/^Listen 80$/Listen ${LISTEN_PORT}/" /etc/apache2/ports.conf +RUN sed -i -e "s/^$//" \ + -e "s/ServerAdmin .*$/ServerAdmin ${ADMIN_EMAIL}/" \ + -e "s/#ServerName .*$/ServerName ${SERVER_NAME}/" \ + -e 's|#Include conf-available/serve-cgi-bin.conf|Include conf-available/serve-cgi-bin.conf|' \ /etc/apache2/sites-available/000-default.conf -# Allow http to run these binaries as root with sudo +# Allow http user to run these binaries as root with sudo RUN echo "www-data ALL=(ALL:ALL) NOPASSWD: /usr/bin/wg, /usr/bin/openssl, /usr/bin/[, /usr/bin/tee, /bin/cat, /bin/mkdir, /bin/rm, /bin/chmod, /bin/chgrp" \ -| sudo EDITOR='tee -a' visudo + | sudo EDITOR='tee -a' visudo # Copy over CGIs and libs COPY admin_peer.cgi /usr/lib/cgi-bin/peer diff --git a/back/dashboard.Dockerfile b/back/dashboard.Dockerfile index 77fd41a..8eb4ecc 100644 --- a/back/dashboard.Dockerfile +++ b/back/dashboard.Dockerfile @@ -22,7 +22,7 @@ RUN sed -i "s/^Listen 80$/Listen ${LISTEN_PORT}/" \ RUN sed -i -e "s/^$//" \ -e "s/ServerAdmin .*$/ServerAdmin ${ADMIN_EMAIL}/" \ -e "s/#ServerName .*$/ServerName ${SERVER_NAME}/" \ - -e '/#Include conf-available/serve-cgi-bin.conf/s/^\t#/\t/' \ + -e 's|#Include conf-available/serve-cgi-bin.conf|Include conf-available/serve-cgi-bin.conf|' \ /etc/apache2/sites-available/000-default.conf # Allow http user to run these binaries as root with sudo