Vaultwarden: Difference between revisions

Klinger (talk | contribs)
Ftvkyo (talk | contribs)
m fix nginx config typo
Tags: Mobile edit Mobile web edit Visual edit
 
(4 intermediate revisions by 3 users not shown)
Line 5: Line 5:
services.vaultwarden = {
services.vaultwarden = {
     enable = true;
     enable = true;
     backupDir = "/var/lib/vaultwarden/backup";
     backupDir = "/var/local/vaultwarden/backup";
     # in order to avoid having  ADMIN_TOKEN in the nix store it can be also set with the help of an environment file
     # in order to avoid having  ADMIN_TOKEN in the nix store it can be also set with the help of an environment file
     # be aware that this file must be created by hand (or via secrets management like sops)
     # be aware that this file must be created by hand (or via secrets management like sops)
     environmentFile = "/var/lib/vaultwarden/vaultwarden.env"
     environmentFile = "/var/lib/vaultwarden/vaultwarden.env";
     config = {
     config = {
         # Refer to https://github.com/dani-garcia/vaultwarden/blob/main/.env.template
         # Refer to https://github.com/dani-garcia/vaultwarden/blob/main/.env.template
Line 24: Line 24:
         SMTP_HOST = "127.0.0.1";
         SMTP_HOST = "127.0.0.1";
         SMTP_PORT = 25;
         SMTP_PORT = 25;
         SMTP_SSL = false;
         SMTP_SECURITY = off;


         SMTP_FROM = "admin@bitwarden.example.com";
         SMTP_FROM = "admin@bitwarden.example.com";
Line 42: Line 42:
'';</syntaxhighlight>
'';</syntaxhighlight>
=== Nginx ===
=== Nginx ===
<syntaxHighlight lang=nix>
<syntaxhighlight lang="nix">
services.nginx.virtualHosts."bitwarden.example.com" = {
services.nginx.virtualHosts."bitwarden.example.com" = {
     enableACME = true;
     enableACME = true;
Line 48: Line 48:
     locations."/" = {
     locations."/" = {
         proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}";
         proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}";
        proxyWebsockets = true;
     };
     };
};
};
'';
</syntaxhighlight>
</syntaxHighlight>