diff --git a/README.md b/README.md index 14e53ed..8b06d0c 100644 --- a/README.md +++ b/README.md @@ -163,18 +163,19 @@ GRANT ALL PRIVILEGES ON kaidi_finance.* TO 'kaidi'@'KAIDI_SERVER_IP'; 管理员数据和运维人员新增的环境变量: ```bash -curl -fsSL https://git.awaioi.com/ERP-Team/kaidi/releases/download/v1.0.0-preview.19/install.sh \ +curl -fsSL https://git.awaioi.com/ERP-Team/kaidi/releases/download/v1.0.0-preview.22/install.sh \ | sudo env KAIDI_REINSTALL=true KAIDI_SETUP_WIZARD=false bash ``` 没有显式设置 `KAIDI_APP_PORT` 时,修复性重装会沿用 `/etc/kaidi/kaidi.env` 中的原端口。重装失败会恢复原应用链接、Java 运行时、环境文件和 systemd 单元;脚本会明确报告回滚不完整, -不会把恢复失败吞掉。 +不会把恢复失败吞掉。新版本安装器在 `KAIDI_REINSTALL=true` 时默认使用生产修复模式,显式的 +`KAIDI_SETUP_WIZARD=false` 仅用于兼容旧版本安装器。 如果安装器已完成但向导尚未提交,可执行下面的命令重新生成一次性安装码;该恢复路径只接受仍处于向导模式且未锁定的安装,正式模式不会被覆盖。 ```bash -curl -fsSL https://git.awaioi.com/ERP-Team/kaidi/releases/download/v1.0.0-preview.19/install.sh \ - | sudo env KAIDI_REINSTALL=true bash +curl -fsSL https://git.awaioi.com/ERP-Team/kaidi/releases/download/v1.0.0-preview.22/install.sh \ + | sudo env KAIDI_REINSTALL=true KAIDI_SETUP_WIZARD=true bash ``` ### 停用并移除程序 diff --git a/deploy/install.sh b/deploy/install.sh index b4401b2..b684727 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -18,7 +18,13 @@ SERVER_ADDRESS=${KAIDI_SERVER_ADDRESS:-127.0.0.1} PROXY_TARGET= TRUSTED_PUBLIC_KEY_SHA256=${KAIDI_RELEASE_PUBLIC_KEY_SHA256:-807c6aec1dc3f7ce494db16aa9d763c66f292033c38f328afd0390d2715a8cd9} REINSTALL=${KAIDI_REINSTALL:-false} -SETUP_WIZARD=${KAIDI_SETUP_WIZARD:-true} +if [ "${KAIDI_SETUP_WIZARD+x}" = x ]; then + SETUP_WIZARD=$KAIDI_SETUP_WIZARD +elif [ "$REINSTALL" = true ]; then + SETUP_WIZARD=false +else + SETUP_WIZARD=true +fi WORK_DIR= RELEASE_AUTH_HEADER_FILE= INSTALL_TRANSACTION_ARMED=false diff --git a/scripts/test-install-fixture.sh b/scripts/test-install-fixture.sh index 3d6146b..d49dcdf 100755 --- a/scripts/test-install-fixture.sh +++ b/scripts/test-install-fixture.sh @@ -325,8 +325,11 @@ grep -Fq 'https://git.awaioi.com/api/v1/repos/ERP-Team/kaidi/releases/latest' "$ grep -Fq 'TRUSTED_PUBLIC_KEY_SHA256=${KAIDI_RELEASE_PUBLIC_KEY_SHA256:-807c6aec1dc3f7ce494db16aa9d763c66f292033c38f328afd0390d2715a8cd9}' "$ROOT/deploy/install.sh" \ || fail 'installer does not pin the default release public-key fingerprint' # shellcheck disable=SC2016 # Match literal installer source. -grep -Fq 'SETUP_WIZARD=${KAIDI_SETUP_WIZARD:-true}' "$ROOT/deploy/install.sh" \ - || fail 'installer does not enable the first-run setup wizard by default' +grep -Fq 'if [ "${KAIDI_SETUP_WIZARD+x}" = x ]; then' "$ROOT/deploy/install.sh" \ + || fail 'installer no longer distinguishes an explicit setup-wizard selection' +# shellcheck disable=SC2016 # Match literal installer source. +grep -Fq 'elif [ "$REINSTALL" = true ]; then' "$ROOT/deploy/install.sh" \ + || fail 'repair reinstall no longer defaults to production mode' ! grep -Fq 'docker run' "$ROOT/deploy/install.sh" \ || fail 'installer must not create a MySQL container' ! grep -Fq 'install_docker' "$ROOT/deploy/install.sh" \