blob: 76de45f4badfda9ffb742a91ccd94e2ab48384a8 [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",
12 },
13
14 synapseConfig+:: {
15 password_config: {
16 enabled: true,
17 },
18 },
Norbert Szulccaabcab2020-11-08 16:16:32 +010019
20 riotConfig+:: {
21 "brand": "Element - %s" % [cfg.serverName],
22 "branding": {
23 "welcomeBackgroundUrl": "https://media.0x3c.pl/file/0x3c-mastodon/0x3c-pixelsort.png"
24 },
25 },
Norbert Szulc9dcf5f82020-11-08 16:19:01 +010026
27 appservices: {
28 "telegram-prod": telegram.AppServiceTelegram("prod") {
29 cfg+: {
30 image: cfg.images.appserviceTelegram,
31 storageClassName: cfg.storageClassName,
32 metadata: app.metadata("appservice-telegram-prod"),
33
34 config+: {
35 homeserver+: {
36 address: "https://%s" % [cfg.webDomain],
37 domain: cfg.serverName,
38 },
39 appservice+: {
40 id: "telegram",
41 bot_avatar: "https://media.0x3c.pl/file/0x3c-mastodon/posejbot2.png",
42 },
43 telegram+: {
44 # not7cd: it may be convinient to use same bot credentials for both appservices
45 api_id: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-id", "\n"))[0],
46 api_hash: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-hash", "\n"))[0],
47 bot_token: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-token", "\n"))[0],
48 },
49 bridge+: {
50 permissions+: {
51 "0x3c.pl": "puppeting",
52 "@not7cd:0x3c.pl": "admin", // propabbly
53 "@q3k:0x3c.pl": "admin",
54 },
55 },
56 },
57 },
58 },
59 },
Serge Bazanski52e79662020-11-03 23:35:21 +010060}