Skip to content

Configuration

Asset đọc cấu hình từ môi trường của host. Host phải cung cấp các biến S3 dưới đây trước khi mount ApplicationAssetComponent. Các key được khai báo trong packages/core/src/common/environments.ts (EnvironmentKeys).

1. Biến môi trường

Riêng cho service (S3 / Minio)

TênKiểuMặc địnhBắt buộcPhạm viMô tả
APP_ENV_S3_ENDPOINTstringruntimeURL endpoint S3/Minio — truyền cho BunS3Helper
APP_ENV_S3_ACCESS_KEYstringruntimeAccess key S3/Minio
APP_ENV_S3_SECRET_KEYstringruntimeSecret key S3/Minio
APP_ENV_S3_BUCKETstringunknown (fallback)runtimeBucket mặc định cho route object/i18n
APP_ENV_APPLICATION_EXPLORER_URLstringruntimeBase dùng để tuyệt-đối-hóa bankLogoUrl trong registry ngân hàng VN

APP_ENV_S3_HOST / APP_ENV_S3_API_PORT cũng tồn tại trong EnvironmentKeys nhưng không được @nx/asset đọc (nó chỉ dùng APP_ENV_S3_ENDPOINT).

Core / DB / Redis / Kafka

N/A — được cung cấp và tiêu thụ bởi ứng dụng host, không phải asset. Asset chỉ yêu cầu các biến S3 ở trên cộng với bất cứ thứ gì host cần để bind PostgresCoreDataSource cho MetaLink.

2. Feature Flags

FlagMặc địnhOwnerMô tả
Không có. Đường dẫn StaticAssetComponent presigned-URL bị gate bằng comment ở source-level, không phải runtime flag

3. Dữ liệu Seed

Không có DB migration hay seed — asset không có schema riêng. Dữ liệu tham chiếu tĩnh ship trong bundle:

FileSeedsIdempotentGhi chú
src/resources/banks-vn.jsonRegistry ngân hàng/nhà cung cấp thanh toán VN✓ (read-only)Re-export thành FinanceBanksVN qua banks-vn.ts
src/resources/banks-vn/*.png~60 logo ngân hàng✓ (read-only)Phục vụ bởi GET /assets/banks-vn/{filename} từ resources/banks-vn cạnh file thực thi

4. Lưu trữ Configuration (bảng Configuration)

Configuration kindEncryptionRead by

N/A — asset không lưu cấu hình runtime theo từng merchant.

5. DI Bindings

Binding keyBound valueBound by
BindingKeys.APPLICATION_S3_STORAGE_HELPER (@nx/commerce/storage/s3-helper)instance BunS3HelperApplicationAssetComponent.binding()

Namespace của binding key là @nx/commerce (BindingKeys.BASE), được kế thừa bất kể host nào mount component.

6. Trang liên quan

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.