From f62fb02ef0a91a8c09a15d49c33495435847455c Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Tue, 1 Sep 2026 16:08:10 +0800 Subject: [PATCH 01/43] =?UTF-8?q?=E6=94=B9=E7=94=A8=E5=85=B1=E4=BA=AB?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E4=BC=A0=E9=80=92Salon=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/salon-prod-deploy.yml | 43 +++++-------------- .gitea/workflows/salon-prod-prepare.yml | 22 ++++++---- .../Salon生产发布共享目录配置说明_20260901.md | 25 +++++++++++ 3 files changed, 49 insertions(+), 41 deletions(-) create mode 100644 docs/scripts/Salon生产发布共享目录配置说明_20260901.md diff --git a/.gitea/workflows/salon-prod-deploy.yml b/.gitea/workflows/salon-prod-deploy.yml index edf960ac..57cfddb4 100644 --- a/.gitea/workflows/salon-prod-deploy.yml +++ b/.gitea/workflows/salon-prod-deploy.yml @@ -42,45 +42,22 @@ jobs: java -version 2>&1 | grep -q '17\.' node --version | grep -q '^v20\.' pwsh --version - - name: 下载已审核发布包 + - name: 读取已审核发布包 shell: bash env: - GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PREPARE_RUN_ID: ${{ inputs.prepare_run_id }} - ARTIFACT_NAME: salon-prod-${{ inputs.release_sha }} + RELEASE_SHA: ${{ inputs.release_sha }} run: | set -euo pipefail - test -n "$GITEA_TOKEN" - test -n "$PREPARE_RUN_ID" - test -n "$ARTIFACT_NAME" - api_base="$GITHUB_SERVER_URL/api/actions_pipeline/_apis/pipelines/workflows/$PREPARE_RUN_ID/artifacts?api-version=6.0-preview" - response_file="$RUNNER_TEMP/salon-prod-artifacts.json" - curl --fail-with-body --silent --show-error --retry 3 --retry-all-errors \ - -H "Authorization: Bearer $GITEA_TOKEN" "$api_base" > "$response_file" - artifact_id=$(node -e 'const fs=require("fs"); const name=process.argv[1]; const data=JSON.parse(fs.readFileSync(process.argv[2],"utf8")); const item=(data.value||[]).find(v=>v.name===name); if(!item||!item.fileContainerResourceUrl) process.exit(2); const m=item.fileContainerResourceUrl.match(/\\/(\\d+)\\/path$/); if(!m) process.exit(3); process.stdout.write(m[1]);' "$ARTIFACT_NAME" "$response_file") - path_url="$GITHUB_SERVER_URL/api/actions_pipeline/_apis/pipelines/workflows/$PREPARE_RUN_ID/artifacts/$artifact_id/path?api-version=6.0-preview" - curl --fail-with-body --silent --show-error --retry 3 --retry-all-errors \ - -H "Authorization: Bearer $GITEA_TOKEN" "$path_url" > "$RUNNER_TEMP/salon-prod-artifact-path.json" + test -n "$RELEASE_SHA" + shared_dir="/salon-release/$RELEASE_SHA" + test -d "$shared_dir" + test -f "$shared_dir/.manifest.sha256" + (cd "$shared_dir" && sha256sum -c .manifest.sha256) mkdir -p artifacts/release - node - "$RUNNER_TEMP/salon-prod-artifact-path.json" "$GITHUB_SERVER_URL" "$PREPARE_RUN_ID" "$artifact_id" "$GITEA_TOKEN" <<'NODE' - const fs = require('fs'); - const { execFileSync } = require('child_process'); - const [pathFile, server, runId, artifactId, token] = process.argv.slice(2); - const data = JSON.parse(fs.readFileSync(pathFile, 'utf8')); - const files = data.value || []; - if (files.length === 0) throw new Error('Artifact 未返回任何文件'); - for (const file of files) { - if (!file.contentLocation || !file.path) throw new Error('Artifact 文件项缺少下载地址或路径'); - const relativePath = file.path.split('/').slice(1).join('/'); - if (!relativePath || relativePath.includes('..')) throw new Error(`非法 Artifact 路径: ${file.path}`); - const output = `artifacts/release/${relativePath}`; - fs.mkdirSync(require('path').dirname(output), { recursive: true }); - execFileSync('curl', ['--fail-with-body', '--silent', '--show-error', '--retry', '3', '--retry-all-errors', '-H', `Authorization: Bearer ${token}`, `${server}${file.contentLocation}?itemPath=${encodeURIComponent(file.path)}`, '-o', output], { stdio: 'inherit' }); - } - NODE + cp -a "$shared_dir/." artifacts/release/ test -f artifacts/release/manifest.json - test -f artifacts/release/backend/JC-Salon-Core.jar || find artifacts/release -name 'JC-Salon-Core.jar' -exec cp {} artifacts/release/backend/JC-Salon-Core.jar \; - test -f artifacts/release/backend/JC-Salon-Gateway.jar || find artifacts/release -name 'JC-Salon-Gateway.jar' -exec cp {} artifacts/release/backend/JC-Salon-Gateway.jar \; + test -f artifacts/release/backend/JC-Salon-Core.jar + test -f artifacts/release/backend/JC-Salon-Gateway.jar - name: 发布并校验 Salon 生产 Nacos shell: bash env: diff --git a/.gitea/workflows/salon-prod-prepare.yml b/.gitea/workflows/salon-prod-prepare.yml index 4a1229bf..450169cb 100644 --- a/.gitea/workflows/salon-prod-prepare.yml +++ b/.gitea/workflows/salon-prod-prepare.yml @@ -47,13 +47,19 @@ jobs: -PackageOnly -SkipTests -SkipDatabaseInit - - name: 上传发布包 - uses: actions/upload-artifact@v4 - with: - name: salon-prod-${{ github.event.pull_request.merge_commit_sha }} - path: artifacts/release/* - if-no-files-found: error - retention-days: 30 + - name: 保存发布包到共享目录 + shell: bash + env: + RELEASE_SHA: ${{ github.event.pull_request.merge_commit_sha }} + run: | + set -euo pipefail + test -n "$RELEASE_SHA" + shared_dir="/salon-release/$RELEASE_SHA" + rm -rf "$shared_dir" + mkdir -p "$shared_dir" + cp -a artifacts/release/. "$shared_dir/" + test -f "$shared_dir/manifest.json" + (cd "$shared_dir" && sha256sum manifest.json > .manifest.sha256) - name: 输出部署参数 shell: bash env: @@ -66,7 +72,7 @@ jobs: echo "" echo "**release_sha**: \`$RELEASE_SHA\`" echo "" - echo "**Artifact**: \`salon-prod-$RELEASE_SHA\`" + echo "**共享目录**: \`/salon-release/$RELEASE_SHA\`" } >> "$GITHUB_STEP_SUMMARY" echo "prepare_run_id=${{ github.run_id }}" diff --git a/docs/scripts/Salon生产发布共享目录配置说明_20260901.md b/docs/scripts/Salon生产发布共享目录配置说明_20260901.md new file mode 100644 index 00000000..fe38107e --- /dev/null +++ b/docs/scripts/Salon生产发布共享目录配置说明_20260901.md @@ -0,0 +1,25 @@ +# Salon 生产发布共享目录配置 + +Prepare 和 Deploy 工作流通过 Runner 宿主机共享目录传递发布包,不再跨运行读取 Gitea Artifact。 + +## Runner 配置 + +在 Runner 宿主机创建目录并设置为 Runner 用户可读写: + +```text +/opt/software/panel/apps/gitea/salon-release +``` + +在 `act_runner/config.yaml` 的 `container.options` 增加目录挂载: + +```yaml +- "--volume=/opt/software/panel/apps/gitea/salon-release:/salon-release:rw" +``` + +修改后重启 `jayucloud-runner`。Prepare 会将包写入 `/salon-release/`,Deploy 使用相同 `release_sha` 读取并校验 `manifest.json`。 + +## 验证 + +1. 在 Runner 任务容器中确认 `/salon-release` 可读写。 +2. 重新运行 Prepare,确认共享目录生成对应 SHA 子目录和 `manifest.json`。 +3. Deploy 输入同一 `release_sha`,确认“读取已审核发布包”步骤通过。 -- 2.54.0 From cad7afb12e97c2b2be83c0db9cf66f0be91fc144 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Tue, 1 Sep 2026 16:34:02 +0800 Subject: [PATCH 02/43] =?UTF-8?q?=E6=96=B0=E5=A2=9ESalon=20SIT=E5=8D=95?= =?UTF-8?q?=E6=9C=BA=E8=87=AA=E5=8A=A8=E5=8F=91=E5=B8=83=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/salon-sit-deploy.yml | 91 +++++++++++++++++++ .../Salon SIT自动发布配置说明_20260901.md | 23 +++++ .../deploy-jayucloud-salon-production.ps1 | 11 ++- docs/业务服务器清单.md | 13 +++ 4 files changed, 135 insertions(+), 3 deletions(-) create mode 100644 .gitea/workflows/salon-sit-deploy.yml create mode 100644 docs/scripts/Salon SIT自动发布配置说明_20260901.md diff --git a/.gitea/workflows/salon-sit-deploy.yml b/.gitea/workflows/salon-sit-deploy.yml new file mode 100644 index 00000000..e46c55f5 --- /dev/null +++ b/.gitea/workflows/salon-sit-deploy.yml @@ -0,0 +1,91 @@ +name: Salon SIT 自动发布 + +on: + push: + branches: + - sit + workflow_dispatch: + +jobs: + deploy: + runs-on: jayucloud + env: + GITHUB_SERVER_URL: http://192.168.5.15:3000 + WEB_TARGET_HOST: ${{ secrets.SALON_PROD_WEB_HOST }} + WEB_TARGET_PORT: ${{ secrets.SALON_PROD_WEB_PORT }} + WEB_TARGET_USER: ${{ secrets.SALON_PROD_WEB_USER }} + WEB_REMOTE_DIR: /opt/jc-salon-frontend-sit + steps: + - name: 从内网 Gitea 检出代码 + shell: bash + env: + GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + test -n "$GITEA_TOKEN" + git init . + git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" + git -c http.extraheader="Authorization: token $GITEA_TOKEN" fetch --no-tags --depth=1 origin "$GITHUB_SHA" + git checkout --detach "$GITHUB_SHA" + - name: 检查发布工具链 + shell: bash + run: | + set -euo pipefail + java -version 2>&1 | grep -q '17\.' + node --version | grep -q '^v20\.' + mvn --version | grep -q 'Java version: 17\.' + pwsh --version + - name: 构建 Salon SIT 发布包 + shell: pwsh + run: >- + ./docs/scripts/deploy-jayucloud-salon-production.ps1 + -PackageOnly + -SkipTests + -SkipDatabaseInit + - name: 写入 SIT SSH 配置和目标清单 + shell: bash + env: + SALON_PROD_SSH_PRIVATE_KEY: ${{ secrets.SALON_PROD_SSH_PRIVATE_KEY }} + SALON_PROD_KNOWN_HOSTS: ${{ secrets.SALON_PROD_KNOWN_HOSTS }} + run: | + set -euo pipefail + test -n "$SALON_PROD_SSH_PRIVATE_KEY" + test -n "$SALON_PROD_KNOWN_HOSTS" + test -n "$WEB_TARGET_HOST" + test -n "$WEB_TARGET_PORT" + test -n "$WEB_TARGET_USER" + mkdir -p "$RUNNER_TEMP/salon-sit" + printf '%s\n' "$SALON_PROD_SSH_PRIVATE_KEY" > "$RUNNER_TEMP/salon-sit/id_ed25519" + printf '%s\n' "$SALON_PROD_KNOWN_HOSTS" > "$RUNNER_TEMP/salon-sit/known_hosts" + chmod 600 "$RUNNER_TEMP/salon-sit/id_ed25519" "$RUNNER_TEMP/salon-sit/known_hosts" + cat > "$RUNNER_TEMP/salon-sit/servers.json" <- + ./docs/scripts/deploy-jayucloud-salon-production.ps1 + -Deploy + -SkipDatabaseInit + -AllowSitTarget + -RequireSystemd + -PackageDirectory "artifacts/release" + -ServerInfoJsonPath "$env:SERVER_INFO_JSON" + -SshKeyPath "$env:SSH_KEY_PATH" + -KnownHostsPath "$env:KNOWN_HOSTS_PATH" + -CoreRemoteAppDir "/opt/jc-salon-core-sit" + -GatewayRemoteAppDir "/opt/jc-salon-gateway-sit" + -CoreServiceName "jc-salon-core-sit" + -GatewayServiceName "jc-salon-gateway-sit" + -CoreHealthPort 181 + -GatewayHealthPort 180 + -WebTargetName "salon-web-sit" + -WebRemoteDir "$env:WEB_REMOTE_DIR" + -PublicBaseUrl "https://sit.yunail.art" diff --git a/docs/scripts/Salon SIT自动发布配置说明_20260901.md b/docs/scripts/Salon SIT自动发布配置说明_20260901.md new file mode 100644 index 00000000..d4af9aa7 --- /dev/null +++ b/docs/scripts/Salon SIT自动发布配置说明_20260901.md @@ -0,0 +1,23 @@ +# Salon SIT 自动发布配置 + +推送到 `sit` 分支后,`.gitea/workflows/salon-sit-deploy.yml` 自动构建并部署 Salon Core、Gateway 和前端;数据库 SQL 只随发布包归档,不自动执行。 + +## 部署目标 + +- Core/Gateway:`192.168.10.106:22`,独立目录 `/opt/jc-salon-core-sit`、`/opt/jc-salon-gateway-sit`,服务名 `jc-salon-core-sit`、`jc-salon-gateway-sit`。 +- 前端:与生产共用阿里云入口服务器,独立目录 `/opt/jc-salon-frontend-sit`,域名 `sit.yunail.art`。 +- SIT 中间件:Nacos `192.168.10.103:8848`、MySQL `192.168.10.102:3306`、Redis `192.168.10.101:6379`、RabbitMQ `192.168.10.104:5672`,由 SIT Nacos 配置注入。 +- 工作流显式传入 `-AllowSitTarget`,仅允许 `Environment=sit` 的目标;生产工作流不传入该开关,仍拒绝非生产节点。 + +## 前置配置 + +1. Gitea Secrets 中已有的 `SALON_PROD_SSH_PRIVATE_KEY`、`SALON_PROD_KNOWN_HOSTS` 和 `SALON_PROD_WEB_*` 用于连接同一阿里云前端服务器;`known_hosts` 必须包含 `192.168.10.106`。 +2. 阿里云 Nginx 新增 `sit.yunail.art` server 配置,将站点根目录指向 `/opt/jc-salon-frontend-sit`,并按现有生产规则代理 `/api`。 +3. Nginx 修改后执行 `nginx -t`,通过后再 reload。 +4. 首次部署前确认 `192.168.10.106` 已安装 Java 17、systemd 可用,且网络可访问 SIT Nacos、MySQL、Redis 和 RabbitMQ。 + +## 验证 + +- 推送 `sit` 后确认工作流完成 Core/Gateway 健康检查和前端文件发布。 +- 检查 `https://sit.yunail.art/`、`/health/check` 及前端静态资源均返回 200。 +- 检查 Nacos `jayucloud-salon` namespace 中服务注册状态和 SIT 配置读取。 diff --git a/docs/scripts/deploy-jayucloud-salon-production.ps1 b/docs/scripts/deploy-jayucloud-salon-production.ps1 index 8cf0dc40..90028dcb 100644 --- a/docs/scripts/deploy-jayucloud-salon-production.ps1 +++ b/docs/scripts/deploy-jayucloud-salon-production.ps1 @@ -9,6 +9,7 @@ param( [switch]$AllowDirtyWorkingTree, [switch]$SkipDatabaseInit, [switch]$PackageOnly, + [switch]$AllowSitTarget, [switch]$RequireSystemd, [string]$PackageDirectory = "", [string]$ServerInfoJsonPath = "", @@ -379,14 +380,18 @@ function Resolve-ServerInfoPath { } function Assert-ProductionTarget { - param([object[]]$Servers) + param( + [object[]]$Servers, + [switch]$AllowSit + ) $blocked = @($Servers | Where-Object { $_.Name -match "^(?i:MessageHub|mysql|nacos|redis|rabbitmq)" }) if ($blocked.Count -gt 0) { throw "拒绝把应用发布到基础设施节点:$($blocked.Name -join ', ')" } - $knownNonProduction = @($Servers | Where-Object { $_.Environment -match "(?i)\b(dev|test|local|staging)\b" }) + $blockedEnvironments = if ($AllowSit) { "(?i)\b(dev|test|local|staging)\b" } else { "(?i)\b(dev|test|local|staging|sit)\b" } + $knownNonProduction = @($Servers | Where-Object { $_.Environment -match $blockedEnvironments }) if ($knownNonProduction.Count -gt 0) { throw "拒绝发布到非生产环境节点:$($knownNonProduction.Name -join ', ')" } @@ -919,7 +924,7 @@ if ((-not $SkipDatabaseInit) -and $databaseServers.Count -ne 1) { throw "数据库初始化目标必须唯一,当前按 $DatabaseTargetName 找到 $($databaseServers.Count) 个。" } -Assert-ProductionTarget (@($coreServers) + @($gatewayServers) + @($webServers)) +Assert-ProductionTarget (@($coreServers) + @($gatewayServers) + @($webServers)) -AllowSit:$AllowSitTarget $databaseServer = if (-not $SkipDatabaseInit) { $databaseServers[0] } else { $null } Write-Host "服务器清单:$resolvedServerInfoPath" diff --git a/docs/业务服务器清单.md b/docs/业务服务器清单.md index e39d156d..bcdaea94 100644 --- a/docs/业务服务器清单.md +++ b/docs/业务服务器清单.md @@ -13,9 +13,22 @@ | gateway01-02 | 生产 | Salon Gateway | `192.168.10.27` | 22 | Rocky Linux 9.8 | 17.0.20.1 | `/opt/jc-salon-gateway` | 已创建发布、备份、日志目录;服务单元待首次部署创建 | | gateway01-03 | 生产 | Salon Gateway | `192.168.20.18` | 22 | Rocky Linux 9.8 | 17.0.20.1 | `/opt/jc-salon-gateway` | 已创建发布、备份、日志目录;服务单元待首次部署创建 | +## SIT 后端服务器 + +| 名称 | 环境 | 角色 | IP 地址 | SSH 端口 | 操作系统 | Java | 应用目录 | systemd 服务名 | 当前状态 | +| ---------- | ---- | ---------------- | ---------------- | ------: | -------------- | ---- | -------------------------------- | ------------------------------- | -------------------- | +| sit-app01 | SIT | Salon Core/Gateway | `192.168.10.106` | 22 | Rocky Linux 9.8 | 17 | `/opt/jc-salon-core-sit`、`/opt/jc-salon-gateway-sit` | `jc-salon-core-sit`、`jc-salon-gateway-sit` | 待首次自动部署创建 | + +## SIT 前端入口 + +| 名称 | 环境 | 角色 | 入口域名 | 部署目录 | 说明 | +| ------------- | ---- | ---------- | ----------------- | -------------------------------- | ----------------------------------------- | +| aliyun01-web | SIT | Salon Nginx | `sit.yunail.art` | `/opt/jc-salon-frontend-sit` | 与生产前端共用阿里云服务器,通过域名区分 | + ## 统一基线 - 6 台服务器 SSH 端口均为 `22`,账号密码均为root,122503wcy....,防火墙由 firewalld 管理并处于运行状态。 - 应用目录及其 `releases`、`backups`、`logs` 子目录权限均为 `755 root:root`。 - 当前未创建或启动 `jc-salon-core`、`jc-salon-gateway` systemd 服务,80/81 业务端口未监听。 - 生产 SSH 凭据、Nacos 凭据和部署私钥由私有凭据管理,不写入本清单。 +- SIT 应用 SSH 端口、账号和凭据沿用生产部署凭据;SIT 使用独立 systemd 服务、应用目录和 Nginx 站点目录,不得复用生产目录。 -- 2.54.0 From 629375cd2ead32005c4636b836c659df1e5d5162 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Wed, 2 Sep 2026 20:45:35 +0800 Subject: [PATCH 03/43] =?UTF-8?q?=E4=BF=AE=E5=A4=8DSIT=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/salon-sit-deploy.yml | 3 +++ docs/scripts/Salon SIT自动发布配置说明_20260901.md | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.gitea/workflows/salon-sit-deploy.yml b/.gitea/workflows/salon-sit-deploy.yml index e46c55f5..c64bb94c 100644 --- a/.gitea/workflows/salon-sit-deploy.yml +++ b/.gitea/workflows/salon-sit-deploy.yml @@ -37,6 +37,9 @@ jobs: pwsh --version - name: 构建 Salon SIT 发布包 shell: pwsh + env: + VITE_API_BASE_URL: https://sit.yunail.art/api + VITE_ADMIN_API_BASE_URL: https://sit.yunail.art/admin/api run: >- ./docs/scripts/deploy-jayucloud-salon-production.ps1 -PackageOnly diff --git a/docs/scripts/Salon SIT自动发布配置说明_20260901.md b/docs/scripts/Salon SIT自动发布配置说明_20260901.md index d4af9aa7..5e5f6d10 100644 --- a/docs/scripts/Salon SIT自动发布配置说明_20260901.md +++ b/docs/scripts/Salon SIT自动发布配置说明_20260901.md @@ -6,6 +6,7 @@ - Core/Gateway:`192.168.10.106:22`,独立目录 `/opt/jc-salon-core-sit`、`/opt/jc-salon-gateway-sit`,服务名 `jc-salon-core-sit`、`jc-salon-gateway-sit`。 - 前端:与生产共用阿里云入口服务器,独立目录 `/opt/jc-salon-frontend-sit`,域名 `sit.yunail.art`。 +- 前端构建阶段显式注入 `VITE_API_BASE_URL=https://sit.yunail.art/api` 和 `VITE_ADMIN_API_BASE_URL=https://sit.yunail.art/admin/api`,避免构建产物使用生产接口默认值。 - SIT 中间件:Nacos `192.168.10.103:8848`、MySQL `192.168.10.102:3306`、Redis `192.168.10.101:6379`、RabbitMQ `192.168.10.104:5672`,由 SIT Nacos 配置注入。 - 工作流显式传入 `-AllowSitTarget`,仅允许 `Environment=sit` 的目标;生产工作流不传入该开关,仍拒绝非生产节点。 @@ -20,4 +21,5 @@ - 推送 `sit` 后确认工作流完成 Core/Gateway 健康检查和前端文件发布。 - 检查 `https://sit.yunail.art/`、`/health/check` 及前端静态资源均返回 200。 +- 检查前端 JavaScript 产物包含 SIT API 地址,且不包含 `https://yunail.art/api` 或 `https://yunail.art/admin/api`。 - 检查 Nacos `jayucloud-salon` namespace 中服务注册状态和 SIT 配置读取。 -- 2.54.0 From 6110227ad650ae9c88170d784b282dd39c55bb6e Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Wed, 2 Sep 2026 21:25:33 +0800 Subject: [PATCH 04/43] =?UTF-8?q?=E4=BF=AE=E5=A4=8DSIT=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E9=93=BE=E6=A3=80=E6=9F=A5=E7=AE=A1=E9=81=93=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/salon-sit-deploy.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/salon-sit-deploy.yml b/.gitea/workflows/salon-sit-deploy.yml index c64bb94c..a40287a3 100644 --- a/.gitea/workflows/salon-sit-deploy.yml +++ b/.gitea/workflows/salon-sit-deploy.yml @@ -31,9 +31,12 @@ jobs: shell: bash run: | set -euo pipefail - java -version 2>&1 | grep -q '17\.' - node --version | grep -q '^v20\.' - mvn --version | grep -q 'Java version: 17\.' + java_version="$(java -version 2>&1)" + [[ "$java_version" == *'17.'* ]] + node_version="$(node --version)" + [[ "$node_version" == v20.* ]] + mvn_version="$(mvn --version 2>&1)" + [[ "$mvn_version" == *'Java version: 17.'* ]] pwsh --version - name: 构建 Salon SIT 发布包 shell: pwsh -- 2.54.0 From fd35a330e0801057a27ecc54cf756692e9233497 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Thu, 3 Sep 2026 09:46:54 +0800 Subject: [PATCH 05/43] =?UTF-8?q?=E6=94=B9=E7=94=A8=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E6=89=A7=E8=A1=8CSalon=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/salon-prod-deploy.yml | 40 ++++++++++--------- .gitea/workflows/salon-sit-deploy.yml | 32 ++++++++------- .../Salon SIT自动发布配置说明_20260901.md | 2 +- .../deploy-jayucloud-salon-production.ps1 | 35 ++++++++++++++-- .../生产Salon Gitea流水线配置说明_20260827.md | 8 ++-- 5 files changed, 75 insertions(+), 42 deletions(-) diff --git a/.gitea/workflows/salon-prod-deploy.yml b/.gitea/workflows/salon-prod-deploy.yml index 57cfddb4..5c917d2c 100644 --- a/.gitea/workflows/salon-prod-deploy.yml +++ b/.gitea/workflows/salon-prod-deploy.yml @@ -17,10 +17,11 @@ jobs: runs-on: jayucloud env: GITHUB_SERVER_URL: http://192.168.5.15:3000 - WEB_TARGET_HOST: ${{ secrets.SALON_PROD_WEB_HOST }} - WEB_TARGET_PORT: ${{ secrets.SALON_PROD_WEB_PORT }} - WEB_TARGET_USER: ${{ secrets.SALON_PROD_WEB_USER }} - WEB_REMOTE_DIR: ${{ secrets.SALON_PROD_WEB_DIR }} + WEB_TARGET_HOST: 10.66.0.3 + WEB_TARGET_PORT: 22 + WEB_TARGET_USER: root + WEB_REMOTE_DIR: /opt/jc-salon-frontend + SALON_PROD_SSH_PASSWORD: ${{ secrets.SALON_PROD_SSH_PASSWORD }} steps: - name: 从内网 Gitea 检出发布脚本 shell: bash @@ -39,9 +40,20 @@ jobs: shell: bash run: | set -euo pipefail - java -version 2>&1 | grep -q '17\.' - node --version | grep -q '^v20\.' + java_version="$(java -version 2>&1)" + [[ "$java_version" == *'17.'* ]] + node_version="$(node --version)" + [[ "$node_version" == v20.* ]] pwsh --version + - name: 准备 SSH 密码登录工具 + shell: bash + run: | + set -euo pipefail + if ! command -v sshpass >/dev/null 2>&1; then + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends sshpass + fi + sshpass -V >/dev/null 2>&1 - name: 读取已审核发布包 shell: bash env: @@ -72,20 +84,14 @@ jobs: - name: 写入临时 SSH 配置和目标清单 shell: bash env: - SALON_PROD_SSH_PRIVATE_KEY: ${{ secrets.SALON_PROD_SSH_PRIVATE_KEY }} - SALON_PROD_KNOWN_HOSTS: ${{ secrets.SALON_PROD_KNOWN_HOSTS }} + SALON_PROD_SSH_PASSWORD: ${{ secrets.SALON_PROD_SSH_PASSWORD }} run: | set -euo pipefail - test -n "$SALON_PROD_SSH_PRIVATE_KEY" - test -n "$SALON_PROD_KNOWN_HOSTS" + test -n "$SALON_PROD_SSH_PASSWORD" test -n "$WEB_TARGET_HOST" test -n "$WEB_TARGET_PORT" test -n "$WEB_TARGET_USER" test -n "$WEB_REMOTE_DIR" - mkdir -p "$RUNNER_TEMP/salon-prod" - printf '%s\n' "$SALON_PROD_SSH_PRIVATE_KEY" > "$RUNNER_TEMP/salon-prod/id_ed25519" - printf '%s\n' "$SALON_PROD_KNOWN_HOSTS" > "$RUNNER_TEMP/salon-prod/known_hosts" - chmod 600 "$RUNNER_TEMP/salon-prod/id_ed25519" "$RUNNER_TEMP/salon-prod/known_hosts" cat > "$RUNNER_TEMP/salon-prod/servers.json" <- ./docs/scripts/deploy-jayucloud-salon-production.ps1 @@ -110,7 +115,6 @@ jobs: -RequireSystemd -PackageDirectory "artifacts/release" -ServerInfoJsonPath "$env:SERVER_INFO_JSON" - -SshKeyPath "$env:SSH_KEY_PATH" - -KnownHostsPath "$env:KNOWN_HOSTS_PATH" + -SshPassword "$env:SALON_PROD_SSH_PASSWORD" -WebTargetName salon-web -WebRemoteDir "$env:WEB_REMOTE_DIR" diff --git a/.gitea/workflows/salon-sit-deploy.yml b/.gitea/workflows/salon-sit-deploy.yml index a40287a3..58ddd25a 100644 --- a/.gitea/workflows/salon-sit-deploy.yml +++ b/.gitea/workflows/salon-sit-deploy.yml @@ -11,9 +11,10 @@ jobs: runs-on: jayucloud env: GITHUB_SERVER_URL: http://192.168.5.15:3000 - WEB_TARGET_HOST: ${{ secrets.SALON_PROD_WEB_HOST }} - WEB_TARGET_PORT: ${{ secrets.SALON_PROD_WEB_PORT }} - WEB_TARGET_USER: ${{ secrets.SALON_PROD_WEB_USER }} + WEB_TARGET_HOST: 10.66.0.3 + WEB_TARGET_PORT: 22 + WEB_TARGET_USER: root + SALON_PROD_SSH_PASSWORD: ${{ secrets.SALON_PROD_SSH_PASSWORD }} WEB_REMOTE_DIR: /opt/jc-salon-frontend-sit steps: - name: 从内网 Gitea 检出代码 @@ -48,22 +49,25 @@ jobs: -PackageOnly -SkipTests -SkipDatabaseInit + - name: 准备 SSH 密码登录工具 + shell: bash + run: | + set -euo pipefail + if ! command -v sshpass >/dev/null 2>&1; then + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends sshpass + fi + sshpass -V >/dev/null 2>&1 - name: 写入 SIT SSH 配置和目标清单 shell: bash env: - SALON_PROD_SSH_PRIVATE_KEY: ${{ secrets.SALON_PROD_SSH_PRIVATE_KEY }} - SALON_PROD_KNOWN_HOSTS: ${{ secrets.SALON_PROD_KNOWN_HOSTS }} + SALON_PROD_SSH_PASSWORD: ${{ secrets.SALON_PROD_SSH_PASSWORD }} run: | set -euo pipefail - test -n "$SALON_PROD_SSH_PRIVATE_KEY" - test -n "$SALON_PROD_KNOWN_HOSTS" + test -n "$SALON_PROD_SSH_PASSWORD" test -n "$WEB_TARGET_HOST" test -n "$WEB_TARGET_PORT" test -n "$WEB_TARGET_USER" - mkdir -p "$RUNNER_TEMP/salon-sit" - printf '%s\n' "$SALON_PROD_SSH_PRIVATE_KEY" > "$RUNNER_TEMP/salon-sit/id_ed25519" - printf '%s\n' "$SALON_PROD_KNOWN_HOSTS" > "$RUNNER_TEMP/salon-sit/known_hosts" - chmod 600 "$RUNNER_TEMP/salon-sit/id_ed25519" "$RUNNER_TEMP/salon-sit/known_hosts" cat > "$RUNNER_TEMP/salon-sit/servers.json" <- ./docs/scripts/deploy-jayucloud-salon-production.ps1 @@ -84,8 +87,7 @@ jobs: -RequireSystemd -PackageDirectory "artifacts/release" -ServerInfoJsonPath "$env:SERVER_INFO_JSON" - -SshKeyPath "$env:SSH_KEY_PATH" - -KnownHostsPath "$env:KNOWN_HOSTS_PATH" + -SshPassword "$env:SALON_PROD_SSH_PASSWORD" -CoreRemoteAppDir "/opt/jc-salon-core-sit" -GatewayRemoteAppDir "/opt/jc-salon-gateway-sit" -CoreServiceName "jc-salon-core-sit" diff --git a/docs/scripts/Salon SIT自动发布配置说明_20260901.md b/docs/scripts/Salon SIT自动发布配置说明_20260901.md index 5e5f6d10..8f054509 100644 --- a/docs/scripts/Salon SIT自动发布配置说明_20260901.md +++ b/docs/scripts/Salon SIT自动发布配置说明_20260901.md @@ -12,7 +12,7 @@ ## 前置配置 -1. Gitea Secrets 中已有的 `SALON_PROD_SSH_PRIVATE_KEY`、`SALON_PROD_KNOWN_HOSTS` 和 `SALON_PROD_WEB_*` 用于连接同一阿里云前端服务器;`known_hosts` 必须包含 `192.168.10.106`。 +1. Gitea Secret 中配置 `SALON_PROD_SSH_PASSWORD`,用于连接 SIT 后端和共用的阿里云前端服务器;工作流使用账号 `root`、SSH 端口 `22`。 2. 阿里云 Nginx 新增 `sit.yunail.art` server 配置,将站点根目录指向 `/opt/jc-salon-frontend-sit`,并按现有生产规则代理 `/api`。 3. Nginx 修改后执行 `nginx -t`,通过后再 reload。 4. 首次部署前确认 `192.168.10.106` 已安装 Java 17、systemd 可用,且网络可访问 SIT Nacos、MySQL、Redis 和 RabbitMQ。 diff --git a/docs/scripts/deploy-jayucloud-salon-production.ps1 b/docs/scripts/deploy-jayucloud-salon-production.ps1 index 90028dcb..30977d79 100644 --- a/docs/scripts/deploy-jayucloud-salon-production.ps1 +++ b/docs/scripts/deploy-jayucloud-salon-production.ps1 @@ -15,6 +15,7 @@ param( [string]$ServerInfoJsonPath = "", [string]$SshKeyPath = "", [string]$KnownHostsPath = "", + [string]$SshPassword = "", [string]$DatabaseTargetName = "mysql02", [int]$DatabasePort = 3306, [string]$DatabaseName = "jayucloud_salon", @@ -348,7 +349,7 @@ function Get-ServersFromJson { Host = [string]$item.Host Port = if ($item.Port) { [int]$item.Port } else { 22 } User = if ($item.User) { [string]$item.User } else { "root" } - Password = "" + Password = $SshPassword Purpose = if ($item.Purpose) { [string]$item.Purpose } else { "" } Note = if ($item.Note) { [string]$item.Note } else { "" } Environment = if ($item.Environment) { [string]$item.Environment } else { "prod" } @@ -410,7 +411,21 @@ function Invoke-RemoteShell { [switch]$Sensitive ) - if ($SshKeyPath) { + if ($SshPassword) { + $sshpass = Get-Command sshpass -ErrorAction SilentlyContinue + if ((-not $DryRun) -and (-not $sshpass)) { + throw "找不到 sshpass,无法使用 SSH 密码登录。" + } + $sshpassPath = if ($sshpass) { $sshpass.Source } else { "sshpass" } + $env:SSHPASS = $SshPassword + try { + Invoke-Native $sshpassPath @("-e", "ssh", "-o", "StrictHostKeyChecking=accept-new", "-p", [string]$Server.Port, (Get-SshTarget $Server), $Command) -Sensitive:$Sensitive -RemoteMutation + } + finally { + Remove-Item Env:SSHPASS -ErrorAction SilentlyContinue + } + } + elseif ($SshKeyPath) { $sshArgs = @("-o", "BatchMode=yes", "-o", "StrictHostKeyChecking=yes", "-i", $SshKeyPath) if ($KnownHostsPath) { $sshArgs += @("-o", "UserKnownHostsFile=$KnownHostsPath") @@ -443,7 +458,21 @@ function Copy-FileToRemote { throw "本地上传文件不存在:$LocalPath" } - if ($SshKeyPath) { + if ($SshPassword) { + $sshpass = Get-Command sshpass -ErrorAction SilentlyContinue + if ((-not $DryRun) -and (-not $sshpass)) { + throw "找不到 sshpass,无法使用 SSH 密码登录。" + } + $sshpassPath = if ($sshpass) { $sshpass.Source } else { "sshpass" } + $env:SSHPASS = $SshPassword + try { + Invoke-Native $sshpassPath @("-e", "scp", "-o", "StrictHostKeyChecking=accept-new", "-P", [string]$Server.Port, $LocalPath, "$(Get-SshTarget $Server):$RemotePath") -Sensitive:$Sensitive -RemoteMutation + } + finally { + Remove-Item Env:SSHPASS -ErrorAction SilentlyContinue + } + } + elseif ($SshKeyPath) { $scpArgs = @("-o", "BatchMode=yes", "-o", "StrictHostKeyChecking=yes", "-i", $SshKeyPath) if ($KnownHostsPath) { $scpArgs += @("-o", "UserKnownHostsFile=$KnownHostsPath") diff --git a/docs/scripts/生产Salon Gitea流水线配置说明_20260827.md b/docs/scripts/生产Salon Gitea流水线配置说明_20260827.md index a0085c6a..50387bf9 100644 --- a/docs/scripts/生产Salon Gitea流水线配置说明_20260827.md +++ b/docs/scripts/生产Salon Gitea流水线配置说明_20260827.md @@ -18,18 +18,16 @@ ## Runner -Runner 标签为 `jayucloud`,当前使用固定任务镜像 `jayucloud/runner:node20-java17-maven-pwsh`,已预装 Node.js 20、JDK 17、Maven、npm、tar、PowerShell 7 和 OpenSSH client。人工发布阶段还必须能访问生产 Nacos、6 台 Salon 后端服务器和阿里云 NGINX 主机。 +Runner 标签为 `jayucloud`,当前使用固定任务镜像 `jayucloud/runner:node20-java17-maven-pwsh`,已预装 Node.js 20、JDK 17、Maven、npm、tar、PowerShell 7 和 OpenSSH client。发布工作流会在任务容器内安装 `sshpass`,人工发布阶段还必须能访问生产 Nacos、6 台 Salon 后端服务器和阿里云 NGINX 主机。 ## Secrets 仓库 Actions Secrets 需要配置: -- `SALON_PROD_SSH_PRIVATE_KEY`:仅用于生产发布的 SSH 私钥; -- `SALON_PROD_KNOWN_HOSTS`:6 台后端和阿里云 NGINX 的固定主机指纹; -- `SALON_PROD_WEB_HOST`、`SALON_PROD_WEB_PORT`、`SALON_PROD_WEB_USER`、`SALON_PROD_WEB_DIR`:阿里云 NGINX 实际目标信息; +- `SALON_PROD_SSH_PASSWORD`:生产和 SIT 发布使用的 SSH 密码; - `GITHUB_TOKEN`:用于下载准备工作流 Artifact(由 Gitea 自动提供)。 -SSH 私钥必须对应后端节点和 Web 节点上的部署公钥,禁止把 root 密码写入工作流或 Secrets。生产 Nacos 认证和应用启动所需运行时变量应通过受控的服务环境文件或 Gitea Secrets 注入,不能写入仓库。 +SSH 登录目标固定为生产后端节点和阿里云 NGINX;账号、端口和前端目录由工作流按服务器清单注入。密码只配置为 Gitea Secret,禁止写入工作流或提交记录。生产 Nacos 认证和应用启动所需运行时变量应通过受控的服务环境文件或 Gitea Secrets 注入,不能写入仓库。 ## 发布边界 -- 2.54.0 From 006306171b7e8e8db85f8e4c3ab8286c597effaa Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Thu, 3 Sep 2026 10:30:01 +0800 Subject: [PATCH 06/43] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E7=9B=AE=E5=BD=95=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/salon-prod-deploy.yml | 1 + .gitea/workflows/salon-sit-deploy.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitea/workflows/salon-prod-deploy.yml b/.gitea/workflows/salon-prod-deploy.yml index 5c917d2c..b1383a52 100644 --- a/.gitea/workflows/salon-prod-deploy.yml +++ b/.gitea/workflows/salon-prod-deploy.yml @@ -92,6 +92,7 @@ jobs: test -n "$WEB_TARGET_PORT" test -n "$WEB_TARGET_USER" test -n "$WEB_REMOTE_DIR" + mkdir -p "$RUNNER_TEMP/salon-prod" cat > "$RUNNER_TEMP/salon-prod/servers.json" < "$RUNNER_TEMP/salon-sit/servers.json" < Date: Thu, 3 Sep 2026 10:49:10 +0800 Subject: [PATCH 07/43] =?UTF-8?q?=E4=BF=AE=E5=A4=8DSalon=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=8C=B9=E9=85=8D=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/salon-prod-deploy.yml | 2 ++ .gitea/workflows/salon-sit-deploy.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.gitea/workflows/salon-prod-deploy.yml b/.gitea/workflows/salon-prod-deploy.yml index b1383a52..87a93260 100644 --- a/.gitea/workflows/salon-prod-deploy.yml +++ b/.gitea/workflows/salon-prod-deploy.yml @@ -117,5 +117,7 @@ jobs: -PackageDirectory "artifacts/release" -ServerInfoJsonPath "$env:SERVER_INFO_JSON" -SshPassword "$env:SALON_PROD_SSH_PASSWORD" + -CorePattern "^core01-" + -GatewayPattern "^gateway01-" -WebTargetName salon-web -WebRemoteDir "$env:WEB_REMOTE_DIR" diff --git a/.gitea/workflows/salon-sit-deploy.yml b/.gitea/workflows/salon-sit-deploy.yml index 20b50a5d..30a98167 100644 --- a/.gitea/workflows/salon-sit-deploy.yml +++ b/.gitea/workflows/salon-sit-deploy.yml @@ -91,6 +91,8 @@ jobs: -SshPassword "$env:SALON_PROD_SSH_PASSWORD" -CoreRemoteAppDir "/opt/jc-salon-core-sit" -GatewayRemoteAppDir "/opt/jc-salon-gateway-sit" + -CorePattern "^sit-app01$" + -GatewayPattern "^sit-app01$" -CoreServiceName "jc-salon-core-sit" -GatewayServiceName "jc-salon-gateway-sit" -CoreHealthPort 181 -- 2.54.0 From 47611d5c7a1ebc7333284d693a6c0b3d1e506001 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Thu, 3 Sep 2026 23:45:38 +0800 Subject: [PATCH 08/43] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=8C=85=E6=97=B6=E6=B8=85=E5=8D=95=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/scripts/deploy-jayucloud-salon-production.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/scripts/deploy-jayucloud-salon-production.ps1 b/docs/scripts/deploy-jayucloud-salon-production.ps1 index 30977d79..7c36be8b 100644 --- a/docs/scripts/deploy-jayucloud-salon-production.ps1 +++ b/docs/scripts/deploy-jayucloud-salon-production.ps1 @@ -849,6 +849,10 @@ function Write-ReleaseManifest { deploy = [bool]$Deploy } } + $manifestDirectory = Split-Path -Parent $manifestPath + if (-not (Test-Path -LiteralPath $manifestDirectory)) { + New-Item -ItemType Directory -Path $manifestDirectory -Force | Out-Null + } $manifest | ConvertTo-Json -Depth 8 | Set-Content -LiteralPath $manifestPath -Encoding UTF8 Write-Host "Manifest: $manifestPath" } @@ -886,6 +890,10 @@ if ($PackageOnly) { packageOnly = $true } } + $packageManifestDirectory = Split-Path -Parent $manifestPath + if (-not (Test-Path -LiteralPath $packageManifestDirectory)) { + New-Item -ItemType Directory -Path $packageManifestDirectory -Force | Out-Null + } $packageManifest | ConvertTo-Json -Depth 8 | Set-Content -LiteralPath $manifestPath -Encoding UTF8 Write-Host "发布包已生成:$($package.Directory)" exit 0 -- 2.54.0 From aee4c0ff3d7466fa448f688b1f34101de5183b73 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Fri, 4 Sep 2026 09:14:37 +0800 Subject: [PATCH 09/43] =?UTF-8?q?=E7=A1=AE=E8=AE=A4SIT=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E5=89=8D=E7=BD=AE=E9=85=8D=E7=BD=AE=E5=B9=B6=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?MinIO=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/scripts/Salon SIT自动发布配置说明_20260901.md | 9 ++++++++- docs/项目变更记录.md | 7 +++++++ .../sit/jayucloud-artlist/DEFAULT_GROUP/infra.yaml | 2 +- .../sit/jayucloud-salon/DEFAULT_GROUP/infra.yaml | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/scripts/Salon SIT自动发布配置说明_20260901.md b/docs/scripts/Salon SIT自动发布配置说明_20260901.md index 8f054509..054a6863 100644 --- a/docs/scripts/Salon SIT自动发布配置说明_20260901.md +++ b/docs/scripts/Salon SIT自动发布配置说明_20260901.md @@ -7,7 +7,7 @@ - Core/Gateway:`192.168.10.106:22`,独立目录 `/opt/jc-salon-core-sit`、`/opt/jc-salon-gateway-sit`,服务名 `jc-salon-core-sit`、`jc-salon-gateway-sit`。 - 前端:与生产共用阿里云入口服务器,独立目录 `/opt/jc-salon-frontend-sit`,域名 `sit.yunail.art`。 - 前端构建阶段显式注入 `VITE_API_BASE_URL=https://sit.yunail.art/api` 和 `VITE_ADMIN_API_BASE_URL=https://sit.yunail.art/admin/api`,避免构建产物使用生产接口默认值。 -- SIT 中间件:Nacos `192.168.10.103:8848`、MySQL `192.168.10.102:3306`、Redis `192.168.10.101:6379`、RabbitMQ `192.168.10.104:5672`,由 SIT Nacos 配置注入。 +- SIT 中间件:Nacos `192.168.10.103:8848`、MySQL `192.168.10.102:3306`、Redis `192.168.10.101:6379`、RabbitMQ `192.168.10.104:5672`、MinIO `192.168.10.105:9000`,由 SIT Nacos 配置注入。 - 工作流显式传入 `-AllowSitTarget`,仅允许 `Environment=sit` 的目标;生产工作流不传入该开关,仍拒绝非生产节点。 ## 前置配置 @@ -17,6 +17,13 @@ 3. Nginx 修改后执行 `nginx -t`,通过后再 reload。 4. 首次部署前确认 `192.168.10.106` 已安装 Java 17、systemd 可用,且网络可访问 SIT Nacos、MySQL、Redis 和 RabbitMQ。 +## 已确认的 SIT 前置条件 + +- 数据库 `jayucloud_salon` 已完成初始化;部署工作流继续跳过数据库执行。 +- RabbitMQ 已创建/更新业务用户 `xiaowang`,已授权 `/` 和 `/jayucloud-salon-sit`;业务 vhost 使用 `/jayucloud-salon-sit`。 +- MinIO 使用 `192.168.10.105:9000`;七牛 Kodo 和阿里云 OSS 沿用生产凭据与连接参数,SIT 使用带 `sit` 后缀的 Bucket。 +- RabbitMQ 密码、对象存储密钥和 Nacos 凭据仅通过受控环境或 Gitea Secrets 注入,不写入本文档。 + ## 验证 - 推送 `sit` 后确认工作流完成 Core/Gateway 健康检查和前端文件发布。 diff --git a/docs/项目变更记录.md b/docs/项目变更记录.md index e50754a6..11ca97ab 100644 --- a/docs/项目变更记录.md +++ b/docs/项目变更记录.md @@ -1,5 +1,12 @@ # 项目变更记录 +## 2026-09-04 SIT Salon 部署前置配置确认 + +- 已确认 SIT `jayucloud_salon` 数据库完成初始化,SIT 发布继续跳过数据库执行。 +- 已确认 SIT RabbitMQ 地址为 `192.168.10.104:5672`,业务 vhost 为 `/jayucloud-salon-sit`,用户为 `xiaowang`;密码不写入仓库。 +- 已确认 SIT MinIO 地址为 `192.168.10.105:9000`;七牛 Kodo、阿里云 OSS 沿用生产连接参数,Bucket 使用 SIT 后缀。 +- 修正两端 SIT Nacos 配置源的 MinIO 默认地址,避免后续配置发布覆盖运行时地址。 + ## 2026-08-28 修复 Salon 生产包 Maven 构建阻塞 - Maven 构建参数移除静默输出,保留批处理模式,流水线失败时会显示实际构建错误。 diff --git a/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/infra.yaml b/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/infra.yaml index 5fea2aab..bc5476a1 100644 --- a/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/infra.yaml +++ b/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/infra.yaml @@ -32,7 +32,7 @@ object-storage: minio: enabled: ${MINIO_ENABLED:true} - endpoint: ${MINIO_ENDPOINT:http://192.168.5.15:9000} + endpoint: ${MINIO_ENDPOINT:http://192.168.10.105:9000} bucket-name: ${MINIO_BUCKET_NAME:jayucloud-sit} access-key: ${MINIO_ACCESS_KEY} secret-key: ${MINIO_SECRET_KEY} diff --git a/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/infra.yaml b/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/infra.yaml index 5fea2aab..bc5476a1 100644 --- a/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/infra.yaml +++ b/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/infra.yaml @@ -32,7 +32,7 @@ object-storage: minio: enabled: ${MINIO_ENABLED:true} - endpoint: ${MINIO_ENDPOINT:http://192.168.5.15:9000} + endpoint: ${MINIO_ENDPOINT:http://192.168.10.105:9000} bucket-name: ${MINIO_BUCKET_NAME:jayucloud-sit} access-key: ${MINIO_ACCESS_KEY} secret-key: ${MINIO_SECRET_KEY} -- 2.54.0 From 6dd2233c16985f2af4a4fadae407aef3b49e3e37 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Fri, 4 Sep 2026 13:37:42 +0800 Subject: [PATCH 10/43] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=A4=9A=E7=8E=AF=E5=A2=83=E8=AF=B7=E6=B1=82=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-ArtList-WeChat/utils/config.js | 4 ++-- JC-ArtList-WeChat/utils/config.local.example.js | 2 +- JC-Salon-WeChat/utils/config.js | 4 ++-- JC-Salon-WeChat/utils/config.local.example.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/JC-ArtList-WeChat/utils/config.js b/JC-ArtList-WeChat/utils/config.js index 60785d4a..0a970d5f 100644 --- a/JC-ArtList-WeChat/utils/config.js +++ b/JC-ArtList-WeChat/utils/config.js @@ -123,7 +123,7 @@ const DEFAULT_DOMAINS = { local: 'http://127.0.0.1:80', tunnel: 'https://yunail.art', 'dev-remote': 'https://yunail.art', - trial: 'https://yunail.art', + trial: 'https://sit.yunail.art', release: 'https://yunail.art' } @@ -140,7 +140,7 @@ const DOMAIN_MAP = { * Purpose: DEFAULT_DEVELOP_TARGET supports config.js by holding or executing the default develop target page or API role. * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. */ -const DEFAULT_DEVELOP_TARGET = IS_DEVTOOLS ? 'local' : 'dev-remote' +const DEFAULT_DEVELOP_TARGET = 'local' /** * Purpose: DEVELOP_TARGET supports config.js by holding or executing the develop target page or API role. * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. diff --git a/JC-ArtList-WeChat/utils/config.local.example.js b/JC-ArtList-WeChat/utils/config.local.example.js index 14b0cd41..292e1e73 100644 --- a/JC-ArtList-WeChat/utils/config.local.example.js +++ b/JC-ArtList-WeChat/utils/config.local.example.js @@ -9,7 +9,7 @@ module.exports = { local: 'http://127.0.0.1:80', tunnel: 'https://yunail.art', 'dev-remote': 'https://yunail.art', - trial: 'https://yunail.art', + trial: 'https://sit.yunail.art', release: 'https://yunail.art' } } diff --git a/JC-Salon-WeChat/utils/config.js b/JC-Salon-WeChat/utils/config.js index be914c00..91afbcdc 100644 --- a/JC-Salon-WeChat/utils/config.js +++ b/JC-Salon-WeChat/utils/config.js @@ -127,12 +127,12 @@ const DEFAULT_DOMAINS = { local: 'http://127.0.0.1:80', tunnel: 'http://wcy111.top:18888', 'dev-remote': 'http://wcy111.top:18888', - trial: 'https://yunail.art', + trial: 'https://sit.yunail.art', release: 'https://yunail.art' } const DOMAIN_MAP = mergeDomains(DEFAULT_DOMAINS, localOverride.domains) -const DEFAULT_DEVELOP_TARGET = IS_DEVTOOLS ? 'local' : 'dev-remote' +const DEFAULT_DEVELOP_TARGET = 'local' const DEVELOP_TARGET = Object.prototype.hasOwnProperty.call(localOverride, 'developTarget') ? String(localOverride.developTarget) : DEFAULT_DEVELOP_TARGET diff --git a/JC-Salon-WeChat/utils/config.local.example.js b/JC-Salon-WeChat/utils/config.local.example.js index 807bd8c7..0f066672 100644 --- a/JC-Salon-WeChat/utils/config.local.example.js +++ b/JC-Salon-WeChat/utils/config.local.example.js @@ -12,7 +12,7 @@ module.exports = { local: 'http://127.0.0.1:80', tunnel: 'http://dev.yunail.art:18888', 'dev-remote': 'http://dev.yunail.art:18888', - trial: 'https://yunail.art', + trial: 'https://sit.yunail.art', release: 'https://yunail.art' } } -- 2.54.0 From c3511d2f470e593d6cabb932306439e3d6faed76 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Fri, 4 Sep 2026 13:57:17 +0800 Subject: [PATCH 11/43] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=99=BB=E5=BD=95=E5=BA=97=E9=93=BA=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-Salon-WeChat/pages/login/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/JC-Salon-WeChat/pages/login/index.js b/JC-Salon-WeChat/pages/login/index.js index 94cb1e31..094aef20 100644 --- a/JC-Salon-WeChat/pages/login/index.js +++ b/JC-Salon-WeChat/pages/login/index.js @@ -320,6 +320,10 @@ Page({ async openLoginShopSelector() { const shopOptions = await this.loadLoginShopOptions() + if (shopOptions.length === 1) { + await this.loginWithSelectedShop(shopOptions[0].id) + return + } this.setData({ shopOptions, shopSelectVisible: true, @@ -436,7 +440,7 @@ Page({ this.saveLoginPreference() wx.reLaunch({ url: '/pages/planning/index' }) } catch (error) { - if (isShopSelectionRequiredError(error) || await this.tryOpenLoginShopSelector()) { + if (isShopSelectionRequiredError(error)) { try { if (!this.data.shopSelectVisible) { await this.openLoginShopSelector() -- 2.54.0 From d5535fbfa2fcaa06c5c81a7e64e7f6564e4772ea Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Fri, 4 Sep 2026 14:01:15 +0800 Subject: [PATCH 12/43] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=90=84=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E7=BD=91=E5=85=B3JWT=E5=8F=91=E8=A1=8C=E8=80=85?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../namespaces/dev/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml | 2 +- nacos/namespaces/dev/jayucloud-salon/DEFAULT_GROUP/gateway.yaml | 2 +- .../prod/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml | 2 +- .../namespaces/prod/jayucloud-salon/DEFAULT_GROUP/gateway.yaml | 2 +- .../namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml | 2 +- nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/gateway.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nacos/namespaces/dev/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml b/nacos/namespaces/dev/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml index 7ff5a640..2b457630 100644 --- a/nacos/namespaces/dev/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml +++ b/nacos/namespaces/dev/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml @@ -105,7 +105,7 @@ spring: fingertip-designer: security: jwt: - issuer: fingertip-designer + issuer: jayucloud-artlist clock-skew-seconds: 30 gateway: whitelist: diff --git a/nacos/namespaces/dev/jayucloud-salon/DEFAULT_GROUP/gateway.yaml b/nacos/namespaces/dev/jayucloud-salon/DEFAULT_GROUP/gateway.yaml index 2ff5be66..3aee5aef 100644 --- a/nacos/namespaces/dev/jayucloud-salon/DEFAULT_GROUP/gateway.yaml +++ b/nacos/namespaces/dev/jayucloud-salon/DEFAULT_GROUP/gateway.yaml @@ -129,7 +129,7 @@ spring: fingertip-designer: security: jwt: - issuer: fingertip-designer + issuer: jayucloud-salon clock-skew-seconds: 30 gateway: whitelist: diff --git a/nacos/namespaces/prod/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml b/nacos/namespaces/prod/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml index 7ff5a640..2b457630 100644 --- a/nacos/namespaces/prod/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml +++ b/nacos/namespaces/prod/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml @@ -105,7 +105,7 @@ spring: fingertip-designer: security: jwt: - issuer: fingertip-designer + issuer: jayucloud-artlist clock-skew-seconds: 30 gateway: whitelist: diff --git a/nacos/namespaces/prod/jayucloud-salon/DEFAULT_GROUP/gateway.yaml b/nacos/namespaces/prod/jayucloud-salon/DEFAULT_GROUP/gateway.yaml index 9c91bc17..b2fab928 100644 --- a/nacos/namespaces/prod/jayucloud-salon/DEFAULT_GROUP/gateway.yaml +++ b/nacos/namespaces/prod/jayucloud-salon/DEFAULT_GROUP/gateway.yaml @@ -126,7 +126,7 @@ spring: fingertip-designer: security: jwt: - issuer: fingertip-designer + issuer: jayucloud-salon clock-skew-seconds: 30 gateway: whitelist: diff --git a/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml b/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml index 7ff5a640..2b457630 100644 --- a/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml +++ b/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/gateway.yaml @@ -105,7 +105,7 @@ spring: fingertip-designer: security: jwt: - issuer: fingertip-designer + issuer: jayucloud-artlist clock-skew-seconds: 30 gateway: whitelist: diff --git a/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/gateway.yaml b/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/gateway.yaml index 9c91bc17..b2fab928 100644 --- a/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/gateway.yaml +++ b/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/gateway.yaml @@ -126,7 +126,7 @@ spring: fingertip-designer: security: jwt: - issuer: fingertip-designer + issuer: jayucloud-salon clock-skew-seconds: 30 gateway: whitelist: -- 2.54.0 From c0a51a278e8f0178b0a0a76eaef7d83eca55fbb6 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Fri, 4 Sep 2026 14:10:28 +0800 Subject: [PATCH 13/43] =?UTF-8?q?=E8=A1=A5=E5=85=85=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=AF=86=E7=A0=81=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-Salon-Frontend/src/views/admin/UsersView.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/JC-Salon-Frontend/src/views/admin/UsersView.vue b/JC-Salon-Frontend/src/views/admin/UsersView.vue index d46416ca..141b62ef 100644 --- a/JC-Salon-Frontend/src/views/admin/UsersView.vue +++ b/JC-Salon-Frontend/src/views/admin/UsersView.vue @@ -645,6 +645,19 @@ const showDefaultPasswordCreateNotice = async () => { }) } +const showDefaultPasswordResetNotice = async () => { + const password = await resolveAdminDefaultPasswordForNotice() + Modal.success({ + title: '密码重置成功', + content: h('div', { class: 'default-password-notice' }, [ + h('p', '该用户的密码已重置为后台默认密码,请及时告知用户并提醒首次登录后修改。'), + h('div', { class: 'default-password-notice__value' }, password) + ]), + okText: '一键复制密码', + onOk: () => copyTextToClipboard(password) + }) +} + /** normalizeUserType is a local helper used by this page script. */ const normalizeUserType = (value: unknown) => { const type = Number(value) @@ -1646,7 +1659,7 @@ const handleResetPassword = (record: any) => { try { await runWithGlobalLoading(async () => { await adminUserApi.resetPassword(record.id) - message.success('密码重置成功') + await showDefaultPasswordResetNotice() }) } catch (error) { console.error('重置密码失败:', error) -- 2.54.0 From 89c9deeeb23e2528c73228722a506643c5654b64 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Fri, 4 Sep 2026 15:17:08 +0800 Subject: [PATCH 14/43] =?UTF-8?q?=E6=94=B6=E6=95=9BSalon=E7=BD=91=E9=A1=B5?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/config/admin-navigation.ts | 3 +- JC-Salon-Frontend/src/router/index.ts | 2 +- .../src/views/admin/HomeView.vue | 10 +----- .../src/views/admin/ShopsView.vue | 21 ++++++------ .../src/views/admin/UsersView.vue | 34 +++++++------------ 5 files changed, 25 insertions(+), 45 deletions(-) diff --git a/JC-Salon-Frontend/src/config/admin-navigation.ts b/JC-Salon-Frontend/src/config/admin-navigation.ts index d2fe3531..fe8bbd10 100644 --- a/JC-Salon-Frontend/src/config/admin-navigation.ts +++ b/JC-Salon-Frontend/src/config/admin-navigation.ts @@ -24,8 +24,7 @@ export const ADMIN_DASHBOARD_PATH = '/admin/dashboard' export const adminNavigationItems: AdminNavigationItem[] = [ { path: ADMIN_HOME_PATH, iconKey: 'home', label: '首页', permissionCode: '' }, - { path: ADMIN_DASHBOARD_PATH, iconKey: 'dashboard', label: '仪表盘', permissionCode: 'dashboard:view' }, - { path: '/admin/users', iconKey: 'user', label: '用户管理', permissionCode: 'user:view' }, + { path: '/admin/users', iconKey: 'user', label: '店长账号', permissionCode: 'user:view' }, { path: '/admin/shops', iconKey: 'home', label: '店铺管理', permissionCode: 'shop:view' }, { path: '/admin/profile', iconKey: 'user', label: '个人设置', permissionCode: '' } ] diff --git a/JC-Salon-Frontend/src/router/index.ts b/JC-Salon-Frontend/src/router/index.ts index a8822bf5..7726cda6 100644 --- a/JC-Salon-Frontend/src/router/index.ts +++ b/JC-Salon-Frontend/src/router/index.ts @@ -8,7 +8,7 @@ import { } from '@/utils/admin-auth-bootstrap' const pageNames = [ - ['', 'HomeView', 'admin', undefined], ['dashboard', 'DashboardView', 'admin-dashboard', 'dashboard:view'], + ['', 'HomeView', 'admin', undefined], ['users', 'UsersView', 'admin-users', 'user:view'], ['shops', 'ShopsView', 'admin-shops', 'shop:view'], ['profile', 'ProfileView', 'admin-profile', undefined] ] as const diff --git a/JC-Salon-Frontend/src/views/admin/HomeView.vue b/JC-Salon-Frontend/src/views/admin/HomeView.vue index 8f39c049..4d562f65 100644 --- a/JC-Salon-Frontend/src/views/admin/HomeView.vue +++ b/JC-Salon-Frontend/src/views/admin/HomeView.vue @@ -154,7 +154,6 @@ import { computed, onBeforeUnmount, onMounted, ref } from 'vue' import { useRouter } from 'vue-router' import { - DashboardOutlined, HomeOutlined, SafetyCertificateOutlined, UserOutlined @@ -231,16 +230,9 @@ const quickActions = computed(() => { return [] } const actions = [ - { - key: 'dashboard', - title: '仪表盘', - path: '/admin/dashboard', - icon: DashboardOutlined, - permissionCode: 'dashboard:view' - }, { key: 'users', - title: '用户管理', + title: '店长账号', path: '/admin/users', icon: UserOutlined, permissionCode: 'user:view' diff --git a/JC-Salon-Frontend/src/views/admin/ShopsView.vue b/JC-Salon-Frontend/src/views/admin/ShopsView.vue index d82f45d7..a00154f3 100644 --- a/JC-Salon-Frontend/src/views/admin/ShopsView.vue +++ b/JC-Salon-Frontend/src/views/admin/ShopsView.vue @@ -103,7 +103,7 @@ @change="(checked: any) => handleStatusChange(record, checked === true)" /> -