Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
In-App-Update (!40) nachgeschaerft: Zeile nur mit APK-Asset, keine Installation ohne Pruefsumme, ein Release-Check pro App-Sitzung
Duarte Santos067302fd16c2
diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.jsindex bf42ef053..1e6dc9b19 100644--- a/frontend/src/lib/pt-br-locale.test.js+++ b/frontend/src/lib/pt-br-locale.test.js@@ -28,10 +28,10 @@ describe('Brazilian Portuguese locale', () => {const fingerprint = createHash('sha256').update(JSON.stringify(inherited)).digest('hex')expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(626)- expect(inherited).toHaveLength(612)+ expect(inherited).toHaveLength(613)// If this fails, review the changed keys and wording before accepting a new hash. From// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list- expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('d0483d2d3a56ac55054229234fe54481e2b5c539b5836bbdc9305230cb8dd475')+ expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('81d277306b3029090b7a2ba6cc19108ca207ea65d738487155123260b6e9525d')})test('does not leak European Portuguese UI terms', () => {diff --git a/frontend/src/lib/update.js b/frontend/src/lib/update.jsindex 7073e4f6c..49457456e 100644--- a/frontend/src/lib/update.js+++ b/frontend/src/lib/update.js@@ -33,7 +33,15 @@ function compareSemver(a, b) {* - apkUrl: direct download URL of the first .apk asset, or null* - hashUrl: direct download URL of the .apk.sha256 hash file, or null*/+// One request per app session: Settings is opened often, gitlab.com does not need to hear+// about it every time. The promise is cached, a failure is not.+let cached = null+export function resetUpdateCheck() { cached = null }export async function checkForUpdate() {+ if (!cached) cached = fetchLatest().catch(e => { cached = null; throw e })+ return cached+}+async function fetchLatest() {const res = await fetch(RELEASES_URL + '?per_page=1')if (!res.ok) throw new Error(`GitLab API ${res.status}`)const releases = await res.json()diff --git a/frontend/src/lib/update.test.js b/frontend/src/lib/update.test.jsindex 1103c6b68..df8f20147 100644--- a/frontend/src/lib/update.test.js+++ b/frontend/src/lib/update.test.js@@ -1,5 +1,5 @@import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'-import { checkForUpdate, sha256 } from './update.js'+import { checkForUpdate, sha256, resetUpdateCheck } from './update.js'// __APP_VERSION__ is defined at build time by vite.config.js (reads package.json).// In the test environment vitest applies the same define, so it's available here.@@ -28,7 +28,7 @@ describe('sha256', () => {describe('checkForUpdate', () => {let originalFetch- beforeEach(() => { originalFetch = globalThis.fetch })+ beforeEach(() => { originalFetch = globalThis.fetch; resetUpdateCheck() })afterEach(() => { globalThis.fetch = originalFetch })function mockFetch(body, status = 200) {@@ -231,7 +231,7 @@ describe('checkForUpdate', () => {describe('semver comparison (via checkForUpdate behavior)', () => {let originalFetch- beforeEach(() => { originalFetch = globalThis.fetch })+ beforeEach(() => { originalFetch = globalThis.fetch; resetUpdateCheck() })afterEach(() => { globalThis.fetch = originalFetch })function mockRelease(tag) {diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex 826417b5b..5b0e2ff54 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -1199,4 +1199,5 @@ export default {'Downloading update…': 'Update wird heruntergeladen…','{0} %': '{0} %','{0} MB': '{0} MB',+ 'Checksum not available — not installing': 'Prüfsumme nicht verfügbar — Installation abgebrochen',}diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex ef393e1c9..b933ef8a7 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -1180,4 +1180,5 @@ export default {'Downloading update…': 'Descargando actualización…','{0} %': '{0} %','{0} MB': '{0} MB',+ 'Checksum not available — not installing': 'Suma de verificación no disponible — no se instala',}diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex 133ff2fa7..4437662b9 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -1180,4 +1180,5 @@ export default {'Downloading update…': 'Téléchargement de la mise à jour…','{0} %': '{0} %','{0} MB': '{0} Mo',+ 'Checksum not available — not installing': 'Somme de contrôle indisponible — installation annulée',}diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex 8f1314a13..7b5bb0d56 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -1180,4 +1180,5 @@ export default {'Downloading update…': 'अपडेट डाउनलोड हो रहा है…','{0} %': '{0}%','{0} MB': '{0} MB',+ 'Checksum not available — not installing': 'चेकसम उपलब्ध नहीं — इंस्टॉल नहीं किया गया',}diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex 74b7bc557..b8a3d4672 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -1183,4 +1183,5 @@ export default {'Downloading update…': 'Frissítés letöltése…','{0} %': '{0} %','{0} MB': '{0} MB',+ 'Checksum not available — not installing': 'Ellenőrző összeg nem érhető el — nincs telepítés',}diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex 64174d0bf..bbd905719 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -1180,4 +1180,5 @@ export default {'Downloading update…': 'Download dell’aggiornamento…','{0} %': '{0} %','{0} MB': '{0} MB',+ 'Checksum not available — not installing': 'Checksum non disponibile — installazione annullata',}diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex 9d5281e9c..aba5bf209 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -1180,4 +1180,5 @@ export default {'Downloading update…': '업데이트 다운로드 중…','{0} %': '{0}%','{0} MB': '{0} MB',+ 'Checksum not available — not installing': '체크섬을 확인할 수 없어 설치하지 않습니다',}diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex 665045c36..544b6c4e8 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -1180,4 +1180,5 @@ export default {'Downloading update…': 'Pobieranie aktualizacji…','{0} %': '{0}%','{0} MB': '{0} MB',+ 'Checksum not available — not installing': 'Suma kontrolna niedostępna — instalacja przerwana',}diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex 7ceb526b2..f06f98666 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -1180,4 +1180,5 @@ export default {'Downloading update…': 'A transferir atualização…','{0} %': '{0} %','{0} MB': '{0} MB',+ 'Checksum not available — not installing': 'Soma de verificação indisponível — não instalado',}diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 15654351e..adcc62980 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -1180,4 +1180,5 @@ export default {'Downloading update…': 'Загрузка обновления…','{0} %': '{0} %','{0} MB': '{0} МБ',+ 'Checksum not available — not installing': 'Контрольная сумма недоступна — установка отменена',}diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex d4e31a32c..229a0241d 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -1191,4 +1191,5 @@ export default {'Downloading update…': 'กำลังดาวน์โหลดอัปเดต…','{0} %': '{0}%','{0} MB': '{0} MB',+ 'Checksum not available — not installing': 'ไม่มีค่าตรวจสอบ — ยกเลิกการติดตั้ง',}diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex 2154da360..d4d554b6d 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -1180,4 +1180,5 @@ export default {'Downloading update…': 'Güncelleme indiriliyor…','{0} %': '%{0}','{0} MB': '{0} MB',+ 'Checksum not available — not installing': 'Sağlama toplamı yok — yüklenmedi',}diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex d69ee45da..05108b7bb 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -1180,4 +1180,5 @@ export default {'Downloading update…': '正在下载更新…','{0} %': '{0}%','{0} MB': '{0} MB',+ 'Checksum not available — not installing': '校验和不可用,已取消安装',}diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex f96cc5c8b..f9e0bad84 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -74,14 +74,16 @@ export default function Settings() {return <DownloadProgress ref={fn => { setProgress = fn }} />}, { locked: true })try {- // Fetch the expected SHA-256 hash if available+ // The release always publishes the checksum next to the APK. Without it the file is+ // not installed — a sideloaded binary is exactly the thing that should be verified.let expectedHash = nullif (updateInfo.hashUrl) {try {const hashRes = await fetch(updateInfo.hashUrl)if (hashRes.ok) expectedHash = (await hashRes.text()).split(/\s/)[0]- } catch (e) { /* proceed without hash verification */ }+ } catch (e) { /* reported below */ }}+ if (!/^[0-9a-f]{64}$/i.test(expectedHash || '')) throw new Error(t('Checksum not available — not installing'))await downloadAndInstall(updateInfo.apkUrl, expectedHash, (received, total) => {if (setProgress) setProgress(received, total)})@@ -316,7 +318,7 @@ export default function Settings() {{/* ---------- data: fill it, bring things over, back it up, wipe it ---------- */}<Section title={t('Data')}>- {MOBILE && updateInfo?.hasUpdate && <Row icon="info" iconTint="var(--purple)" title={t('openGym v{0} available', updateInfo.latestVersion)}+ {MOBILE && updateInfo?.hasUpdate && updateInfo.apkUrl && <Row icon="info" iconTint="var(--purple)" title={t('openGym v{0} available', updateInfo.latestVersion)}accessory="chevron"onClick={onUpdateRowClick} />}<Row icon="sparkles" iconTint="var(--acc)" title={t('Load starter plan')} accessory="chevron" onClick={starterPlanSheet} />