Commit Graph
791 Commits
Author SHA1 Message Date
Duarte Santos 142b444c8f Merge remote-tracking branch 'mrq/14' into integrate2 2026-08-25 13:58:59 +02:00
Duarte Santos 39577f6f2e Merge remote-tracking branch 'mrq/18' into integrate2 2026-08-25 13:58:59 +02:00
andi242 9c4bc16967 add fields for gravl csv import 2026-08-25 13:21:44 +02:00
andi242 881fe4b2dc add date format parse and tests
parse and test YYYY/MM/DD format
add some different date formats to testing
2026-08-25 12:31:50 +02:00
JoseviandClaude Opus 5 f0c554e86d docs: SECURITY.md al dia con las protecciones nuevas
La afirmacion "CSRF protection is SameSite=Lax and nothing else" y la de que
nginx no pone ninguna cabecera ya no eran ciertas, y el parrafo de las IPs del
activity log describia un stack que se podia falsificar. Se anaden las garantias
del bloque push y se recalculan las referencias a lineas de api/server.js, que
habian quedado desplazadas.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 10:01:07 +02:00
JoseviandClaude Opus 5 ec3dc8ba69 web: cabeceras de proxy no falsificables, /api prioritario y cabeceras de seguridad
X-Forwarded-For se ponia con $proxy_add_x_forwarded_for, que APENDE lo que mande
el cliente, y el API lee la primera entrada — asi que cualquiera elegia la IP que
quedaba registrada contra el en el activity log. CF-Connecting-IP no la tocaba
nadie y es la que el API mira primero. Ahora se sobrescribe con $remote_addr y la
de Cloudflare se descarta salvo que pongas CF_CONNECTING_IP=$http_cf_connecting_ip,
que solo es correcto con Cloudflare de verdad delante. .env.example afirmaba que el
stack venia correcto de fabrica; no era cierto.

location /api/ pasa a ^~ para que gane a los location con regex: sin eso una ruta
como /api/algo.json la atraparia el bloque \.(js|css|json|html)$ y se buscaria en
disco en vez de proxearse. Hoy no rompe nada, manana si.

Y cuatro cabeceras de seguridad, repetidas en los dos location con regex porque
add_header dentro de un location reemplaza los heredados en vez de sumarse. Sin
HSTS ni CSP completa a proposito: eso sigue siendo del reverse proxy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 10:01:07 +02:00
JoseviandClaude Opus 5 e326f1b1cb api: cierra SSRF en push, CSRF por subdominio hermano y shadowing de cookie
Cuatro problemas encontrados en una revision de seguridad, los cuatro reproducidos
antes y despues del arreglo.

SSRF + cuelgue del handler. El `endpoint` de una suscripcion push se validaba solo
como "string no vacio", y web-push lo pasa tal cual a https.request: cualquier
usuario registrado alcanzaba cualquier host:puerto que viera el contenedor api,
que comparte red Docker con el resto del stack. Ademas no habia timeout, asi que
un endpoint que aceptaba TCP y se callaba dejaba colgado el handler que hacia
await (>2 min medidos). Ahora el rechazo de direcciones loopback/privadas/
link-local/CGNAT vive en el lookup del propio agente, no en una pasada previa, asi
que no queda ventana de DNS rebinding; y los envios llevan timeout de 10s.

Amplificacion. No habia tope de suscripciones por usuario y sendPush lanzaba un
Promise.all sin limite: una peticion de ~90 bytes producia 200 conexiones TLS
simultaneas al host que eligiera el atacante. Cap de 20 por cuenta y 6 en vuelo.

CSRF. SameSite=Lax deja fuera un origen cross-site pero no un subdominio hermano,
que es el mismo site y es el reparto habitual en self-hosting; y el body se
parseaba como JSON dijera lo que dijera el Content-Type, asi que bastaba un POST
simple sin preflight. Ahora una peticion que cambia estado tiene que ser
Sec-Fetch-Site: same-origin, o traer un Origin igual a ORIGIN donde esa cabecera
no llegue. Exentas las rutas que llevan su credencial en el body y todo lo
autenticado por Bearer, para no romper la app movil.

Fijacion de sesion. Las cookies se reducian con Object.fromEntries, que se queda
con la ultima repetida: un subdominio hermano podia plantar gymsid para el dominio
padre y quedarse con la sesion. En HTTPS la cookie pasa a __Host-gymsid, que el
navegador garantiza host-only; la legacy se sigue aceptando, asi que actualizar no
desloguea a nadie. Un nombre repetido con valores distintos se rechaza entero.

