homelab/nomad-job/radicale.nomad

80 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

2022-05-05 20:07:51 +00:00
job "radicale" {
2022-09-09 15:19:07 +00:00
datacenters = ["hetzner"]
2022-05-05 20:07:51 +00:00
type = "service"
meta {
forcedeploy = "0"
}
group "radicale"{
network {
mode = "host"
port "http" {
to = 5232
}
}
vault{
2022-07-21 16:42:49 +00:00
policies= ["access-tables"]
2022-05-05 20:07:51 +00:00
}
2022-05-12 09:36:04 +00:00
task "radicale" {
2022-05-05 20:07:51 +00:00
driver = "docker"
service {
name = "radicale"
port = "http"
tags = [
2022-05-23 19:44:34 +00:00
"homer.enable=true",
"homer.name=Radicale",
"homer.service=Application",
"homer.logo=https://radicale.org/assets/logo.svg",
"homer.target=_blank",
"homer.url=https://www.ducamps.win/${NOMAD_JOB_NAME}",
2022-05-05 20:07:51 +00:00
"traefik.enable=true",
2022-05-13 18:16:38 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`www.ducamps.win`)&&PathPrefix(`/radicale`)",
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=www.ducamps.win",
2022-05-05 20:07:51 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver",
"traefik.http.routers.${NOMAD_JOB_NAME}.middlewares=radicaleHeader,radicalestrip",
"traefik.http.middlewares.radicaleHeader.headers.customrequestheaders.X-Script-Name=/radicale",
"traefik.http.middlewares.radicalestrip.stripprefix.prefixes=/radicale",
]
}
config {
image = "tomsquest/docker-radicale"
ports = ["http"]
volumes = [
"local/config:/config/config",
"/mnt/diskstation/CardDav:/data"
]
}
env {
TAKE_FILE_OWNERSHIP=false
}
template {
data = <<EOH
[server]
hosts = 0.0.0.0:5232
[auth]
type = htpasswd
htpasswd_encryption = md5
htpasswd_filename = /data/users.htpasswd
delay = 1
[rights]
type = from_file
file = /data/rights.conf
[storage]
type = multifilesystem
filesystem_folder = /data/collections
EOH
destination = "local/config"
}
2022-05-12 09:36:04 +00:00
resources {
memory = 100
}
2022-05-05 20:07:51 +00:00
}
}
}