Commit Graph

5 Commits

Author SHA1 Message Date
hailin 1d611f9a5f fix(kong): use host network mode to reach internal microservices
Kong container uses network_mode:host so it shares the gateway's
network namespace and can reach 192.168.1.222:PORT directly.
Listen on 127.0.0.1:48080 (local only, Nginx proxies externally).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 03:52:31 -08:00
hailin 099c1fe49c infra: move Kong to gateway server, fix MinIO internal path
- infrastructure/kong/: Kong declarative config for gateway server
  All service URLs use http://192.168.1.222:PORT (internal server)
  admin-service gets extended timeouts (300s) for large uploads
- docker-compose.yml: admin-service uses MINIO_ENDPOINT=192.168.1.200:9200
  Plain HTTP via Nginx internal proxy (no SSL, no extra_hosts needed)

New upload path:
  Browser → Nginx:443 → Kong:48080 (local) → admin-service(LAN) → MinIO:9200(local)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 03:41:45 -08:00
hailin 7ba5401e2f feat(infra): use oss.gogenex.com for app version download URLs
将应用版本的文件下载链接从 API 代理路径改为直接指向对象存储域名。

backend/admin-service (admin-version.controller.ts)
- uploadVersion 上传成功后,downloadUrl 改为:
    https://oss.gogenex.com/app-releases/<storageKey>
  (原:/api/v1/app/version/download/:id 代理路径)
- 读取 OSS_BASE_URL 环境变量,默认 https://oss.gogenex.com

backend/docker-compose.yml
- admin-service 新增 OSS_BASE_URL=https://oss.gogenex.com

infrastructure/minio/deploy.sh
- app-releases bucket 加入公开下载列表
  (APK/IPA 需被移动端直接下载,无需鉴权)

frontend/admin-web
- .env.production 新增 NEXT_PUBLIC_OSS_URL=https://oss.gogenex.com
- .env.development 新增 NEXT_PUBLIC_OSS_URL=https://oss.gogenex.com

MinIO 现状:
  app-releases bucket 已在服务器上设为 anonymous download

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 00:42:05 -08:00
hailin 11bb88badd feat(infra): configure oss.gogenex.com domain for MinIO object storage
按域名规划文档为 MinIO 配置专属域名访问。

变更内容:

DNS(Namecheap)
- 新增 A 记录:oss.gogenex.com → 154.84.135.121

Nginx(网关服务器 14.215.128.96)
- 新增 /etc/nginx/conf.d/oss.gogenex.com.conf
- 反代配置:oss.gogenex.com → localhost:9100
- client_max_body_size 500m(支持大文件 APK/IPA 上传)
- proxy_request_buffering off(流式上传,不缓冲至磁盘)
- Let's Encrypt SSL 证书已签发

backend/docker-compose.yml
- MINIO_ENDPOINT: 192.168.1.200 → oss.gogenex.com
- MINIO_PORT: 9100 → 443
- 新增 MINIO_USE_SSL=true

infrastructure/minio/docker-compose.yml
- 补充域名访问注释说明

服务器现状:
  admin-service 已重启,MinIO 通过 https://oss.gogenex.com 访问。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 00:16:51 -08:00
hailin 3b60fed078 feat(infra): migrate MinIO object storage to gateway server
将 MinIO 对象存储从内网服务器(192.168.1.222)迁移至入口网关服务器
(192.168.1.200 / 14.215.128.96),作为独立基础设施部署。

变更内容:

backend/docker-compose.yml
- 移除 minio 和 minio-init 服务(不再随后端栈启动)
- admin-service 的 MINIO_ENDPOINT 改为 192.168.1.200,端口改为 9100
- 移除 admin-service 对 minio 服务的 depends_on 依赖
- 删除 minio_data docker volume 声明

infrastructure/minio/docker-compose.yml(新增)
- MinIO 独立部署配置
- S3 API  : 9100(映射容器内 9000)
- Console : 9101(映射容器内 9001)
- 数据持久化到宿主机 /data/minio

infrastructure/minio/deploy.sh(新增)
- 支持 up / down / status / init / logs 命令
- up 时自动创建全部 7 个 bucket:
    app-releases, kyc-documents, coupon-images,
    issuer-documents, sar-reports, avatars, exports
- coupon-images / avatars 设为匿名可下载

部署说明:
  # 在网关服务器上首次部署
  cd infrastructure/minio && ./deploy.sh up

  # 查看状态
  ./deploy.sh status

服务器现状:
  genex-minio 已在 14.215.128.96 上运行,所有 bucket 已初始化。
  admin-service 已重启并指向新地址,文件上传恢复正常。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 00:03:01 -08:00