From f157e6e820f055b33dd31009883df3ce181bf6f5 Mon Sep 17 00:00:00 2001 From: Kamesuta Date: Mon, 7 Apr 2025 02:40:03 +0900 Subject: [PATCH] support SHOKKU_CERT for manual TLS setup --- bootstrap.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 5a246db..c71275c 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -62,8 +62,13 @@ create-shokku-app() { echo "==> deploying" dokku config:unset shokku DOKKU_SKIP_DEPLOY &>/dev/null - echo "==> enabling letsencrypt" - dokku letsencrypt:enable shokku &>/dev/null + if [ -z "$SHOKKU_CERT" ]; then + echo "==> enabling letsencrypt" + dokku letsencrypt:enable shokku &>/dev/null + else + echo "==> adding certificate from SHOKKU_CERT" + dokku certs:add shokku < "$SHOKKU_CERT" + fi } main() { @@ -77,9 +82,11 @@ main() { exit 1 fi - if ! dokku plugin:installed letsencrypt; then - echo "Please setup letsencrypt using the instructions at https://dokku.com/docs/deployment/application-deployment/#setting-up-ssl" 1>&2 - exit 1 + if [ -z "$SHOKKU_CERT" ]; then + if ! dokku plugin:installed letsencrypt; then + echo "Please setup letsencrypt using the instructions at https://dokku.com/docs/deployment/application-deployment/#setting-up-ssl" 1>&2 + exit 1 + fi fi for plugin in redis postgres mongo mysql; do