From 1cc8e7b7790858deca3a04bfe79efb689bb2aa6a Mon Sep 17 00:00:00 2001 From: iman Date: Tue, 15 Oct 2024 14:59:47 +0330 Subject: [PATCH 1/8] update(postgre,redis): customizable url string for redis, postgres --- docker-compose.yaml | 12 ++++++++++++ gatewayd_plugins.yaml | 9 +++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 0f5340bf..24528a9d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -19,11 +19,18 @@ services: # Possible values: amd64 or arm64 # - ARCH=amd64 - REDIS_URL=redis://redis:6379/0 + # Allow custom PostgreSQL connection string + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_DB=postgres + - POSTGRE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@write-postgres:5432/${POSTGRES_DB} + write-postgres: image: postgres:latest environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres + - POSTGRES_DB=postgres healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s @@ -34,11 +41,13 @@ services: environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres + - POSTGRES_DB=postgres # Ensure consistency healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 + redis: image: redis:latest healthcheck: @@ -46,6 +55,7 @@ services: interval: 5s timeout: 5s retries: 5 + gatewayd: image: gatewaydio/gatewayd:latest command: @@ -65,6 +75,8 @@ services: # https://docs.gatewayd.io/using-gatewayd/configuration#environment-variables - GATEWAYD_CLIENTS_DEFAULT_WRITES_ADDRESS=write-postgres:5432 - GATEWAYD_CLIENTS_DEFAULT_READS_ADDRESS=read-postgres:5432 + # Use the connection string set in install_plugins + - POSTGRE_URL=${POSTGRE_URL} # - GATEWAYD_LOGGERS_DEFAULT_LEVEL=debug ports: # GatewayD server for PostgreSQL clients to connect to diff --git a/gatewayd_plugins.yaml b/gatewayd_plugins.yaml index dce0b285..d20c7dd9 100644 --- a/gatewayd_plugins.yaml +++ b/gatewayd_plugins.yaml @@ -39,11 +39,8 @@ actionTimeout: 30s # action redis configures a Redis connection for the async actions to be published to. actionRedis: - # enabled controls whether to enable redis as async action queue - enabled: false - - # if enabled, the url and channel are used to connect to the Redis server. - address: localhost:6379 + enabled: false # Change to true to enable Redis as async action queue + address: ${REDIS_URL} # Use environment variable for Redis URL channel: gatewayd-actions # The policy is a list of policies to apply to the signals received from the plugins. @@ -72,7 +69,7 @@ plugins: env: - MAGIC_COOKIE_KEY=GATEWAYD_PLUGIN - MAGIC_COOKIE_VALUE=5712b87aa5d7e9f9e9ab643e6603181c5b796015cb1c09d6f5ada882bf2a1872 - - REDIS_URL=redis://localhost:6379/0 + - REDIS_URL=${REDIS_URL} # Use environment variable for Redis URL - EXPIRY=1h # - DEFAULT_DB_NAME=postgres - METRICS_ENABLED=True From 0c50df01faa8f9fded8853cf6bee1ca497da4081 Mon Sep 17 00:00:00 2001 From: iman Date: Tue, 15 Oct 2024 15:02:23 +0330 Subject: [PATCH 2/8] update(postgre,redis): customizable url string for redis, postgres --- gatewayd_plugins.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/gatewayd_plugins.yaml b/gatewayd_plugins.yaml index d20c7dd9..a4581550 100644 --- a/gatewayd_plugins.yaml +++ b/gatewayd_plugins.yaml @@ -39,7 +39,6 @@ actionTimeout: 30s # action redis configures a Redis connection for the async actions to be published to. actionRedis: - enabled: false # Change to true to enable Redis as async action queue address: ${REDIS_URL} # Use environment variable for Redis URL channel: gatewayd-actions From b5b6a5155c014c01c9b23dd78e9f46e0b5c86dbc Mon Sep 17 00:00:00 2001 From: iman Date: Wed, 16 Oct 2024 15:51:52 +0330 Subject: [PATCH 3/8] fix(docker-compose): ENV variables --- docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 24528a9d..ca0f818b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -23,7 +23,7 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=postgres - - POSTGRE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@write-postgres:5432/${POSTGRES_DB} + - POSTGRES_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@write-postgres:5432/${POSTGRES_DB} write-postgres: image: postgres:latest @@ -76,7 +76,7 @@ services: - GATEWAYD_CLIENTS_DEFAULT_WRITES_ADDRESS=write-postgres:5432 - GATEWAYD_CLIENTS_DEFAULT_READS_ADDRESS=read-postgres:5432 # Use the connection string set in install_plugins - - POSTGRE_URL=${POSTGRE_URL} + - POSTGRES_URL=${POSTGRES_URL} # - GATEWAYD_LOGGERS_DEFAULT_LEVEL=debug ports: # GatewayD server for PostgreSQL clients to connect to From 45e0312883a992464b61a628525ae65ea37e102b Mon Sep 17 00:00:00 2001 From: iman Date: Wed, 16 Oct 2024 16:09:02 +0330 Subject: [PATCH 4/8] chore(sign) --- gatewayd_plugins.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gatewayd_plugins.yaml b/gatewayd_plugins.yaml index a4581550..73a418bd 100644 --- a/gatewayd_plugins.yaml +++ b/gatewayd_plugins.yaml @@ -39,6 +39,10 @@ actionTimeout: 30s # action redis configures a Redis connection for the async actions to be published to. actionRedis: + # enabled controls whether to enable redis as async action queue + enabled: false + + # if enabled, the url and channel are used to connect to the Redis server. address: ${REDIS_URL} # Use environment variable for Redis URL channel: gatewayd-actions From a017ec6a3c3420920da520db9b0a2cd43717b77a Mon Sep 17 00:00:00 2001 From: iman Date: Wed, 16 Oct 2024 15:51:52 +0330 Subject: [PATCH 5/8] fix(docker-compose): ENV variables From b0c3243b624355206d9618615a3d67b96ab1dd52 Mon Sep 17 00:00:00 2001 From: iman Date: Wed, 16 Oct 2024 15:51:52 +0330 Subject: [PATCH 6/8] fix(docker-compose): ENV variables From 8a748e69fd7c463bd95beceee0c01f91716f58e8 Mon Sep 17 00:00:00 2001 From: iman Date: Wed, 16 Oct 2024 15:51:52 +0330 Subject: [PATCH 7/8] fix(docker-compose): ENV variables From 686b5517b90ae53ef433eb24e2be1b4334f0bfda Mon Sep 17 00:00:00 2001 From: iman Date: Wed, 16 Oct 2024 15:51:52 +0330 Subject: [PATCH 8/8] fix(docker-compose): ENV variables