feat: added bitwarden/vaultwarden support.

This commit is contained in:
silver 2023-11-07 13:38:59 +00:00
parent c53e7ffcf2
commit 29dc2750ae
5 changed files with 143 additions and 22 deletions

View file

@ -0,0 +1,93 @@
{
config,
pkgs,
lib,
inputs,
...
}:
with lib; let
cfg = config.services.skynet_vaultwarden;
domain_sub = "pw";
domain = "${domain_sub}.skynet.ie";
in {
imports = [
../acme.nix
../dns.nix
../nginx.nix
];
options.services.skynet_vaultwarden = {
enable = mkEnableOption "Skynet vaultwarden server";
host = {
ip = mkOption {
type = types.str;
};
name = mkOption {
type = types.str;
};
};
};
config = mkIf cfg.enable {
#backups = [ "/etc/silver_ul_ical/database.db" ];
# Website config
skynet_acme.domains = [
domain
];
skynet_dns.records = [
{
record = domain_sub;
r_type = "CNAME";
value = cfg.host.name;
}
];
services.nginx.virtualHosts."${domain}" = {
forceSSL = true;
useACMEHost = "skynet";
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}";
};
};
# has ADMIN_TOKEN and SMTP_PASSWORD
age.secrets.bitwarden_details.file = ../../secrets/bitwarden/details.age;
services.vaultwarden = {
enable = true;
environmentFile = config.age.secrets.bitwarden_details.path;
config = {
DOMAIN = "https://${domain}";
SENDS_ALLOWED = true;
SIGNUPS_ALLOWED = false;
INVITATION_ORG_NAME = "Skyhold";
ORG_GROUPS_ENABLED = true;
USE_SENDMAIL = false;
SMTP_HOST = "mail.skynet.ie";
SMTP_FROM = "vaultwarden@skynet.ie";
SMTP_FROM_NAME = "Skynet Bitwarden server";
SMTP_SECURITY = "starttls";
SMTP_PORT = 587;
SMTP_USERNAME = "vaultwarden@skynet.ie";
SMTP_AUTH_MECHANISM = "Login";
SMTP_EMBED_IMAGES = true;
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222;
ROCKET_LOG = "critical";
};
};
};
}

View file

