-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add vaultwarden job on new host artemis
- Loading branch information
Showing
9 changed files
with
141 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ profiles, ... }: | ||
{ | ||
imports = with profiles; [ | ||
hetzner-cloud | ||
base | ||
nomad.client | ||
]; | ||
|
||
services.nomad.settings.client.host_volume = { | ||
"vault/data" = { | ||
path = "/var/lib/nomad-volumes/vault/data"; | ||
}; | ||
}; | ||
|
||
systemd.tmpfiles.rules = [ | ||
"d /var/lib/nomad-volumes 0500 0 0" | ||
"d /var/lib/nomad-volumes/vault/data 0700 0 0" # vaultwarden runs as root | ||
]; | ||
|
||
# Change this if you want to lose all data on this machine! | ||
system.stateVersion = "24.05"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
variable "domain_name" { | ||
type = string | ||
default = "vault.datasektionen.se" | ||
} | ||
|
||
job "vault" { | ||
namespace = "vault" | ||
|
||
group "vault" { | ||
network { | ||
port "http" { } | ||
} | ||
|
||
service { | ||
name = "vault" | ||
port = "http" | ||
provider = "nomad" | ||
tags = [ | ||
"traefik.enable=true", | ||
"traefik.http.routers.vault.rule=Host(`${var.domain_name}`)", | ||
"traefik.http.routers.vault.tls.certresolver=default", | ||
] | ||
} | ||
|
||
volume "data" { | ||
type = "host" | ||
source = "vault/data" | ||
} | ||
|
||
task "vault" { | ||
driver = "docker" | ||
|
||
config { | ||
image = "vaultwarden/server:1.32.0-alpine" | ||
ports = ["http"] | ||
} | ||
|
||
template { | ||
data = <<EOF | ||
DOMAIN=https://${var.domain_name} | ||
ROCKET_PORT={{ env "NOMAD_PORT_http" }} | ||
{{ with nomadVar "nomad/jobs/vault" }} | ||
DATABASE_URL=postgres://vaultwarden:{{ .db_password }}@postgres.dsekt.internal:5432/vaultwarden?sslmode=disable&connect_timeout=10 | ||
SMTP_USERNAME={{ .smtp_username }} | ||
SMTP_PASSWORD={{ .smtp_password }} | ||
{{ end }} | ||
SMTP_HOST=email-smtp.eu-north-1.amazonaws.com | ||
SMTP_PORT=587 | ||
[email protected] | ||
SMTP_FROM_NAME="Datasektionen Vault" | ||
INVITATION_ORG_NAME="Datasektionen Vault" | ||
SIGNUPS_ALLOWED=false | ||
SIGNUPS_VERIFY=true | ||
SIGNUPS_DOMAINS_WHITELIST=datasektionen.se | ||
[email protected] | ||
ORG_GROUPS_ENABLED=true | ||
ADMIN_TOKEN=$argon2id$v=19$m=65540,t=3,p=4$Eq5XC4/9uPFrvVadxrAEBD3+cvaUjZaXWuJkxMAGiQQ$BDzKBz53KMb+e8hIaiCca42ZRak8RFW09qVCXjqgfPk | ||
EOF | ||
destination = "local/.env" | ||
env = true | ||
} | ||
|
||
volume_mount { | ||
volume = "data" | ||
destination = "/data" | ||
} | ||
|
||
resources { | ||
memory = 128 // MB | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
"default" | ||
"auth" | ||
"mattermost" | ||
"vault" | ||
]; | ||
}; | ||
|
||
|