Infini-DL360: use common domain config

This commit is contained in:
Infinidoge 2024-05-08 03:40:59 -04:00
parent 17d9520365
commit 84a49c43e2
Signed by: Infinidoge
SSH key fingerprint: SHA256:GT2StvPQMMfFHyiiFJymQxfTG/z6EWLJ6NWItf5K5sA

View file

@ -1,9 +1,11 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let
domain = config.common.subdomain "bitwarden";
in
{ {
persist.directories = [ config.services.vaultwarden.dataDir ]; persist.directories = [ config.services.vaultwarden.dataDir ];
services.nginx.virtualHosts."bitwarden.inx.moe" = config.common.nginx.ssl // { services.nginx.virtualHosts.${domain} = config.common.nginx.ssl // {
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}";
}; };
@ -13,8 +15,8 @@
enable = true; enable = true;
environmentFile = config.secrets."vaultwarden"; environmentFile = config.secrets."vaultwarden";
dataDir = "/srv/vaultwarden"; dataDir = "/srv/vaultwarden";
config = { config = with config.common.email; {
DOMAIN = "https://bitwarden.inx.moe"; DOMAIN = "https://${domain}";
SIGNUPS_ALLOWED = false; SIGNUPS_ALLOWED = false;
ROCKET_ADDRESS = "127.0.0.1"; ROCKET_ADDRESS = "127.0.0.1";
@ -24,11 +26,11 @@
PUSH_ENABLED = true; PUSH_ENABLED = true;
PUSH_RELAY_URI = "https://push.bitwarden.com"; PUSH_RELAY_URI = "https://push.bitwarden.com";
SMTP_HOST = "smtp.purelymail.com"; SMTP_HOST = smtp.address;
SMTP_FROM = "noreply+vaultwarden@inx.moe"; SMTP_PORT = smtp.SSLTLS;
SMTP_PORT = 465;
SMTP_SECURITY = "force_tls"; SMTP_SECURITY = "force_tls";
SMTP_USERNAME = "noreply@inx.moe"; SMTP_USERNAME = outgoing;
SMTP_FROM = withSubaddress "vaultwarden";
}; };
}; };
} }