mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-28 02:56:13 +01:00
cab7764e90
Signed-off-by: Magic_RB <magic_rb@redalder.org>
107 lines
2.2 KiB
HCL
107 lines
2.2 KiB
HCL
variable "flake_ref" {
|
|
type = string
|
|
}
|
|
|
|
variable "flake_sha" {
|
|
type = string
|
|
}
|
|
|
|
job "matrix-mautrix-facebook" {
|
|
datacenters = [ "homelab-1" ]
|
|
type = "service"
|
|
|
|
group "mautrix-facebook" {
|
|
count = 1
|
|
|
|
volume "matrix-mautrix-facebook" {
|
|
type = "csi"
|
|
source = "matrix-mautrix-facebook"
|
|
read_only = false
|
|
|
|
attachment_mode = "file-system"
|
|
access_mode = "single-node-writer"
|
|
}
|
|
|
|
volume "matrix-registrations" {
|
|
type = "csi"
|
|
source = "matrix-registrations"
|
|
read_only = false
|
|
|
|
attachment_mode = "file-system"
|
|
access_mode = "multi-node-multi-writer"
|
|
}
|
|
|
|
restart {
|
|
attempts = 5
|
|
delay = "5s"
|
|
}
|
|
|
|
network {
|
|
mode = "bridge"
|
|
}
|
|
|
|
service {
|
|
name = "matrix-mautrix-facebook"
|
|
port = "29319"
|
|
|
|
# check {
|
|
# type = "http"
|
|
# address_mode = "alloc"
|
|
# path = "/public"
|
|
# port = "29319"
|
|
# interval = "2s"
|
|
# timeout = "2s"
|
|
# }
|
|
|
|
connect {
|
|
sidecar_service {}
|
|
}
|
|
}
|
|
|
|
task "mautrix-facebook" {
|
|
driver = "docker"
|
|
|
|
volume_mount {
|
|
volume = "matrix-mautrix-facebook"
|
|
destination = "/var/lib/mautrix-facebook"
|
|
read_only = false
|
|
}
|
|
|
|
volume_mount {
|
|
volume = "matrix-registrations"
|
|
destination = "/var/lib/registrations"
|
|
read_only = false
|
|
}
|
|
|
|
config {
|
|
nix_flake_ref = "${var.flake_ref}#nixngSystems.mautrix-facebook.config.system.build.toplevel"
|
|
nix_flake_sha = var.flake_sha
|
|
entrypoint = [ "init" ]
|
|
}
|
|
|
|
vault {
|
|
policies = ["matrix-mautrix-facebook-policy"]
|
|
}
|
|
|
|
template {
|
|
data = <<EOF
|
|
{{ with secret "kv/data/cluster/matrix/mautrix-facebook/main" }}
|
|
MAUTRIX_FACEBOOK_APPSERVICE_AS_TOKEN={{ .Data.data.as_token }}
|
|
MAUTRIX_FACEBOOK_APPSERVICE_HS_TOKEN={{ .Data.data.hs_token }}
|
|
{{ end }}
|
|
EOF
|
|
# {{ with secret "kv/data/cluster/matrix/mautrix-facebook/postgresql" }}
|
|
# MAUTRIX_FACEBOOK_APPSERVICE_DATABASE_OPTS={{ .Data.data.pgpass }}
|
|
# {{ end }}
|
|
destination = "secrets/environment"
|
|
env = true
|
|
}
|
|
|
|
resources {
|
|
cpu = 256
|
|
memory = 256
|
|
}
|
|
}
|
|
}
|
|
}
|