Phase 7a: real 6:00am n8n schedule for the school brief (AUD-115)

The 06:00 workflow is now one schedule-trigger -> Execute Command pair that
runs scripts/morning-brief.sh on the host over a restricted SSH key. The
earlier scan -> HTTP shape could not work: the n8n container cannot resolve
the `remote` ssh alias (its ~/.ssh/config is a dangling nix symlink) and a
split scan node hides scan failures before the notify node runs.

- deploy/n8n-morning-brief.json: two-node workflow, scheduleTrigger v1.3
- deploy/setup-n8n-scan-key.sh: restricted (restrict,command=) trigger key
- deploy/import-n8n-morning-brief.sh: import + publish + restart + verify
- deploy/DEPLOYMENT.md, Makefile: document and expose both scripts (dry run)
- docs/phase-7a-n8n-schedule.md: design, verification, failure drill

Import into the shared n8n service still needs Sam's approval.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-10-15 19:51:36 +11:00
parent 9cbfa7db9b
commit 7d367f7712
6 changed files with 316 additions and 53 deletions

View File

@@ -19,7 +19,7 @@ GO_RUN = timeout 600 docker run --rm --network host --user "$$(id -u):$$(id -g)"
-e HOME=/src/.gocache -e GOMODCACHE=/src/.gocache/mod -e GOCACHE=/src/.gocache/build \
-v "$$PWD":/src -w /src $(GO_IMAGE)
.PHONY: help test vet build up down restart logs ps deps fmt hash-password gen-secret verify-phase1 verify-phase8 parse scan calendar notify morning-brief
.PHONY: help test vet build up down restart logs ps deps fmt hash-password gen-secret verify-phase1 verify-phase8 parse scan calendar notify morning-brief n8n-key n8n-import
help:
@echo "make test run go test ./... in golang:1.25-alpine"
@@ -38,6 +38,8 @@ help:
@echo "make notify build and send the morning briefs via Apprise (Phase 7; NOTIFY_ARGS=...)"
@echo "make preview print the briefs without sending (Phase 7)"
@echo "make morning-brief scan both children, then send the briefs (the n8n job)"
@echo "make n8n-key print the restricted SSH trigger key plan (Phase 7a)"
@echo "make n8n-import print the n8n import/publish plan (Phase 7a; APPLY=1 applies)"
@echo "make verify-phase1 prove /health, the login and the Caddy route"
@echo "make verify-phase8 prove the Hub API: /capabilities, /ask, /notify (--send delivers)"
@@ -102,6 +104,14 @@ preview:
morning-brief:
IMAGE=$(IMAGE) scripts/morning-brief.sh
# Phase 7a: the 06:00 n8n schedule. Both default to a dry run; pass APPLY=1 to
# change the shared n8n service on .13 (after approval).
n8n-key:
deploy/setup-n8n-scan-key.sh $(if $(APPLY),--apply,)
n8n-import:
deploy/import-n8n-morning-brief.sh $(if $(APPLY),--apply,)
# Phase 1 definition of done: /health 200, login page + session login, and the
# Caddy route on .35.
verify-phase1: