diff --git a/install-stack.sh b/install-stack.sh index b4993f8..d11c3b0 100755 --- a/install-stack.sh +++ b/install-stack.sh @@ -962,6 +962,18 @@ if [[ "${1:-}" == "--only" ]]; then key="${line%%=*}"; value="${line#*=}" export "$key"="$value" done < "$CREDS_FILE" + # Generate and append any secrets that didn't exist when the stack was first installed + _append_secret() { + local var=$1 val=$2 + export "$var"="$val" + echo "${var}=${val}" >> "$CREDS_FILE" + msg_ok "Generated missing secret: ${var}" + } + [[ -z "${SETTINGS_DB_PASS:-}" ]] && _append_secret SETTINGS_DB_PASS \ + "$(openssl rand -base64 24 | tr -dc 'a-zA-Z0-9' | head -c 24)" + [[ -z "${SETTINGS_SECRET:-}" ]] && _append_secret SETTINGS_SECRET \ + "$(openssl rand -hex 32)" + USE_FORGEJO=true [[ -f /root/.ssh/hotel-manage_deploy.pub ]] \ && MGMT_PUBKEY=$(cat /root/.ssh/hotel-manage_deploy.pub) || MGMT_PUBKEY=""