Commit Graph
9 Commits
Author SHA1 Message Date
gurix 96d1364b54 wyby sync: log PIN collisions as WARNING (journal error filter) 2026-11-12 15:29:57 +01:00
gurix 841e2e53d4 wyby sync: skip PIN collisions with foreign manual codes
Glutz codes are globally unique; a PIN already owned by another user
(e.g. manually set temporary code) is skipped with a clear WARNING
instead of failing the whole run. 41 tests green.
2026-11-12 11:56:24 +01:00
gurix 3056ab97bb Add wyby sync: proactive PIN provisioning from wyby admin portal
- wyby_client.py: headless login to admin.wyby.ch (OIDC auth-code flow with
  PKCE, cookie session) + booking extraction from the scheduler API
  (GetWallpaperData); PIN = last 6 digits of transaction Number; rental days
  derived from RentingStartDate / AllotmentRentingEndDate (exclusive midnight)
- wyby_sync.py: for every upcoming booking ensure Glutz user, group membership
  and PIN with full-day validity; idempotent, self-healing against wyby's own
  late interface runs; dry-run default
- deploy: wyby-sync.service + 15-min timer (24/7); extend_pins stays hourly
  as safety net
- 39 tests; requests added via uv (available system-wide for the oneshot)
2026-11-12 11:53:41 +01:00
gurix d034d3088c Add structured logging via stdlib logging module
- INFO -> stdout (journal priority info), WARNING/ERROR -> stderr (err)
- no-validity-window skip for wyby users is now a WARNING (interface bug hint)
- setup_logging(force=True) rebinding handlers, covered by tests
- SyslogIdentifier in systemd unit; README logging section (German)
2026-10-23 09:01:37 +02:00
gurix d2a612a37e Add pytest suite, uv project setup and ruff compliance
- pyproject.toml: dev deps via uv (pytest, ruff), pytest and ruff config
- tests/: 24 tests for extend_pins (helpers + mocked main flow) and
  glutz_api.load_env; no network access
- translate source code to English per AGENT.md
- fix ruff findings (unused import, max() simplification, shebang)
2026-10-23 08:49:49 +02:00
gurix 66fef822de Add AGENT.md: uv for deps, ruff lint, TDD with pytest, English source code 2026-10-23 08:41:42 +02:00
gurix d65ae78e91 deploy.sh: rsync/chown unter sudo (DEST gehoert apps, dev darf nicht schreiben) 2026-10-22 21:46:27 +02:00
gurix 6ab00fcb9f extend_pins: wyby-Buchungs-PINs auf tageweise Gueltigkeit erweitern
- glutz_api.py: vendorierter JSON-RPC-Client (aus glutz-eaccess-api)
- extend_pins.py: Dry-Run-Standard, --apply, --only-code fuer Schreibtests
  * wyby-Benutzer via Label-Muster '<Name> <6 Ziffern>'
  * Fenster aus Code-Gueltigkeit abgeleitet (Buchung +/- Puffer, Default 15 min)
  * idempotent: tageweise/persoenliche/abgelaufene Codes werden uebersprungen
- deploy/: systemd oneshot + Timer 05:40..23:40 stuendlich, deploy.sh
- README.md, .env.example ergaenzt
2026-10-22 21:45:29 +02:00
gurix 8623e8e745 Repo-Initialisierung: .env.example uebernommen, .env ignoriert 2026-10-22 21:39:17 +02:00