Family Home Lab: portal, dsh (chat+plugins), transcriber, music/media tools, home dash

This commit is contained in:
2026-08-26 11:30:34 +10:00
commit 1110dbc978
62 changed files with 4237 additions and 0 deletions

63
deploy/DEPLOYMENT.md Normal file
View File

@@ -0,0 +1,63 @@
# Deployment notes — Family Home Lab
## Domains
- Public zone `lab.audasmedia.com.au` → `144.6.86.11` (router) → `.35` Caddy.
- **No Pi-hole local records needed.** `*.home.lab` is deprecated (not a registered TLD).
## Caddy (.35)
1. SSH: `ssh sam@192.168.20.35`
2. Locate the running Caddy config (Docker container on .35).
3. Append `deploy/caddy/Caddyfile.snippet` contents to the Caddyfile.
4. Reload: `docker exec <caddy> caddy reload --config /etc/caddy/Caddyfile`
5. Verify Caddy can obtain Let's Encrypt certs (ports 80/443 forwarded on router — already working for omniroute/gitea domains).
## Host (.13)
1. Compose project: `/home/sam/Docker/Containers/family-home-lab/` (created during build).
2. Data: `/mnt/data/family-home-lab/` (garage-data, garage-meta, shared-media, dsh/).
3. Backup: add `/mnt/data/family-home-lab/` to Borg sources in `/etc/nixos/backup.nix`.
## Ports (on .13)
| Port | Service |
|---|---|
| 8500 | Portal (FastAPI) |
| 8487 | Photopea (→ container 8887) |
| 8083 | Video editor (kdenlive) — 8081 was taken by airflow-webserver |
| 8084 | Audio editor (audacity) — 3000 was taken by a NixOS service |
| 3900/3902 | Garage (S3/admin) |
| 3081–3084 | dsh instances (other agent) |
## Order of operations
1. Build portal + compose stack (this repo) → `docker compose up -d` on .13
2. Apply Caddy snippet on .35
3. Test `https://console.lab.audasmedia.com.au`
4. Deploy tool containers one at a time, verifying each URL
5. dsh agent deploys its instances and coordinates token handoff
## First run (portal)
Portal auto-creates the DB tables and, if the users table is empty, seeds the
admin from `ADMIN_USERNAME`/`ADMIN_PASSWORD` in `.env` (Sam, by default).
```bash
cd /home/sam/Docker/Containers/family-home-lab
docker compose up -d
# first admin already created on startup; create the rest in the UI at /admin
```
## Garage provisioning (S3 buckets + access keys)
After Garage is up, create buckets/keys from inside the container:
```bash
# env for the garage CLI
G=('docker compose exec -T garage garage --config /etc/garage.toml')
# main service key for the portal
KEY_ID=$($G key import --name portal - <<< "$(cat .env | grep S3_ACCESS | cut -d= -f2)")
# buckets
for b in sam jo harry finn shared-media; do $G bucket create "$b"; done
# allow the portal key to access every bucket
for b in sam jo harry finn shared-media; do $G bucket allow --read --write "$b" --key portal; done
```
> Symmetry: ensure S3_ACCESS_KEY/S3_SECRET_KEY in `.env` match what `key import`
> registers, else portal uploads will 403.

View File

@@ -0,0 +1,50 @@
# Caddyfile additions for the Family Home Lab console
# Apply on .35 (sam-ubuntu1, 192.168.20.35) — append to the existing Caddyfile
# and reload: docker exec <caddy-container> caddy reload --config /etc/caddy/Caddyfile
#
# Domains use the public zone lab.audasmedia.com.au (already resolves to
# 144.6.86.11 -> router -> .35). No Pi-hole local records required.
# --- Family Console (portal) ---
console.lab.audasmedia.com.au {
reverse_proxy 192.168.20.13:8500
}
# --- Image Lab (Photopea) ---
photo.lab.audasmedia.com.au {
reverse_proxy 192.168.20.13:8487
}
# --- Video Lab ---
# host port 8083 (8081 was taken by airflow-webserver on .13)
video.lab.audasmedia.com.au {
reverse_proxy 192.168.20.13:8083
}
# --- Audio Lab ---
# host port 8084 (3000 was taken by a NixOS service on .13)
audio.lab.audasmedia.com.au {
reverse_proxy 192.168.20.13:8084
}
# --- Garage S3 API ---
s3.lab.audasmedia.com.au {
reverse_proxy 192.168.20.13:3900
}
# --- DeepSeek Harness instances (built by dsh agent) ---
dsh-sam.lab.audasmedia.com.au {
reverse_proxy 192.168.20.13:3081
}
dsh-jo.lab.audasmedia.com.au {
reverse_proxy 192.168.20.13:3082
}
dsh-harry.lab.audasmedia.com.au {
reverse_proxy 192.168.20.13:3083
}
dsh-finn.lab.audasmedia.com.au {
reverse_proxy 192.168.20.13:3084
}

14
deploy/pi-dash-sync.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Copy Pi dashboard agent-session JSONs from the pi host to .13 so the portal's
# admin Pi Dashboard view (/admin/pi) can render them. Run this on the host
# where `pi` runs (sam-4screen-desktop). Automate with cron, e.g. every 5 min:
# */5 * * * * /home/sam/home_network/custom_tools/family_home_lab/deploy/pi-dash-sync.sh >> /tmp/pi-dash-sync.log 2>&1
set -e
DST="sam@192.168.20.13:/mnt/data/family-home-lab/pi-dashboard"
ssh sam@192.168.20.13 "mkdir -p /mnt/data/family-home-lab/pi-dashboard"
if command -v rsync >/dev/null 2>&1; then
rsync -a --delete /home/sam/.pi/agent/dashboard/*.json "$DST"/
else
scp -q /home/sam/.pi/agent/dashboard/*.json "$DST"/
fi
echo "pi dashboard synced: $(ls /home/sam/.pi/agent/dashboard/*.json 2>/dev/null | wc -l) files"