blob: d13d620c2875009cbd3c0c441470265bbf367304 [file] [log] [blame]
Serge Bazanski60076c72020-11-03 19:17:25 +01001# Matrix server (synapse).
Piotr Dobrowolskia2226912019-05-14 18:49:29 +02002# This needs a secret provisioned, create with:
Serge Bazanski60076c72020-11-03 19:17:25 +01003# ns=matrix
4# kubectl -n $ns create secret generic synapse --from-literal=postgres_password=$(pwgen 24 1) --from-literal=macaroon_secret_key=$(pwgen 32 1) --from-literal=registration_shared_secret=$(pwgen 32 1)
5# kubectl -n $ns create secret generic oauth2-cas-proxy --from-literal=oauth2_secret=...
Serge Bazanskide627512020-08-24 21:17:55 +00006#
Serge Bazanski21a96162020-11-03 23:34:36 +01007# After starting, re-create the postgres database (because docker/postgres won't let you set ENCODING):
8# postgres=# drop database synapse;
9# DROP DATABASE
10# postgres=# CREATE DATABASE synapse
11# postgres-# ENCODING 'UTF8'
12# postgres-# LC_COLLATE='C'
13# postgres-# LC_CTYPE='C'
14# postgres-# template=template0
15# postgres-# OWNER synapse;
16# CREATE DATABASE
17#
Serge Bazanskide627512020-08-24 21:17:55 +000018# Sequencing appservices is fun. The appservice needs to run first (for
19# instance, via a bootstrap job), and on startup it will spit out a
20# registration file. This registration file then needs to be fed to synapse -
21# this is done via specialy named secrets (appservice-X-registration, for X key
22# in the appservices object).
23#
24# For appservice-irc instances, you can use this oneliner magic to get the
25# registration YAML from logs.
Piotr Dobrowolskiee628572021-01-30 00:14:20 +010026# kubectl -n matrix create secret generic appservice-irc-freenode-registration --from-file=registration.yaml=<(kubectl -n matrix logs job/appservice-irc-freenode-bootstrap | tail -n +4 | sed -r 's/(.*aliases:.*)/ group_id: "+freenode:hackerspace.pl"\n\1/')
Serge Bazanskide627512020-08-24 21:17:55 +000027#
28# For appservice-telegram instances, you can use this oneliner magic:
29# kubectl -n matrix create secret generic appservice-telegram-prod-registration --from-file=registration.yaml=<(kubectl -n matrix logs job/appservice-telegram-prod-bootstrap | grep -A 100 SNIPSNIP | grep -v SNIPSNIP)
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020030
Radek Pietruszewskif5844312023-10-27 22:41:18 +020031local kube = import "../../../kube/hscloud.libsonnet";
Serge Bazanski60076c72020-11-03 19:17:25 +010032local postgres = import "../../../kube/postgres.libsonnet";
Serge Bazanskicdba2912020-08-24 19:11:10 +000033
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020034{
radexc995c212023-11-24 12:01:49 +010035 local top = self,
36 local cfg = top.cfg,
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020037 cfg:: {
Serge Bazanski60076c72020-11-03 19:17:25 +010038 namespace: error "cfg.namespace must be set",
39 # webDomain is the domain name at which element will run
40 webDomain: error "cfg.webDomain must be set",
41 # serverName is the server part of the MXID this homeserver will cover
42 serverName: error "cfg.serverName must be set",
Serge Bazanskide627512020-08-24 21:17:55 +000043 storageClassName: "waw-hdd-redundant-3",
Piotr Dobrowolskifef4c122019-05-16 21:05:02 +020044
Serge Bazanskiace32c02020-11-03 22:04:06 +010045 images: {
Norbert Szulca5e8c332021-07-08 15:10:43 +020046 synapse: "matrixdotorg/synapse:v1.37.1",
Serge Bazanskid67635d2020-12-29 23:25:54 +010047 riot: "vectorim/riot-web:v1.7.16",
Serge Bazanskiace32c02020-11-03 22:04:06 +010048 casProxy: "registry.k0.hswaw.net/q3k/oauth2-cas-proxy:0.1.4",
49 appserviceIRC: "matrixdotorg/matrix-appservice-irc:release-0.17.1",
Serge Bazanskic3ca2952021-04-10 11:15:30 +000050 # :latest tag on 2021/04/10.
51 appserviceTelegram: "dock.mau.dev/tulir/mautrix-telegram@sha256:c6e25cb57e1b67027069e8dc2627338df35d156315c004a6f2b34b6aeaa79f77",
Piotr Dobrowolski63244ca2021-01-30 00:14:02 +010052 wellKnown: "registry.k0.hswaw.net/q3k/wellknown:1611960794-adbf560851a46ad0e58b42f0daad7ef19535687c",
Serge Bazanskiace32c02020-11-03 22:04:06 +010053 },
54
Norbert Szulcc67abc22020-11-08 16:46:56 +010055 # Central Authentication Scheme, a single-sign-on system. Note: this flow is now called 'SSO' in Matrix, we keep this name for legacy reasons.
56 # Refer to https://matrix.org/docs/spec/client_server/r0.6.1#sso-client-login
Serge Bazanskiace32c02020-11-03 22:04:06 +010057 cas: {
58 # whether to enable the CAS proxy (ie. connect to hswaw sso via OAuth)
59 enable: false,
Norbert Szulc014c9cd2020-11-08 16:44:48 +010060 # generate client ID and secret in with your OAuth2 provider, refer to https://www.oauth.com/oauth2-servers/client-registration/client-id-secret/
61 oauth2: {
62 clientID: error "cas.oauth2.clientID must be set",
63 clientSecret: error "cas.oauth2.clientSecret must be set",
64 scope: error "cas.oauth2.scope must be set",
65 authorizeURL: error "cas.oauth2.authorizeURL must be set",
66 tokenURL: error "cas.oauth2.tokenURL must be set",
67 userinfoURL: error "cas.oauth2.userinfoURL must be set",
68 },
Serge Bazanskiace32c02020-11-03 22:04:06 +010069 },
Piotr Dobrowolski63244ca2021-01-30 00:14:02 +010070
71 wellKnown: false,
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020072 },
73
74 metadata(component):: {
Piotr Dobrowolski4b4231d2019-05-15 11:41:21 +020075 namespace: cfg.namespace,
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020076 labels: {
77 "app.kubernetes.io/name": "matrix",
78 "app.kubernetes.io/managed-by": "kubecfg",
79 "app.kubernetes.io/component": component,
80 },
81 },
82
radex99ed6a72023-11-24 11:42:55 +010083 local ns = kube.Namespace(cfg.namespace),
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020084
radex0e128492023-11-24 12:47:27 +010085 postgres3: ns.Contain(postgres) {
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020086 cfg+: {
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020087 appName: "synapse",
radexad91bd22023-11-16 22:55:45 +010088 version: "10.4",
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020089 database: "synapse",
90 username: "synapse",
Serge Bazanskic0c037a2020-08-23 01:24:03 +000091 prefix: "waw3-",
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020092 password: { secretKeyRef: { name: "synapse", key: "postgres_password" } },
Serge Bazanskide627512020-08-24 21:17:55 +000093 storageClassName: cfg.storageClassName,
Serge Bazanskic0c037a2020-08-23 01:24:03 +000094 storageSize: "100Gi",
Piotr Dobrowolskia2226912019-05-14 18:49:29 +020095 },
96 },
97
Serge Bazanskic0c037a2020-08-23 01:24:03 +000098 dataVolume: kube.PersistentVolumeClaim("synapse-data-waw3") {
radexc995c212023-11-24 12:01:49 +010099 metadata+: top.metadata("synapse-data"),
radex36964dc2023-11-24 11:19:46 +0100100 storage:: "50Gi",
101 storageClass:: cfg.storageClassName,
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200102 },
Piotr Dobrowolskiffbb47c2019-05-16 12:18:39 +0200103
Serge Bazanski21a96162020-11-03 23:34:36 +0100104 // homeserver.yaml that will be used to run synapse (in synapseConfigMap).
Serge Bazanskiace32c02020-11-03 22:04:06 +0100105 // This is based off of //app/matrix/lib/synapse/homeserver.yaml with some fields overriden per
106 // deployment.
107 // Note this is a templated yaml - {{}}/{%%} style. This templatization is consumed by the Docker
108 // container startup magic.
Serge Bazanski21a96162020-11-03 23:34:36 +0100109 synapseConfig:: (std.native("parseYaml"))(importstr "synapse/homeserver.yaml")[0] {
Serge Bazanskiace32c02020-11-03 22:04:06 +0100110 server_name: cfg.serverName,
111 public_baseurl: "https://%s" % [cfg.webDomain],
112 signing_key_path: "/data/%s.signing.key" % [cfg.serverName],
Serge Bazanski21a96162020-11-03 23:34:36 +0100113 app_service_config_files: [
114 "/appservices/%s/registration.yaml" % [k]
radexc995c212023-11-24 12:01:49 +0100115 for k in std.objectFields(top.appservices)
Serge Bazanski21a96162020-11-03 23:34:36 +0100116 ],
117 } + (if cfg.cas.enable then {
118 cas_config: {
Serge Bazanskiace32c02020-11-03 22:04:06 +0100119 enabled: true,
120 server_url: "https://%s/_cas" % [cfg.webDomain],
121 service_url: "https://%s" % [cfg.webDomain],
Serge Bazanski21a96162020-11-03 23:34:36 +0100122 },
123 } else {}),
Serge Bazanskiace32c02020-11-03 22:04:06 +0100124
Serge Bazanski21a96162020-11-03 23:34:36 +0100125 synapseConfigMap: kube.ConfigMap("synapse") {
radexc995c212023-11-24 12:01:49 +0100126 metadata+: top.metadata("synapse"),
Piotr Dobrowolskic39fb042019-05-17 09:13:56 +0200127 data: {
radexc995c212023-11-24 12:01:49 +0100128 "homeserver.yaml": std.manifestYamlDoc(top.synapseConfig),
Serge Bazanski60076c72020-11-03 19:17:25 +0100129 "log.config": importstr "synapse/log.config",
Piotr Dobrowolskic39fb042019-05-17 09:13:56 +0200130 },
131 },
132
Serge Bazanskiace32c02020-11-03 22:04:06 +0100133 casDeployment: if cfg.cas.enable then kube.Deployment("oauth2-cas-proxy") {
radexc995c212023-11-24 12:01:49 +0100134 metadata+: top.metadata("oauth2-cas-proxy"),
Piotr Dobrowolskic39fb042019-05-17 09:13:56 +0200135 spec+: {
136 replicas: 1,
137 template+: {
138 spec+: {
139 containers_: {
140 proxy: kube.Container("oauth2-cas-proxy") {
Serge Bazanskiace32c02020-11-03 22:04:06 +0100141 image: cfg.images.casProxy,
Piotr Dobrowolskic39fb042019-05-17 09:13:56 +0200142 ports_: {
143 http: { containerPort: 5000 },
144 },
145 env_: {
Serge Bazanski60076c72020-11-03 19:17:25 +0100146 BASE_URL: "https://%s" % [cfg.webDomain],
147 SERVICE_URL: "https://%s" % [cfg.webDomain],
Norbert Szulc014c9cd2020-11-08 16:44:48 +0100148 OAUTH2_CLIENT: cfg.cas.oauth2.clientID,
149 OAUTH2_SECRET: cfg.cas.oauth2.clientSecret,
150 OAUTH2_SCOPE: cfg.cas.oauth2.scope,
151 OAUTH2_AUTHORIZE: cfg.cas.oauth2.authorizeURL,
152 OAUTH2_TOKEN: cfg.cas.oauth2.tokenURL,
153 OAUTH2_USERINFO: cfg.cas.oauth2.userinfoURL,
Piotr Dobrowolskic39fb042019-05-17 09:13:56 +0200154 },
155 },
156 },
157 },
158 },
159 },
160 },
161
Serge Bazanskiace32c02020-11-03 22:04:06 +0100162 casSvc: if cfg.cas.enable then kube.Service("oauth2-cas-proxy") {
radexc995c212023-11-24 12:01:49 +0100163 metadata+: top.metadata("oauth2-cas-proxy"),
164 target:: top.casDeployment,
Piotr Dobrowolskic39fb042019-05-17 09:13:56 +0200165 },
166
Piotr Dobrowolskifef4c122019-05-16 21:05:02 +0200167 synapseDeployment: kube.Deployment("synapse") {
radexc995c212023-11-24 12:01:49 +0100168 metadata+: top.metadata("synapse"),
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200169 spec+: {
170 replicas: 1,
171 template+: {
172 spec+: {
173 volumes_: {
radex4ffc64d2023-11-24 13:28:57 +0100174 data: top.dataVolume.volume,
175 config: top.synapseConfigMap.volume,
Piotr Dobrowolskifef4c122019-05-16 21:05:02 +0200176 } + {
177 [k]: { secret: { secretName: "appservice-%s-registration" % [k] } }
radexc995c212023-11-24 12:01:49 +0100178 for k in std.objectFields(top.appservices)
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200179 },
180 containers_: {
181 web: kube.Container("synapse") {
Serge Bazanskiace32c02020-11-03 22:04:06 +0100182 image: cfg.images.synapse,
Piotr Dobrowolski8ebfc1d2020-03-03 21:01:18 +0100183 command: ["/bin/sh", "-c", "/start.py migrate_config && exec /start.py"],
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200184 ports_: {
185 http: { containerPort: 8008 },
Serge Bazanski1230ac32020-09-12 22:09:46 +0000186 metrics: { containerPort: 9092 },
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200187 },
188 env_: {
Serge Bazanski21a96162020-11-03 23:34:36 +0100189 SYNAPSE_CONFIG_DIR: "/tmp/config",
190 SYNAPSE_CONFIG_PATH: "/tmp/config/homeserver.yaml",
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200191
Piotr Dobrowolski8ebfc1d2020-03-03 21:01:18 +0100192 # These values are not used in a template, but
193 # are required by /start.py migrate_config
Serge Bazanski60076c72020-11-03 19:17:25 +0100194 SYNAPSE_SERVER_NAME: cfg.serverName,
Piotr Dobrowolski8ebfc1d2020-03-03 21:01:18 +0100195 SYNAPSE_REPORT_STATS: "no",
196
197 SYNAPSE_MACAROON_SECRET_KEY: { secretKeyRef: { name: "synapse", key: "macaroon_secret_key" } },
198 SYNAPSE_REGISTRATION_SHARED_SECRET: { secretKeyRef: { name: "synapse", key: "registration_shared_secret" } },
199 POSTGRES_PASSWORD: { secretKeyRef: { name: "synapse", key: "postgres_password" } },
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200200 },
201 volumeMounts_: {
202 data: { mountPath: "/data" },
Serge Bazanski21a96162020-11-03 23:34:36 +0100203 config: { mountPath: "/conf", },
Piotr Dobrowolskifef4c122019-05-16 21:05:02 +0200204 } + {
205 [k]: { mountPath: "/appservices/%s" % [k] }
radexc995c212023-11-24 12:01:49 +0100206 for k in std.objectFields(top.appservices)
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200207 },
208 },
209 },
Serge Bazanski21a96162020-11-03 23:34:36 +0100210 securityContext: {
211 runAsUser: 991,
212 runAsGroup: 991,
213 fsGroup: 991,
214 },
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200215 },
216 },
217 },
218 },
219
Piotr Dobrowolskifef4c122019-05-16 21:05:02 +0200220 synapseSvc: kube.Service("synapse") {
radexc995c212023-11-24 12:01:49 +0100221 metadata+: top.metadata("synapse"),
222 target:: top.synapseDeployment,
Piotr Dobrowolskiffbb47c2019-05-16 12:18:39 +0200223 },
224
Norbert Szulc1ef56002020-11-08 16:13:58 +0100225 riotConfig:: {
226 "default_hs_url": "https://%s" % [cfg.webDomain],
227 "disable_custom_urls": false,
228 "disable_guests": false,
229 "disable_login_language_selector": false,
230 "disable_3pid_login": true,
231 "brand": "Riot",
232 "integrations_ui_url": "https://scalar.vector.im/",
233 "integrations_rest_url": "https://scalar.vector.im/api",
234 "integrations_jitsi_widget_url": "https://scalar.vector.im/api/widgets/jitsi.html",
235
236 "bug_report_endpoint_url": "https://riot.im/bugreports/submit",
237 "features": {
238 "feature_groups": "labs",
239 "feature_pinning": "labs",
240 "feature_reactions": "labs"
241 },
242 "default_federate": true,
243 "default_theme": "light",
244 "roomDirectory": {
245 "servers": [
246 cfg.serverName,
247 ]
248 },
249 "welcomeUserId": "@riot-bot:matrix.org",
250 "enable_presence_by_hs_url": {
251 "https://matrix.org": false
252 }
253 },
254
255 riotConfigMap: kube.ConfigMap("riot-web-config") {
radexc995c212023-11-24 12:01:49 +0100256 metadata+: top.metadata("riot-web-config"),
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200257 data: {
radexc995c212023-11-24 12:01:49 +0100258 "config.json": std.manifestJsonEx(top.riotConfig, ""),
Serge Bazanski21a96162020-11-03 23:34:36 +0100259 // Standard nginx.conf, made to work when running as unprivileged user.
260 "nginx.conf": |||
261 worker_processes auto;
Radek Pietruszewskif28cd622023-11-03 17:30:10 +0100262
Serge Bazanski21a96162020-11-03 23:34:36 +0100263 error_log /tmp/nginx_error.log warn;
264 pid /tmp/nginx.pid;
Radek Pietruszewskif28cd622023-11-03 17:30:10 +0100265
Serge Bazanski21a96162020-11-03 23:34:36 +0100266 events {
267 worker_connections 1024;
268 }
Radek Pietruszewskif28cd622023-11-03 17:30:10 +0100269
270
Serge Bazanski21a96162020-11-03 23:34:36 +0100271 http {
272 client_body_temp_path /tmp/nginx_client_temp;
273 proxy_temp_path /tmp/nginx_proxy_temp;
274 fastcgi_temp_path /tmp/nginx_fastcgi_temp;
275 uwsgi_temp_path /tmp/nginx_uwsgi_temp;
276 scgi_temp_path /tmp/nginx_scgi_temp;
277
278 include /etc/nginx/mime.types;
279 default_type application/octet-stream;
280 log_format main '$remote_addr - $remote_user [$time_local] "$request" '
281 '$status $body_bytes_sent "$http_referer" '
282 '"$http_user_agent" "$http_x_forwarded_for"';
283 access_log /tmp/nginx_access.log main;
284 sendfile on;
285 keepalive_timeout 65;
Radek Pietruszewskif28cd622023-11-03 17:30:10 +0100286
Serge Bazanski21a96162020-11-03 23:34:36 +0100287 server {
288 listen 8080;
289 server_name localhost;
Radek Pietruszewskif28cd622023-11-03 17:30:10 +0100290
Serge Bazanski21a96162020-11-03 23:34:36 +0100291 location / {
292 root /usr/share/nginx/html;
293 index index.html index.htm;
294 }
Radek Pietruszewskif28cd622023-11-03 17:30:10 +0100295
Serge Bazanski21a96162020-11-03 23:34:36 +0100296 error_page 500 502 503 504 /50x.html;
297 location = /50x.html {
298 root /usr/share/nginx/html;
299 }
300 }
301 }
302 |||,
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200303 },
304 },
305
306 riotDeployment: kube.Deployment("riot-web") {
radexc995c212023-11-24 12:01:49 +0100307 metadata+: top.metadata("riot-web"),
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200308 spec+: {
309 replicas: 1,
310 template+: {
311 spec+: {
312 volumes_: {
radex4ffc64d2023-11-24 13:28:57 +0100313 config: top.riotConfigMap.volume,
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200314 },
315 containers_: {
Piotr Dobrowolskifef4c122019-05-16 21:05:02 +0200316 web: kube.Container("riot-web") {
Serge Bazanskiace32c02020-11-03 22:04:06 +0100317 image: cfg.images.riot,
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200318 ports_: {
Serge Bazanski21a96162020-11-03 23:34:36 +0100319 http: { containerPort: 8080 },
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200320 },
Serge Bazanski21a96162020-11-03 23:34:36 +0100321 volumeMounts: [
322 {
323 name: "config",
Piotr Dobrowolskiaca7e282020-03-21 22:14:38 +0100324 mountPath: "/app/config.json",
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200325 subPath: "config.json",
326 },
Serge Bazanski21a96162020-11-03 23:34:36 +0100327 {
328 name: "config",
329 mountPath: "/etc/nginx/nginx.conf",
330 subPath: "nginx.conf",
331 },
332 ],
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200333 },
334 },
Serge Bazanski21a96162020-11-03 23:34:36 +0100335 securityContext: {
336 // nginx:nginx
337 runAsUser: 101,
338 runAsGroup: 101,
339 },
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200340 },
341 },
342 },
343 },
344
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200345 riotSvc: kube.Service("riot-web") {
radexc995c212023-11-24 12:01:49 +0100346 metadata+: top.metadata("riot-web"),
347 target:: top.riotDeployment,
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200348 },
349
Piotr Dobrowolski63244ca2021-01-30 00:14:02 +0100350 wellKnown: if cfg.wellKnown then {
351 deployment: kube.Deployment("wellknown") {
radexc995c212023-11-24 12:01:49 +0100352 metadata+: top.metadata("wellknown"),
Piotr Dobrowolski63244ca2021-01-30 00:14:02 +0100353 spec+: {
354 replicas: 1,
355 template+: {
356 spec+: {
357 containers_: {
358 web: kube.Container("wellknown") {
359 image: cfg.images.wellKnown,
360 ports_: {
361 http: { containerPort: 8080 },
362 },
363 command: ["/app/matrix/wellknown"],
364 args: ["-hspki_disable", "-domain", cfg.webDomain],
365 },
366 },
367 securityContext: {
368 runAsUser: 101,
369 runAsGroup: 101,
370 },
371 },
372 },
373 },
374 },
375 svc: kube.Service("wellknown") {
radexc995c212023-11-24 12:01:49 +0100376 metadata+: top.metadata("wellknown"),
377 target:: top.wellKnown.deployment,
Piotr Dobrowolski63244ca2021-01-30 00:14:02 +0100378 },
379 } else {},
380
Serge Bazanskide627512020-08-24 21:17:55 +0000381 // Any appservice you add here will require an appservice-X-registration
382 // secret containing a registration.yaml file. Adding something to this
383 // dictionary will cause Synapse to not start until that secret is
384 // available - so change things carefully!
385 // If bootstrapping a new appservice, just keep it out of this dictionary
386 // until it spits you a registration YAML and you feed that to a secret.
Serge Bazanski60076c72020-11-03 19:17:25 +0100387 appservices: {},
Piotr Dobrowolskifef4c122019-05-16 21:05:02 +0200388
Radek Pietruszewskif5844312023-10-27 22:41:18 +0200389 ingress: kube.SimpleIngress("matrix") {
390 hosts:: [cfg.webDomain],
radexd45584a2023-11-24 12:51:57 +0100391 target:: top.riotSvc,
radexc995c212023-11-24 12:01:49 +0100392 metadata+: top.metadata("matrix"),
radexd45584a2023-11-24 12:51:57 +0100393 extraPaths:: [
radexc995c212023-11-24 12:01:49 +0100394 { path: "/_matrix", backend: top.synapseSvc.name_port },
Radek Pietruszewskif5844312023-10-27 22:41:18 +0200395 ] + (if cfg.cas.enable then [
radexc995c212023-11-24 12:01:49 +0100396 { path: "/_cas", backend: top.casSvc.name_port },
Radek Pietruszewskif5844312023-10-27 22:41:18 +0200397 ] else []) + (if cfg.wellKnown then [
radexc995c212023-11-24 12:01:49 +0100398 { path: "/.well-known/matrix", backend: top.wellKnown.svc.name_port },
Radek Pietruszewskif5844312023-10-27 22:41:18 +0200399 ] else [])
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200400 },
Piotr Dobrowolskia2226912019-05-14 18:49:29 +0200401}