feat: add DSN/URL connection string support for PostgreSQL and Redis (#11729)

This commit is contained in:
Mridang Agarwalla
2026-03-20 15:21:15 +00:00
committed by GitHub
parent dad4565d5d
commit 471ed4a5d7
25 changed files with 810 additions and 302 deletions
+19
View File
@@ -231,6 +231,16 @@ WebAuthNName: ZITADEL # ZITADEL_WEBAUTHNNAME
Database:
# Postgres is the default database of ZITADEL
postgres:
# DSN is a full PostgreSQL connection URL (see
# https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING).
# When set, individual connection fields (Host, Port, Database, User, Admin,
# Options) are ignored.
# Format: postgresql://user:password@host:port/dbname?sslmode=disable
# Note: In DSN mode, zitadel init cannot use the Admin connection to create
# a separate target database/user. The DB and user from the DSN must already
# exist and have sufficient privileges, or the DSN must directly point to
# the final ZITADEL database.
DSN: "" # ZITADEL_DATABASE_POSTGRES_DSN
Host: localhost # ZITADEL_DATABASE_POSTGRES_HOST
Port: 5432 # ZITADEL_DATABASE_POSTGRES_PORT
Database: zitadel # ZITADEL_DATABASE_POSTGRES_DATABASE
@@ -286,6 +296,15 @@ Caches:
TimeOut: 30s
Redis:
Enabled: false
# URL is a full Redis connection URL (see
# https://redis.io/docs/latest/develop/tools/cli/#host-port-password-and-database).
# When set, individual connection fields
# (Addr, Username, Password, Network, EnableTLS) are ignored.
# Pool, timeout, retry, and circuit breaker settings can still be used as overlays.
# Format: redis://user:password@host:port/db or rediss://... for TLS.
# Note: ZITADEL ignores the `/db` path when selecting Redis databases; DBs are chosen
# internally via DBOffset + purpose. Use `/0` in the URL to avoid confusion.
URL: "" # ZITADEL_CACHES_CONNECTORS_REDIS_URL
# The network type, either tcp or unix.
# Default is tcp.
# Network string
+2
View File
@@ -136,6 +136,7 @@ Source:
# Postgres is used as soon as a value is set
# The values describe the possible fields to set values
postgres:
DSN: "" # ZITADEL_SOURCE_POSTGRES_DSN
Host: # ZITADEL_SOURCE_POSTGRES_HOST
Port: # ZITADEL_SOURCE_POSTGRES_PORT
Database: # ZITADEL_SOURCE_POSTGRES_DATABASE
@@ -155,6 +156,7 @@ Source:
Destination:
postgres:
DSN: "" # ZITADEL_DESTINATION_POSTGRES_DSN
Host: localhost # ZITADEL_DESTINATION_POSTGRES_HOST
Port: 5432 # ZITADEL_DESTINATION_POSTGRES_PORT
Database: zitadel # ZITADEL_DESTINATION_POSTGRES_DATABASE