homelab-codex-ws/services/vikunja/healthcheck.sh
Oskar Kapala f7e1391f30 feat(vikunja): bring PIHA Vikunja under GitOps (postgres + Forgejo OIDC)
Wraps the existing manually-run Vikunja instance on PIHA in the standard
service layout. No deploy — definition only, for review.

- services/vikunja/: docker-compose.yml (vikunja + postgres:16-alpine),
  service.yaml, README, healthcheck, config.yml (OIDC, secret-free),
  .env.example. Real .env stays gitignored.
- Pins EXISTING named volumes (vikunja_vikunja_db, vikunja_vikunja_files)
  so DB + uploaded files survive cutover.
- extra_hosts forgejo.okit.pl=192.168.31.5 (npm on PIHA) so OIDC discovery
  resolves over LAN instead of flaky public DNS.
- OIDC client secret injected via env (VIKUNJA_AUTH_OPENID_PROVIDERS_
  FORGEJO_CLIENTSECRET); config.yml keeps trailing-slash authurl/redirecturl.
- Registers vikunja in hosts/piha/services.yaml + inventory/topology.yaml,
  plus hosts/piha/runtime/vikunja override (advisory mem_limits).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 15:02:37 +02:00

24 lines
653 B
Bash
Executable file

#!/bin/bash
# Healthcheck for Vikunja (app + database)
# Vikunja app container must be running
if ! docker ps --filter "name=vikunja" --filter "status=running" | grep -qw "vikunja"; then
echo "[FAIL] vikunja container is not running"
exit 1
fi
# Postgres container must be running
if ! docker ps --filter "name=vikunja-db" --filter "status=running" | grep -qw "vikunja-db"; then
echo "[FAIL] vikunja-db container is not running"
exit 1
fi
# API must respond
if ! curl -sf http://localhost:3456/api/v1/info > /dev/null; then
echo "[FAIL] Vikunja API is not responding on :3456"
exit 1
fi
echo "[OK] Vikunja is healthy"
exit 0