Just use port 80 and be done with it

master
Keith Irwin 2022-11-07 15:29:46 -07:00
parent 1477c79abe
commit 5e0df1dc95
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
3 changed files with 4 additions and 12 deletions

View File

@ -12,10 +12,7 @@ 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 ${ADMIN_PORT}/" /etc/apache2/ports.conf
RUN sed -i -e "s/^<VirtualHost \*:80>$/<VirtualHost *:${ADMIN_PORT}>/" \
-e "s|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|" \
-e "s/ServerAdmin .*$/ServerAdmin ${ADMIN_EMAIL}/" \
RUN sed -i 's|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|' \
/etc/apache2/sites-available/000-default.conf
# Allow http user to run these binaries as root with sudo
@ -29,5 +26,5 @@ COPY admin_user.cgi /usr/lib/cgi-bin/user
COPY lib/ /usr/lib/wgapi/
# Run time!
EXPOSE ${ADMIN_PORT}
EXPOSE 80
CMD ["apachectl", "-D", "FOREGROUND"]

View File

@ -13,9 +13,7 @@ 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 ${DASHBOARD_PORT}/" /etc/apache2/ports.conf
RUN sed -i -e "s/^<VirtualHost \*:80>$/<VirtualHost *:${DASHBOARD_PORT}>/" \
-e "s|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|" \
-e "s/ServerAdmin .*$/ServerAdmin ${ADMIN_EMAIL}/" \
RUN sed -i "s|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|" \
/etc/apache2/sites-available/000-default.conf
# Allow http user to run these binaries as root with sudo
@ -29,5 +27,5 @@ COPY dashboard_ssl.cgi /usr/lib/cgi-bin/ssl
COPY lib/ /usr/lib/wgapi/
# Run time!
EXPOSE ${DASHBOARD_PORT}
EXPOSE 80
CMD ["apachectl", "-D", "FOREGROUND"]

View File

@ -2,9 +2,6 @@
# FILE: /etc/wgapi/config
# DESCRIPTION: Admin-editable configs
ADMIN_PORT=8080
DASHBOARD_PORT=8081
ADMIN_EMAIL='me@example.com'
export TLD='tld'
export LOGFILE='/var/log/apache2/error.log'
export LOCAL_SERVER='myhost'