-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make PostgreSQL and Redis connection strings configurable #627
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
88e63a9
to
a1838c0
Compare
a1838c0
to
686b551
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, the original ticket, #563, seems to be stale now and the only change that can benefit Docker users is to change the Redis URL.
I can change them myself if you want.
@@ -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 | |||
- POSTGRES_URL=${POSTGRES_URL} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used anywhere in the setup.sh
script or config files and seems unnecessary.
# Allow custom PostgreSQL connection string | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@write-postgres:5432/${POSTGRES_DB} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary. Explained why below.
@@ -72,7 +72,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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing these will make this file unusable if someone tries to use it outside Docker and docker-compose. Hence, you should change the setup.sh
script to update this instead of changing these files directly. Also, the PostgreSQL addresses and ports are already configurable via environment variables, hence you don't need to change that.
@@ -43,7 +43,7 @@ actionRedis: | |||
enabled: false | |||
|
|||
# if enabled, the url and channel are used to connect to the Redis server. | |||
address: localhost:6379 | |||
address: ${REDIS_URL} # Use environment variable for Redis URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to the following, so that it gets replaced by the value of the REDIS_URL
environment variable, defined here:
address: ${REDIS_URL} # Use environment variable for Redis URL | |
address: redis://localhost:6379/0 |
Ticket(s)
Closes #563
Description
Configured the
docker-compose.yaml
,gatewayd_plugins.yaml
to read from the the Environment variables for redis and postresql url stringRelated PRs
N/A
Development Checklist
make gen-docs
command.Legal Checklist