migrate matrix db to own host
This commit is contained in:
parent
2ba74c195d
commit
57515cab45
5 changed files with 34 additions and 26 deletions
|
|
@ -6,11 +6,8 @@
|
||||||
../../services/openssh.nix
|
../../services/openssh.nix
|
||||||
../../services/nginx.nix
|
../../services/nginx.nix
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
../../services/postgres.nix
|
./synapse.nix
|
||||||
../../services/synapse.nix
|
./draupnir.nix
|
||||||
../../services/draupnir.nix
|
|
||||||
../../services/prometheus.nix
|
|
||||||
../../services/grafana.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
|
|
@ -19,11 +16,15 @@
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
80 # HTTP/1
|
80 # HTTP/1
|
||||||
443 # HTTP/2
|
443 # HTTP/2
|
||||||
8448 # Matrix federation
|
#8448 # Matrix federation
|
||||||
];
|
];
|
||||||
allowedUDPPorts = [
|
allowedUDPPorts = [
|
||||||
443 # HTTP/3
|
443 # HTTP/3
|
||||||
];
|
];
|
||||||
|
extraInputRules = ''
|
||||||
|
ip saddr 195.160.173.14/32 tcp dport 9009 accept comment "Allow monitoring to scrape"
|
||||||
|
ip6 saddr 2001:678:760:cccb::14/128 tcp dport 9009 accept comment "Allow monitoring to scrape"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
services.draupnir = {
|
services.draupnir = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
homeserverUrl = "https://matrix.berlin.ccc.de";
|
homeserverUrl = "https://matrix.${config.networking.domain}";
|
||||||
managementRoom = "!ZYWNuaQBkkenNklCSm:matrix.org"; # #cccb-moderators:berlin.ccc.de
|
managementRoom = "!ZYWNuaQBkkenNklCSm:matrix.org"; # #cccb-moderators:berlin.ccc.de
|
||||||
autojoinOnlyIfManager = true;
|
autojoinOnlyIfManager = true;
|
||||||
recordIgnoredInvites = true;
|
recordIgnoredInvites = true;
|
||||||
|
|
@ -14,3 +14,4 @@
|
||||||
secrets.accessToken = config.age.secrets.draupnir_access_token.path;
|
secrets.accessToken = config.age.secrets.draupnir_access_token.path;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations = {
|
locations = {
|
||||||
#"/.well-known/acme-challenge".root = config.security.acme.defaults.webroot;
|
|
||||||
"/".return = "418 \"🫖\"";
|
"/".return = "418 \"🫖\"";
|
||||||
"~ ^(/_matrix|/_synapse/client)" = {
|
"~ ^(/_matrix|/_synapse/client)" = {
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,20 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
domain = "berlin.ccc.de";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
services = {
|
services = {
|
||||||
matrix-synapse = {
|
matrix-synapse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
server_name = domain;
|
server_name = config.networking.domain;
|
||||||
public_baseurl = "https://matrix.${domain}:443/";
|
public_baseurl = "https://matrix.${config.networking.domain}:443/";
|
||||||
# "/var/lib/matrix-synapse/homeserver.signing.key"
|
# "/var/lib/matrix-synapse/homeserver.signing.key"
|
||||||
signing_key_path = config.age.secrets.matrix_signing_key.path;
|
signing_key_path = config.age.secrets.matrix_signing_key.path;
|
||||||
registration_shared_secret_path = config.age.secrets.matrix_registration_shared_secret.path;
|
registration_shared_secret_path = config.age.secrets.matrix_registration_shared_secret.path;
|
||||||
database = {
|
database = {
|
||||||
name = "psycopg2";
|
name = "psycopg2";
|
||||||
args = {
|
args = {
|
||||||
|
host = "sql.berlin.ccc.de";
|
||||||
|
port = 5432;
|
||||||
user = "matrix-synapse";
|
user = "matrix-synapse";
|
||||||
database = "matrix-synapse";
|
database = "matrix-synapse";
|
||||||
};
|
};
|
||||||
|
|
@ -42,7 +41,7 @@ in
|
||||||
type = "metrics";
|
type = "metrics";
|
||||||
tls = false;
|
tls = false;
|
||||||
port = 9009;
|
port = 9009;
|
||||||
bind_addresses = [ "::1" ];
|
bind_addresses = [ "::" "0.0.0.0" ];
|
||||||
resources = [
|
resources = [
|
||||||
{
|
{
|
||||||
compress = false;
|
compress = false;
|
||||||
|
|
@ -66,19 +65,10 @@ in
|
||||||
allowed_lifetime_max = "1y";
|
allowed_lifetime_max = "1y";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
extraConfigFiles = [
|
||||||
|
config.age.secrets.matrix_db_password.path;
|
||||||
|
];
|
||||||
enableRegistrationScript = true;
|
enableRegistrationScript = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
postgresql = {
|
|
||||||
ensureUsers = [
|
|
||||||
{
|
|
||||||
name = config.services.matrix-synapse.settings.database.args.user;
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
ensureDatabases = [
|
|
||||||
config.services.matrix-synapse.settings.database.args.database
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
17
secrets/matrix_db_password.age
Normal file
17
secrets/matrix_db_password.age
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 uH+n1w 3XkQvPdRZ3vv+xKVCWUvrBXW7j+ys7qnQ0YYq+q21lU
|
||||||
|
i2z2q5Xvwp3ct0j37JWddeYpOxN9RP846cmor9GLus8
|
||||||
|
-> ssh-ed25519 EvLbWw hCQX1qI+cEhkFBJp7X/LYkJc8NviNCCaOHWV10dBQng
|
||||||
|
Gby2sbypfBeBy4M8EemknYRDuxzom+/IE/GMQTcIzP8
|
||||||
|
-> ssh-ed25519 dM+fLQ r9QqteSqxdYC6v0awi6c0oDC+2LBhY8gN5t/6L1M5F0
|
||||||
|
iBzdPMfgFfY8oIBaE53GzOK7UpHnZLkolAoOSSE2+VU
|
||||||
|
-> ssh-ed25519 jxWM2Q zktiZmBytdfpQkEKkUAGNvJNWYCe8c4IbsZ1lcdEHTs
|
||||||
|
h58rbCUi3Mog/eY5goWQLBHtRVdr8uR9JzySCT93a5I
|
||||||
|
-> ssh-ed25519 /yCUCg mz90furAJYrwV5BzbPk3h/NuEt1epLx3jt/QVzPWtFg
|
||||||
|
dDp5sYa+d0CHvtToGl0p49zF7OZ+1WaNZ5o/hDyzL/M
|
||||||
|
-> ssh-ed25519 FGp51g m/DB09M3rkfrjy+fw0LCiT7ltb5t5owVUNaxXQaSLms
|
||||||
|
zxIlnt5enT31tpnVkRt46ilwbyAcmjQkVoEt2ckIyMQ
|
||||||
|
-> ssh-ed25519 yoCmaA TnkX8JzHM/RKx7kF9rs/RbxjuDmwbMxfU6O+RkSSXjg
|
||||||
|
ba+elF9+Q2iBqbc+c0cpm4RDjfyykFiXm/qdDC0DOXg
|
||||||
|
--- SyxBhMLhDLQhmbm47HlFxLtImHMQWfXP2E/90ceHnr0
|
||||||
|
q¢PãÝ<EFBFBD>°Pç$ñ…så
ôˆ+TwðG0 ôx†\\2Jõòô,<2C>16ÇæX*ÆfÄ& ù`bÐ?ƒÏ
]µw„‚ÛпÇïÈ7z2µ@‚–@örÆ9xæYå^èž(ùÔVxv<>*Yþ¹¤\Gš¦j&CÃL#
|
||||||
Loading…
Add table
Add a link
Reference in a new issue