blob: 238170fb8dd0865ded3a1ab356d4170371829cc6 [file] [log] [blame]
Serge Bazanski52e79662020-11-03 23:35:21 +01001local matrix = import "lib/matrix.libsonnet";
2local irc = import "lib/appservice-irc.libsonnet";
3local telegram = import "lib/appservice-telegram.libsonnet";
4
5matrix {
6 local app = self,
7 local cfg = app.cfg,
8 cfg+:: {
9 namespace: "matrix-0x3c",
10 webDomain: "matrix.0x3c.pl",
11 serverName: "0x3c.pl",
Norbert Szulc25080092020-11-11 18:06:41 +010012
13 images+: {
14 # We are using patched version for 0x3c now, to not break other configs
15 casProxy: "registry.k0.hswaw.net/informatic/oauth2-cas-proxy:0.1.5",
16 },
17
Norbert Szulcc67abc22020-11-08 16:46:56 +010018 cas: {
19 enable: true,
20 oauth2: {
21 clientID: "YCWg1Qor9YstKn_yAHB_NT3GFAGqbnDFzIwyI_fCUWI",
Serge Bazanskiab1f7dc2021-05-12 21:06:20 +000022 clientSecret: (std.split(importstr "secrets/plain/cas-proxy-0x3c-0auth2-secret", "\n"))[0],
Norbert Szulcc67abc22020-11-08 16:46:56 +010023 scope: "read:accounts",
24 authorizeURL: "https://0x3c.pl/oauth/authorize",
25 tokenURL: "https://0x3c.pl/oauth/token",
26 userinfoURL: "https://0x3c.pl/api/v1/accounts/verify_credentials",
27 },
Serge Bazanski52e79662020-11-03 23:35:21 +010028 },
29 },
Norbert Szulccaabcab2020-11-08 16:16:32 +010030
31 riotConfig+:: {
32 "brand": "Element - %s" % [cfg.serverName],
33 "branding": {
34 "welcomeBackgroundUrl": "https://media.0x3c.pl/file/0x3c-mastodon/0x3c-pixelsort.png"
35 },
36 },
Norbert Szulc9dcf5f82020-11-08 16:19:01 +010037
Piotr Dobrowolskib17060a2023-09-18 00:32:23 +020038 postgres3+: {
39 cfg+:: {
40 storageSize: "200Gi"
41 },
42 volumeClaim+: {
43 metadata+: {
44 name: "waw3-postgres-2",
45 },
46 },
47 },
48
Norbert Szulc9dcf5f82020-11-08 16:19:01 +010049 appservices: {
50 "telegram-prod": telegram.AppServiceTelegram("prod") {
51 cfg+: {
52 image: cfg.images.appserviceTelegram,
53 storageClassName: cfg.storageClassName,
54 metadata: app.metadata("appservice-telegram-prod"),
55
56 config+: {
57 homeserver+: {
58 address: "https://%s" % [cfg.webDomain],
59 domain: cfg.serverName,
60 },
61 appservice+: {
62 id: "telegram",
63 bot_avatar: "https://media.0x3c.pl/file/0x3c-mastodon/posejbot2.png",
64 },
65 telegram+: {
66 # not7cd: it may be convinient to use same bot credentials for both appservices
67 api_id: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-id", "\n"))[0],
68 api_hash: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-hash", "\n"))[0],
69 bot_token: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-token", "\n"))[0],
70 },
71 bridge+: {
72 permissions+: {
73 "0x3c.pl": "puppeting",
74 "@not7cd:0x3c.pl": "admin", // propabbly
75 "@q3k:0x3c.pl": "admin",
76 },
Norbert Szulc5d784c52021-02-12 19:35:26 +010077 displayname_template: "{displayname}[T]",
78 displayname_preference: [
79 "username",
80 "full name",
81 "phone number",
82 ],
Norbert Szulc9dcf5f82020-11-08 16:19:01 +010083 },
84 },
85 },
86 },
87 },
Serge Bazanski52e79662020-11-03 23:35:21 +010088}