ma bitwarden: finish migration

This commit is contained in:
makefu 2021-12-17 21:11:21 +01:00
parent f58d9d52ad
commit 26e0cca2e2
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225

View File

@ -2,7 +2,7 @@
let
port = 8812;
in {
services.bitwarden_rs = {
services.vaultwarden = {
enable = true;
dbBackend = "postgresql";
config.signups_allowed = false;
@ -13,17 +13,15 @@ in {
config.websocket_enabled = true;
};
systemd.services.bitwarden_rs.after = [ "postgresql.service" ];
systemd.services.vaultwarden.after = [ "postgresql.service" ];
services.postgresql = {
enable = true;
ensureDatabases = [ "bitwarden" ];
ensureUsers = [ { name = "bitwarden_rs"; ensurePermissions."DATABASE bitwarden" = "ALL PRIVILEGES"; } ];
#initialScript = pkgs.writeText "postgresql-init.sql" ''
# CREATE DATABASE bitwarden;
# CREATE USER bitwardenuser WITH PASSWORD '${dbPassword}';
# GRANT ALL PRIVILEGES ON DATABASE bitwarden TO bitwardenuser;
#'';
ensureUsers = [
{ name = "bitwarden_rs"; ensurePermissions."DATABASE bitwarden" = "ALL PRIVILEGES"; }
{ name = "vaultwarden"; ensurePermissions."DATABASE bitwarden" = "ALL PRIVILEGES"; }
];
};
services.nginx.virtualHosts."bw.euer.krebsco.de" ={