This commit is contained in:
@@ -41,11 +41,27 @@ npm run build
|
|||||||
./scripts/export-openapi.sh http://127.0.0.1:18080
|
./scripts/export-openapi.sh http://127.0.0.1:18080
|
||||||
```
|
```
|
||||||
|
|
||||||
## R1 Preview 手动部署
|
## R1 Preview 部署方式
|
||||||
|
|
||||||
代码仓库和 Release 已公开。本版交付物是签名的应用压缩包,部署方式固定为“下载、校验、解压、运行本地初始化脚本、
|
代码仓库和 Release 已公开,提供两种互斥方式:
|
||||||
在宝塔创建 Spring Boot 项目”;不再使用 `curl | bash` 一键安装。程序不会安装 MySQL、JDK、Nginx 或其他第三方服务,
|
|
||||||
也不会修改宝塔和反向代理配置。数据库只支持运维人员预先准备的外部 MySQL 8.4.x,PostgreSQL 18 兼容工作继续冻结。
|
1. **systemd 一键安装(推荐)**:程序独占 `/opt/kaidi` 和 `kaidi-finance.service`,不创建宝塔 Java 项目。
|
||||||
|
2. **宝塔手动部署**:下载压缩包后解压并运行本地初始化脚本,再创建 Spring Boot 项目。
|
||||||
|
|
||||||
|
两种方式不能同时运行在同一个端口。程序不会安装 MySQL,数据库只支持运维人员预先准备的外部 MySQL 8.4.x,
|
||||||
|
PostgreSQL 18 兼容工作继续冻结。
|
||||||
|
|
||||||
|
### systemd 一键安装(推荐)
|
||||||
|
|
||||||
|
先在宝塔面板停止并删除当前错误的 Java 项目,再执行:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://git.awaioi.com/ERP-Team/kaidi/releases/download/v1.0.0-preview.26/install.sh | sudo env KAIDI_APP_PORT=18080 bash
|
||||||
|
```
|
||||||
|
|
||||||
|
该命令只安装程序运行所需的 systemd 单元,自动创建 `kaidi` 用户并检测现有 Java 17(包括
|
||||||
|
`/www/server/java/*/bin/java`);没有可用 Java 时才下载匹配架构的运行时。它不会安装 MySQL,也不会要求宝塔面板提供
|
||||||
|
`kaidi` 用户。安装完成后查看 `/root/kaidi-first-login.txt`,通过反向代理域名进入 `/setup`。
|
||||||
|
|
||||||
### 彻底清理旧安装
|
### 彻底清理旧安装
|
||||||
|
|
||||||
|
|||||||
+30
-8
@@ -233,14 +233,8 @@ java_arch_matches_host() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
system_java_home() {
|
java_home_from_bin() {
|
||||||
local java_bin resolved_java java_major home
|
local java_bin=$1 resolved_java java_major home
|
||||||
if [ -n "${KAIDI_JAVA_HOME:-}" ]; then
|
|
||||||
home=${KAIDI_JAVA_HOME%/}
|
|
||||||
java_bin="$home/bin/java"
|
|
||||||
else
|
|
||||||
java_bin=$(command -v java 2>/dev/null || true)
|
|
||||||
fi
|
|
||||||
[ -x "$java_bin" ] || return 1
|
[ -x "$java_bin" ] || return 1
|
||||||
java_major=$(
|
java_major=$(
|
||||||
"$java_bin" -version 2>&1 \
|
"$java_bin" -version 2>&1 \
|
||||||
@@ -258,6 +252,34 @@ system_java_home() {
|
|||||||
printf '%s\n' "$home"
|
printf '%s\n' "$home"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
system_java_home() {
|
||||||
|
local candidate home
|
||||||
|
if [ -n "${KAIDI_JAVA_HOME:-}" ]; then
|
||||||
|
candidate="${KAIDI_JAVA_HOME%/}/bin/java"
|
||||||
|
java_home_from_bin "$candidate" && return 0
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
candidate=$(command -v java 2>/dev/null || true)
|
||||||
|
if [ -n "$candidate" ] && home=$(java_home_from_bin "$candidate"); then
|
||||||
|
printf '%s\n' "$home"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
# Baota commonly keeps JDKs outside PATH. Prefer an existing Java 17 there
|
||||||
|
# before consulting the remote Azul metadata endpoint.
|
||||||
|
for candidate in \
|
||||||
|
/www/server/java/*/bin/java \
|
||||||
|
/www/server/java/*/jre/bin/java \
|
||||||
|
/usr/lib/jvm/*/bin/java \
|
||||||
|
/usr/java/*/bin/java; do
|
||||||
|
[ -x "$candidate" ] || continue
|
||||||
|
if home=$(java_home_from_bin "$candidate"); then
|
||||||
|
printf '%s\n' "$home"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
prepare_java() {
|
prepare_java() {
|
||||||
local api java_metadata package_metadata package_uuid java_url java_sha256 actual_sha256 system_home java_line
|
local api java_metadata package_metadata package_uuid java_url java_sha256 actual_sha256 system_home java_line
|
||||||
if system_home=$(system_java_home); then
|
if system_home=$(system_java_home); then
|
||||||
|
|||||||
@@ -326,6 +326,8 @@ grep -Fq '[ "$actual_sha256" = "$java_sha256" ]' "$ROOT/deploy/install.sh" \
|
|||||||
|| fail 'installer no longer verifies the Java runtime SHA-256'
|
|| fail 'installer no longer verifies the Java runtime SHA-256'
|
||||||
grep -Fq 'https://git.awaioi.com/api/v1/repos/ERP-Team/kaidi/releases/latest' "$ROOT/deploy/install.sh" \
|
grep -Fq 'https://git.awaioi.com/api/v1/repos/ERP-Team/kaidi/releases/latest' "$ROOT/deploy/install.sh" \
|
||||||
|| fail 'installer default release source is not the public Gitea latest API'
|
|| fail 'installer default release source is not the public Gitea latest API'
|
||||||
|
grep -Fq '/www/server/java/*/bin/java' "$ROOT/deploy/install.sh" \
|
||||||
|
|| fail 'installer does not search the common Baota Java installation path'
|
||||||
# shellcheck disable=SC2016 # Match literal installer source.
|
# shellcheck disable=SC2016 # Match literal installer source.
|
||||||
grep -Fq 'TRUSTED_PUBLIC_KEY_SHA256=${KAIDI_RELEASE_PUBLIC_KEY_SHA256:-807c6aec1dc3f7ce494db16aa9d763c66f292033c38f328afd0390d2715a8cd9}' "$ROOT/deploy/install.sh" \
|
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'
|
|| fail 'installer does not pin the default release public-key fingerprint'
|
||||||
|
|||||||
Reference in New Issue
Block a user