.
D 2026-10-14T00:30:41.087
L Home
N text/x-markdown
P aa1e80aa21a0b172e4f95ebe001fffa240759c39111d873261b16fc30a77b1fd
U dmestas
W 3800
# infra
Infrastructure-as-code for `vps-nbg1` (Hetzner, Ubuntu 24.04 LTS, arm64).
This repo contains install scripts, config templates, and documentation for all
services running on the VPS. Each service is self-contained under its own directory
with idempotent install scripts.
---
## Services
``` pikchr
# Top band: Cloudflare in front of everything
right
CF: box "Cloudflare" color white fill 0x2a4a6b width 5.8 height 0.45 rad 4px
# VPS outline, drawn for the dark skin
VPS: box width 5.8 height 2.6 rad 8px at CF.s + (0, -1.3) fill 0x272a30 color 0x6b7079
text "vps-nbg1" small color 0xb3b8c0 at VPS.se + (-0.6, 0.18)
# Fossil stack (left)
down
CFD: box "cloudflared" color white fill 0x5b4a8a width 1.4 height 0.4 rad 4px \
at VPS.nw + (0.9, -0.5)
arrow from CFD.s down 0.15 color 0x888888
CDY: box "Caddy :8090" color white fill 0x5b4a8a width 1.4 height 0.4 rad 4px
arrow from CDY.s down 0.15 color 0x888888
FSL: box "Fossil :8081" color white fill 0x3a6b3a width 1.4 height 0.4 rad 4px
text "fossil.craftdesign.group" small color 0xb3b8c0 at FSL.s + (0, -0.2)
# NATS stack (right)
NT: box "nats-server :4222" color white fill 0x2a4a8a width 1.7 height 0.4 rad 4px \
at VPS.ne + (-1.0, -0.5)
arrow from NT.s down 0.15 color 0x888888
JS: box "JetStream" color white fill 0x2a4a8a width 1.7 height 0.4 rad 4px
arrow from JS.s down 0.15 color 0x888888
box "edgesync" color white fill 0x31353d width 1.7 height 0.4 rad 4px
# Coolify (centre)
box "Coolify :8000" color white fill 0x7a5a1a width 1.4 height 0.4 rad 4px at VPS.n + (0, -0.7)
box "excalidraw" color white fill 0x7a5a1a width 1.4 height 0.4 rad 4px at VPS.n + (0, -1.25)
# Edges from Cloudflare
arrow from CF.s + (-1.9, 0) down 0.1 color white thick
text "fossil." small color 0xb3b8c0 at CF.s + (-1.9, -0.2)
arrow from CF.s + (1.9, 0) down 0.1 color white thick
text "sync. :4222" small color 0xb3b8c0 at CF.s + (1.9, -0.2)
```
| Service | Directory | Endpoint |
|---------|-----------|---------|
| **NATS Server** | `nats/` | `tls://sync.craftdesign.group:4222` |
| Fossil SCM | *(managed separately)* | `https://fossil.craftdesign.group/` |
| Coolify | *(managed separately)* | `http://localhost:8000` |
---
## NATS Documentation
- [NATS Server — Setup & Architecture](NATS Server — Setup & Architecture)
- [NATS Server — Operations Runbook](NATS Server — Operations Runbook)
- [NATS Server — Docker Image](NATS Server — Docker Image)
---
## Repository Layout
```
nats/
install.sh Phase 1 — binary, user, dirs, TLS cert, systemd unit
bootstrap-creds.sh Phase 2 — nsc operator/accounts/users, .creds files
start.sh Phase 3 — render config, start service, copy JWTs
provision-streams.sh Phase 4 — create JetStream streams
nats-server.conf.template Config template (envsubst vars: OPERATOR_JWT, SYS_ACCOUNT_KEY)
nats.service Systemd unit
Dockerfile Container image (24 MB, tested)
docker-entrypoint.sh Entrypoint — renders config, starts server
creds/ *.creds files (fossil-ignored, not committed)
docs/
superpowers/
specs/ Design documents
plans/ Implementation plans
```
---
## Quickstart — Re-installing NATS
```sh
cd ~/Projects/infra
export NATS_VERSION=2.10.22
sudo --preserve-env=NATS_VERSION bash nats/install.sh # Phase 1 (root)
bash nats/bootstrap-creds.sh # Phase 2 (dmestas)
sudo bash nats/start.sh # Phase 3 (root)
bash nats/provision-streams.sh # Phase 4 (dmestas)
```
Z b3fd345b918d9735f4b2b30b738b199c