diff options
author | TheArcaneBrony <root@thearcanebrony.net> | 2023-03-26 01:45:21 +0000 |
---|---|---|
committer | TheArcaneBrony <root@thearcanebrony.net> | 2023-03-26 01:45:21 +0000 |
commit | 5ca4257dd8431014df9a566ac9033060918169ed (patch) | |
tree | 67e741a053694e43482193a434cdb760ffaf564c /host | |
parent | get synapse running (diff) | |
download | Rory-Open-Architecture-5ca4257dd8431014df9a566ac9033060918169ed.tar.xz |
Update synapse
Diffstat (limited to 'host')
-rwxr-xr-x | host/Rory-synapse/configuration.nix | 91 | ||||
-rwxr-xr-x | host/Rory-synapse/post-rebuild.sh | 4 |
2 files changed, 63 insertions, 32 deletions
diff --git a/host/Rory-synapse/configuration.nix b/host/Rory-synapse/configuration.nix index a805e5f..46da7b6 100755 --- a/host/Rory-synapse/configuration.nix +++ b/host/Rory-synapse/configuration.nix @@ -121,8 +121,6 @@ }; url_preview_enabled = true; - - database = { name = "psycopg2"; args = { @@ -141,37 +139,63 @@ plugins = with pkgs.matrix-synapse-plugins; [ # Alicia - need to port draupnir... #matrix-synapse-mjolnir-antispam - matrix-synapse-pam +# matrix-synapse-pam ]; - extraConfigFiles = [ - (pkgs.writeTextFile { - name = "matrix-synapse-extra-config.yml"; - text = '' - modules: - - module: "pam_auth_provider.PAMAuthProvider" - config: - create_users: true - skip_user_check: false - ''; - }) - ]; +# extraConfigFiles = [ +# (pkgs.writeTextFile { +# name = "matrix-synapse-extra-config.yml"; +# text = '' +# modules: +# - module: "pam_auth_provider.PAMAuthProvider" +# config: +# create_users: true +# skip_user_check: false +# ''; +# }) +# ]; }; # Alicia - doesnt work yet... until in nixpkgs... - #services.draupnir = { - # enable = true; - # pantalaimon = { - # enable = true; - # username = "draupnir"; - # passwordFile = "/run/secrets/draupnir-password"; - # options = { - # homeserver = "http://localhost:8008"; - # ssl = false; - # }; - # - # }; - # managementRoom = "#draupnir-mgmt:rory.gay"; - #}; + services.draupnir = { + enable = true; + + pantalaimon = { + enable = true; + username = "draupnir"; + passwordFile = "/etc/draupnir-password"; + options = { + homeserver = "http://localhost:8008"; + ssl = false; + }; + + }; + managementRoom = "#draupnir-mgmt:rory.gay"; + homeserverUrl = "http://localhost:8008"; + verboseLogging = false; + settings = { + recordIgnoredInvites = false; + automaticallyRedactForReasons = [ "*" ]; + fasterMembershipChecks = true; + backgroundDelayMS = 100; + pollReports = true; + admin.enableMakeRoomAdminCommand = true; + commands.ban.defaultReasons = [ + "spam" + "harassment" + "transphobia" + "scam" + ]; + protections = { + wordlist = { + words = [ + "tranny" + "faggot" + ]; + minutesBeforeTrusting = 0; + }; + }; + }; + }; systemd.services.matrix-synapse-reg-token = { description = "Random registration token for Synapse."; @@ -179,7 +203,14 @@ wantedBy = ["multi-user.target"]; after = ["network.target"]; - script = ''cat /dev/urandom | tr -dc a-zA-Z0-9 | fold -w 256 | head -n 1 > registration_shared_secret.txt''; + script = '' + + if [ ! -f "registration_shared_secret.txt" ] + then + cat /dev/urandom | tr -dc a-zA-Z0-9 | fold -w 256 | head -n 1 > registration_shared_secret.txt + else + echo Not generating key, key exists; + fi''; serviceConfig = { User = "matrix-synapse"; Group = "matrix-synapse"; diff --git a/host/Rory-synapse/post-rebuild.sh b/host/Rory-synapse/post-rebuild.sh index 7be1383..27028d9 100755 --- a/host/Rory-synapse/post-rebuild.sh +++ b/host/Rory-synapse/post-rebuild.sh @@ -24,8 +24,8 @@ register(){ -PASSWD=`cat /run/keys/matrix-user-pass` -for u in {Alicia,Emma,Rory,root} +PASSWD=`cat /etc/matrix-user-pass` +for u in {draupnir,Alicia,Emma,Rory,root} do register $u $PASSWD done |