matrix.hackerspace.pl: use external postgres

Change-Id: Ie0bb76a4200f905bfd0c065cde81283271f8397a
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1483
Reviewed-by: informatic <informatic@hackerspace.pl>
diff --git a/app/matrix/lib/synapse.libsonnet b/app/matrix/lib/synapse.libsonnet
index 0d8ef8a..6bf6144 100644
--- a/app/matrix/lib/synapse.libsonnet
+++ b/app/matrix/lib/synapse.libsonnet
@@ -117,7 +117,7 @@
             mountData: false,
 
             resources: {
-                requests: { cpu: "300m", memory: "1Gi" },
+                requests: { cpu: "300m", memory: "2Gi" },
                 limits: { cpu: "1500m", memory: "2Gi" },
             },
         },
@@ -158,7 +158,13 @@
                                 SYNAPSE_MACAROON_SECRET_KEY: cfg.macaroonSecretKey,
                                 SYNAPSE_REGISTRATION_SHARED_SECRET: cfg.registrationSharedSecret,
                                 WORKER_REPLICATION_SECRET: cfg.workerReplicationSecret,
+
                                 POSTGRES_PASSWORD: app.postgres.cfg.password,
+                                POSTGRES_USER: app.postgres.cfg.username,
+                                POSTGRES_DB: app.postgres.cfg.database,
+                                POSTGRES_HOST: app.postgres.cfg.host,
+                                POSTGRES_PORT: app.postgres.cfg.port,
+
                                 REDIS_PASSWORD: app.redis.cfg.password,
                                 POD_NAME: { fieldRef: { fieldPath: "metadata.name" } },
                                 OIDC_CLIENT_SECRET: if cfg.oidc.enable then cfg.oidc.config.client_secret else "",
@@ -322,7 +328,7 @@
             "/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state/",
             "/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/(join|invite|leave|ban|unban|kick)",
             "/_matrix/client/(api/v1|r0|v3|unstable)/join/",
-            "/_matrix/client/(api/v1|r0|v3|unstable)/profile/",
+            "/_matrix/client/(api/v1|r0|v3|unstable)/profile/"
 
             # These need to be handled by stream writers, not supported yet
             # "/_matrix/client/(r0|v3|unstable)/sendToDevice/",