summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2024-03-21 08:50:51 -0500
committerGitHub <noreply@github.com>2024-03-21 13:50:51 +0000
commit21daa56ee15b6b68c05f827b221f9b00004d040b (patch)
tree45f4a3cb2ca0103f82a1c67e0b9cb3a095f60656
parentUpdate power level default for public rooms (#16907) (diff)
downloadsynapse-21daa56ee15b6b68c05f827b221f9b00004d040b.tar.xz
Prevent `start_for_complement.sh` from setting `START_POSTGRES` to `false` when it's already set (#16985)
I have a use case where I'd like the Synapse image to start up a
postgres instance that I can use, but don't want to force Synapse to use
postgres as well.

This commit prevents postgres from being started when it has already
been explicitly enabled elsewhere.
-rw-r--r--changelog.d/16985.misc1
-rw-r--r--docker/complement/conf/postgres.supervisord.conf2
-rwxr-xr-xdocker/complement/conf/start_for_complement.sh5
3 files changed, 5 insertions, 3 deletions
diff --git a/changelog.d/16985.misc b/changelog.d/16985.misc
new file mode 100644
index 0000000000..34d1337a28
--- /dev/null
+++ b/changelog.d/16985.misc
@@ -0,0 +1 @@
+Allow containers building on top of Synapse's Complement container is use the included PostgreSQL cluster.
diff --git a/docker/complement/conf/postgres.supervisord.conf b/docker/complement/conf/postgres.supervisord.conf
index b88bfc772e..657845dfdb 100644
--- a/docker/complement/conf/postgres.supervisord.conf
+++ b/docker/complement/conf/postgres.supervisord.conf
@@ -1,7 +1,7 @@
 [program:postgres]
 command=/usr/local/bin/prefix-log gosu postgres postgres
 
-# Only start if START_POSTGRES=1
+# Only start if START_POSTGRES=true
 autostart=%(ENV_START_POSTGRES)s
 
 # Lower priority number = starts first
diff --git a/docker/complement/conf/start_for_complement.sh b/docker/complement/conf/start_for_complement.sh
index 7b012ce8ab..cc798a3210 100755
--- a/docker/complement/conf/start_for_complement.sh
+++ b/docker/complement/conf/start_for_complement.sh
@@ -32,8 +32,9 @@ case "$SYNAPSE_COMPLEMENT_DATABASE" in
     ;;
 
   sqlite|"")
-    # Configure supervisord not to start Postgres, as we don't need it
-    export START_POSTGRES=false
+    # Set START_POSTGRES to false unless it has already been set
+    # (i.e. by another container image inheriting our own).
+    export START_POSTGRES=${START_POSTGRES:-false}
     ;;
 
   *)