El proxy de Vite reescribe Origin porque el dev server vive en otro puerto.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 10:01:07 +02:00
JoseviandClaude Sonnet 5 781e2441ba mobile: modo "conectar a mi servidor" (emparejamiento por codigo, sin passkeys)
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>
2026-08-25 07:59:12 +02:00
Josevi ec84f6db06 i18n: completa las 10 traducciones que faltaban en todos los idiomas
check-locales.mjs exige el mismo set de claves en las 11 locales; las
cadenas de drop-set/rest-pause (commit 02ea938) y las de tema
"Sistema"/auto-backup solo estaban en es.js, lo que rompia el job
test:frontend en CI y bloqueaba build:apk (dependia de el).
2026-08-24 21:17:47 +02:00
Josevi 7261403d2d settings: opcion de tema "Sistema" que sigue el prefers-color-scheme del OS
Ademas de Oscuro/Claro fijos, ahora se puede elegir que el tema siga la
preferencia del sistema operativo/navegador, con actualizacion en vivo si
esta cambia mientras la app esta abierta (sin necesitar recargar).
2026-08-24 21:04:42 +02:00
Josevi 50194442b6 mobile: opcion de auto-backup local al terminar entreno o editar rutina
En el build movil (Capacitor) los datos solo viven en el dispositivo, sin
backend. Ademas del export/import manual ya existente, se agrega un toggle
en Settings que escribe una copia fechada en la carpeta Documents (visible
en Files/gestor de archivos) tras terminar un entrenamiento o salir del
editor de rutinas, para que una app de sincronizacion externa (o una copia
manual) siempre tenga algo reciente que llevarse.
2026-08-24 20:54:28 +02:00
JoseviandClaude Sonnet 5 02ea938b2c Add planned drop-sets and rest-pause/myo-reps intensifiers
An exercise's set config can now plan a drop-set (N drops, weight
decrement % per drop) or rest-pause (a total rep count split into
descending, roughly-halving bursts) via a new "Intensifier" picker in
the routine editor / exercise config sheet. The guided workout screen
pre-fills the resulting rows already computed and editable, no live
sheet or timer required; a plain set can still grow a drop/burst on
the spot too.

Rest-pause collapses the exercise to exactly two sets (a warm-up at
its own reps, then one rest-pause work set whose own reps ARE the
configured total) rather than repeating the full protocol per set.

Volume, fatigue tonnage, 1RM estimation and progression all continue
to read a set row's own w/r directly, so most of the app needed no
changes; the few that sum across a row's extras (workoutVolume,
setTonnage, applyPrescription's set-growth path) got small, targeted
fixes to avoid double-counting. Full design writeup in
PROJECT_CONTEXT.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-24 20:36:25 +02:00
Horus Gonzalez 79206950c4 Add the note placeholder string to the remaining 10 locales
check-locales.mjs requires every locale to carry the same key set —
the previous commit only added the string to es.js. Machine-translated
for de/fr/it/pl/pt/ru/tr/zh/ko/hi; happy to have a native speaker
refine any of these on review.
2026-08-24 11:47:22 -06:00
Horus Gonzalez f52decf633 Add optional per-exercise notes
An exercise instance in a routine only carried sets/reps/weight — a flat
target with no room for loading instructions that vary within a session
(e.g. a pyramid: "bar only, then +1 plate/side each set"). Adds a small
free-text `note` field alongside the existing config flags, shown in the
routine editor, during the active workout, and round-tripped through the
plan share/print/import paths.

