Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide a way to disable SSL completely #182

Closed
wants to merge 10 commits into from
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SSL_TYPE=selfsign|letsencrypt|customssl
SSL_TYPE=selfsign|letsencrypt|customssl|none
aiqui marked this conversation as resolved.
Show resolved Hide resolved
DOMAIN=local|your.domain.com
SYSADMIN_EMAIL=administrator@email.com
OPEN_PORT=80
aiqui marked this conversation as resolved.
Show resolved Hide resolved
SSL_PORT=443
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ services:
- DOMAIN=${DOMAIN}
- CERTBOT_EMAIL=${SYSADMIN_EMAIL}
ports:
- "80:80"
- "443:443"
- "${OPEN_PORT}:80"
- "${SSL_PORT}:443"
healthcheck:
test: [ "CMD-SHELL", "nc -z localhost 443 || exit 1" ]
restart: always
Expand Down
8 changes: 7 additions & 1 deletion files/nginx/odk-setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DHPATH=/etc/dh/nginx.pem
if [ ! -e "$DHPATH" ]
if [ ! -e "$DHPATH" ] && [ "$SSL_TYPE" != "none" ]
then
echo "diffie hellman private key does not exist; creating.."
openssl dhparam -out "$DHPATH" 2048
Expand All @@ -25,6 +25,12 @@ if [ "$SSL_TYPE" = "letsencrypt" ]
then
echo "starting nginx with certbot.."
/bin/bash /scripts/entrypoint.sh
elif [ "$SSL_TYPE" = "none" ]
then
perl -i -ne 's/listen 443.*/listen 80;/; print if ! /ssl_/' /etc/nginx/conf.d/odk.conf
rm -f /etc/nginx/conf.d/certbot.conf
echo "starting open nginx (no SSL) without certbot.."
nginx -g "daemon off;"
else
echo "starting nginx without certbot.."
nginx -g "daemon off;"
Expand Down