This commit is contained in:
@@ -72,7 +72,7 @@ jobs:
|
||||
run: node .gitea/scripts/rollback-nacos.mjs
|
||||
- name: 执行 SIT 应用回退
|
||||
shell: pwsh
|
||||
run: ./docs/scripts/deploy-jayucloud-salon-production.ps1 -Deploy -SkipDatabaseInit -AllowSitTarget -RequireSystemd -PackageDirectory "$env:PACKAGE_DIRECTORY" -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 -GatewayHealthPort 180 -WebTargetName salon-web-sit -WebRemoteDir "$env:WEB_REMOTE_DIR" -PublicBaseUrl https://sit.yunail.art
|
||||
run: ./docs/scripts/deploy-jayucloud-salon-production.ps1 -Deploy -SkipDatabaseInit -AllowSitTarget -RequireSystemd -PackageDirectory "$env:PACKAGE_DIRECTORY" -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 -GatewayHealthPort 180 -WebTargetName salon-web-sit -WebRemoteDir "$env:WEB_REMOTE_DIR" -PublicBaseUrl https://sit.salon.yunail.art
|
||||
- name: 记录回退后的成功版本
|
||||
shell: bash
|
||||
run: node .gitea/scripts/record-rollback.mjs
|
||||
|
||||
@@ -48,8 +48,8 @@ jobs:
|
||||
- name: 构建并校验含 Flyway 迁移的 SIT 发布包
|
||||
shell: pwsh
|
||||
env:
|
||||
VITE_API_BASE_URL: https://sit.yunail.art/api
|
||||
VITE_ADMIN_API_BASE_URL: https://sit.yunail.art/admin/api
|
||||
VITE_API_BASE_URL: https://sit.salon.yunail.art/api
|
||||
VITE_ADMIN_API_BASE_URL: https://sit.salon.yunail.art/admin/api
|
||||
run: ./docs/scripts/deploy-jayucloud-salon-production.ps1 -PackageOnly -SkipTests -SkipDatabaseInit
|
||||
- name: 持久化已校验发布包
|
||||
shell: bash
|
||||
@@ -69,7 +69,7 @@ jobs:
|
||||
printf '[{"Name":"sit-app01","Host":"192.168.10.15","Port":22,"User":"root","Purpose":"Salon SIT Core/Gateway","Environment":"sit"},{"Name":"salon-web-sit","Host":"%s","Port":%s,"User":"%s","Purpose":"Salon SIT NGINX","Environment":"sit"}]\n' "$WEB_TARGET_HOST" "$WEB_TARGET_PORT" "$WEB_TARGET_USER" > "$RUNNER_TEMP/salon-sit/servers.json"
|
||||
- name: 执行 SIT 部署
|
||||
shell: pwsh
|
||||
run: ./docs/scripts/deploy-jayucloud-salon-production.ps1 -Deploy -SkipDatabaseInit -AllowSitTarget -RequireSystemd -PackageDirectory "$env:PACKAGE_DIRECTORY" -ServerInfoJsonPath "$env:RUNNER_TEMP/salon-sit/servers.json" -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 -GatewayHealthPort 180 -WebTargetName salon-web-sit -WebRemoteDir "$env:WEB_REMOTE_DIR" -PublicBaseUrl https://sit.yunail.art
|
||||
run: ./docs/scripts/deploy-jayucloud-salon-production.ps1 -Deploy -SkipDatabaseInit -AllowSitTarget -RequireSystemd -PackageDirectory "$env:PACKAGE_DIRECTORY" -ServerInfoJsonPath "$env:RUNNER_TEMP/salon-sit/servers.json" -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 -GatewayHealthPort 180 -WebTargetName salon-web-sit -WebRemoteDir "$env:WEB_REMOTE_DIR" -PublicBaseUrl https://sit.salon.yunail.art
|
||||
- name: 记录成功部署
|
||||
shell: bash
|
||||
run: node .gitea/scripts/record-deploy.mjs
|
||||
|
||||
+19
-2
@@ -22,6 +22,12 @@ public class MinioStorageConfig {
|
||||
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
* Optional public endpoint used only when MinIO signs URLs for clients.
|
||||
* Internal uploads, downloads and deletes continue to use endpoint.
|
||||
*/
|
||||
private String publicEndpoint;
|
||||
|
||||
private String bucketName;
|
||||
|
||||
private String accessKey;
|
||||
@@ -34,13 +40,24 @@ public class MinioStorageConfig {
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "minio", name = "enabled", havingValue = "true")
|
||||
public MinioClient minioClient() {
|
||||
if (!StringUtils.hasText(endpoint)
|
||||
return buildClient(endpoint);
|
||||
}
|
||||
|
||||
public MinioClient createSigningClient() {
|
||||
if (!Boolean.TRUE.equals(enabled) || !StringUtils.hasText(publicEndpoint)) {
|
||||
return null;
|
||||
}
|
||||
return buildClient(publicEndpoint);
|
||||
}
|
||||
|
||||
private MinioClient buildClient(String clientEndpoint) {
|
||||
if (!StringUtils.hasText(clientEndpoint)
|
||||
|| !StringUtils.hasText(accessKey)
|
||||
|| !StringUtils.hasText(secretKey)) {
|
||||
throw new IllegalStateException("MinIO is enabled but endpoint/accessKey/secretKey is incomplete");
|
||||
}
|
||||
return MinioClient.builder()
|
||||
.endpoint(endpoint)
|
||||
.endpoint(clientEndpoint)
|
||||
.credentials(accessKey, secretKey)
|
||||
.build();
|
||||
}
|
||||
|
||||
+22
-3
@@ -9,7 +9,6 @@ import io.minio.MinioClient;
|
||||
import io.minio.PutObjectArgs;
|
||||
import io.minio.RemoveObjectArgs;
|
||||
import io.minio.http.Method;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -20,15 +19,35 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MinioObjectStorageProvider implements ObjectStorageProvider {
|
||||
|
||||
private static final long UNKNOWN_SIZE_PART_SIZE = 10 * 1024 * 1024L;
|
||||
|
||||
private final ObjectProvider<MinioClient> minioClientProvider;
|
||||
private final MinioClient signingClient;
|
||||
private final MinioStorageConfig minioStorageConfig;
|
||||
private final ObjectStorageProperties objectStorageProperties;
|
||||
|
||||
public MinioObjectStorageProvider(
|
||||
ObjectProvider<MinioClient> minioClientProvider,
|
||||
MinioStorageConfig minioStorageConfig,
|
||||
ObjectStorageProperties objectStorageProperties
|
||||
) {
|
||||
this(minioClientProvider, minioStorageConfig, objectStorageProperties, minioStorageConfig.createSigningClient());
|
||||
}
|
||||
|
||||
MinioObjectStorageProvider(
|
||||
ObjectProvider<MinioClient> minioClientProvider,
|
||||
MinioStorageConfig minioStorageConfig,
|
||||
ObjectStorageProperties objectStorageProperties,
|
||||
MinioClient signingClient
|
||||
) {
|
||||
this.minioClientProvider = minioClientProvider;
|
||||
this.minioStorageConfig = minioStorageConfig;
|
||||
this.objectStorageProperties = objectStorageProperties;
|
||||
this.signingClient = signingClient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String providerCode() {
|
||||
return "MINIO";
|
||||
@@ -86,7 +105,7 @@ public class MinioObjectStorageProvider implements ObjectStorageProvider {
|
||||
if (!Boolean.TRUE.equals(minioStorageConfig.getPrivateBucket())) {
|
||||
return getFileUrl(objectName);
|
||||
}
|
||||
return requireClient().getPresignedObjectUrl(
|
||||
return (signingClient == null ? requireClient() : signingClient).getPresignedObjectUrl(
|
||||
GetPresignedObjectUrlArgs.builder()
|
||||
.method(Method.GET)
|
||||
.bucket(minioStorageConfig.getBucketName())
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.xiaowang.jayucloud.salon.core.modules.file.service.impl;
|
||||
|
||||
import com.xiaowang.jayucloud.salon.core.config.ObjectStorageProperties;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.file.config.MinioStorageConfig;
|
||||
import io.minio.GetObjectArgs;
|
||||
import io.minio.GetPresignedObjectUrlArgs;
|
||||
import io.minio.MinioClient;
|
||||
import io.minio.PutObjectArgs;
|
||||
import io.minio.RemoveObjectArgs;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
class MinioObjectStorageProviderTest {
|
||||
|
||||
@Test
|
||||
void signsClientUrlsWithPublicEndpointWhenConfigured() throws Exception {
|
||||
ObjectProvider<MinioClient> internalClientProvider = mock(ObjectProvider.class);
|
||||
MinioClient signingClient = mock(MinioClient.class);
|
||||
when(signingClient.getPresignedObjectUrl(org.mockito.ArgumentMatchers.any(GetPresignedObjectUrlArgs.class)))
|
||||
.thenReturn("https://sit.minio.yunail.art/jayucloud-salon-sit/style.jpg?signature=ok");
|
||||
|
||||
MinioStorageConfig config = new MinioStorageConfig();
|
||||
config.setEnabled(true);
|
||||
config.setEndpoint("http://192.168.10.14:9000");
|
||||
config.setPublicEndpoint("https://sit.minio.yunail.art");
|
||||
config.setAccessKey("access-key");
|
||||
config.setSecretKey("secret-key");
|
||||
config.setBucketName("jayucloud-salon-sit");
|
||||
config.setPrivateBucket(true);
|
||||
|
||||
MinioObjectStorageProvider provider = new MinioObjectStorageProvider(
|
||||
internalClientProvider,
|
||||
config,
|
||||
new ObjectStorageProperties(),
|
||||
signingClient
|
||||
);
|
||||
|
||||
String signedUrl = provider.getPresignedUrl("style.jpg", 60);
|
||||
|
||||
assertTrue(signedUrl.startsWith("https://sit.minio.yunail.art/jayucloud-salon-sit/style.jpg?"));
|
||||
verify(internalClientProvider, org.mockito.Mockito.never()).getIfAvailable();
|
||||
verify(signingClient).getPresignedObjectUrl(org.mockito.ArgumentMatchers.any(GetPresignedObjectUrlArgs.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void usesInternalMinioClientForUploadDownloadAndDelete() throws Exception {
|
||||
MinioClient internalClient = mock(MinioClient.class);
|
||||
ObjectProvider<MinioClient> internalClientProvider = mock(ObjectProvider.class);
|
||||
when(internalClientProvider.getIfAvailable()).thenReturn(internalClient);
|
||||
|
||||
MinioStorageConfig config = new MinioStorageConfig();
|
||||
config.setEnabled(true);
|
||||
config.setEndpoint("http://192.168.10.14:9000");
|
||||
config.setAccessKey("access-key");
|
||||
config.setSecretKey("secret-key");
|
||||
config.setBucketName("jayucloud-salon-sit");
|
||||
|
||||
MinioObjectStorageProvider provider = new MinioObjectStorageProvider(
|
||||
internalClientProvider,
|
||||
config,
|
||||
new ObjectStorageProperties()
|
||||
);
|
||||
|
||||
provider.uploadStream(new ByteArrayInputStream(new byte[]{1}), 1, "image/jpeg", "style.jpg");
|
||||
provider.downloadFile("style.jpg");
|
||||
provider.deleteFile("style.jpg");
|
||||
|
||||
assertEquals("http://192.168.10.14:9000/jayucloud-salon-sit/style.jpg", provider.getFileUrl("style.jpg"));
|
||||
verify(internalClient).putObject(org.mockito.ArgumentMatchers.any(PutObjectArgs.class));
|
||||
verify(internalClient).getObject(org.mockito.ArgumentMatchers.any(GetObjectArgs.class));
|
||||
verify(internalClient).removeObject(org.mockito.ArgumentMatchers.any(RemoveObjectArgs.class));
|
||||
verify(internalClient, never()).getPresignedObjectUrl(org.mockito.ArgumentMatchers.any(GetPresignedObjectUrlArgs.class));
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ const DEFAULT_DOMAINS = {
|
||||
local: 'http://127.0.0.1:80',
|
||||
tunnel: 'http://wcsrv.top:18888',
|
||||
'dev-remote': 'http://wcsrv.top:18888',
|
||||
trial: 'https://sit.yunail.art',
|
||||
trial: 'https://sit.salon.yunail.art',
|
||||
release: 'https://yunail.art'
|
||||
}
|
||||
|
||||
|
||||
@@ -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://sit.yunail.art',
|
||||
trial: 'https://sit.salon.yunail.art',
|
||||
release: 'https://yunail.art'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
# Salon 域名与对象存储入口核对记录
|
||||
|
||||
更新时间:2026-10-31
|
||||
|
||||
## 范围和结论
|
||||
|
||||
本次只整理 DEV 与 SIT;PROD 不处理。DEV 不建设公网入口,继续使用内网 MinIO;当前主要目标是 SIT 的 Salon 前端/API 和 MinIO HTTPS 入口。
|
||||
|
||||
| 项目 | DEV | SIT | 状态 |
|
||||
| --- | --- | --- | --- |
|
||||
| Salon 业务入口 | 不配置公网入口 | `https://sit.salon.yunail.art` | 仓库配置已调整;阿里云1 Nginx、DNS 和证书尚未远端实施 |
|
||||
| MinIO 内网 endpoint | `http://192.168.5.15:9000` | `http://192.168.10.14:9000` | 保留服务端内网访问 |
|
||||
| MinIO 公网签名 endpoint | 不设置,沿用内网 endpoint | `https://sit.minio.yunail.art` | SIT 仓库配置已调整;Nginx、DNS 和证书尚未远端实施 |
|
||||
| 七牛加速域名 | `https://dev.qiniu.yunail.art` | `https://sit.qiniu.yunail.art` | 仓库配置已调整;此前核查 CNAME 分别指向七牛分配的目标且 HTTPS 可达,私有桶根路径 403 属正常访问控制表现 |
|
||||
| PROD | 不在范围内 | 不在范围内 | 保持现状 |
|
||||
|
||||
旧 SIT 业务域名 `sit.yunail.art` 暂时保留兼容,不在本次撤销或改写。此前从阿里云1验证该域名可返回健康检查;新域名此前检查到证书主机名不匹配。`192.168.10.14:9000/minio/health/live` 曾返回真实 MinIO 健康响应。DNS 最终结果必须从独立公网 DNS 解析器重新确认;本机解析结果曾出现保留网段地址,不能据此填写 A 记录。
|
||||
|
||||
## 仓库变更
|
||||
|
||||
- SIT 工作流的 Salon API、后台 API、部署健康检查基址及回退工作流切换到 `https://sit.salon.yunail.art`。
|
||||
- 小程序体验版接口域名切换到 `https://sit.salon.yunail.art/api`;正式版地址不变。
|
||||
- DEV/SIT Salon 七牛域名分别改为 `https://dev.qiniu.yunail.art`、`https://sit.qiniu.yunail.art`;ArtList 配置未修改。
|
||||
- MinIO 增加可选 `minio.public-endpoint`。应用上传、下载、删除及内部对象读写仍走 `minio.endpoint`;只有私有对象签名使用专用客户端和公网 endpoint。未配置时签名客户端退回内网 endpoint,保持现有环境兼容。
|
||||
- SIT Core/Gateway 部署工作流和历史 SIT 清单使用 `192.168.10.15`,仓库原业务服务器总表曾写 `192.168.10.106`。总表已按当前工作流和 SIT 清单统一为 `.15`,但实际启用 Nginx upstream 前仍须从阿里云1和 SIT 主机确认网络可达与监听端口。
|
||||
|
||||
## SIT DNS 与入口拓扑
|
||||
|
||||
预期拓扑:
|
||||
|
||||
```text
|
||||
sit.salon.yunail.art -> 阿里云1公网 A 记录 -> 阿里云1 Nginx -> SIT Gateway 192.168.10.15:180
|
||||
sit.minio.yunail.art -> 与 sit.salon 相同的阿里云1公网 A 记录 -> 阿里云1 Nginx -> MinIO 192.168.10.14:9000
|
||||
```
|
||||
|
||||
DNS 变更前应读取 `sit.salon.yunail.art` 当前权威 A/AAAA 记录,并将 `sit.minio.yunail.art` 指向同一阿里云1公网入口;不要从受限的本机 DNS 结果推断公网 IP。若 `sit.minio` 已有 AAAA 记录,还需确认该 IPv6 入口的 Nginx/TLS 已配置,否则移除错误 AAAA 或补齐 IPv6 服务。
|
||||
|
||||
阿里云1 WireGuard 地址为 `10.66.0.3`,SIT Web 部署目录为 `/opt/jc-salon-frontend-sit`,发布脚本将静态站点链接到 `current`。最终 Nginx 配置须以服务器现有配置为基础合并,不能覆盖 ArtList 或生产站点。以下是配置目标示例;上游 IP/端口需先确认:
|
||||
|
||||
```nginx
|
||||
upstream salon_sit_gateway {
|
||||
server 192.168.10.15:180;
|
||||
keepalive 32;
|
||||
}
|
||||
|
||||
upstream salon_sit_minio {
|
||||
server 192.168.10.14:9000;
|
||||
keepalive 32;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name sit.salon.yunail.art sit.minio.yunail.art;
|
||||
# HTTP-01 验证期间保留 ACME challenge 可访问;其余请求跳转 HTTPS。
|
||||
location ^~ /.well-known/acme-challenge/ {
|
||||
root /var/www/letsencrypt;
|
||||
}
|
||||
location / { return 301 https://$host$request_uri; }
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name sit.salon.yunail.art;
|
||||
ssl_certificate /etc/letsencrypt/live/sit.salon.yunail.art/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/sit.salon.yunail.art/privkey.pem;
|
||||
|
||||
root /opt/jc-salon-frontend-sit/current;
|
||||
index index.html;
|
||||
client_max_body_size 20m;
|
||||
proxy_connect_timeout 10s;
|
||||
proxy_send_timeout 300s;
|
||||
proxy_read_timeout 300s;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://salon_sit_gateway;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
location /admin/api/ {
|
||||
proxy_pass http://salon_sit_gateway;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
location = /health/check {
|
||||
proxy_pass http://salon_sit_gateway;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name sit.minio.yunail.art;
|
||||
ssl_certificate /etc/letsencrypt/live/sit.salon.yunail.art/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/sit.salon.yunail.art/privkey.pem;
|
||||
|
||||
client_max_body_size 100m;
|
||||
proxy_http_version 1.1;
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
proxy_connect_timeout 10s;
|
||||
proxy_send_timeout 300s;
|
||||
proxy_read_timeout 300s;
|
||||
|
||||
location / {
|
||||
# MinIO SigV4 依赖原始 Host 和 URI;不得改写 Host、路径或查询参数。
|
||||
proxy_pass http://salon_sit_minio;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Connection "";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
MinIO Console `9001` 不配置公网 upstream;阿里云安全组和 Nginx 均不得开放公网到 `9001`。`proxy_pass` 不附带 URI 后缀,避免改写 MinIO 签名 URL 的原始路径和查询串。SIT Gateway 工作流健康端口为 `180`,Core 健康端口为 `181`;公网 `/api` 与 `/admin/api` 都按现有 Gateway 路由转发。
|
||||
|
||||
## TLS 与续签
|
||||
|
||||
在阿里云1确认 Nginx 版本、发行版及现有 Certbot 安装方式后,为两个域名签发同一张证书:
|
||||
|
||||
```bash
|
||||
certbot --nginx -d sit.salon.yunail.art -d sit.minio.yunail.art
|
||||
certbot renew --dry-run
|
||||
systemctl list-timers --all | grep -i certbot
|
||||
```
|
||||
|
||||
必须确保公网 TCP/80 可达以完成 HTTP-01,并允许 TCP/443 提供业务。若系统没有 Certbot 自动定时器,应按该发行版安装包启用 systemd timer/cron;部署续签 hook,在续签成功后执行 `nginx -t && systemctl reload nginx`。完成后检查证书 SAN 同时包含两个 SIT 域名、有效期和续签 dry-run。不能只配置证书而不验收 timer 与 reload hook。
|
||||
|
||||
## 验收清单
|
||||
|
||||
### DNS / TLS
|
||||
|
||||
- 从至少两个独立公网 DNS 解析器查询 `sit.salon.yunail.art`、`sit.minio.yunail.art`,确认 A 地址相同且为阿里云1公网 IP;检查 AAAA 不会引流到未配置的 IPv6 入口。
|
||||
- 检查 `dev.qiniu.yunail.art`、`sit.qiniu.yunail.art` 的 CNAME 指向七牛分配目标;HTTPS TLS 主机名匹配。
|
||||
- 检查两个 SIT 域名证书 SAN、到期时间、Certbot timer 与 `renew --dry-run`。
|
||||
|
||||
### 应用 / MinIO
|
||||
|
||||
- `https://sit.salon.yunail.art/` 返回 Salon 前端;`/api/health/check` 或当前实际健康路由可达。
|
||||
- `/api`、`/admin/api` 请求到达 SIT Gateway;`/health/check` 满足发布脚本健康检查。
|
||||
- `https://sit.minio.yunail.art/minio/health/live` 返回真实 MinIO 健康状态。
|
||||
- 从 SIT Core 生成的私有 MinIO 签名 URL 主机名为 `sit.minio.yunail.art`,对象可读;过期后返回拒绝。
|
||||
- 验证同一对象的七牛签名读取和过期行为;私有桶根路径 403 不作为失败判据。
|
||||
- 外网无法连接 MinIO `9001`;只允许 Nginx 必需的 80/443 暴露。
|
||||
|
||||
### 仓库
|
||||
|
||||
- YAML 解析、Salon Core 测试/编译、小程序配置静态检查、`git diff --check` 和 GitNexus 变更检查。
|
||||
- SIT 发布应通过现有 `sit` 分支工作流发布 Core 配置和工作流生成的前端/API 地址;本次不直接写入实际 Nacos。
|
||||
|
||||
## 尚未执行的远端事项
|
||||
|
||||
现有 SSH 身份认证无法登录阿里云1,因此本次没有修改 DNS、Nginx、Certbot、防火墙、安全组或真实 Nacos,也没有宣称 SIT 公网验收完成。取得可用授权 SSH 方式后,先只读检查阿里云1上的站点配置、证书、续签任务和防火墙,再备份配置;核实 DNS 目标与 SIT Gateway 地址/端口后再分阶段变更,并逐项执行上方验收。若 `.15` 与服务器总表 `.106` 的差异未在现网确认,应先修正目标地址再加 Nginx upstream。
|
||||
@@ -33,7 +33,7 @@
|
||||
- `gateway.yaml`:Gateway 端口、路由、白名单和网关参数。
|
||||
- `logging.yaml`:公共日志级别。
|
||||
|
||||
对象存储统一使用 `object-storage.signed-url-expire-minutes`。MinIO、七牛和 OSS 的连接配置只保留各自必要字段;私有桶按环境配置 `private-bucket: true`。三套 Salon 环境默认签名有效期为 60 分钟。
|
||||
对象存储统一使用 `object-storage.signed-url-expire-minutes`。MinIO `endpoint` 始终指服务端内网访问地址;可选 `public-endpoint` 仅用于生成交给客户端访问的 MinIO 签名 URL,不改变服务端上传、下载、删除和对象读取路径。DEV 不配置该字段时沿用原内网 endpoint;SIT 配置为 `https://sit.minio.yunail.art`。MinIO、七牛和 OSS 的连接配置只保留各自必要字段;私有桶按环境配置 `private-bucket: true`。三套 Salon 环境默认签名有效期为 60 分钟。
|
||||
|
||||
后端启动时需要 Nacos 启动引导参数:`NACOS_SERVER_ADDR`、`NACOS_NAMESPACE`、`NACOS_GROUP`、`NACOS_USERNAME`、`NACOS_PASSWORD`。Salon Core 另需由部署环境注入 `SALON_SECURE_CONFIG_MASTER_KEY`,用于数据库安全接入配置的 AES-GCM 加解密;此密钥不放 Nacos、不提交仓库,按环境独立设置,所有同环境 Core 实例保持一致。业务数据库、Redis、RabbitMQ 和对象存储参数仍由 Nacos 提供,不通过应用环境变量覆盖。
|
||||
|
||||
@@ -46,7 +46,7 @@ Salon 地图 Key、微信审核回调 Token 和 EncodingAESKey 不属于通用
|
||||
- 开发工具 `develop`:默认 `http://127.0.0.1:80/api`。
|
||||
- 真机开发:不能访问手机自身的 `127.0.0.1`,使用 `config.local.js` 切换到局域网地址、tunnel 或远程开发地址。
|
||||
- `tunnel` / `dev-remote`:默认使用 `http://wcsrv.top:18888`。
|
||||
- 体验版 `trial`:`https://sit.yunail.art/api`。
|
||||
- 体验版 `trial`:`https://sit.salon.yunail.art/api`。
|
||||
- 正式版 `release`:`https://yunail.art/api`。
|
||||
|
||||
个人覆盖配置从 `JC-Salon-WeChat/utils/config.local.example.js` 复制为未提交的 `config.local.js`,不要将其加入版本库。
|
||||
|
||||
+2
-2
@@ -17,13 +17,13 @@
|
||||
|
||||
| 名称 | 环境 | 角色 | 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-app01 | SIT | Salon Core/Gateway | `192.168.10.15` | 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 部署工作流与环境清单统一,部署前需现网复核 |
|
||||
|
||||
## SIT 前端入口
|
||||
|
||||
| 名称 | 环境 | 角色 | 入口域名 | 部署目录 | 说明 |
|
||||
| ------------- | ---- | ---------- | ----------------- | -------------------------------- | ----------------------------------------- |
|
||||
| aliyun01-web | SIT | Salon Nginx | `sit.yunail.art` | `/opt/jc-salon-frontend-sit` | 与生产前端共用阿里云服务器,通过域名区分 |
|
||||
| aliyun01-web | SIT | Salon Nginx | `sit.salon.yunail.art` | `/opt/jc-salon-frontend-sit` | 与生产前端共用阿里云服务器,通过域名区分;API 经 Nginx 转发至 SIT Gateway |
|
||||
|
||||
## 统一基线
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# 运维配置与集成说明
|
||||
|
||||
> 已于 2026-10-10 停用后端环境变量注入方案。当前以 `docs/scripts/运行与发布配置总说明.md` 为准;本文中的环境变量表仅保留为历史记录,不得继续作为部署依据。
|
||||
> 已于 2026-10-10 停用后端环境变量注入方案。当前以 `docs/scripts/运行与发布配置总说明.md` 为准;本文中的环境变量表仅保留为历史记录,不得继续作为部署依据。表中七牛域名是历史默认值,DEV/SIT Salon 已分别迁移到专属加速域名。
|
||||
|
||||
## 双端生产隔离
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ minio:
|
||||
qiniu:
|
||||
kodo:
|
||||
bucket-name: jayucloud-salon-dev
|
||||
domain: https://img.yunail.art
|
||||
domain: https://dev.qiniu.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
signed-url-expire-minutes: 60
|
||||
|
||||
@@ -27,6 +27,7 @@ object-storage:
|
||||
minio:
|
||||
enabled: true
|
||||
endpoint: http://192.168.10.14:9000
|
||||
public-endpoint: https://sit.minio.yunail.art
|
||||
bucket-name: jayucloud-salon-sit
|
||||
private-bucket: true
|
||||
signed-url-expire-minutes: 60
|
||||
@@ -34,7 +35,7 @@ minio:
|
||||
qiniu:
|
||||
kodo:
|
||||
bucket-name: jayucloud-salon-sit
|
||||
domain: https://img.yunail.art
|
||||
domain: https://sit.qiniu.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
signed-url-expire-minutes: 60
|
||||
|
||||
Reference in New Issue
Block a user