2020-11-03 22:35:21 +00:00
|
|
|
local matrix = import "lib/matrix.libsonnet";
|
|
|
|
local irc = import "lib/appservice-irc.libsonnet";
|
|
|
|
local telegram = import "lib/appservice-telegram.libsonnet";
|
|
|
|
|
|
|
|
matrix {
|
|
|
|
local app = self,
|
|
|
|
local cfg = app.cfg,
|
|
|
|
cfg+:: {
|
|
|
|
namespace: "matrix-0x3c",
|
|
|
|
webDomain: "matrix.0x3c.pl",
|
|
|
|
serverName: "0x3c.pl",
|
2020-11-11 17:06:41 +00:00
|
|
|
|
|
|
|
images+: {
|
|
|
|
# We are using patched version for 0x3c now, to not break other configs
|
|
|
|
casProxy: "registry.k0.hswaw.net/informatic/oauth2-cas-proxy:0.1.5",
|
|
|
|
},
|
|
|
|
|
2020-11-08 15:46:56 +00:00
|
|
|
cas: {
|
|
|
|
enable: true,
|
|
|
|
oauth2: {
|
|
|
|
clientID: "YCWg1Qor9YstKn_yAHB_NT3GFAGqbnDFzIwyI_fCUWI",
|
2021-05-12 21:06:20 +00:00
|
|
|
clientSecret: (std.split(importstr "secrets/plain/cas-proxy-0x3c-0auth2-secret", "\n"))[0],
|
2020-11-08 15:46:56 +00:00
|
|
|
scope: "read:accounts",
|
|
|
|
authorizeURL: "https://0x3c.pl/oauth/authorize",
|
|
|
|
tokenURL: "https://0x3c.pl/oauth/token",
|
|
|
|
userinfoURL: "https://0x3c.pl/api/v1/accounts/verify_credentials",
|
|
|
|
},
|
2020-11-03 22:35:21 +00:00
|
|
|
},
|
|
|
|
},
|
2020-11-08 15:16:32 +00:00
|
|
|
|
|
|
|
riotConfig+:: {
|
|
|
|
"brand": "Element - %s" % [cfg.serverName],
|
|
|
|
"branding": {
|
|
|
|
"welcomeBackgroundUrl": "https://media.0x3c.pl/file/0x3c-mastodon/0x3c-pixelsort.png"
|
|
|
|
},
|
|
|
|
},
|
2020-11-08 15:19:01 +00:00
|
|
|
|
2023-09-17 22:32:23 +00:00
|
|
|
postgres3+: {
|
|
|
|
cfg+:: {
|
|
|
|
storageSize: "200Gi"
|
|
|
|
},
|
|
|
|
volumeClaim+: {
|
|
|
|
metadata+: {
|
|
|
|
name: "waw3-postgres-2",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2020-11-08 15:19:01 +00:00
|
|
|
appservices: {
|
|
|
|
"telegram-prod": telegram.AppServiceTelegram("prod") {
|
|
|
|
cfg+: {
|
|
|
|
image: cfg.images.appserviceTelegram,
|
|
|
|
storageClassName: cfg.storageClassName,
|
|
|
|
metadata: app.metadata("appservice-telegram-prod"),
|
|
|
|
|
|
|
|
config+: {
|
|
|
|
homeserver+: {
|
|
|
|
address: "https://%s" % [cfg.webDomain],
|
|
|
|
domain: cfg.serverName,
|
|
|
|
},
|
|
|
|
appservice+: {
|
|
|
|
id: "telegram",
|
|
|
|
bot_avatar: "https://media.0x3c.pl/file/0x3c-mastodon/posejbot2.png",
|
|
|
|
},
|
|
|
|
telegram+: {
|
|
|
|
# not7cd: it may be convinient to use same bot credentials for both appservices
|
|
|
|
api_id: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-id", "\n"))[0],
|
|
|
|
api_hash: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-api-hash", "\n"))[0],
|
|
|
|
bot_token: (std.split(importstr "secrets/plain/appservice-telegram-0x3c-token", "\n"))[0],
|
|
|
|
},
|
|
|
|
bridge+: {
|
|
|
|
permissions+: {
|
|
|
|
"0x3c.pl": "puppeting",
|
|
|
|
"@not7cd:0x3c.pl": "admin", // propabbly
|
|
|
|
"@q3k:0x3c.pl": "admin",
|
|
|
|
},
|
2021-02-12 18:35:26 +00:00
|
|
|
displayname_template: "{displayname}[T]",
|
|
|
|
displayname_preference: [
|
|
|
|
"username",
|
|
|
|
"full name",
|
|
|
|
"phone number",
|
|
|
|
],
|
2020-11-08 15:19:01 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-11-03 22:35:21 +00:00
|
|
|
}
|