mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 04:49:01 +02:00
Merge pull request #259980 from Ma27/synapse-db-assertion
nixos/matrix-synapse: drop old DB check assertion, actually require DB to be up
This commit is contained in:
commit
3d3b99ad20
|
@ -12,7 +12,9 @@ let
|
||||||
|
|
||||||
usePostgresql = cfg.settings.database.name == "psycopg2";
|
usePostgresql = cfg.settings.database.name == "psycopg2";
|
||||||
hasLocalPostgresDB = let args = cfg.settings.database.args; in
|
hasLocalPostgresDB = let args = cfg.settings.database.args; in
|
||||||
usePostgresql && (!(args ? host) || (elem args.host [ "localhost" "127.0.0.1" "::1" ]));
|
usePostgresql
|
||||||
|
&& (!(args ? host) || (elem args.host [ "localhost" "127.0.0.1" "::1" ]))
|
||||||
|
&& config.services.postgresql.enable;
|
||||||
hasWorkers = cfg.workers != { };
|
hasWorkers = cfg.workers != { };
|
||||||
|
|
||||||
listenerSupportsResource = resource: listener:
|
listenerSupportsResource = resource: listener:
|
||||||
|
@ -944,23 +946,6 @@ in {
|
||||||
by synapse in `services.matrix-synapse.settings.listeners` or in one of the workers!
|
by synapse in `services.matrix-synapse.settings.listeners` or in one of the workers!
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
|
||||||
assertion = hasLocalPostgresDB -> config.services.postgresql.enable;
|
|
||||||
message = ''
|
|
||||||
Cannot deploy matrix-synapse with a configuration for a local postgresql database
|
|
||||||
and a missing postgresql service. Since 20.03 it's mandatory to manually configure the
|
|
||||||
database (please read the thread in https://github.com/NixOS/nixpkgs/pull/80447 for
|
|
||||||
further reference).
|
|
||||||
|
|
||||||
If you
|
|
||||||
- try to deploy a fresh synapse, you need to configure the database yourself. An example
|
|
||||||
for this can be found in <nixpkgs/nixos/tests/matrix/synapse.nix>
|
|
||||||
- update your existing matrix-synapse instance, you simply need to add `services.postgresql.enable = true`
|
|
||||||
to your configuration.
|
|
||||||
|
|
||||||
For further information about this update, please read the release-notes of 20.03 carefully.
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
assertion = hasWorkers -> cfg.settings.redis.enabled;
|
assertion = hasWorkers -> cfg.settings.redis.enabled;
|
||||||
message = ''
|
message = ''
|
||||||
|
@ -1034,9 +1019,11 @@ in {
|
||||||
partOf = [ "matrix-synapse.target" ];
|
partOf = [ "matrix-synapse.target" ];
|
||||||
wantedBy = [ "matrix-synapse.target" ];
|
wantedBy = [ "matrix-synapse.target" ];
|
||||||
unitConfig.ReloadPropagatedFrom = "matrix-synapse.target";
|
unitConfig.ReloadPropagatedFrom = "matrix-synapse.target";
|
||||||
|
requires = optional hasLocalPostgresDB "postgresql.service";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
after = [ "network-online.target" ] ++ optional hasLocalPostgresDB "postgresql.service";
|
after = [ "network-online.target" ] ++ optional hasLocalPostgresDB "postgresql.service";
|
||||||
|
requires = optional hasLocalPostgresDB "postgresql.service";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
};
|
};
|
||||||
baseServiceConfig = {
|
baseServiceConfig = {
|
||||||
|
|
Loading…
Reference in a new issue