.
D 2026-03-15T20:21:57.843
L Home
N text/x-markdown
U dmestas
W 3161
# 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
scale = 0.85
# VPS box
box wid 6.5 ht 5.2 rad 8px at (3.25, 2.0) "vps-nbg1 (91.99.202.69, arm64)" big bold fill lightyellow
# Internet / Cloudflare band
box wid 6.5 ht 0.6 rad 4px at (3.25, 5.0) "Cloudflare" fill lightcyan bold
arrow from (1.2, 4.7) down 0.4; "fossil.craftdesign.group" above small
arrow from (5.3, 4.7) down 0.4; "sync.craftdesign.group :4222" above small
# Fossil stack
box "cloudflared" fit rad 4px at (1.2, 3.9) fill lavender
arrow from (1.2, 3.7) down 0.3
box "Caddy :8090" fit rad 4px at (1.2, 3.2) fill lavender
arrow from (1.2, 3.0) down 0.3
box "Fossil :8081" fit rad 4px at (1.2, 2.5) fill lightgreen
text "edgesync, go-libfossil," at (1.2, 2.15) small
text "infra, fossil-skin" at (1.2, 1.95) small
# NATS stack
box "nats-server :4222" fit rad 4px at (5.3, 3.9) fill lightblue bold
arrow from (5.3, 3.7) down 0.3
box "JetStream" fit rad 4px at (5.3, 3.2) fill lightblue
arrow from (5.3, 3.0) down 0.3
box "EDGESYNC" wid 1.6 ht 0.35 rad 4px at (4.7, 2.5) fill aliceblue
box "GO_LIBFOSSIL" wid 1.6 ht 0.35 rad 4px at (4.7, 2.05) fill aliceblue
# Other services
box "Coolify :8000" fit rad 4px at (3.25, 3.9) fill lightyellow
box "excalidraw" fit rad 4px at (3.25, 3.2) fill lightyellow
```
| 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)
---
## 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 Future: containerised deployment
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 639138cc5c1ceb1b5f4e2594632ba318