matrix: add whatsapp bridge
This commit is contained in:
parent
bdbfca3642
commit
20455180f9
45
matrix.nix
45
matrix.nix
@ -131,7 +131,12 @@ in
|
||||
event_cache_size = "2K";
|
||||
max_upload_size = "1000M";
|
||||
turn_user_lifetime = "1d";
|
||||
|
||||
# bridges configuration
|
||||
app_service_config_files =
|
||||
[ "/var/lib/mautrix-whatsapp/whatsapp-registration.yaml" ];
|
||||
};
|
||||
|
||||
# Secrets
|
||||
services.matrix-synapse.extraConfigFiles =
|
||||
[
|
||||
@ -151,13 +156,19 @@ in
|
||||
### Database
|
||||
services.postgresql.enable = true;
|
||||
|
||||
# Create database on the first run
|
||||
# Create databases on the first run
|
||||
services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" ''
|
||||
CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
|
||||
CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
|
||||
TEMPLATE template0
|
||||
LC_COLLATE = "C"
|
||||
LC_CTYPE = "C";
|
||||
|
||||
CREATE ROLE "mautrix-whatsapp" WITH LOGIN PASSWORD 'whatsapp';
|
||||
CREATE DATABASE "mautrix-whatsapp" WITH OWNER "mautrix-whatsapp"
|
||||
TEMPLATE template0
|
||||
LC_COLLATE = "C"
|
||||
LC_CTYPE = "C";
|
||||
'';
|
||||
|
||||
|
||||
@ -201,4 +212,36 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
### Whatsapp bridge
|
||||
|
||||
# allow synapse to read the shared secrets
|
||||
users.users.matrix-synapse.extraGroups = [ "mautrix-whatsapp" ];
|
||||
|
||||
services.mautrix-whatsapp =
|
||||
{
|
||||
enable = true;
|
||||
serviceDependencies = [ "postgresql.service" ];
|
||||
settings.appservice =
|
||||
{ database.type = "postgres";
|
||||
database.uri = "postgresql:///mautrix-whatsapp?host=/run/postgresql";
|
||||
};
|
||||
settings.bridge =
|
||||
{ encryption =
|
||||
{ allow = true;
|
||||
default = true;
|
||||
require = true;
|
||||
};
|
||||
permissions =
|
||||
{ "maxwell.ydns.eu" = "user";
|
||||
"@rnhmjoj:maxwell.ydns.eu" = "admin";
|
||||
};
|
||||
relay.enabled = false;
|
||||
mute_bridging = true;
|
||||
};
|
||||
settings.whatsapp =
|
||||
{ os_name = "Chrome (Linux)";
|
||||
browser_name = "chrome";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user