@ -23,6 +23,8 @@ in {
imports = [
../applications/ldap/server.nix
../applications/discord.nix
../applications/bitwarden/vaultwarden.nix
../applications/bitwarden/bitwarden_sync.nix
];
deployment = {
@ -66,4 +68,13 @@ in {
services.discord_bot = {
enable = true;
};
services.skynet_vaultwarden = {
enable = true;
host = {
ip = ip_pub;
name = name;
};
};
}

View file

@ -0,0 +1,16 @@
age-encryption.org/v1
-> ssh-ed25519 V1pwNA d3Xy8iQxiSb8gV8NRqBAxBm0g5V1INUAeHJDFdAqe3o
Uaw/Q/BjZabCWBoKJmSICiUn8/OWXjj+/sx0BZKxWj8
-> ssh-ed25519 4PzZog qxpYb+zz05nntFRA8k0ZwWSmpvOA8gnf8AaBuy5xyhQ
ssOtug0RBDkPbSEC4Acs/UNelfLmkLLH2pEm0geAuVE
-> ssh-ed25519 5Nd93w iXfwzbDeUuFqwXPztMdaBXnfXY7W8sQXmcxEtMqkPzM
t88pMxJ09RtrNEd1tn8N5iUh2mnaHwzb3dD6xlt8jRw
-> ssh-ed25519 q8eJgg 4NAejBkAf4tZEsq6YsWJiOTq3wBBkDHB3Z1CFG8LeSk
yIicVNLUkaHs9RzaEFFn0SVqR5QiKNJZShehiEfvTh4
-> ssh-ed25519 IzAMqA orpGqetn3ND76DC2QejaGnAlPDlV43l7/GdJB47SFQA
U0Bm9/VgoY6/dwIdqZpOY5rQc5j/TBlKzRS8rndyxu4
-> _-grease yOwV[T R\ b>SI aVM^#_X
VfqPBdd5CK3GXPcBxXzbq9ak7qYJrnrxU7O7pKmfavJJ55dsmXKvEI7NE2tgASsr
Gxc1ttbQ4310R2CN0IM7xvMRLQsg/MnA2WGiwO52OYkHJXZ/i9F8ro4sq8q5cJE
--- T8NUXH3YnnAIycabcEi8uFUfnDuvdgy3COrUoPPA+lQ
QýPÀŒÍE“*NcYÞ³³ Î Y튰nK¶Bžù•°íšêaâšz<C5A1>˜^fJy¢h£™W!u|¶dDq'ê} €6^Ô5½ðÍwSÊží³k1%ÈN¹sº÷wÁ½i+ó|Dƒ´“°pÏ”½qr!1¿É™ì ü<>‡¨ïš£°?µŒžÙÀ¢ïH†îèш$›‰Ýð(fÍ<66>‰gKn{ïa93tlÜì…Gbrˆã<CB86>§bMYÆ(¹—Öî¬`y&,â'«{è=

View file

@ -1,23 +1,23 @@
age-encryption.org/v1
-> ssh-ed25519 V1pwNA P02Xzq2IYlbZMvvBUjy6eM0FN1CfSyCinTJnQrZUUlg
QU9CrDYFL0KwDiH9T0zOzydeJBm4eS+Rp4m2ozA3FA0
-> ssh-ed25519 4PzZog 0dqzbH7AY96+GFtwrkrcxYKuO/c9eBPgdxMKa1qliw0
y0Kx5IG3CCzFcXM5MuS3eLij/l7QFKaHlr3VQty+gsA
-> ssh-ed25519 5Nd93w i9j9spcBf2ww6koxQu+802p8ua70VmQTtuLNC/v8MzY
wgYQc+JdSPd2cen/mQyL4NVn9fHtRsHX0E5lDW06yMs
-> ssh-ed25519 q8eJgg L55YurMQv+czgj6uwgHS3L2vX2A5VYRcUEXsGcj0r38
vLRAuYLEljcVqVXs6k0hrVQNkRIpvvpCUeMP4jWVItQ
-> ssh-ed25519 IzAMqA Q1wP64lIZtvFPa0wAD+jQZtS7NwDr4rkthZEoVtuJjo
EnLKgtFFpzEKpLZMatZFNTt0rINciFUryYd0GMIUSp0
-> ssh-ed25519 uZzB3g EwOnsGci+aqHj7XR+sVCi2pNowFbTLtQimzFNHy7LTo
jtl2RhtNayPr44rrZ1ESgR6p1hDJg1h70flu/0rDCjg
-> ssh-ed25519 Hb0ipQ Jmcvd8zOLb7qf2ZIY1HsBrMA3wETGJFUTicBb/Gf2n4
RTiE+f1N+npbnh1M20x76MJ/uj/5SDTdWKj1uMWPThM
-> ssh-ed25519 IzAMqA cSzsukksm2E0coLmIXmd6DsEs/gHmIeGfcH/unNd1B4
6ThlGLwm5iFG/UXoNMtAup909MVxz5JTpK45HJDeYFk
-> d7'/PSOq-grease BF,
ka0OOXHqf7TrhcdP9NFMQVGlF2x+fnC5PRZba5o
--- s5GXDMgktkfdge6Ndk1J8ooCdXVsryH9XzD2+TF6wC8
`2ÕÊÇÅöå™SÇ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5XjTX582r
zSM85sEgYsJe0arZqPDHwnjssUCkAuiLMZM8atLM
--- PICAIqdJW/DCPw9lvrRLsdMJLUFsE48EQxd03DboxqI
H<EFBFBD>„r á§!{ýì'ž!‡­æy™•o$¤µà0Ô:dáä6àituìRf©ú;ä Í´‰ƒÝˆ¹Ñ?…¥€·ðM«a½ˆâ6lÚ;
°P¦Ë@pX×kiÄrðò&â ò£|2…»S#Ÿœü¶¢Ü×…þÁ¢Á…Ú…ÌÀ6A@~T§*R/

View file

@ -140,4 +140,5 @@ in {
# for bitwarden connector
"bitwarden/api.age".publicKeys = users ++ bitwarden;
"bitwarden/details.age".publicKeys = users ++ bitwarden;
}