From 13c222f783e6087105ef22dfd3ce00656d8aeaca Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Fri, 11 Apr 2025 22:26:27 +0100 Subject: [PATCH] Initial config. --- services/{instasync.hcl => igsync.hcl} | 0 services/petruwiki.hcl | 74 ++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) rename services/{instasync.hcl => igsync.hcl} (100%) create mode 100644 services/petruwiki.hcl diff --git a/services/instasync.hcl b/services/igsync.hcl similarity index 100% rename from services/instasync.hcl rename to services/igsync.hcl diff --git a/services/petruwiki.hcl b/services/petruwiki.hcl new file mode 100644 index 0000000..d2f2088 --- /dev/null +++ b/services/petruwiki.hcl @@ -0,0 +1,74 @@ +job "petruwiki" { + datacenters = ["alo"] + + group "server" { + volume "appdata" { + type = "host" + read_only = false + source = "appdata" + } + volume "nix-store" { + type = "host" + read_only = true + source = "nix-store" + } + volume "sw" { + type = "host" + read_only = true + source = "sw" + } + + network { + port "http" { } + } + + task "wiki" { + driver = "exec" + + config { + command = "/sw/bin/node" + args = [ + "/appdata/petruwiki/node_modules/tiddlywiki/tiddlywiki.js", + "/appdata/petruwiki/petruwiki", + "--listen", + "host=0.0.0.0", + "port=${NOMAD_PORT_http}", + "authenticated-user-header=X-authentik-username", + "readers=ppetru", + "writers=ppetru", + "admin=ppetru", + ] + } + + user = "ppetru" + + volume_mount { + volume = "appdata" + destination = "/appdata" + } + volume_mount { + volume = "nix-store" + destination = "/nix/store" + } + volume_mount { + volume = "sw" + destination = "/sw" + } + + service { + name = "petruwiki" + port = "http" + tags = [ + "traefik.enable=true", + "traefik.http.routers.petruwiki.entryPoints=websecure", + "traefik.http.routers.petruwiki.middlewares=authentik@file", + ] + } + + resources { + cpu = 1000 + memory = 512 + } + } + } +}