Added D53 and Diplonat

This commit is contained in:
Zuma 2026-01-09 16:45:28 +01:00
parent b99659f23e
commit 9ad682ae87
6 changed files with 119 additions and 2 deletions

45
apps/core/d53.hcl Normal file
View file

@ -0,0 +1,45 @@
job "d53" {
datacenters = ["mayel-house", "gribse-house", "zuma-house"]
type = "service"
priority = 90
group "D53" {
count = 1
task "d53" {
driver = "docker"
config {
image = "git.shenanigans.cc/zuma/d53:41e79af-dirty"
network_mode = "host"
readonly_rootfs = true
}
resources {
cpu = 100
memory = 100
}
restart {
interval = "3m"
attempts = 10
delay = "15s"
mode = "delay"
}
template {
data = <<EOH
D53_CONSUL_HOST=http://localhost:8500
D53_PROVIDERS=chokbar.bzh:porkbun
D53_PORKBUN_API_KEY={{ key "secrets/d53/porkbun_api_key" }}
D53_PORKBUN_SECRET_API_KEY={{ key "secrets/d53/porkbun_secret_api_key" }}
D53_ALLOWED_DOMAINS=chokbar.bzh
RUST_LOG=d53=debug
EOH
destination = "secrets/env"
env = true
}
}
}
}

52
apps/core/diplonat.hcl Normal file
View file

@ -0,0 +1,52 @@
job "diplonat" {
datacenters = ["zuma-house", "mayel-house", "gribse-house"]
type = "system"
priority = 90
update {
max_parallel = 2
stagger = "1m"
}
group "diplonat" {
task "diplonat" {
driver = "docker"
config {
image = "git.shenanigans.cc/zuma/diplonat:filouterie"
network_mode = "host"
readonly_rootfs = true
privileged = true
}
restart {
interval = "5m"
attempts = 10
delay = "15s"
mode = "delay"
}
template {
data = <<EOH
DIPLONAT_REFRESH_TIME=60
DIPLONAT_EXPIRATION_TIME=300
DIPLONAT_DISABLE_IGD=true
DIPLONAT_STUN_SERVER=stun.l.google.com:19302
DIPLONAT_CONSUL_NODE_NAME={{ env "attr.unique.hostname" }}
DIPLONAT_CONSUL_URL=http://consul.service.filouterie.consul:8500
DIPLONAT_CONSUL_TLS_SKIP_VERIFY=true
RUST_LOG=debug
RUST_BACKTRACE=1
EOH
destination = "secrets/env"
env = true
}
resources {
memory = 100
memory_max = 200
}
}
}
}

98
apps/core/tricot.hcl Normal file
View file

@ -0,0 +1,98 @@
job "tricot" {
datacenters = ["zuma-house", "gribse-house", "mayel-house"]
type = "system"
priority = 90
update {
max_parallel = 1
stagger = "5m"
}
group "tricot" {
network {
port "http_port" { static = 80 }
port "https_port" { static = 443 }
port "metrics_port" { static = 9334 }
}
task "server" {
driver = "docker"
config {
image = "git.shenanigans.cc/zuma/tricot:filouterie"
network_mode = "host"
readonly_rootfs = true
ports = [ "http_port", "https_port" ]
volumes = [
"secrets:/etc/tricot",
]
ulimit {
nofile = "65535:65535"
}
# exporting jemalloc profiles requires a
# writeable tmpfs
mount {
type = "tmpfs"
target = "/tmp"
readonly = false
}
}
resources {
cpu = 1000
memory = 400
}
restart {
interval = "5m"
attempts = 10
delay = "15s"
mode = "delay"
}
template {
data = <<EOH
TRICOT_NODE_NAME={{ env "attr.unique.hostname" }}
TRICOT_LETSENCRYPT_EMAIL=zuma@deuxfleurs.fr
TRICOT_ENABLE_COMPRESSION=true
TRICOT_CONSUL_TLS_SKIP_VERIFY=true
TRICOT_HTTP_BIND_ADDR=[::]:80
TRICOT_HTTPS_BIND_ADDR=[::]:443
TRICOT_METRICS_BIND_ADDR=[::]:9334
TRICOT_MAX_LOG_PER_SEC=10
TRICOT_WARMUP_CERT_MEMORY_STORE=true
RUST_LOG=tricot=debug
EOH
destination = "secrets/env"
env = true
}
service {
name = "tricot-http"
port = "http_port"
tags = [
"${meta.site}",
"d53-a global.site.chokbar.bzh",
"d53-a ${meta.site}.site.chokbar.bzh",
]
address_mode = "host"
}
service {
name = "tricot-https"
port = "https_port"
tags = [
"${meta.site}",
]
address_mode = "host"
}
service {
name = "tricot-metrics"
port = "metrics_port"
address_mode = "host"
}
}
}
}