Compare commits
2 Commits
7470a0e077
...
77ef777a3f
| Author | SHA1 | Date | |
|---|---|---|---|
| 77ef777a3f | |||
| 611862d5e9 |
@@ -30,10 +30,18 @@ in
|
|||||||
path = "/data/compute/code";
|
path = "/data/compute/code";
|
||||||
read_only = true;
|
read_only = true;
|
||||||
};
|
};
|
||||||
|
appdata = {
|
||||||
|
path = "/data/compute/appdata";
|
||||||
|
read_only = false;
|
||||||
|
};
|
||||||
nix-store = {
|
nix-store = {
|
||||||
path = "/nix/store";
|
path = "/nix/store";
|
||||||
read_only = true;
|
read_only = true;
|
||||||
};
|
};
|
||||||
|
sw = {
|
||||||
|
path = "/run/current-system/sw";
|
||||||
|
read_only = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -84,6 +92,8 @@ in
|
|||||||
nomad
|
nomad
|
||||||
wander
|
wander
|
||||||
damon
|
damon
|
||||||
|
# for tiddlypwa
|
||||||
|
deno
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ job "instasync" {
|
|||||||
type = "batch"
|
type = "batch"
|
||||||
|
|
||||||
periodic {
|
periodic {
|
||||||
cron = "*/5 * * * *"
|
crons = [ "*/5 * * * *" ]
|
||||||
prohibit_overlap = true
|
prohibit_overlap = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,12 +19,17 @@ job "instasync" {
|
|||||||
read_only = true
|
read_only = true
|
||||||
source = "nix-store"
|
source = "nix-store"
|
||||||
}
|
}
|
||||||
|
volume "sw" {
|
||||||
|
type = "host"
|
||||||
|
read_only = true
|
||||||
|
source = "sw"
|
||||||
|
}
|
||||||
|
|
||||||
task "sync" {
|
task "sync" {
|
||||||
driver = "exec"
|
driver = "exec"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
command = "/nix/store/k5inwzpp6a0295pd3nfckk9hq8wmifhz-nodejs-20.15.1/bin/node"
|
command = "/sw/bin/node"
|
||||||
args = ["/code/instasync/sync.js"]
|
args = ["/code/instasync/sync.js"]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,6 +41,10 @@ job "instasync" {
|
|||||||
volume = "nix-store"
|
volume = "nix-store"
|
||||||
destination = "/nix/store"
|
destination = "/nix/store"
|
||||||
}
|
}
|
||||||
|
volume_mount {
|
||||||
|
volume = "sw"
|
||||||
|
destination = "/sw"
|
||||||
|
}
|
||||||
|
|
||||||
resources {
|
resources {
|
||||||
memory = 100
|
memory = 100
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ job "resol-gateway" {
|
|||||||
read_only = true
|
read_only = true
|
||||||
source = "nix-store"
|
source = "nix-store"
|
||||||
}
|
}
|
||||||
|
volume "sw" {
|
||||||
|
type = "host"
|
||||||
|
read_only = true
|
||||||
|
source = "sw"
|
||||||
|
}
|
||||||
|
|
||||||
network {
|
network {
|
||||||
port "http" {
|
port "http" {
|
||||||
@@ -23,7 +28,7 @@ job "resol-gateway" {
|
|||||||
driver = "exec"
|
driver = "exec"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
command = "/nix/store/k5inwzpp6a0295pd3nfckk9hq8wmifhz-nodejs-20.15.1/bin/node"
|
command = "/sw/bin/node"
|
||||||
args = ["/code/resol-vbus/examples/json-live-data-server/index.js"]
|
args = ["/code/resol-vbus/examples/json-live-data-server/index.js"]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,6 +40,10 @@ job "resol-gateway" {
|
|||||||
volume = "nix-store"
|
volume = "nix-store"
|
||||||
destination = "/nix/store"
|
destination = "/nix/store"
|
||||||
}
|
}
|
||||||
|
volume_mount {
|
||||||
|
volume = "sw"
|
||||||
|
destination = "/sw"
|
||||||
|
}
|
||||||
|
|
||||||
service {
|
service {
|
||||||
name = "resol-gateway"
|
name = "resol-gateway"
|
||||||
|
|||||||
87
services/tiddlypwa.hcl
Normal file
87
services/tiddlypwa.hcl
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
job "tiddlypwa" {
|
||||||
|
datacenters = ["alo"]
|
||||||
|
|
||||||
|
group "server" {
|
||||||
|
volume "code" {
|
||||||
|
type = "host"
|
||||||
|
read_only = true
|
||||||
|
source = "code"
|
||||||
|
}
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
volume "sw" {
|
||||||
|
type = "host"
|
||||||
|
read_only = true
|
||||||
|
source = "sw"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" { }
|
||||||
|
}
|
||||||
|
|
||||||
|
task "sync" {
|
||||||
|
driver = "exec"
|
||||||
|
|
||||||
|
config {
|
||||||
|
command = "/sw/bin/deno"
|
||||||
|
args = [
|
||||||
|
"run",
|
||||||
|
"--unstable-broadcast-channel",
|
||||||
|
"--allow-env",
|
||||||
|
"--allow-read=/appdata/tiddlypwa",
|
||||||
|
"--allow-write=/appdata/tiddlypwa",
|
||||||
|
"--allow-net=:${NOMAD_PORT_http}",
|
||||||
|
"/code/tiddlypwa/server/run.ts",
|
||||||
|
"--port=${NOMAD_PORT_http}",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
ADMIN_PASSWORD_HASH = "T2JTyY9jplOqXO5FwnLmPpUu79SXOOW7hav9moTQuD4"
|
||||||
|
ADMIN_PASSWORD_SALT = "SB_uRmIlJPPssPWyOUEip-HwQZJZn1q2A6QA8ptB7aY"
|
||||||
|
DB_PATH = "/appdata/tiddlypwa/tiddly.db"
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "code"
|
||||||
|
destination = "/code"
|
||||||
|
}
|
||||||
|
volume_mount {
|
||||||
|
volume = "appdata"
|
||||||
|
destination = "/appdata"
|
||||||
|
}
|
||||||
|
volume_mount {
|
||||||
|
volume = "nix-store"
|
||||||
|
destination = "/nix/store"
|
||||||
|
}
|
||||||
|
volume_mount {
|
||||||
|
volume = "sw"
|
||||||
|
destination = "/sw"
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "tiddlypwa"
|
||||||
|
port = "http"
|
||||||
|
tags = [
|
||||||
|
"traefik.enable=true",
|
||||||
|
"traefik.http.routers.whoami.rule=Host(`wiki.alo.land`)",
|
||||||
|
"traefik.http.routers.whoami.entryPoints=websecure",
|
||||||
|
#"traefik.http.routers.whoami.middlewares=authentik@file",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user