diff options
-rw-r--r-- | README.md | 13 | ||||
-rw-r--r-- | docker-compose.yaml | 2 | ||||
-rwxr-xr-x | docker/docker-entrypoint.sh | 14 |
3 files changed, 25 insertions, 4 deletions
@@ -224,13 +224,20 @@ Obviously replace `<youronionaddress>` by the onion address of `/var/lib/tor/4ge ## Docker Install + +``` +docker run -d -p 80:80 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_SERVER_ADMIN_EMAIL="you@example.com" luuul/4get:latest +``` + +With SSL ``` -docker run -d -p 80:80 -p 443:443 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_SERVER_ADMIN_EMAIL="you@example.com" -v /etc/letsencrypt/live/domain.tld:/etc/4get/certs luuul/4get:1.0.0 +docker run -d -p 443:443 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_SERVER_ADMIN_EMAIL="you@example.com" -v /etc/letsencrypt/live/domain.tld:/etc/4get/certs luuul/4get:latest ``` replace enviroment variables FOURGET_SERVER_NAME and FOURGET_SERVER_ADMIN_EMAIL with relevant values -the certs directory expects files named `cert.pem`, `chain.pem`, `privkey.pem` +if the certificate files are not mounted to /etc/4get/certs the service listens to port 80 +the certificate directory expects files named `cert.pem`, `chain.pem`, `privkey.pem` ## Docker compose @@ -244,7 +251,7 @@ version: "3.7" services: fourget: - image: luuul/4get:1.0.0 + image: luuul/4get:latest restart: always environment: - FOURGET_SERVER_NAME=4get.ca diff --git a/docker-compose.yaml b/docker-compose.yaml index 3c34548..a5eaf35 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,7 @@ version: "3.7" services: fourget: - image: luuul/4get:1.0.0 + image: luuul/4get:latest restart: always environment: - FOURGET_SERVER_NAME=beak.chat diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 939e59b..89bd7cf 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -2,4 +2,18 @@ set -e sed -i "s/ServerName.*/ServerName ${FOURGET_SERVER_NAME}/g" /etc/apache2/httpd.conf sed -i "s/ServerAdmin.*/ServerAdmin ${FOURGET_SERVER_ADMIN_EMAIL}/g" /etc/apache2/httpd.conf + +if [ ! -f /etc/4get/certs/cert.pem ] || [ ! -f /etc/4get/certs/chain.pem ] || [ ! -f /etc/4get/certs/privkey.pem ]; then + # remove SSL VirtualHost + echo "No certificate files detected. Listening on port 80" + sed -i '/<VirtualHost \*:443>/,/<\/VirtualHost>/d' /etc/apache2/httpd.conf + + # prepend Listen 80 to /apache2/httpd.conf + echo "Listen 80" > /etc/apache2/httpd.conf_temp + cat /etc/apache2/httpd.conf >> /etc/apache2/httpd.conf_temp + mv /etc/apache2/httpd.conf_temp /etc/apache2/httpd.conf +fi + +echo "4get is running" exec httpd -DFOREGROUND + |