1
0
Fork 0

Fix saml login! :D

This commit is contained in:
Daniel Lovbrotte Olsen 2022-01-22 21:10:17 +01:00 committed by System administrator
parent 8910e4b8a2
commit b116c3a56e
2 changed files with 11 additions and 9 deletions

View File

@ -1,3 +1,4 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
let let
@ -433,7 +434,7 @@ in
partOf = [ "matrix-synapse.target" ]; partOf = [ "matrix-synapse.target" ];
wantedBy = [ "matrix-synapse.target" ]; wantedBy = [ "matrix-synapse.target" ];
preStart = '' preStart = ''
${cfg.package}/bin/homeserver \ ${cfg.package}/bin/synapse_homeserver \
${ lib.concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ matrix-synapse-common-config ] ++ cfg.extraConfigFiles) } ${ lib.concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ matrix-synapse-common-config ] ++ cfg.extraConfigFiles) }
--keys-directory ${cfg.dataDir} \ --keys-directory ${cfg.dataDir} \
--generate-keys --generate-keys
@ -445,7 +446,7 @@ in
Group = "matrix-synapse"; Group = "matrix-synapse";
WorkingDirectory = cfg.dataDir; WorkingDirectory = cfg.dataDir;
ExecStart = '' ExecStart = ''
${cfg.package}/bin/homeserver \ ${cfg.package}/bin/synapse_homeserver \
${ lib.concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ matrix-synapse-common-config ] ++ cfg.extraConfigFiles) } ${ lib.concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ matrix-synapse-common-config ] ++ cfg.extraConfigFiles) }
--keys-directory ${cfg.dataDir} --keys-directory ${cfg.dataDir}
''; '';
@ -471,7 +472,6 @@ in
after = [ "matrix-synapse.service" ]; after = [ "matrix-synapse.service" ];
environment.PYTHONPATH = lib.makeSearchPathOutput "lib" cfg.package.python.sitePackages [ environment.PYTHONPATH = lib.makeSearchPathOutput "lib" cfg.package.python.sitePackages [
pluginsEnv pluginsEnv
# (cfg.package.python.pkgs.toPythonModule cfg.package)
]; ];
serviceConfig = { serviceConfig = {
Type = "notify"; Type = "notify";
@ -479,7 +479,7 @@ in
Group = "matrix-synapse"; Group = "matrix-synapse";
WorkingDirectory = cfg.dataDir; WorkingDirectory = cfg.dataDir;
ExecStart = '' ExecStart = ''
${cfg.package.python.withPackages (ps: [(cfg.package.python.pkgs.toPythonModule cfg.package)])}/bin/python -m synapse.app.generic_worker \ ${cfg.package}/bin/synapse_worker \
${ lib.concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ matrix-synapse-common-config (workerConfig worker) ] ++ cfg.extraConfigFiles) } ${ lib.concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ matrix-synapse-common-config (workerConfig worker) ] ++ cfg.extraConfigFiles) }
--keys-directory ${cfg.dataDir} --keys-directory ${cfg.dataDir}
''; '';
@ -489,4 +489,4 @@ in
) workerList); ) workerList);
}) })
]); ]);
} }

View File

@ -9,7 +9,7 @@ in
services.matrix-synapse-next = { services.matrix-synapse-next = {
enable = true; enable = true;
package = pkgs.unstable.matrix-synapse; # Can be stable after 21.11? package = pkgs.matrix-synapse;
dataDir = "/data/synapse"; dataDir = "/data/synapse";
@ -63,13 +63,17 @@ in
} }
]; ];
enable_registration = true;
enable_metrics = true; enable_metrics = true;
use_presence = true; use_presence = true;
password_config.enabled = lib.mkForce false;
enable_registration = false;
saml2_config = { saml2_config = {
sp_config.metadata.remote = [ sp_config.metadata.remote = [
{ url = "https://idp.pvv.ntnu.no/simplesaml/saml2/idp/metadata.php"; } { url = "https://idp.pvv.ntnu.no/simplesaml/saml2/idp/metadata.php"; }
@ -146,8 +150,6 @@ in
}; };
password_config.enable = lib.mkForce false;
signing_key_path = "${cfg.dataDir}/homeserver.signing.key"; signing_key_path = "${cfg.dataDir}/homeserver.signing.key";
media_store_path = "${cfg.dataDir}/media"; media_store_path = "${cfg.dataDir}/media";