2025-12-01 15:30:04 +09:00
|
|
|
# =============================================================================
|
|
|
|
|
# Customer Portal Backend (BFF) - Production Environment
|
|
|
|
|
# =============================================================================
|
|
|
|
|
# Copy to portal-backend.env and configure values marked with CHANGE_ME
|
|
|
|
|
# Variables with defaults can be omitted unless you need to override them
|
|
|
|
|
# =============================================================================
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# REQUIRED - Must be configured
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
2025-09-01 15:11:42 +09:00
|
|
|
NODE_ENV=production
|
2025-12-01 15:30:04 +09:00
|
|
|
DATABASE_URL=postgresql://portal:CHANGE_ME@database:5432/portal_prod?schema=public
|
|
|
|
|
JWT_SECRET=CHANGE_ME_GENERATE_WITH_openssl_rand_base64_32
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Core Application
|
|
|
|
|
# -----------------------------------------------------------------------------
|
2025-09-01 15:11:42 +09:00
|
|
|
|
2025-09-06 14:05:18 +09:00
|
|
|
APP_NAME=customer-portal-bff
|
2025-12-01 15:30:04 +09:00
|
|
|
APP_BASE_URL=https://your-domain.com
|
|
|
|
|
BFF_PORT=4000
|
2025-09-01 15:11:42 +09:00
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Security
|
|
|
|
|
# -----------------------------------------------------------------------------
|
2025-09-01 15:11:42 +09:00
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# Redis cache (required for production token management)
|
2025-09-01 15:11:42 +09:00
|
|
|
REDIS_URL=redis://cache:6379/0
|
|
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# JWT configuration
|
2025-09-01 15:11:42 +09:00
|
|
|
JWT_EXPIRES_IN=7d
|
|
|
|
|
BCRYPT_ROUNDS=12
|
|
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# CORS - set to your frontend domain
|
|
|
|
|
CORS_ORIGIN=https://your-domain.com
|
2025-09-01 15:11:42 +09:00
|
|
|
TRUST_PROXY=true
|
|
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# CSRF Protection (generate secret: openssl rand -base64 32)
|
|
|
|
|
CSRF_SECRET_KEY=CHANGE_ME_GENERATE_WITH_openssl_rand_base64_32
|
|
|
|
|
|
|
|
|
|
# Redis token handling
|
|
|
|
|
AUTH_ALLOW_REDIS_TOKEN_FAILOPEN=false
|
|
|
|
|
AUTH_REQUIRE_REDIS_FOR_TOKENS=false
|
|
|
|
|
|
|
|
|
|
# Maintenance mode (enable during deployments)
|
|
|
|
|
AUTH_MAINTENANCE_MODE=false
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Rate Limiting
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
2025-10-29 15:54:45 +09:00
|
|
|
RATE_LIMIT_TTL=60
|
2025-09-06 14:05:18 +09:00
|
|
|
RATE_LIMIT_LIMIT=100
|
2025-10-29 15:54:45 +09:00
|
|
|
AUTH_RATE_LIMIT_TTL=900
|
2025-09-06 14:05:18 +09:00
|
|
|
AUTH_RATE_LIMIT_LIMIT=3
|
2025-11-05 15:47:06 +09:00
|
|
|
LOGIN_RATE_LIMIT_TTL=900
|
|
|
|
|
LOGIN_RATE_LIMIT_LIMIT=5
|
|
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# CAPTCHA (optional - set provider to 'turnstile' or 'hcaptcha' to enable)
|
2025-11-05 15:47:06 +09:00
|
|
|
AUTH_CAPTCHA_PROVIDER=none
|
|
|
|
|
AUTH_CAPTCHA_SECRET=
|
2025-09-06 14:05:18 +09:00
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# Hide validation errors from clients in production
|
2025-09-06 17:38:42 +09:00
|
|
|
EXPOSE_VALIDATION_ERRORS=false
|
|
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# WHMCS Integration
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
2025-09-01 15:11:42 +09:00
|
|
|
WHMCS_BASE_URL=https://accounts.asolutions.co.jp
|
|
|
|
|
WHMCS_API_IDENTIFIER=
|
|
|
|
|
WHMCS_API_SECRET=
|
2025-09-06 14:05:18 +09:00
|
|
|
WHMCS_WEBHOOK_SECRET=
|
2025-12-01 15:30:04 +09:00
|
|
|
|
|
|
|
|
# Queue throttling
|
|
|
|
|
WHMCS_QUEUE_CONCURRENCY=15
|
|
|
|
|
WHMCS_QUEUE_TIMEOUT_MS=30000
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Salesforce Integration
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
2025-09-01 15:11:42 +09:00
|
|
|
SF_LOGIN_URL=https://asolutions.my.salesforce.com
|
|
|
|
|
SF_CLIENT_ID=
|
|
|
|
|
SF_USERNAME=
|
2025-12-01 15:30:04 +09:00
|
|
|
SF_PRIVATE_KEY_PATH=/app/secrets/sf-private.key
|
2025-09-06 14:05:18 +09:00
|
|
|
SF_WEBHOOK_SECRET=
|
2025-09-26 17:02:36 +09:00
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# Queue throttling
|
2025-09-26 17:02:36 +09:00
|
|
|
SF_QUEUE_CONCURRENCY=15
|
|
|
|
|
SF_QUEUE_TIMEOUT_MS=30000
|
|
|
|
|
SF_QUEUE_LONG_RUNNING_TIMEOUT_MS=600000
|
2025-09-01 15:11:42 +09:00
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# Platform Events
|
2025-09-06 10:01:44 +09:00
|
|
|
SF_EVENTS_ENABLED=true
|
|
|
|
|
SF_EVENTS_REPLAY=LATEST
|
2025-11-06 16:32:29 +09:00
|
|
|
SF_PUBSUB_ENDPOINT=api.pubsub.salesforce.com:7443
|
|
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Freebit SIM Management
|
|
|
|
|
# -----------------------------------------------------------------------------
|
2025-11-06 16:32:29 +09:00
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
FREEBIT_BASE_URL=https://i1.mvno.net/emptool/api
|
|
|
|
|
FREEBIT_OEM_ID=PASI
|
|
|
|
|
FREEBIT_OEM_KEY=
|
|
|
|
|
FREEBIT_TIMEOUT=30000
|
2025-09-01 15:11:42 +09:00
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# -----------------------------------------------------------------------------
|
2025-09-01 15:11:42 +09:00
|
|
|
# Email (SendGrid)
|
2025-12-01 15:30:04 +09:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
EMAIL_ENABLED=true
|
2025-09-01 15:11:42 +09:00
|
|
|
EMAIL_FROM=no-reply@asolutions.jp
|
|
|
|
|
EMAIL_FROM_NAME=Assist Solutions
|
2025-12-01 15:30:04 +09:00
|
|
|
SENDGRID_API_KEY=
|
2025-09-01 15:11:42 +09:00
|
|
|
SENDGRID_SANDBOX=false
|
|
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Portal Configuration
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
PORTAL_PRICEBOOK_ID=
|
|
|
|
|
PORTAL_PRICEBOOK_NAME=Portal
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Logging
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
LOG_LEVEL=info
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Node Runtime
|
|
|
|
|
# -----------------------------------------------------------------------------
|
2025-09-06 14:05:18 +09:00
|
|
|
|
2025-09-01 15:11:42 +09:00
|
|
|
NODE_OPTIONS=--max-old-space-size=512
|
|
|
|
|
|
2025-12-01 15:30:04 +09:00
|
|
|
|
|
|
|
|
# =============================================================================
|
|
|
|
|
# ADVANCED CONFIGURATION (rarely need to change)
|
|
|
|
|
# =============================================================================
|
|
|
|
|
# The following variables have sensible defaults and only need to be set
|
|
|
|
|
# if your Salesforce org uses non-standard field API names.
|
|
|
|
|
# Uncomment and modify only if needed.
|
|
|
|
|
# =============================================================================
|
|
|
|
|
|
|
|
|
|
# --- Salesforce Field Mappings - Account ---
|
|
|
|
|
# ACCOUNT_INTERNET_ELIGIBILITY_FIELD=Internet_Eligibility__c
|
|
|
|
|
# ACCOUNT_CUSTOMER_NUMBER_FIELD=SF_Account_No__c
|
|
|
|
|
# ACCOUNT_PORTAL_STATUS_FIELD=Portal_Status__c
|
|
|
|
|
# ACCOUNT_PORTAL_STATUS_SOURCE_FIELD=Portal_Registration_Source__c
|
|
|
|
|
# ACCOUNT_PORTAL_LAST_SIGNED_IN_FIELD=Portal_Last_SignIn__c
|
|
|
|
|
|
|
|
|
|
# --- Salesforce Field Mappings - Product ---
|
|
|
|
|
# PRODUCT_SKU_FIELD=StockKeepingUnit
|
|
|
|
|
# PRODUCT_PORTAL_CATEGORY_FIELD=Product2Categories1__c
|
|
|
|
|
# PRODUCT_PORTAL_CATALOG_FIELD=Portal_Catalog__c
|
|
|
|
|
# PRODUCT_PORTAL_ACCESSIBLE_FIELD=Portal_Accessible__c
|
|
|
|
|
# PRODUCT_ITEM_CLASS_FIELD=Item_Class__c
|
|
|
|
|
# PRODUCT_BILLING_CYCLE_FIELD=Billing_Cycle__c
|
|
|
|
|
# PRODUCT_WHMCS_PRODUCT_ID_FIELD=WH_Product_ID__c
|
|
|
|
|
# PRODUCT_WHMCS_PRODUCT_NAME_FIELD=WH_Product_Name__c
|
|
|
|
|
# PRODUCT_INTERNET_PLAN_TIER_FIELD=Internet_Plan_Tier__c
|
|
|
|
|
# PRODUCT_INTERNET_OFFERING_TYPE_FIELD=Internet_Offering_Type__c
|
|
|
|
|
# PRODUCT_DISPLAY_ORDER_FIELD=Catalog_Order__c
|
|
|
|
|
# PRODUCT_BUNDLED_ADDON_FIELD=Bundled_Addon__c
|
|
|
|
|
# PRODUCT_IS_BUNDLED_ADDON_FIELD=Is_Bundled_Addon__c
|
|
|
|
|
# PRODUCT_SIM_DATA_SIZE_FIELD=SIM_Data_Size__c
|
|
|
|
|
# PRODUCT_SIM_PLAN_TYPE_FIELD=SIM_Plan_Type__c
|
|
|
|
|
# PRODUCT_SIM_HAS_FAMILY_DISCOUNT_FIELD=SIM_Has_Family_Discount__c
|
|
|
|
|
# PRODUCT_VPN_REGION_FIELD=VPN_Region__c
|
|
|
|
|
|
|
|
|
|
# --- Salesforce Field Mappings - Order ---
|
|
|
|
|
# ORDER_TYPE_FIELD=Type
|
|
|
|
|
# ORDER_ACTIVATION_TYPE_FIELD=Activation_Type__c
|
|
|
|
|
# ORDER_ACTIVATION_SCHEDULED_AT_FIELD=Activation_Scheduled_At__c
|
|
|
|
|
# ORDER_ACTIVATION_STATUS_FIELD=Activation_Status__c
|
|
|
|
|
# ORDER_SIM_TYPE_FIELD=SIM_Type__c
|
|
|
|
|
# ORDER_EID_FIELD=EID__c
|
|
|
|
|
# ORDER_MNP_APPLICATION_FIELD=MNP_Application__c
|
|
|
|
|
# ORDER_MNP_RESERVATION_FIELD=MNP_Reservation_Number__c
|
|
|
|
|
# ORDER_MNP_EXPIRY_FIELD=MNP_Expiry_Date__c
|
|
|
|
|
# ORDER_MNP_PHONE_FIELD=MNP_Phone_Number__c
|
|
|
|
|
# ORDER_WHMCS_ORDER_ID_FIELD=WHMCS_Order_ID__c
|
|
|
|
|
|
|
|
|
|
# --- Salesforce CDC Channels (Change Data Capture) ---
|
|
|
|
|
# SF_CATALOG_PRODUCT_CDC_CHANNEL=/data/Product2ChangeEvent
|
|
|
|
|
# SF_CATALOG_PRICEBOOKENTRY_CDC_CHANNEL=/data/PricebookEntryChangeEvent
|
|
|
|
|
# SF_ORDER_CDC_CHANNEL=/data/OrderChangeEvent
|
|
|
|
|
# SF_ORDER_ITEM_CDC_CHANNEL=/data/OrderItemChangeEvent
|