No description
  • Rust 93.5%
  • Nix 2.8%
  • HTML 2.6%
  • Dockerfile 1.1%
Find a file
Dennis 92f92acf9c
Some checks failed
/ check (push) Has been cancelled
/ release (push) Has been cancelled
(+) Deployment preparation
2026-10-26 20:38:46 +00:00
.forgejo/workflows (+) Deployment preparation 2026-10-26 20:38:46 +00:00
.idea (c) updates 2025-06-08 12:14:02 +02:00
.vscode (c) updates 2025-06-08 12:14:02 +02:00
containers (+) Deployment preparation 2026-10-26 20:38:46 +00:00
src (+) Deployment preparation 2026-10-26 20:38:46 +00:00
test_out (c) updates 2025-06-08 12:14:02 +02:00
.env.template (+) Deployment preparation 2026-10-26 20:38:46 +00:00
.gitignore (+) Deployment preparation 2026-10-26 20:38:46 +00:00
.mise.toml (+) Deployment preparation 2026-10-26 20:38:46 +00:00
.onedev-buildspec.yml (c) updates 2025-06-08 12:14:02 +02:00
api_notes.md (c) holiday from pub api 2023-04-27 12:42:37 +02:00
Cargo.lock (c) updated flake nix to base image / updated dependencies 2026-10-26 20:34:27 +00:00
Cargo.toml (c) updated flake nix to base image / updated dependencies 2026-10-26 20:34:27 +00:00
flake.lock (c) updated flake nix to base image / updated dependencies 2026-10-26 20:34:27 +00:00
flake.nix (+) Deployment preparation 2026-10-26 20:38:46 +00:00
laenderapi.txt (c) restructuring 2023-04-26 21:47:18 +02:00
README.md (+) Deployment preparation 2026-10-26 20:38:46 +00:00
renovate.json (+) Deployment preparation 2026-10-26 20:38:46 +00:00

syapi – School Year Plan API

Erzeugt aus Schuljahr, Bundesland, eigenen Ferien und Stundenverteilung einen Stoffverteilungsplan als Excel-Datei (POST /). Schul- und Feiertage kommen von der OpenHolidays API.

Entwicklung

Entwickelt wird in der MicroVM (flake.nix, nix run --impure), bedient wird alles über mise:

cp .env.template .env    # einmalig, dann anpassen
mise run                 # listet alle Tasks
mise run dev             # Server auf APP_ADDR (in der VM 0.0.0.0:3000)
mise run request         # Beispielanfrage, Ergebnis nach test_out/
mise run check           # Formatierung, Clippy, Tests
Variable Bedeutung
APP_ADDR Adresse des Servers, Vorgabe 127.0.0.1:3000
APP_DATA Ablage der erzeugten Pläne (zugleich Cache), Pflicht
RUST_LOG Log-Filter für tracing

Betrieb

Läuft auf dem Server d0b als rootless Podman-Pod syapi (Nummer 06), hinter dem zentralen Caddy unter https://syapi.d0b.de.

Rolle app – Container syapi-app, Port 8080 im Pod, 127.0.0.1:10680 auf d0b
Daten /srv/syapi/data → /data (erzeugte Pläne)
Umgebung /etc/apps/syapi/app.env, Vorlage containers/env/app.env.example
Health GET /health → 200

Die Dateien für d0b liegen unter containers/ (Containerfile, Quadlets, site.caddy, smoke.txt).

Release

mise run build:deploy v2026.10.26-1     # deploy/ und dist/syapi-<tag>.tar.zst (+ .sha256)
mise run test:containers                # baut und startet jede Rolle wie auf d0b
git tag v2026.10.26-1 && git push --tags

Ein Tag v* baut das Bündel per Forgejo-Workflow (.forgejo/workflows/release.yml) und hängt es an das Release. build:deploy packt nur versionierte Dateien aus HEAD ein: vorher committen.

Einrichtung auf d0b (einmalig, als root)

app add syapi 06
editor /etc/apps/syapi/app.conf     # DOMAIN=syapi.d0b.de  REPO=https://zumcode.de/<besitzer>/syapi
install -m 0640 -o root -g syapi /dev/null /etc/apps/syapi/app.env   # Werte aus containers/env/app.env.example
app deploy syapi <tag>

Die Releases müssen ohne Anmeldung ladbar sein (öffentliches Repo), sonst das Bündel vorher holen und app deploy syapi <ordner>.