From 8e1456d52b53d77a8b744614c2aca88d218809a0 Mon Sep 17 00:00:00 2001 From: William Valentin Date: Mon, 8 Sep 2025 20:44:19 -0700 Subject: [PATCH] feat: update generated configs and environment files - Regenerate all environment-specific config files with unified config - Update Vite environment files for all environments (dev/staging/prod) - Update Docker environment files with current configuration - Update Kubernetes config.env files for development and production - Add staging environment configurations and overlays - Ensures all generated files reflect unified configuration system --- .env.development | 4 +- .env.vite.development | 2 +- .env.vite.production | 2 +- .env.vite.staging | 15 ++ config/generated/development.config.ts | 6 +- config/generated/production.config.ts | 14 +- config/generated/staging.config.ts | 130 ++++++++++++++++++ docker/.env.development | 2 +- k8s-kustomize/overlays/development/config.env | 4 +- k8s-kustomize/overlays/production/config.env | 6 +- k8s-kustomize/overlays/staging/config.env | 43 ++++++ .../overlays/staging/kustomization.yaml | 73 ++++++++++ 12 files changed, 281 insertions(+), 20 deletions(-) create mode 100644 .env.vite.staging create mode 100644 config/generated/staging.config.ts create mode 100644 k8s-kustomize/overlays/staging/config.env create mode 100644 k8s-kustomize/overlays/staging/kustomization.yaml diff --git a/.env.development b/.env.development index 8140930..632c327 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ # DEVELOPMENT Environment Configuration # Generated automatically from unified configuration -# Generated on: 2025-09-08T16:32:25.385Z +# Generated on: 2025-09-09T03:27:30.597Z # # This file was auto-generated. Do not edit manually. # To make changes, update config/unified.config.ts and regenerate. @@ -22,7 +22,7 @@ DOCKER_IMAGE=gitea-http.taildb3494.ts.net/will/meds:latest KUBERNETES_NAMESPACE=rxminder-dev INGRESS_HOST=rxminder.192.168.153.243.nip.io INGRESS_CLASS=nginx -CERT_MANAGER_ISSUER=letsencrypt-prod +CERT_MANAGER_ISSUER=selfsigned STORAGE_CLASS=longhorn STORAGE_SIZE=1Gi ENABLE_EMAIL_VERIFICATION=true diff --git a/.env.vite.development b/.env.vite.development index 9e656a6..1e53fc4 100644 --- a/.env.vite.development +++ b/.env.vite.development @@ -1,5 +1,5 @@ # Vite environment variables for development -# Generated on: 2025-09-08T16:32:25.392Z +# Generated on: 2025-09-09T03:27:30.601Z # # These variables are available in the frontend build process diff --git a/.env.vite.production b/.env.vite.production index c6b6936..602e9dc 100644 --- a/.env.vite.production +++ b/.env.vite.production @@ -1,5 +1,5 @@ # Vite environment variables for production -# Generated on: 2025-09-08T16:25:25.057Z +# Generated on: 2025-09-09T03:27:30.605Z # # These variables are available in the frontend build process diff --git a/.env.vite.staging b/.env.vite.staging new file mode 100644 index 0000000..71ff403 --- /dev/null +++ b/.env.vite.staging @@ -0,0 +1,15 @@ +# Vite environment variables for staging +# Generated on: 2025-09-09T03:27:30.603Z +# +# These variables are available in the frontend build process + +VITE_APP_NAME=rxminder +VITE_APP_VERSION=1.0.0 +VITE_APP_BASE_URL=rxminder.192.168.153.243.nip.io +VITE_COUCHDB_URL=http://rxminder-couchdb-service:5984 +VITE_COUCHDB_USER=admin +VITE_COUCHDB_PASSWORD=L7tfqHyg0T4sIYiWK +VITE_ENABLE_EMAIL_VERIFICATION=true +VITE_ENABLE_OAUTH=true +VITE_ENABLE_ADMIN_INTERFACE=true +VITE_DEBUG_MODE=true diff --git a/config/generated/development.config.ts b/config/generated/development.config.ts index 9b68c0b..076b8a8 100644 --- a/config/generated/development.config.ts +++ b/config/generated/development.config.ts @@ -1,6 +1,6 @@ /** * Generated configuration for development - * Generated on: 2025-09-08T16:32:25.392Z + * Generated on: 2025-09-09T03:27:30.601Z * * This file exports the resolved configuration for the development environment. * It can be imported by other TypeScript files for type-safe configuration access. @@ -22,7 +22,7 @@ export const developmentConfig: UnifiedConfig = { password: 'L7tfqHyg0T4sIYiWK', name: 'meds_app', useMock: false, - connectionTimeout: 30000, + connectionTimeout: 5000, retryAttempts: 3, }, container: { @@ -35,7 +35,7 @@ export const developmentConfig: UnifiedConfig = { namespace: 'rxminder-dev', ingressHost: 'rxminder.192.168.153.243.nip.io', ingressClass: 'nginx', - certIssuer: 'letsencrypt-prod', + certIssuer: 'selfsigned', storageClass: 'longhorn', storageSize: '1Gi', replicas: { diff --git a/config/generated/production.config.ts b/config/generated/production.config.ts index 0bf6ca5..9d33d88 100644 --- a/config/generated/production.config.ts +++ b/config/generated/production.config.ts @@ -1,6 +1,6 @@ /** * Generated configuration for production - * Generated on: 2025-09-08T16:25:25.058Z + * Generated on: 2025-09-09T03:27:30.605Z * * This file exports the resolved configuration for the production environment. * It can be imported by other TypeScript files for type-safe configuration access. @@ -22,8 +22,8 @@ export const productionConfig: UnifiedConfig = { password: 'L7tfqHyg0T4sIYiWK', name: 'meds_app', useMock: false, - connectionTimeout: 30000, - retryAttempts: 3, + connectionTimeout: 10000, + retryAttempts: 5, }, container: { registry: 'gitea-http.taildb3494.ts.net', @@ -66,7 +66,7 @@ export const productionConfig: UnifiedConfig = { }, }, auth: { - jwtSecret: 'my-production-jwt-secret', + jwtSecret: 'your-super-secret-jwt-key-change-in-production', jwtExpiresIn: '1h', refreshTokenExpiresIn: '7d', emailVerificationExpiresIn: '24h', @@ -106,10 +106,10 @@ export const productionConfig: UnifiedConfig = { }, performance: { cacheTimeout: 3600, - requestTimeout: 30000, + requestTimeout: 120000, maxConnections: 200, enableCors: true, - corsOrigin: '*', + corsOrigin: 'https://rxminder.com', }, logging: { level: 'debug', @@ -121,7 +121,7 @@ export const productionConfig: UnifiedConfig = { enableHttps: true, enableHsts: true, enableCsp: true, - sessionSecret: 'my-production-session-secret', + sessionSecret: 'secure-session-secret-key', rateLimitRequests: 100, rateLimitWindow: 900000, }, diff --git a/config/generated/staging.config.ts b/config/generated/staging.config.ts new file mode 100644 index 0000000..6d5a799 --- /dev/null +++ b/config/generated/staging.config.ts @@ -0,0 +1,130 @@ +/** + * Generated configuration for staging + * Generated on: 2025-09-09T03:27:30.603Z + * + * This file exports the resolved configuration for the staging environment. + * It can be imported by other TypeScript files for type-safe configuration access. + */ + +import type { UnifiedConfig } from '../unified.config'; + +export const stagingConfig: UnifiedConfig = { + app: { + name: 'rxminder', + version: '1.0.0', + environment: 'staging', + baseUrl: 'rxminder.192.168.153.243.nip.io', + port: 5173, + }, + database: { + url: 'http://rxminder-couchdb-service:5984', + username: 'admin', + password: 'L7tfqHyg0T4sIYiWK', + name: 'meds_app', + useMock: false, + connectionTimeout: 30000, + retryAttempts: 3, + }, + container: { + registry: 'gitea-http.taildb3494.ts.net', + repository: 'will/meds', + tag: 'latest', + imageUrl: 'gitea-http.taildb3494.ts.net/will/meds:latest', + }, + kubernetes: { + namespace: 'rxminder-staging', + ingressHost: 'rxminder.192.168.153.243.nip.io', + ingressClass: 'nginx', + certIssuer: 'letsencrypt-staging', + storageClass: 'longhorn', + storageSize: '1Gi', + replicas: { + frontend: 2, + database: 1, + }, + resources: { + frontend: { + requests: { + memory: '256Mi', + cpu: '100m', + }, + limits: { + memory: '512Mi', + cpu: '500m', + }, + }, + database: { + requests: { + memory: '512Mi', + cpu: '200m', + }, + limits: { + memory: '1Gi', + cpu: '1000m', + }, + }, + }, + }, + auth: { + jwtSecret: 'your-super-secret-jwt-key-change-in-production', + jwtExpiresIn: '1h', + refreshTokenExpiresIn: '7d', + emailVerificationExpiresIn: '24h', + bcryptRounds: 12, + }, + email: { + provider: 'console', + mailgun: { + apiKey: 'your-production-mailgun-api-key-here', + domain: 'your-production-domain.com', + baseUrl: 'https://api.mailgun.net/v3', + }, + fromName: 'RxMinder', + fromEmail: 'noreply@your-production-domain.com', + }, + oauth: { + google: { + clientId: 'your_google_client_id_here', + clientSecret: '', + }, + github: { + clientId: 'your_github_client_id_here', + clientSecret: '', + }, + }, + features: { + enableEmailVerification: true, + enableOAuth: true, + enableAdminInterface: true, + enableMonitoring: false, + enableMetrics: false, + enableTracing: false, + enableRateLimiting: true, + enableSecurityHeaders: true, + debugMode: true, + hotReload: false, + }, + performance: { + cacheTimeout: 1800, + requestTimeout: 60000, + maxConnections: 150, + enableCors: true, + corsOrigin: 'https://staging.rxminder.com', + }, + logging: { + level: 'debug', + format: 'json', + enableTimestamp: true, + enableColors: false, + }, + security: { + enableHttps: false, + enableHsts: false, + enableCsp: false, + sessionSecret: 'your-session-secret-change-in-production', + rateLimitRequests: 100, + rateLimitWindow: 900000, + }, +} as const; + +export default stagingConfig; diff --git a/docker/.env.development b/docker/.env.development index 720c725..9fe060d 100644 --- a/docker/.env.development +++ b/docker/.env.development @@ -1,5 +1,5 @@ # Docker environment for development -# Generated on: 2025-09-08T16:32:25.391Z +# Generated on: 2025-09-09T03:27:30.600Z # Container Configuration DOCKER_IMAGE=gitea-http.taildb3494.ts.net/will/meds:latest diff --git a/k8s-kustomize/overlays/development/config.env b/k8s-kustomize/overlays/development/config.env index 8bd516b..51ddac2 100644 --- a/k8s-kustomize/overlays/development/config.env +++ b/k8s-kustomize/overlays/development/config.env @@ -1,6 +1,6 @@ # Kubernetes configuration for development # Generated automatically from unified configuration -# Generated on: 2025-09-08T16:32:25.389Z +# Generated on: 2025-09-09T03:27:30.598Z APP_NAME=rxminder APP_VERSION=1.0.0 @@ -15,7 +15,7 @@ USE_MOCK_DB=false KUBERNETES_NAMESPACE=rxminder-dev INGRESS_HOST=rxminder.192.168.153.243.nip.io INGRESS_CLASS=nginx -CERT_MANAGER_ISSUER=letsencrypt-prod +CERT_MANAGER_ISSUER=selfsigned STORAGE_CLASS=longhorn STORAGE_SIZE=1Gi ENABLE_EMAIL_VERIFICATION=true diff --git a/k8s-kustomize/overlays/production/config.env b/k8s-kustomize/overlays/production/config.env index 17d5be7..5537fc1 100644 --- a/k8s-kustomize/overlays/production/config.env +++ b/k8s-kustomize/overlays/production/config.env @@ -1,6 +1,6 @@ # Kubernetes configuration for production # Generated automatically from unified configuration -# Generated on: 2025-09-08T16:25:25.055Z +# Generated on: 2025-09-09T03:27:30.604Z APP_NAME=rxminder APP_VERSION=1.0.0 @@ -27,10 +27,10 @@ DEBUG_MODE=true LOG_LEVEL=debug LOG_FORMAT=json CACHE_TTL=3600 -REQUEST_TIMEOUT=30000 +REQUEST_TIMEOUT=120000 MAX_CONNECTIONS=200 ENABLE_CORS=true -CORS_ORIGIN=* +CORS_ORIGIN=https://rxminder.com FRONTEND_REPLICAS=3 DATABASE_REPLICAS=1 FRONTEND_MEMORY_REQUEST=256Mi diff --git a/k8s-kustomize/overlays/staging/config.env b/k8s-kustomize/overlays/staging/config.env new file mode 100644 index 0000000..b6a1a97 --- /dev/null +++ b/k8s-kustomize/overlays/staging/config.env @@ -0,0 +1,43 @@ +# Kubernetes configuration for staging +# Generated automatically from unified configuration +# Generated on: 2025-09-09T03:27:30.602Z + +APP_NAME=rxminder +APP_VERSION=1.0.0 +NODE_ENV=staging +APP_BASE_URL=rxminder.192.168.153.243.nip.io +PORT=5173 +COUCHDB_URL=http://rxminder-couchdb-service:5984 +COUCHDB_USER=admin +COUCHDB_PASSWORD=L7tfqHyg0T4sIYiWK +COUCHDB_DATABASE_NAME=meds_app +USE_MOCK_DB=false +KUBERNETES_NAMESPACE=rxminder-staging +INGRESS_HOST=rxminder.192.168.153.243.nip.io +INGRESS_CLASS=nginx +CERT_MANAGER_ISSUER=letsencrypt-staging +STORAGE_CLASS=longhorn +STORAGE_SIZE=1Gi +ENABLE_EMAIL_VERIFICATION=true +ENABLE_OAUTH=true +ENABLE_ADMIN_INTERFACE=true +ENABLE_MONITORING=false +ENABLE_METRICS=false +DEBUG_MODE=true +LOG_LEVEL=debug +LOG_FORMAT=json +CACHE_TTL=1800 +REQUEST_TIMEOUT=60000 +MAX_CONNECTIONS=150 +ENABLE_CORS=true +CORS_ORIGIN=https://staging.rxminder.com +FRONTEND_REPLICAS=2 +DATABASE_REPLICAS=1 +FRONTEND_MEMORY_REQUEST=256Mi +FRONTEND_CPU_REQUEST=100m +FRONTEND_MEMORY_LIMIT=512Mi +FRONTEND_CPU_LIMIT=500m +DATABASE_MEMORY_REQUEST=512Mi +DATABASE_CPU_REQUEST=200m +DATABASE_MEMORY_LIMIT=1Gi +DATABASE_CPU_LIMIT=1000m diff --git a/k8s-kustomize/overlays/staging/kustomization.yaml b/k8s-kustomize/overlays/staging/kustomization.yaml new file mode 100644 index 0000000..fe1efea --- /dev/null +++ b/k8s-kustomize/overlays/staging/kustomization.yaml @@ -0,0 +1,73 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +metadata: + name: rxminder-staging + +# Reference the base configuration +resources: + - ../../base + - namespace.yaml + +# Override namespace for staging +namespace: rxminder-staging + +# Staging-specific labels +labels: + - pairs: + environment: staging + tier: staging + +# Staging image tags and configurations +images: + - name: frontend-image + newName: gitea-http.taildb3494.ts.net/will/meds + newTag: latest + - name: couchdb-image + newName: couchdb + newTag: 3.3.2 + +# Staging replicas +replicas: + - name: rxminder-frontend + count: 2 + - name: rxminder-couchdb + count: 1 + +# Environment-specific patches +patches: + # Resource limits + - target: + kind: Deployment + name: rxminder-frontend + patch: |- + - op: replace + path: /spec/template/spec/containers/0/resources + value: + requests: + memory: "256Mi" + cpu: "100m" + limits: + memory: "512Mi" + cpu: "500m" + + - target: + kind: StatefulSet + name: rxminder-couchdb + patch: |- + - op: replace + path: /spec/template/spec/containers/0/resources + value: + requests: + memory: "512Mi" + cpu: "200m" + limits: + memory: "1Gi" + cpu: "1000m" + +# ConfigMap generation +configMapGenerator: + - name: rxminder-config + envs: + - config.env + behavior: create