Skip to content

Commit

Permalink
Fix SSL cert generation when domain has a port included
Browse files Browse the repository at this point in the history
  • Loading branch information
supercid committed Apr 24, 2024
1 parent 4dd2e62 commit 43bf981
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compose/bin/setup-ssl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ if ! bin/docker-compose exec -T -u root app cat /root/.local/share/mkcert/rootCA
fi

# Generate the certificate for the specified domain
bin/docker-compose exec -T -u root app mkcert -key-file nginx.key -cert-file nginx.crt "$@"
DOMAIN_WITHOUT_PORT=$(echo "$@" | cut -d ':' -f1)
bin/docker-compose exec -T -u root app mkcert -key-file nginx.key -cert-file nginx.crt "$DOMAIN_WITHOUT_PORT"
echo "Moving key and cert to /etc/nginx/certs/..."
bin/docker-compose exec -T -u root app chown app:app nginx.key nginx.crt
bin/docker-compose exec -T -u root app mv nginx.key nginx.crt /etc/nginx/certs/
Expand Down

0 comments on commit 43bf981

Please sign in to comment.