diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml index 77c7b49..3388b2d 100644 --- a/backend/docker-compose.yml +++ b/backend/docker-compose.yml @@ -359,6 +359,7 @@ services: - MINIO_ACCESS_KEY=genex-admin - MINIO_SECRET_KEY=genex-minio-secret - MINIO_BUCKET=app-releases + - OSS_BASE_URL=https://oss.gogenex.com # Public download base URL for app packages - JWT_ACCESS_SECRET=dev-access-secret-change-in-production depends_on: postgres: diff --git a/backend/services/admin-service/src/interface/http/controllers/admin-version.controller.ts b/backend/services/admin-service/src/interface/http/controllers/admin-version.controller.ts index 254ca75..3696f70 100644 --- a/backend/services/admin-service/src/interface/http/controllers/admin-version.controller.ts +++ b/backend/services/admin-service/src/interface/http/controllers/admin-version.controller.ts @@ -142,9 +142,10 @@ export class AdminVersionController { createdBy: req.user?.sub, }); - // Set stable download URL pointing to this service's download endpoint + // Direct download URL via MinIO (oss.gogenex.com/app-releases/) + const ossBase = process.env.OSS_BASE_URL || 'https://oss.gogenex.com'; const updated = await this.versionService.updateVersion(version.id, { - downloadUrl: `/api/v1/app/version/download/${version.id}`, + downloadUrl: `${ossBase}/app-releases/${uploadResult.objectName}`, }); return { code: 0, data: updated }; diff --git a/frontend/admin-web/.env.development b/frontend/admin-web/.env.development index 1ee373b..fcb636a 100644 --- a/frontend/admin-web/.env.development +++ b/frontend/admin-web/.env.development @@ -1,6 +1,9 @@ # API Configuration NEXT_PUBLIC_API_BASE_URL=http://localhost:8080/api +# Object Storage +NEXT_PUBLIC_OSS_URL=https://oss.gogenex.com + # Application Info NEXT_PUBLIC_APP_NAME=Genex Admin NEXT_PUBLIC_VERSION=1.0.0-dev diff --git a/frontend/admin-web/.env.production b/frontend/admin-web/.env.production index 851dfb0..ce17f41 100644 --- a/frontend/admin-web/.env.production +++ b/frontend/admin-web/.env.production @@ -1,6 +1,9 @@ # API Configuration NEXT_PUBLIC_API_BASE_URL=https://api.gogenex.com/api +# Object Storage +NEXT_PUBLIC_OSS_URL=https://oss.gogenex.com + # Application Info NEXT_PUBLIC_APP_NAME=Genex Admin NEXT_PUBLIC_VERSION=1.0.0 diff --git a/infrastructure/minio/deploy.sh b/infrastructure/minio/deploy.sh index 41c5291..8a3924b 100644 --- a/infrastructure/minio/deploy.sh +++ b/infrastructure/minio/deploy.sh @@ -22,7 +22,8 @@ BUCKETS=( ) # Buckets that should be publicly readable (no auth needed for download) -PUBLIC_BUCKETS=(coupon-images avatars) +# app-releases: APK/IPA packages downloaded directly by mobile apps via oss.gogenex.com +PUBLIC_BUCKETS=(app-releases coupon-images avatars) _init_buckets() { local user="${MINIO_ROOT_USER:-genex-admin}"