From a403e6e1eb41334816f1052e6a0159b9f10cc7d3 Mon Sep 17 00:00:00 2001 From: drono Date: Tue, 3 Dec 2024 17:27:38 +0300 Subject: [PATCH] standardize environment variables. --- openfn/docker-compose.yml | 38 ++++++++--------- .../postgres/docker-compose.config.yml | 6 +-- openfn/package-metadata.json | 42 +++++++++---------- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/openfn/docker-compose.yml b/openfn/docker-compose.yml index 0ed720e5..3b55d1fe 100644 --- a/openfn/docker-compose.yml +++ b/openfn/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.9' services: openfn: - image: ${OpenFn_IMAGE} + image: ${OPENFN_IMAGE} # This command runs a shell script that performs the following actions: # 1. Executes the Lightning.Release.migrate() function to handle database migrations. # 2. Sets up a user with the provided first name, last name, email, password, and role using the Lightning.Setup.setup_user function. @@ -16,22 +16,22 @@ services: deploy: resources: limits: - cpus: '${DOCKER_WEB_CPUS:-0}' - memory: '${DOCKER_WEB_MEMORY:-0}' + cpus: '${OPENFN_DOCKER_WEB_CPUS:-0}' + memory: '${OPENFN_DOCKER_WEB_MEMORY:-0}' environment: - - DATABASE_URL=${DATABASE_URL} - - DISABLE_DB_SSL=${DISABLE_DB_SSL} - - IS_RESETTABLE_DEMO=${IS_RESETTABLE_DEMO} - - LISTEN_ADDRESS=${LISTEN_ADDRESS} - - LOG_LEVEL=${LOG_LEVEL} - - ORIGINS=${ORIGINS} - - PRIMARY_ENCRYPTION_KEY=${PRIMARY_ENCRYPTION_KEY} - - SECRET_KEY_BASE=${SECRET_KEY_BASE} + - DATABASE_URL=${OPENFN_DATABASE_URL} + - DISABLE_DB_SSL=${OPENFN_DISABLE_DB_SSL} + - IS_RESETTABLE_DEMO=${OPENFN_IS_RESETTABLE_DEMO} + - LISTEN_ADDRESS=${OPENFN_LISTEN_ADDRESS} + - LOG_LEVEL=${OPENFN_LOG_LEVEL} + - ORIGINS=${OPENFN_ORIGINS} + - PRIMARY_ENCRYPTION_KEY=${OPENFN_PRIMARY_ENCRYPTION_KEY} + - SECRET_KEY_BASE=${OPENFN_SECRET_KEY_BASE} - WORKER_RUNS_PRIVATE_KEY=${OPENFN_WORKER_RUNS_PRIVATE_KEY} - - WORKER_SECRET=${WORKER_SECRET} - - KAFKA_TRIGGERS_ENABLED=${KAFKA_TRIGGERS_ENABLED} + - WORKER_SECRET=${OPENFN_WORKER_SECRET} + - KAFKA_TRIGGERS_ENABLED=${OPENFN_KAFKA_TRIGGERS_ENABLED} healthcheck: - test: '${DOCKER_WEB_HEALTHCHECK_TEST:-curl localhost:4000/health_check}' + test: '${ DOCKER_WEB_HEALTHCHECK_TEST:-curl localhost:4000/health_check}' interval: '10s' timeout: '3s' start_period: '5s' @@ -40,15 +40,15 @@ services: - kafka_public - postgres worker: - image: ${OpenFn_WORKER_IMAGE} + image: ${OPENFN_WORKER_IMAGE} deploy: resources: limits: - cpus: '${DOCKER_WORKER_CPUS:-0}' - memory: '${DOCKER_WORKER_MEMORY:-0}' + cpus: '${OPENFN_DOCKER_WORKER_CPUS:-0}' + memory: '${OPENFN_DOCKER_WORKER_MEMORY:-0}' environment: - - WORKER_LIGHTNING_PUBLIC_KEY=${WORKER_LIGHTNING_PUBLIC_KEY} - - WORKER_SECRET=${WORKER_SECRET} + - WORKER_LIGHTNING_PUBLIC_KEY=${OPENFN_WORKER_LIGHTNING_PUBLIC_KEY} + - WORKER_SECRET=${OPENFN_WORKER_SECRET} - NODE_ENV=production command: [ 'pnpm', 'start:prod', '-l', 'ws://openfn:${URL_PORT-4000}/worker' ] networks: diff --git a/openfn/importer/postgres/docker-compose.config.yml b/openfn/importer/postgres/docker-compose.config.yml index c982ab28..21ae873c 100644 --- a/openfn/importer/postgres/docker-compose.config.yml +++ b/openfn/importer/postgres/docker-compose.config.yml @@ -17,9 +17,9 @@ services: POSTGRES_DATABASE: ${POSTGRES_DATABASE} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_PORT: ${POSTGRES_PORT} - NEW_DATABASE_NAME: ${OpenFn_POSTGRESQL_DB} - NEW_DATABASE_USER: ${OpenFn_POSTGRESQL_USERNAME} - NEW_DATABASE_PASSWORD: ${OpenFn_POSTGRESQL_PASSWORD} + NEW_DATABASE_NAME: ${OPENFN_POSTGRESQL_DB} + NEW_DATABASE_USER: ${OPENFN_POSTGRESQL_USERNAME} + NEW_DATABASE_PASSWORD: ${OPENFN_POSTGRESQL_PASSWORD} deploy: replicas: 1 restart_policy: diff --git a/openfn/package-metadata.json b/openfn/package-metadata.json index 62f39d5c..fda1bd9a 100644 --- a/openfn/package-metadata.json +++ b/openfn/package-metadata.json @@ -6,34 +6,34 @@ "version": "0.0.1", "dependencies": ["database-postgres"], "environmentVariables": { - "DATABASE_URL": "postgresql://openfn:instant101@postgres-1:5432/lightning_dev", - "DISABLE_DB_SSL": "true", - "IS_RESETTABLE_DEMO": "true", - "LISTEN_ADDRESS": "0.0.0.0", - "LOG_LEVEL": "debug", - "ORIGINS": "http://localhost:4000", - "PRIMARY_ENCRYPTION_KEY": "KLu/IoZuaf+baDECd8wG4Z6auwNe6VAmwh9N8lWdJ1A=", - "SECRET_KEY_BASE": "jGDxZj2O+Qzegm5wcZ940RfWO4D6RyU8thNCr5BUpHNwa7UNV52M1/Sn+7RxiP+f", - "WORKER_RUNS_PRIVATE_KEY": "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2Z0lCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktnd2dnU2tBZ0VBQW9JQkFRREVtR3drUW5pT0hqVCsKMnkyRHFvRUhyT3dLZFI2RW9RWG9DeDE4MytXZ3hNcGthTFZyOFViYVVVQWNISGgzUFp2Z2UwcEIzTWlCWWR5Kwp1ajM1am5uK2JIdk9OZGRldWxOUUdpczdrVFFHRU1nTSs0Njhldm5RS0h6R29DRUhabDlZV0s0MUd5SEZCZXppCnJiOGx2T1A1NEtSTS90aE5pVGtHaUIvTGFLMldLcTh0VmtoSHBvaFE3OGIyR21vNzNmcW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S0VMMU1NVzh5QWZwNzV4Ung5cnNaQzI2UEtqQ0pWL2lTVjcyNlQ1ZTFzRG5sZUtBb0JFZnlDRgpvbEhhMmhybWxRS0JnUURHT1YyOWd1K1NmMng1SVRTWm8xT1ZxbitGZDhlZno1d3V5YnZ3Rm1Fa2V1YUdXZDh1CnJ4UFM3MkJ6K0Y1dUJUWngvMWtLa0w4Zm94TUlQN0FleW1zOWhUeWVybnkyMk9TVlBJSmN3dExqMUxTeDN3L0kKK0kyaVpsYVl1akVlZXpXbHY1S2R0cUNORjk3Zzh0ck1NTnMySVZKa1h1NXFwUk82V0ZXRzZGL2h4d0tCZ0hnNApHYUpFSFhIT204ekZTU2lYSW5FWGZKQmVWZmJIOUxqNzFrbVRlR3RJZTdhTlVHZnVxY1BYUGRiZUZGSHRsY2ZsCkx6dWwzS3V6VFExdEhGTnIyWkl5MTlQM1o1TSs4R2c5Y1FFeVRWYmlpV2xha2x0cmttRnRtQTI4bE0zVEZPWmkKUUNWMUZpZStjaWRVeC9qRnFma1F0c1VXQ2llSUxSazZOY1d0WGpXcEFvR0JBTGN6Y210VGlUUEFvWnk0MFV1QQpTOXpUd3RsamhmUWJEVTVjb21EcnlKcnFRU0VOdmQ2VW5HdW0zYVNnNk13dDc0NGxidDAyMC9mSGI0WTJkTGhMCmx4YWJ5b1dQUElRRUpLL1NNOGtURFEvYTRyME5tZzhuV3h5bGFLcHQ5WUhmZ2NYMkYzSzUrc0VSUGNFcVZlWFMKdWZkYXdYQVlFampZK3V2UHZ2YzU3RU1aCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K", - "WORKER_SECRET": "secret_here", + "OPENFN_DATABASE_URL": "postgresql://openfn:instant101@postgres-1:5432/lightning_dev", + "OPENFN_DISABLE_DB_SSL": "true", + "OPENFN_IS_RESETTABLE_DEMO": "true", + "OPENFN_LISTEN_ADDRESS": "0.0.0.0", + "OPENFN_LOG_LEVEL": "debug", + "OPENFN_ORIGINS": "http://localhost:4000", + "OPENF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4bE0zVEZPWmkKUUNWMUZpZStjaWRVeC9qRnFma1F0c1VXQ2llSUxSazZOY1d0WGpXcEFvR0JBTGN6Y210VGlUUEFvWnk0MFV1QQpTOXpUd3RsamhmUWJEVTVjb21EcnlKcnFRU0VOdmQ2VW5HdW0zYVNnNk13dDc0NGxidDAyMC9mSGI0WTJkTGhMCmx4YWJ5b1dQUElRRUpLL1NNOGtURFEvYTRyME5tZzhuV3h5bGFLcHQ5WUhmZ2NYMkYzSzUrc0VSUGNFcVZlWFMKdWZkYXdYQVlFampZK3V2UHZ2YzU3RU1aCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K", + "OPENFN_WORKER_SECRET": "secret_here", "POSTGRES_USER": "postgres", "POSTGRES_SERVICE": "postgres-1", "POSTGRES_DATABASE": "postgres", "POSTGRES_PASSWORD": "instant101", "POSTGRES_PORT": "5432", - "OpenFn_POSTGRESQL_DB": "lightning_dev", - "OpenFn_POSTGRESQL_USERNAME": "openfn", - "OpenFn_POSTGRESQL_PASSWORD": "instant101", - "WORKER_LIGHTNING_PUBLIC_KEY": "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF4SmhzSkVKNGpoNDAvdHN0ZzZxQgpCNnpzQ25VZWhLRUY2QXNkZk4vbG9NVEtaR2kxYS9GRzJsRkFIQng0ZHoyYjRIdEtRZHpJZ1dIY3ZybzkrWTU1Ci9teDd6alhYWHJwVFVCb3JPNUUwQmhESURQdU92SHI1MENoOHhxQWhCMlpmV0ZpdU5Sc2h4UVhzNHEyL0piemoKK2VDa1RQN1lUWWs1Qm9nZnkyaXRsaXF2TFZaSVI2YUlVTy9HOWhwcU85MzZwSngzekdjT0hUZThFcjFqWTN4Kwo3ZENZVTdxSHpNcDdpMFdZQkdoM3kvWUtQcklDbXJCVXpYcUxSUndSZFFObkQ5Z1l5OTRpMmNCMzd0enRkSVBPCklYM2p0b3pJcFgyR2JiQXI1UWl6QTNuSkxVUlYyTTFobGJKeEtVbS9mbkttMVVMYUxSUEFTRGV6aFUzNFM3OUsKSndJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg", - "OpenFn_IMAGE": "openfn/lightning:v2.9.5", - "OpenFn_WORKER_IMAGE": "openfn/ws-worker:latest", - "KAFKA_TRIGGERS_ENABLED": "true", + "OPENFN_POSTGRESQL_DB": "lightning_dev", + "OPENFN_POSTGRESQL_USERNAME": "openfn", + "OPENFN_POSTGRESQL_PASSWORD": "instant101", + "OPENFN_WORKER_LIGHTNING_PUBLIC_KEY": "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF4SmhzSkVKNGpoNDAvdHN0ZzZxQgpCNnpzQ25VZWhLRUY2QXNkZk4vbG9NVEtaR2kxYS9GRzJsRkFIQng0ZHoyYjRIdEtRZHpJZ1dIY3ZybzkrWTU1Ci9teDd6alhYWHJwVFVCb3JPNUUwQmhESURQdU92SHI1MENoOHhxQWhCMlpmV0ZpdU5Sc2h4UVhzNHEyL0piemoKK2VDa1RQN1lUWWs1Qm9nZnkyaXRsaXF2TFZaSVI2YUlVTy9HOWhwcU85MzZwSngzekdjT0hUZThFcjFqWTN4Kwo3ZENZVTdxSHpNcDdpMFdZQkdoM3kvWUtQcklDbXJCVXpYcUxSUndSZFFObkQ5Z1l5OTRpMmNCMzd0enRkSVBPCklYM2p0b3pJcFgyR2JiQXI1UWl6QTNuSkxVUlYyTTFobGJKeEtVbS9mbkttMVVMYUxSUEFTRGV6aFUzNFM3OUsKSndJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg", + "OPENFN_IMAGE": "openfn/lightning:v2.9.5", + "OPENFN_WORKER_IMAGE": "openfn/ws-worker:latest", + "OPENFN_KAFKA_TRIGGERS_ENABLED": "true", "OPENFN_API_KEY": "apiKey", "OPENFN_ENDPOINT": "http://localhost:4000", - "DOCKER_WEB_CPUS": "2", - "DOCKER_WEB_MEMORY": "4G", - "DOCKER_WORKER_CPUS": "2", - "DOCKER_WORKER_MEMORY": "4G", + "OPENFN_DOCKER_WEB_CPUS": "2", + "OPENFN_DOCKER_WEB_MEMORY": "4G", + "OPENFN_DOCKER_WORKER_CPUS": "2", + "OPENFN_DOCKER_WORKER_MEMORY": "4G", "FHIR_SERVER_BASE_URL": "http://openhim-core:5001", "FHIR_SERVER_USERNAME": "openfn_client", "FHIR_SERVER_PASSWORD": "openfn_client_password"