Die Review-Regel verbietet strukturelle Aenderungen unter drei Sessions oder einer Woche
Daten — qwen2.5:3b hatte auf Staging nach EINER Session eine Bein-Uebung entfernt, 'weil
keine Beinarbeit'. Dazu die Changelog-Eintraege fuer den Chat, das Admin-Dashboard, den
Job-Timeout und den 160er-Deckel, COACH_JOB_TIMEOUT_MS in .env.example und in AI_COACH.md,
und Schritt 3 der Doku beschreibt den Chat statt des alten Intake-Buttons.
AI_COACH.md trennt die zwei Provider-Familien (HTTPS mit Key auf dem Default-Image,
Runtime im coach-Image), beschreibt Endpunkt-Regeln, Modell-Liste, Keys pro Provider
samt einmaliger Migration von coach.json und die zwei Wege auf dem Handy. CHANGELOG
unter Unreleased, .env.example/README/Website/SELF_HOSTING nachgezogen.
.gitlab-ci.yml bekommt test:api (Suite, generierte Assets, core-loadable) und
build:api-check, das beide api-Targets baut und laufen laesst: das veroeffentlichte
Image hat kein SDK/codex/bwrap, bootet, und konstruiert die HTTPS-Adapter; das
coach-Image meldet ein lauffaehiges SDK, /coach-auth ist coach 700.
Der Coach-Zweig stand seit v1.2.7. Konflikte: beide Seiten behalten (Server-Imports,
Store-Felder, Home-Titel mit naechster Einheit, history.js), das Dockerfile behaelt seine
zwei Targets und kopiert die neuen Server-Module mit, compose zeigt auf die GitLab-Registry.
pt-BR: die 139 Coach-Strings in die Sie-Form gebracht, Fingerprint nachgezogen.
@simplewebauthn reports a mismatch as "Unexpected RP ID hash", which tells a
self-hoster nothing about their own .env — and this is the most common support
question in #install-help, where charliebelt is currently stuck behind a
Cloudflare Tunnel with values that look right. The error now names both
configured values back and points at the docs. Neither is a secret: one is the
address bar, the other its hostname.
Extracted as api/verify-error.js so it can be tested without booting a server
that opens files and a port, following push-messages.js.
SELF_HOSTING.md gets the diagnosis in order: read what the server logged on
startup (it prints rpID and origin, and `docker compose restart` does not
re-read .env), then the exact shape of each value as a table, then the
reverse-proxy case, then www., then that changing the hostname invalidates
existing passkeys. Plus the thing adam934912 called a blocker: on a LAN
without certificates there is nothing to configure that makes passkeys work.
Takes the nine commits as submitted, with three adjustments:
- remote.test.js ran in the node environment while remote.js pulls in
api.js, which reads navigator.userAgent at module scope — the file failed
to import. Same @vitest-environment happy-dom pragma the api tests use.
- Drops skills-lock.json. It pins a personal Claude Code skill chain to
third-party GitHub repos by hash; that is contributor tooling, not a
project artefact, and this project's GitHub access is gone. CLAUDE.md
itself is kept — it is an accurate description of the repo.
- Corrects two stale claims in that CLAUDE.md: the website deploys from
.gitlab-ci.yml, not GitHub Pages, and the CI gate is GitLab, not Gitea
Actions with a dormant GitHub copy.
pt-BR: 23 of the 44 new pt strings are European (ficheiro, telemóvel,
Definições, «guillemets», tu-forms), so they get Brazilian overrides
rather than being inherited; fingerprint re-baselined.
La app movil puede ahora sincronizar de verdad contra un servidor openGym
propio en vez de guardar todo solo en el telefono. Como las passkeys no
funcionan desde el WebView de la app (su origen nunca coincide con el
hostname real), el emparejamiento se hace con un codigo de un solo uso
generado desde una sesion ya logueada en el navegador (Ajustes > "Emparejar
la app movil"), canjeado por un bearer token con la misma firma que ya usa
la cookie de sesion.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Bis die Release-Pipeline laeuft, gab es auf GitLab keinen APK zum Laden. Der
aktuelle signierte Build (1.2.8, derselbe, den die Website ausliefert) liegt
jetzt in der Generic Package Registry unter opengym-android/1.2.8/ - genau dem
Pfad, den der build:apk-Job spaeter selbst befuellt. Daneben die .sha256:
sideloaden heisst, dass niemand die Datei fuer dich geprueft hat.
Anonym ladbar, ohne Login - nachgerechnet, die Pruefsumme des heruntergeladenen
Exemplars stimmt mit der lokalen ueberein.
gitea.com hat keinen Actions-Runner, also gab es dort seit dem Umzug weder
Container-Images noch einen gebauten APK noch gruene Tests auf Merge Requests.
GitLab kann alles vier, also zieht das Projekt dorthin um.
.gitlab-ci.yml deckt die komplette Kette ab:
- test: Frontend-Suite (346 Tests), Locale-Checks, Fatigue-Probe, MCP-Suite
- build: api- und web-Image nach registry.gitlab.com/duartesantos8/opengym/*,
auf v*-Tags amd64+arm64 mit latest/X.Y/X.Y.Z, sonst amd64 als edge
- package: signierter APK (zipalign + apksigner) plus Upload in die Generic
Package Registry; der Key liegt in geschuetzten CI-Variablen und existiert
damit nur auf main und v*-Tags
- deploy: der Browser-Demo-Build auf GitLab Pages
- release: GitLab-Release mit dem passenden CHANGELOG-Abschnitt und Links auf
APK und Images
GitHub konnte "Tag gepusht" von "Release veroeffentlicht" unterscheiden und hat
Images nur aus letzterem gebaut (Issue #87). GitLab kann das nicht - dort ist die
Tag-Pipeline das, was das Release anlegt. Die Regel steht deshalb als Kommentar
im CI-File, und v*-Tags sind geschuetzt.
Ausserdem: Issue-/MR-Vorlagen unter .gitlab/, und saemtliche Repo-Links in
README, Docs, App, Dockerfile-Labels, docker-compose und Website zeigen auf
GitLab. site.js liest Sterne und Releases jetzt aus der GitLab-API (andere
Feldnamen, deshalb neue sessionStorage-Keys). SECURITY.md hat wieder einen
privaten Meldeweg: ein vertrauliches Issue.
.github/ und .gitea/ bleiben liegen - Spiegel bzw. fuer den Tag, an dem das
GitHub-Konto zurueckkommt.
Wer sich anmeldet, wer es vergeblich versucht und was ein Admin aendert, stand
bisher nirgends — der Server hat schlicht nichts protokolliert.
Aktivitaetslog:
- ./data/audit.log, eine JSON-Zeile pro Event, angehaengt statt neu geschrieben.
Bewusst NICHT in db.json: die Datei wird bei jedem Save komplett neu geschrieben,
und der Login-Handshake ist unauthentifiziert — ein Log darin haette aus einem
Muell-Request einen vollen Rewrite gemacht.
- Aufbewahrung ist eine Obergrenze, kein Archiv: AUDIT_MAX (5000) bzw. AUDIT_DAYS (90).
- Per Default an (AUDIT_LOG=0 schaltet es ganz ab). IP-Adressen per Default AUS;
AUDIT_IP=net speichert nur das Netz, full die ganze Adresse. Nie der User-Agent,
nie die Passkey-ID eines Fehlversuchs, nie ein abgelehnter Invite-Code.
- Adresse kommt aus CF-Connecting-IP, dann X-Forwarded-For, dann X-Real-IP —
ein Cloudflare-Tunnel schreibt den Besucher NICHT in XFF, dort steht sonst nur
der Tunnel selbst und sieht dabei voellig plausibel aus.
- Loeschen wird selbst protokolliert, die Event-IDs zaehlen weiter: die Luecke bleibt sichtbar.
- Neue Karte in views/Admin.jsx (Filter, "Show more"), Aufbereitung in lib/audit.js
mit 20 Tests. GET /api/admin/audit und POST /api/admin/audit/clear, beide hinter requireAdmin.
Demo:
- Die Live-Demo laeuft wieder, jetzt auf der Projektseite selbst statt auf GitHub Pages:
opengym.duarte-santos.ch/demo/. Das eingebettete Telefon auf der Startseite geht damit auch
wieder — es muss derselbe Host sein, X-Frame-Options ist SAMEORIGIN.
Doku: README-Config-Tabelle, .env.example, SELF_HOSTING, SECURITY (inkl. der
api/server.js-Zeilenverweise, die wieder stimmen).
Das GitHub-Repo ist mit dem gesperrten Account weg, mit ihm die GHCR-Images, die
Pages-Demo und die Discussions. Alles, was jemand zum Selbsthosten anklickt, zeigte
aber weiter dorthin.
- docker-compose zieht jetzt gitea.com/duartesantos/opengym-{api,web}; die
Dockerfile-Labels (source/url/documentation) ebenso
- README, SECURITY, CONTRIBUTING und docs/SELF_HOSTING zeigen auf gitea.com.
Discussions gibt es dort nicht: Fragen und Ideen laufen als gelabelte Issues,
Security-Meldungen ueber eine Issue-Anfrage nach einem privaten Kanal statt
ueber GitHubs Advisories
- Badges auf die Gitea-Shields umgestellt, die tote Pages-Demo aus dem Kopf
genommen (die APK bleibt der Weg zum Ausprobieren)
- .gitea/workflows: Tests und Docker-Publish, weiter mit Release- statt
Tag-Trigger. Kein type=gha-Cache, den gibt es auf den Gitea-Runnern nicht;
der Push braucht ein Repo-Secret PACKAGES_TOKEN mit write:package
- .gitea/ISSUE_TEMPLATE mit denselben Formularen wie auf GitHub
- .github/* bleibt unangetastet, falls der Account zurueckkommt
Die alten Issue-/PR-Nummern im CHANGELOG bleiben als reiner Text stehen - sie
zeigen auf ein totes Repo und passen nicht auf die Nummerierung hier.
Two reported bugs, both small:
exercise media (#79): IMG_BASE/GIF_BASE were relative, so on /plan/r/:id --
the app's only two-segment route -- the browser resolved them against the
route and asked for /plan/r/img/..., which nginx's extension block 404s
instead of falling through to index.html. Blank images, nothing in the
console. Absolute defaults; the VITE_* overrides are absolute already, so
the Pages demo and the mobile build are unaffected.
import aliases (#74): Treadmill, Goblet Squat, Cycling and Cable Core
Pallof Press arrived as custom exercises because no word-overlap can reach
the catalogue's names for them. Added those plus the neighbours around
them, and a test file -- matchExercise had none.
Also documents that VITE_IMG_BASE/VITE_GIF_BASE are build-time, which is
why setting them next to docker compose does nothing on a prebuilt image.
Two gaps found by deploying the thing and then trying to use it.
The Coach had no entry point. Its three routes have existed since the UI
landed and nothing in the app linked to them — not the nav, not Home, not
Plan, not Settings. The hub's back button already pointed at /plan, so that is
where the link was always meant to be. On a configured instance the feature was
enabled, credentialed, running, and reachable only by typing the URL.
It sits behind the same coachAvailable() predicate every other Coach surface
uses, so an instance without the feature sees exactly the Plan screen it saw
before.
And there were no setup instructions anywhere. This document said the Coach is
"off until an admin turns it on" and then never said how to turn it on: ten
sections on what it does and why it is safe, nothing on the four steps that get
you from a running instance to a working Coach. .env.example has no Coach knobs
and SELF_HOSTING mentions it only in the backup caveat, so there was nowhere
else to look either.
The new section covers building the target that has a runtime in it, minting a
token with `claude setup-token`, connecting and testing it on the admin card,
and where a user starts. It also warns up front about the thing a multi-profile
instance discovers the hard way: in instance mode the credential binds to the
first profile that spends it and every other profile is refused by design, so
one person gets the Coach and the rest get a refusal.
api 72/72, frontend 404/404, build clean, 11 locales in sync.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Codex CLI adapter, its runtime and sandbox in the coach image only, and the
one placement decision this PR exists to get right.
Codex keeps a refreshable sign-in cache of its own rather than taking a token on
the environment, so it needs somewhere durable to write. That is ./coach-auth —
a sibling of ./data, never a folder inside it, mounted separately, owned by
`coach`, mode 0700.
The placement is the point. docs/SELF_HOSTING §5 tells owners to back up with
`tar czf … data/`, so anything under ./data lands in every archive people are
instructed to produce. Workout history belongs there; a live refresh token does
not — it keeps working after that archive is copied to a laptop or a cloud
drive. Keeping the cache outside ./data is what lets the backup instructions
stay true about what they capture, and §5 now says so explicitly rather than
leaving the reader to find out.
I got to define this rather than fix it: no Codex path was ever committed here,
so the nested layout the fork had never reached this repo. A test asserts the
sibling relationship directly, because "outside ./data" is the kind of invariant
a later refactor breaks by tidying.
bubblewrap and the Codex CLI are added in the coach target only — bubblewrap is
a Codex requirement, so an owner who never opted in carries neither. The image
job now asserts both directions: present and runnable in the coach image
(codex-cli 0.147.0, bubblewrap 0.11.2, /coach-auth as coach:0700), and absent
from the default one.
Codex is usable through the existing connect route with an API key, which needs
no new surface. Its ChatGPT device-code sign-in is not in this PR — see the PR
description for what that still needs.
api 73/73, frontend 404/404, both image targets built and inspected, 11 locales
in sync at 767, library in sync at 1324.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Agent SDK adapter, its dependency, and the packaging that keeps both out
of the image an owner gets when they never wanted the Coach.
api/Dockerfile builds two targets. The default one runs `npm ci --omit=optional`
and ships no AI runtime at all (~158 MB); `--target coach` drops that flag and
adds @anthropic-ai/claude-agent-sdk (~455 MB). The SDK's runtime ships as a
per-platform package, so on this Alpine base the lockfile resolves the musl
build — the kind of thing that only fails on somebody else's machine, which is
why the new api-image CI job builds *and runs* both targets rather than merely
building them.
Both targets now create the unprivileged `coach` user. That is not a Claude
detail: canDropPrivileges() fails closed, so without it every job is refused —
including the fixture provider that exists so the loop can be walked before an
account is connected. The shipped image could not run one.
The adapter imports the SDK lazily, so an absent runtime stays an ordinary
reportable state rather than a boot crash: check() says so, isConnected() goes
false, and /api/config carries no coach key.
Four SDK options are what make this safe next to ./data — tools: [] (no Read,
no Bash, no Grep), settingSources: [], skills: [], strictMcpConfig. They are
one frozen exported object, asserted by value, so re-enabling one is a red
build rather than a quiet capability grant.
Verified against the SDK's own type definitions rather than from memory. Two
things the fork's draft had wrong: SDKResultError carries no `errors` field, so
`message.errors?.join()` was dead code and the failure reason now comes from
`subtype` and `stop_reason`; and the client-app version string was hardcoded at
1.2.3 two releases after it stopped being true, so it is read from package.json.
The credential connect/disconnect routes land here as promised in 2/6 — they
serve a credential, and until this PR there was no provider that had one.
authMode and the per-profile pair still wait for the side that consumes them.
api 72/72 on macOS and on Linux as uid 65534 with the SDK absent; both image
targets built and run; library in sync at 1324.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PR 1 stopped at transport and held every answer as `unvalidated`. This closes
that seam.
validate.js is the gate: a closed list of eighteen change types with no default
case, every exercise id resolved against the real catalogue, every target
resolved against the plan it claims to be about, and a rationale required on
every change. A hostile note in someone's free text can talk a model into saying
anything at all; it cannot invent a change type. Its errors join the parse
failures on the same single repair round, so a model that named an exercise
nobody has is told which one — and a model that cannot be told is a failed job
rather than a retry loop.
frontend/src/lib/coach.js is the other half: snapshot, apply, revert, and the
staleness rules. Applying happens on the client because it is ordinary local
editing — offline, synced like everything else, reversible without the server
knowing. A change-set is all-or-nothing, and a change aimed at something the
user has since edited by hand is disabled with its reason rather than silently
overwriting them.
Two things the seam was hiding, both from PR 1:
hashPlan hashed the pre-1.2.4 field list while canonicalPlan had already learned
repsMax, bodyweight and side — so it computed all three and threw them away. A
rep ceiling raised by hand fingerprinted as an untouched plan, on exactly the
exercises where that ceiling is how progression works. Both runtimes now hash
what canonicalPlan reports, with a test per field.
`refine` reads pending.bundle, and pending only ever carried `unvalidated`, so
`previous` resolved to null every time: the model was asked to refine a plan it
had never been shown. It works now, and the fixture echoes whether the previous
bundle arrived so a test can tell the difference.
The validator also enforces the two rules prompts/common.md states and could
not guarantee: unilateral reps are a total across both sides and must be even,
and a rep ceiling may not sit below its own floor.
"Nothing to change" keeps the reading it came with, on the profile's own record
— deliberately not in the instance log, which stays counts and outcomes only.
api 65/65, frontend 403/403, build clean, locales in sync, library in sync at
1324 exercises. No new dependency.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
First of six. Everything here is transport and boundary: a job can run, its
answer can be parsed, and nothing yet judges whether that answer is safe to
act on. The validator and the apply path are the next PR, and the seam is
explicit — jobs.js carries an answer no further than `unvalidated`, and a
test pins that so the next PR has something to replace.
Whose account pays, settled first because it decides what the rest may be:
instance one account in coach.json, for the single-profile instance
profile one account per profile, in its own coach-auth-<uid>.json
In instance mode the credential binds to the first profile that spends it and
every other profile is refused — no job, not a dismissible warning. A warning
moves the decision onto whoever clicks past it and the decision is about
somebody's personal subscription. A profile credential is deliberately not a
field on state-<uid>.json: that blob syncs and travels in the user's export,
and a credential in a backup is the mistake we are avoiding, not repeating.
openGym does not interpret any provider's terms; it offers the shape that
does not need the interpretation and refuses the shape that does.
The privilege drop now fails closed. It only ever engaged when the server ran
as root, so adding a USER line to the Dockerfile for unrelated hardening would
have silently left the provider runtime on the server's uid. On Linux, no drop
means no job, and the admin card says so.
./data is no longer sealed with a blanket 0700. It is a host bind mount and
this container is root, so sealing it landed on the host as root-owned and
took the owner's own directory hostage — backup scripts, jq, the MCP server in
issue #19. The files that hold secrets carry 0600 themselves instead, which is
what the directory mode was standing in for; db.json gained an explicit mode
rather than inheriting umask once the blanket came off.
Bodyweight and per-side, folded in rather than deferred: v1.2.4 made `weight`
mean *added* load on a bodyweight exercise, so it is 0 on a good session and
every load-shaped signal reads flat. Uncorrected, the Coach would have looked
at a working push-up progression and proposed adding weight to a push-up. The
payload carries bodyweight/side/repsMax, the session reader carries set count,
and the prompts say reps then sets are the progression and per-side targets
step in twos. coach-parity.test.js pins the server's three copied reading
rules against the frontend's originals over a table of configs — modeOf was
never actually pinned, and it is the one that was predicted to drift.
No AI dependency lands here: api/ still installs @simplewebauthn/server and
web-push and nothing else. Jobs run against the in-repo fixture provider, so
CI needs no account, no network and no image build.
33 api tests, 361 frontend tests (169 of them parity), locales in sync.
v1.2.3 was tagged but never published, so everything since v1.2.2 -- the last
published release -- belongs in this one version rather than a new number.
CHANGELOG gets the three new sections, README a feature bullet, SELF_HOSTING a note
that the Wake Lock API wants HTTPS (or localhost) like passkeys do and that iOS
refuses it in Low Power Mode. Website: the APK line said v1.2.2 while the download is
1.2.3, and the feature grid gained the screen-awake card.
Consolidates everything since v1.2.1: the FitNotes/Strong/Hevy/Apple
Health importer, the Capacitor-based standalone mobile flavor, and the
store-free distribution story — signed Android APK from
opengym.duarte-santos.ch, docs corrected to match (no store listings;
iOS via self-hosted PWA or Xcode free signing).
A second flavor of openGym (VITE_MOBILE=1) that runs entirely on the
phone: no account, no server, no sync. State is mirrored into a file in
the app's private storage (survives WebView storage eviction), the
workout-day reminder is a native local notification scheduled on planned
weekdays, and backups export through the OS share sheet. Exercise media
loads from the same CDN as the demo build. npm run build:mobile, then
Android Studio / Xcode — see docs/MOBILE.md. NOTICE.md gains an AGPL §7
app-store exception.
Screenshots were still from the old design — all five regenerated from a
seeded three-month history.
The feature list had been behind since v1.1.0: push notifications and the
workout-day reminder were never listed, nor were custom exercises, the
equipment filter or the admin dashboard. ADMIN_UIDS and INVITE_ONLY were
documented in .env.example but missing from the README config table, and
docs/SELF_HOSTING.md still claimed there was no admin/invite system by
design — it now explains how to turn one on.
api/package.json version was lagging at 1.1.1; it tracks the release now.
React and @vitejs/plugin-react picked up their patch releases (lockfile
only, no manifest change); api dependencies were already current and both
trees audit clean.
GitHub Actions builds and pushes multi-arch (amd64/arm64) api/web
images to ghcr.io on every push to main and on version tags, so
self-hosters can 'docker compose pull' instead of building from
source. compose.yml keeps both image: and build: so building locally
still works via --build.
Web Push (VAPID) backend: keys auto-generated on first run, per-user
subscriptions, one new dependency (web-push). The rest timer schedules
a server-side push on start/extend and cancels it on skip or on-screen
completion, so it only actually fires if the tab got suspended before
finishing. A per-minute check sends an optional daily reminder on days
with a planned routine that hasn't been logged yet.
Opt in per-profile in Settings — requires a signed-in passkey profile.
Rebranding GymLog → openGym. Ein-Befehl-Self-Hosting via Docker Compose:
web (nginx serviert App + Proxy /api → api, ein Origin für Passkeys), api
(Node/WebAuthn), media-Service lädt Übungs-GIFs beim ersten Start automatisch.
Passkey-Domain über .env konfigurierbar (RP_ID/ORIGIN/WEB_PORT/RP_NAME),
Secure-Cookie nur bei HTTPS (http://localhost funktioniert). MIT-Lizenz,
README fürs Self-Hosting, docs/SELF_HOSTING.md, CONTRIBUTING.md.
Standalone-Stack Ende-zu-Ende getestet (Passkey-Register/-Login, Daten-Sync,
User-Isolation über den Proxy auf http://localhost).