Compare commits

...

5 Commits

Author SHA1 Message Date
8a56607163 Serve stale content if backend is down. 2025-04-22 06:04:15 +01:00
9b9f03fc20 Serve stale content if origin is down. 2025-04-21 20:29:02 +01:00
0dbf41d54c WIP 2025-04-21 20:28:54 +01:00
bded37656a Update flake. 2025-04-21 20:21:38 +01:00
d579d0b86b Add grok wiki. 2025-04-20 08:01:15 +01:00
4 changed files with 89 additions and 30 deletions

38
flake.lock generated
View File

@@ -50,11 +50,11 @@
]
},
"locked": {
"lastModified": 1744145203,
"narHash": "sha256-I2oILRiJ6G+BOSjY+0dGrTPe080L3pbKpc+gCV3Nmyk=",
"lastModified": 1745224732,
"narHash": "sha256-0OWgbEKhpMLpk3WQi3ugOwxWW4Y6JVpKiQ+o0nuNzus=",
"owner": "nix-community",
"repo": "disko",
"rev": "76c0a6dba345490508f36c1aa3c7ba5b6b460989",
"rev": "1770bf1ae5da05564f86b969ef21c7228cc1a70b",
"type": "github"
},
"original": {
@@ -280,16 +280,16 @@
]
},
"locked": {
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"lastModified": 1737371634,
"narHash": "sha256-fTVAWzT1UMm1lT+YxHuVPtH+DATrhYfea3B0MxG/cGw=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"rev": "a1176e2a10ce745ff8f63e4af124ece8fe0b1648",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.0.6",
"ref": "v0.0.7",
"repo": "ixx",
"type": "github"
}
@@ -301,11 +301,11 @@
]
},
"locked": {
"lastModified": 1744518957,
"narHash": "sha256-RLBSWQfTL0v+7uyskC5kP6slLK1jvIuhaAh8QvB75m4=",
"lastModified": 1745120797,
"narHash": "sha256-owQ0VQ+7cSanTVPxaZMWEzI22Q4bGnuvhVjLAJBNQ3E=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "4fc9ea78c962904f4ea11046f3db37c62e8a02fd",
"rev": "69716041f881a2af935021c1182ed5b0cc04d40e",
"type": "github"
},
"original": {
@@ -364,11 +364,11 @@
},
"nixpkgs-unstable_2": {
"locked": {
"lastModified": 1744463964,
"narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=",
"lastModified": 1744932701,
"narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650",
"rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef",
"type": "github"
},
"original": {
@@ -387,11 +387,11 @@
"nuschtosSearch": "nuschtosSearch"
},
"locked": {
"lastModified": 1744874965,
"narHash": "sha256-eOnMgAWsjqOhGRoY9smkKlNQcCz9R89mgiKwLrCIYBE=",
"lastModified": 1745244491,
"narHash": "sha256-UlwXkytxGW/aokB9fZ6cSznYKM9ynDLHqhjcPve0KL4=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "500b56f023e0f095ffee2d4f79e58aa09e6b0719",
"rev": "7a58109958d14bcece8ec3e2085e41ea3351e387",
"type": "github"
},
"original": {
@@ -410,11 +410,11 @@
]
},
"locked": {
"lastModified": 1743683223,
"narHash": "sha256-LdXtHFvhEC3S64dphap1pkkzwjErbW65eH1VRerCUT0=",
"lastModified": 1745046075,
"narHash": "sha256-8v4y6k16Ra/fiecb4DxhsoOGtzLKgKlS+9/XJ9z0T2I=",
"owner": "NuschtOS",
"repo": "search",
"rev": "56a49ffef2908dad1e9a8adef1f18802bc760962",
"rev": "066afe8643274470f4a294442aadd988356a478f",
"type": "github"
},
"original": {

View File

@@ -141,6 +141,15 @@
.host = "100.64.229.126";
.port = "10080";
}
sub vcl_backend_response {
# default TTL if backend didn't specify one
if (beresp.ttl <= 0s) {
set beresp.ttl = 1h;
}
# serve stale content in case home link is down
set beresp.grace = 240h;
}
'';
};
}

View File

@@ -1,4 +1,4 @@
job "instasync" {
job "igsync" {
datacenters = ["alo"]
type = "batch"
@@ -9,11 +9,6 @@ job "instasync" {
}
group "cron" {
volume "code" {
type = "host"
read_only = true
source = "code"
}
volume "nix-store" {
type = "host"
read_only = true
@@ -24,18 +19,24 @@ job "instasync" {
read_only = true
source = "sw"
}
volume "appdata" {
type = "host"
read_only = false
source = "appdata"
}
task "sync" {
driver = "exec"
config {
command = "/sw/bin/node"
args = ["/code/instasync/sync.js"]
command = "/appdata/igsync/run.sh"
}
user = "ppetru"
volume_mount {
volume = "code"
destination = "/code"
volume = "appdata"
destination = "/appdata"
}
volume_mount {
volume = "nix-store"
@@ -47,7 +48,8 @@ job "instasync" {
}
resources {
memory = 100
memory = 1024
cpu = 2000
}
}
}

View File

@@ -22,6 +22,7 @@ job "wiki" {
port "captainslog" { }
port "alo" { }
port "pispace" { }
port "grok" { }
}
task "captainslog" {
@@ -168,5 +169,52 @@ job "wiki" {
memory = 256
}
}
task "grok" {
driver = "exec"
config {
command = "/sw/bin/node"
args = [
"/appdata/wiki/node_modules/tiddlywiki/tiddlywiki.js",
"/appdata/wiki/grok",
"--listen",
"host=0.0.0.0",
"port=${NOMAD_PORT_grok}",
"authenticated-user-header=X-authentik-username",
"readers=ppetru",
"writers=ppetru",
"admin=ppetru",
]
}
volume_mount {
volume = "appdata"
destination = "/appdata"
}
volume_mount {
volume = "nix-store"
destination = "/nix/store"
}
volume_mount {
volume = "sw"
destination = "/sw"
}
service {
name = "groktw"
port = "grok"
tags = [
"traefik.enable=true",
"traefik.http.routers.groktw.entryPoints=websecure",
"traefik.http.routers.groktw.middlewares=authentik@file",
]
}
resources {
cpu = 500
memory = 256
}
}
}
}