diff options
author | lolcat <lolcat@no-reply@lolcat.ca> | 2024-02-09 07:29:45 -0600 |
---|---|---|
committer | lolcat <lolcat@no-reply@lolcat.ca> | 2024-02-09 07:29:45 -0600 |
commit | c85d132211092bfe7f7a40082e55785c965af617 (patch) | |
tree | 4a8c43315f1b7a4776e2d19caa5f75f970b86108 /docker/docker-entrypoint.sh | |
parent | 5648fcf2634968f113190e5af7148fc1977fc329 (diff) | |
parent | b3515bc0636e15d42c796ac31e4e088c007e55b2 (diff) |
Merge pull request 'modify docker entrypoint' (#35) from feature/fix_docker_apache into master
Reviewed-on: https://git.lolcat.ca/lolcat/4get/pulls/35
Diffstat (limited to 'docker/docker-entrypoint.sh')
-rwxr-xr-x | docker/docker-entrypoint.sh | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index bbb8229..0a41ddd 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -1,20 +1,13 @@ #!/bin/sh 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 +if [ ! -f /etc/4get/certs/fullchain.pem ] || [ ! -f /etc/4get/certs/privkey.pem ]; then + echo "Using http configuration" + cp /etc/apache2/http.conf /etc/apache2/httpd.conf +else + echo "Using https configuration" + cp /etc/apache2/https.conf /etc/apache2/httpd.conf fi - php82 ./docker/gen_config.php |