feat(validatie): multi-machine bootstrap (rclone+Box) + beheerpagina#59
Merged
feat(validatie): multi-machine bootstrap (rclone+Box) + beheerpagina#59
Conversation
Lost de "DB komt niet mee bij pull op andere computer"-pijn op door oeren/ centraal in Box te hosten en de DB altijd lokaal te herbouwen via één bootstrap-commando. Eenmalige `rclone config` per machine, daarna `./scripts/bootstrap.sh`. - `scripts/sync_oeren.sh`: rclone-wrapper, valideert config en remote-naam. - `scripts/bootstrap.sh`: chained `uv sync` → sync → ingest → seed met `--skip-sync`, `--skip-seed`, `--seed-bulk` flags. - `app/pages/9_beheer.py`: 4-tab beheerpagina (Status, Sync, Re-ingest, Seed) beschermd via `BEHEER_ENABLED=true` env-flag. Subprocess-output wordt live gestreamd via `subprocess.Popen` + scrollende code-block. Status-tab gebruikt verse SQLite-connectie zodat subprocess-commits direct zichtbaar zijn na een ingest-run. - `ingest_runs`-tabel + `voeg_ingest_run_toe()` / `laatste_ingest_run()` helpers; ingest-CLI logt elke run met scope, # OERs, # kerntaken en duur. Documentatie in CLAUDE.md uitgebreid met multi-machine workflow, rclone-setup en beheerpagina-tabs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Eén klik = `uv sync` → `rclone copy` → `ingest --alles` → `seed`. Bedoeld voor nieuwe machines en volledige DB-rebuild. Drie checkboxes (--skip-sync, --skip-seed, --seed-bulk) plus een verplichte bevestigings-checkbox vóór de Start-knop geactiveerd wordt; voorkomt accidentele rebuild van een gevulde DB. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lost de "DB komt niet mee bij pull op andere computer"-pijn op door
oeren/centraal in Box te hosten en de DB altijd lokaal te herbouwen via één bootstrap-commando. Per machine éénmaligrclone config, daarna./scripts/bootstrap.sh.Onderdelen
Scripts
scripts/sync_oeren.sh— rclone-wrapper. Valideert datrclonegeïnstalleerd is en de remote in config staat. Override viaRCLONE_REMOTE/RCLONE_OEREN_PAD/OEREN_PADenv-vars.scripts/bootstrap.sh— chaineduv sync --extra dev→sync_oeren.sh→ingest --alles→seed.py. Flags:--skip-sync,--skip-seed,--seed-bulk.Beheerpagina (
/beheer)BEHEER_ENABLED=truein.env(default uit, dus geen blootstelling op gedeelde servers)._db.get_conn()lost dat niet op).sync_oeren.sh, output live in scrollende code-block.--resetcheckbox, draaitingest.seed.py(basis 3+2 accounts) ofseed_bulk.py(~1000 studenten).subprocess.Popen(stdout=PIPE, bufsize=1)+ lazy generator dat regels yieldt; UI vernieuwt placeholder met laatste 300 regels.DB
ingest_runs (id, tijdstip, scope, n_oers, n_kerntaken, duur_seconden).voeg_ingest_run_toe()+laatste_ingest_run()helpers indb.py.ingest.main()logt elke run met start/eind-tijd en counts.Documentatie
CLAUDE.mduitgebreid met: multi-machine setup-stappen (rclone install → config → bootstrap),BEHEER_ENABLEDenv-var, beheerpagina-tabs.Eenmalige setup-flow voor andere machines
Test plan
uv run python -m pytest(63/63 groen)uv run ruff check src/ app/ scripts/bash -n scripts/sync_oeren.sh scripts/bootstrap.sh(syntax-check)/beheerzonder flag → toegang geweigerd; met flag → 4 tabs renderen, ingest-subprocess streamt live, exit=0, status-tab toont nieuwe runoer_documentencorrect gevuld wordtBEHEER_ENABLEDniet per ongeluk in een prod.envstaatTradeoffs / aandachtspunten
boxsdkPython omdat rclone OAuth-flow visueel afhandelt en geen tokens-in-env nodig is._db.get_conn(). Lichte overhead per render, maar nodig om commits van net-afgesloten subprocesses te zien.🤖 Generated with Claude Code