src.nth.io/

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-07-30 18:19:08 -0500
committerLuke Hoersten <[email protected]>2026-07-30 18:19:08 -0500
commit00e966edfe45e594e8491bda3a235b7a7964f759 (patch)
tree82bd2460b45b2b7dfa6689192f2400a849928b6d
parent006ecfb2c80aeeb609c28534828bbcb5cff3333e (diff)
dendrite, relayer: percent-encode db passwords in connection urls
Passwords containing '/' are invalid unencoded in a url authority and break Go's url.Parse (invalid port after host). Latent until a restart forced a config re-read. jinja urlencode leaves '/' unescaped, hence the extra replace.
-rw-r--r--dendrite/server/templates/dendrite.yaml.j22
-rw-r--r--nostr/relayer/templates/relayer.env.j22
2 files changed, 2 insertions, 2 deletions
diff --git a/dendrite/server/templates/dendrite.yaml.j2 b/dendrite/server/templates/dendrite.yaml.j2
index 0fe6aa2..7fc159d 100644
--- a/dendrite/server/templates/dendrite.yaml.j2
+++ b/dendrite/server/templates/dendrite.yaml.j2
@@ -37,7 +37,7 @@ global:
# sections. For monolith deployments using SQLite databases,
# you must configure the "database" block for each component instead.
database:
- connection_string: postgresql://{{dendrite_db_user}}:{{dendrite_db_pass}}@localhost/{{dendrite_db}}?sslmode=disable
+ connection_string: postgresql://{{dendrite_db_user}}:{{dendrite_db_pass | urlencode | replace("/", "%2F")}}@localhost/{{dendrite_db}}?sslmode=disable
max_open_conns: 25
max_idle_conns: 5
conn_max_lifetime: -1
diff --git a/nostr/relayer/templates/relayer.env.j2 b/nostr/relayer/templates/relayer.env.j2
index 9acacca..b51412c 100644
--- a/nostr/relayer/templates/relayer.env.j2
+++ b/nostr/relayer/templates/relayer.env.j2
@@ -1,4 +1,4 @@
-POSTGRESQL_DATABASE=postgres://{{relayer_db_user}}:{{relayer_db_pass}}@localhost:5432/{{relayer_db}}
+POSTGRESQL_DATABASE=postgres://{{relayer_db_user}}:{{relayer_db_pass | urlencode | replace("/", "%2F")}}@localhost:5432/{{relayer_db}}
WHITELIST={{relayer_pubkey}}
HOST=127.0.0.1
PORT={{relayer_port}}