feat(deploy): 默认安装 ONLYOFFICE 标准组件
This commit is contained in:
+10
-5
@@ -309,7 +309,8 @@ ctms_require_docker_compose() {
|
||||
fi
|
||||
}
|
||||
|
||||
# 安装/更新所需依赖。openssl、curl 仅在非 dev 环境要求(dev 用默认密钥、不做 RSA 生成)。
|
||||
# 安装/更新所需依赖。所有环境都需要 openssl 生成独立的 ONLYOFFICE JWT 密钥;
|
||||
# main/release 还会用它生成登录 RSA 密钥。
|
||||
ctms_require_dependencies() {
|
||||
local env="$1"
|
||||
ctms_require_env "$env"
|
||||
@@ -317,10 +318,7 @@ ctms_require_dependencies() {
|
||||
|
||||
ctms_require_command docker "安装 Docker Engine 或 Docker Desktop,并确认 docker 命令可用" || missing=1
|
||||
ctms_require_command curl "Linux: sudo apt-get install -y curl | macOS: brew install curl" || missing=1
|
||||
# openssl 仅非 dev 需要:dev 用 dev-secret 与空 RSA key,不生成密钥
|
||||
if [[ "$env" != "dev" ]]; then
|
||||
ctms_require_command openssl "Linux: sudo apt-get install -y openssl | macOS: brew install openssl" || missing=1
|
||||
fi
|
||||
ctms_require_command openssl "Linux: sudo apt-get install -y openssl | macOS: brew install openssl" || missing=1
|
||||
[[ "$missing" -eq 0 ]] || ctms_fail "系统依赖不完整,请按上方提示安装后重试"
|
||||
|
||||
if ! docker compose version >/dev/null 2>&1; then
|
||||
@@ -541,6 +539,7 @@ ctms_upsert_env_value() {
|
||||
ctms_write_env_file() {
|
||||
local project_name="$1" runtime_env="$2" login_key_id="$3"
|
||||
local jwt_secret="$4" rsa_private_key="$5"
|
||||
local onlyoffice_jwt_secret="$6" onlyoffice_instance_id="$7"
|
||||
local allow_insecure_dev_login="false"
|
||||
[[ "$runtime_env" == "development" ]] && allow_insecure_dev_login="true"
|
||||
local temp_file
|
||||
@@ -554,6 +553,12 @@ ctms_write_env_file() {
|
||||
printf 'JWT_SECRET_KEY=%s\n' "$jwt_secret"
|
||||
printf 'LOGIN_RSA_KEY_ID=%s\n' "$login_key_id"
|
||||
printf 'LOGIN_RSA_PRIVATE_KEY=%s\n' "$rsa_private_key"
|
||||
printf 'ONLYOFFICE_ENABLED=true\n'
|
||||
printf 'ONLYOFFICE_JWT_SECRET=%s\n' "$onlyoffice_jwt_secret"
|
||||
printf 'ONLYOFFICE_INTERNAL_URL=http://onlyoffice\n'
|
||||
printf 'ONLYOFFICE_STORAGE_BASE_URL=http://backend:8000\n'
|
||||
printf 'ONLYOFFICE_INSTANCE_ID=%s\n' "$onlyoffice_instance_id"
|
||||
printf 'ONLYOFFICE_CONFIG_TTL_SECONDS=300\n'
|
||||
} >> "$temp_file"
|
||||
|
||||
mv "$temp_file" "$CTMS_ENV_FILE"
|
||||
|
||||
Reference in New Issue
Block a user