No schema migration: it's an optional string on the same object that
already carries `sg`/`bodyweight`/`side`.
2026-08-24 11:40:35 -06:00
wagenheimer 4df4406139 feat(exercises): add multi-token, accent-insensitive and multilingual exercise search 2026-08-24 14:32:00 -03:00
andi242 740b2e7df5 rewrite 2026-08-24 18:30:31 +02:00
andi242 e6261e7b7b reword clunky sentence/hint to editing in demo 2026-08-24 18:27:24 +02:00
andi242 7e1c0ae023 wording 2026-08-24 18:17:08 +02:00
mzspicoli 3e531e72e1 fix: allow passkeys in Chrome on iOS 2026-08-24 18:03:10 +02:00
mzspicoli 032fe1a348 fix(push): localize server notifications in pt-BR 2026-08-24 18:02:35 +02:00
mzspicoli 448c66752f feat(i18n): localize pt-BR exercise names 2026-08-24 18:02:29 +02:00
mzspicoli dc3fafc6ef fix(i18n): correct reviewed pt-BR instructions 2026-08-24 18:02:11 +02:00
mzspicoli 3d3e44c973 feat(i18n): complete Brazilian Portuguese instructions 2026-08-24 18:02:11 +02:00
JoseviandClaude Sonnet 5 41061c1754 Claude Code: Projektdoku (CLAUDE.md) und Skills fuer Tests, A11y, Vite und Changelog installiert
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-24 18:02:04 +02:00
mzspicoli cf7b3496a5 fix(i18n): keep translation tooling portable 2026-08-24 18:01:54 +02:00
mzspicoli ad69235f6e feat(i18n): complete pt-BR core instructions 2026-08-24 18:01:54 +02:00
mzspicoli c667539f10 feat(i18n): translate first pt-BR core batch 2026-08-24 18:01:54 +02:00
mzspicoli 600f7ff0e6 test(i18n): allow pt-BR instruction batches to grow 2026-08-24 18:01:54 +02:00
mzspicoli 052ef7e0ba fix(i18n): document and validate pt-BR instructions 2026-08-24 18:01:54 +02:00
mzspicoli 9b72fb7f1e feat(i18n): start Brazilian Portuguese instructions 2026-08-24 18:01:36 +02:00
mzspicoli 03f8abb46b fix(i18n): address final pt-BR UI review 2026-08-24 18:01:31 +02:00
mzspicoli 4081ddac06 fix(i18n): close pt-BR review gaps 2026-08-24 18:01:31 +02:00
mzspicoli 9f913055d7 fix(i18n): harden Brazilian Portuguese locale 2026-08-24 18:01:31 +02:00
mzspicoli 00ba71d4df feat(i18n): add Brazilian Portuguese UI 2026-08-24 18:01:31 +02:00
andi242 e4995bbe5e wording, line breaks 2026-08-24 18:00:38 +02:00
andi242 7b5ea14d4e update rm 2026-08-24 17:51:53 +02:00
andi242 23632a07ee add doc to describe data imports 2026-08-24 17:06:40 +02:00
Space_Hermes 64ea41a5df fix(stats): remove duplicate muscle exercise list 2026-08-23 22:23:12 +02:00
Aaron Sachs d46b9215a3 feat: persisted equipment profiles (Home/Gym/etc)
Builds on the existing session-only equipment filter (issue #6) by adding a
persisted "what I actually own" profile, so the Library and exercise picker
can default to what's usable at Home vs. at the Gym instead of the full
catalogue every time.

- New equipProfiles / activeEquipId / equipFilterOn on synced state (S)
- lib/equipment.js: ALL_EQUIPMENT catalogue, activeProfile(), exAvailable() —
  body weight is always available regardless of profile
- Settings: create/edit/delete profiles (name + equipment checklist), pick
  the active one, toggle filtering on/off
- Library + exercise picker: filter to the active profile by default, with a
  one-tap "show all equipment" escape hatch per session
- RoutineEdit: flags any saved exercise that needs equipment outside the
  active profile (inline warning icon + a summary banner), so you find out
  before showing up at the wrong location, not mid-workout

Purely additive to synced client state — no server/API changes, no new
dependencies. All 339 previously-passing tests still pass (the 7 failures in
Workout.remove.test.jsx are pre-existing on a clean checkout too — a Node
localStorage/vitest environment issue unrelated to this change).
2026-08-23 16:22:34 -04:00
Space_Hermes c8f4d5bd18 feat: extract exercise catalogue and logging 2026-08-23 22:11:49 +02:00
Duarte Santos f8024d344d website: Download auf v1.2.9, jetzt die aus der CI
Erste APK, die nicht von Hand gebaut wurde. Zertifikats-Fingerprint gegen den
alten 1.2.8-Build und den Keystore geprueft - identisch, Updates installieren
sich also ueber bestehende Installationen.
2026-08-23 22:03:23 +02:00
Duarte Santos cc036406dc website: die Issue-Zahl kam anonym als undefined zurueck
Die GitLab-Projekt-API liefert einem nicht eingeloggten Aufrufer nur star_count
und forks_count - open_issues_count gibt es dort nur mit Session. site.js hat es
trotzdem gelesen und damit "undefined" in die Kachel geschrieben.

Die Zahl steht stattdessen im X-Total-Header des Issues-Endpunkts, und GitLab
fuehrt den in Access-Control-Expose-Headers, der Browser darf ihn also lesen.
Schlaegt der Aufruf fehl, bleibt der Platzhalter stehen statt einer leeren
Kachel.
v1.2.9
2026-08-23 21:36:04 +02:00
Duarte Santos 02b02de1b2 CI: PUBLISH_LATEST auch aus per API gestarteten Pipelines
Die Regel pruefte nur auf source == web. Ueber die API gestartet ist die Quelle
"api", der Job lief dann nur zufaellig mit - naemlich ueber die
Default-Branch-Regel, waehrend das Script die Variable trotzdem sah.
2026-08-23 21:31:31 +02:00
Duarte Santos ba7ad8423f CI: latest auch ohne Release veroeffentlichen koennen (PUBLISH_LATEST)
Die docker-compose.yml im Repo zeigt auf :latest, aber latest entsteht nur aus
einem v*-Tag - bis zum ersten GitLab-Release laeuft ein `docker compose pull`
also ins Leere. Das war ein Fehler im Umzug.

Eine von Hand gestartete Pipeline mit PUBLISH_LATEST=1 baut jetzt genau wie ein
Tag: multi-arch, latest, X.Y und X.Y.Z, Version aus frontend/package.json. Der
Weg wird ohnehin gebraucht, sobald ein Basis-Image eine CVE fixt und latest
nachziehen muss, ohne dass sich am Code etwas geaendert hat.
2026-08-23 21:28:28 +02:00
Duarte Santos 24b61c2411 Den signierten APK auf GitLab legen und von README und MOBILE.md verlinken
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.
2026-08-23 21:08:54 +02:00
Duarte Santos dc765083fe Buy-Me-a-Coffee-Badge oben, und den toten Sponsor-Verweis ersetzen
Der grosse gelbe Button stand schon unten in der README, aber der Satz darueber
schickte Leute zum "Sponsor button at the top of the page" - das war GitHubs
FUNDING.yml-Knopf, den es auf GitLab nicht gibt. Stattdessen jetzt ein Badge in
der Kopfzeile neben dem Discord-Badge, und der Satz zeigt dorthin.
2026-08-23 20:50:06 +02:00
Duarte Santos 2b3ffad314 Discord ueberall dort verlinken, wo Leute nach Hilfe suchen
Der Server war nur auf der Website verlinkt - im Repo selbst nirgends, obwohl
dort inzwischen das meiste passiert. Jetzt: Badge und eigener Punkt im
Community-Abschnitt der README, erste Zeile der Tabelle in CONTRIBUTING, und ein
Hinweis in der Frage-Vorlage.

Mit der Trennung, die der Sache entspricht: Discord fuer die schnelle Frage,
Issue fuer alles, was der Naechste ueber die Suche finden koennen soll - und
Exploits gehoeren in keines von beiden, sondern in ein vertrauliches Issue.

Statischer Badge, kein Live-Zaehler: das Server-Widget ist aus, shields.io wuerde
sonst "widget disabled" anzeigen.
2026-08-23 20:47:21 +02:00
Duarte Santos d1c2247e82 CI: auf einem Release-Tag ohne Signing-Key abbrechen
Ein Release darf keinen APK ausliefern, den niemand installieren kann. Fehlt auf
einem v*-Tag ANDROID_KEYSTORE_B64, ist an den geschuetzten Variablen etwas kaputt
- dann soll der Job scheitern statt still eine unsignierte Datei zu bauen.
2026-08-23 20:25:12 +02:00
Duarte Santos d2035e0562 CI: Renovate als Dependabot-Ersatz, geplante Pipelines bauen nichts mit
GitLab hat kein Dependabot, also laeuft Renovate als Job - aber nur in einer
*geplanten* Pipeline (monatlich, 1. um 04:00), damit es nie mit einem Push um
Runner-Minuten konkurriert. renovate.json uebernimmt die Politik aus
.github/dependabot.yml eins zu eins: monatlich, pro Oekosystem gruppiert, Majors
einzeln, ungerade Node-Majors raus, android/ und ios/ folgen den @capacitor/*-
Paketen statt eigene Bumps zu bekommen.

Damit die geplante Pipeline nicht nebenbei die Suite laufen laesst und die
edge-Images neu schiebt, haben test, build, apk und pages jetzt eine
"schedule -> never"-Regel.
2026-08-23 20:21:56 +02:00
Duarte Santos f38036fab6 CI: SHA256 zum APK veroeffentlichen, Pages-URL richtigstellen
Ein per Sideload installierter APK ist von niemandem geprueft worden, also soll
die Pruefsumme daneben liegen statt gar nicht zu existieren: das Release haengt
jetzt openGym-<ver>.apk.sha256 mit an.

Pages laeuft unter GitLabs "unique domain" (opengym-bc111a.gitlab.io);
duartesantos8.gitlab.io/opengym/ leitet mit 308 dorthin um.
2026-08-23 20:18:02 +02:00