fix: keep setup database config empty and isolate Baota mode
Release / release (push) Successful in 19m31s

This commit is contained in:
Qiufeng
2026-08-18 19:50:14 +08:00
parent 69f738465e
commit 36f1a8b00d
4 changed files with 47 additions and 44 deletions
+8 -3
View File
@@ -586,9 +586,11 @@ configure_database() {
if [ "$SETUP_WIZARD" = true ]; then
[ -z "${KAIDI_DB_URL:-}${KAIDI_DB_USERNAME:-}${KAIDI_DB_PASSWORD:-}" ] \
|| die "Do not pass database credentials when KAIDI_SETUP_WIZARD=true; enter them in the browser wizard"
DB_URL='jdbc:mysql://setup.invalid:3306/kaidi_finance'
DB_USERNAME=setup_pending
DB_PASSWORD=setup_pending
# First-run mode does not create a datasource. Keep database fields empty
# so hosting panels cannot mistake a placeholder for a local MySQL service.
DB_URL=
DB_USERNAME=
DB_PASSWORD=
return 0
fi
if [ "$REINSTALL" = true ]; then
@@ -613,6 +615,7 @@ configure_database() {
database_host() {
local endpoint host_port
[ -n "$DB_URL" ] || { printf ''; return; }
endpoint=${DB_URL#jdbc:mysql://}
host_port=${endpoint%%/*}
printf '%s' "${KAIDI_DB_HOST:-${host_port%%:*}}"
@@ -620,6 +623,7 @@ database_host() {
database_port() {
local endpoint host_port candidate
[ -n "$DB_URL" ] || { printf ''; return; }
endpoint=${DB_URL#jdbc:mysql://}
host_port=${endpoint%%/*}
candidate=${host_port##*:}
@@ -629,6 +633,7 @@ database_port() {
database_name() {
local endpoint name
[ -n "$DB_URL" ] || { printf ''; return; }
endpoint=${DB_URL#jdbc:mysql://}
name=${endpoint#*/}
name=${name%%\?*}