Skip to content

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.

Pairing: a login page or proxy rule answering in openGym's place is named as such, and http:// in the app says it needs https:// (#329)

Duarte Santosc284c9bd3f27
diff --git a/frontend/src/lib/api.js b/frontend/src/lib/api.js
index b1d443312..bb38a4a3c 100644
--- a/frontend/src/lib/api.js
+++ b/frontend/src/lib/api.js
@@ -220,7 +220,12 @@ const PROBE_MS = 5000
const hostOfBase = base => {
try { const u = new URL(base); return u.host + u.pathname.replace(/\/$/, '') } catch { return base || '' }
}
-async function healthIsNotOpenGym(base, ms) {
+// What /api/health says when it can be read (the app's native fetch reads it past CORS):
+// 'opengym', 'front' when something in front of openGym answered in its place (a redirect, a
+// 401/403 or an HTML page: an SSO login, forward-auth, a proxy rule), 'other' for an answer that
+// is just not openGym's (another app's JSON, a proxy's plain "404 page not found"), and null
+// when nothing readable came back.
+async function healthAnswer(base, ms) {
const ctl = typeof AbortController === 'function' ? new AbortController() : null
let timer = null
try {
@@ -228,11 +233,16 @@ async function healthIsNotOpenGym(base, ms) {
nativeFetch(base + '/api/health', { method: 'GET', headers: { Accept: 'application/json' }, ...(ctl ? { signal: ctl.signal } : {}) }),
new Promise((_, reject) => { timer = setTimeout(() => { if (ctl) ctl.abort(); reject(new Error('timeout')) }, ms) }),
])
+ const text = await res.text()
let body = null
- try { body = JSON.parse(await res.text()) } catch { body = null }
- return !(res.ok && body && typeof body === 'object' && body.ok === true)
+ try { body = JSON.parse(text) } catch { body = null }
+ if (res.ok && body && typeof body === 'object' && body.ok === true) return 'opengym'
+ const type = (res.headers && typeof res.headers.get === 'function' && res.headers.get('content-type')) || ''
+ const html = /html/i.test(type) || /^\s*</.test(text || '')
+ if ((res.status >= 300 && res.status < 400) || res.status === 401 || res.status === 403 || res.status === 407 || html) return 'front'
+ return 'other'
} catch {
- return false
+ return null
} finally { clearTimeout(timer) }
}
async function whyUnreachable(base, ms) {
@@ -248,9 +258,14 @@ async function whyUnreachable(base, ms) {
} catch { /* not reachable either */ }
finally { clearTimeout(timer) }
// Something answered. Whether it is openGym needs a readable answer: in the app the native
- // fetch reads /api/health past CORS. A page that is not openGym's health JSON means a wrong
- // address, not a proxy (#329). No readable answer at all leaves the CORS explanation.
- if (reached && (await healthIsNotOpenGym(base, ms))) {
+ // fetch reads /api/health past CORS. A login page or a proxy rule answering in openGym's place
+ // is not a wrong address, and a page that is simply not openGym's is (#329). No readable
+ // answer at all leaves the CORS explanation.
+ const answer = reached ? await healthAnswer(base, ms) : null
+ if (answer === 'front') {
+ return failure(t('That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.'), 'proxy-answered')
+ }
+ if (answer === 'other') {
return failure(t('That address answers, but it isn’t an openGym server. Check the URL.'), 'not-opengym')
}
if (reached) {
@@ -260,6 +275,19 @@ async function whyUnreachable(base, ms) {
return failure(t('Could not reach {0}. Check the address and that this phone can reach it.', hostOfBase(base)), 'unreachable')
}
+// The app's WebView is an https:// page with mixed content off, so a plain http:// server is
+// refused before a single byte goes out, and the probes above would only say "could not reach".
+// localhost counts as secure and is let through.
+async function blockedAsMixedContent(base) {
+ let u
+ try { u = new URL(base) } catch { return false }
+ if (u.protocol !== 'http:' || /^(localhost|127\.\d+\.\d+\.\d+|\[::1\])$/i.test(u.hostname)) return false
+ try {
+ const cap = await import('@capacitor/core')
+ return !!(cap && cap.Capacitor && cap.Capacitor.isNativePlatform())
+ } catch { return false }
+}
+
// Bootstraps the connection itself: the base isn't configured yet (that's what this call decides),
// so it talks straight to the server the user typed in, no Authorization header.
export async function pairRedeem(serverBase, code, { probeMs = PROBE_MS } = {}) {
@@ -271,6 +299,9 @@ export async function pairRedeem(serverBase, code, { probeMs = PROBE_MS } = {})
} catch (e) {
// The server answered (any status) or did not answer in time: that error says it already.
if (e && (e.status != null || e.code)) throw e
+ if (await blockedAsMixedContent(serverBase)) {
+ throw failure(t('The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.'), 'insecure')
+ }
throw await whyUnreachable(serverBase, probeMs)
}
// Anything that is not a pairing would be saved as one — and the phone would then send every
diff --git a/frontend/src/lib/api.pair-insecure.test.js b/frontend/src/lib/api.pair-insecure.test.js
new file mode 100644
index 000000000..16bdf9a46
--- /dev/null
+++ b/frontend/src/lib/api.pair-insecure.test.js
@@ -0,0 +1,53 @@
+// @vitest-environment happy-dom
+// #329: the app's WebView is an https:// page with mixed content off, so pairing with a plain
+// http:// address is refused before anything is sent. "Could not reach" sent people looking for
+// a network problem; the message says it is the http:// instead.
+import { afterEach, describe, expect, it, vi } from 'vitest'
+
+const h = vi.hoisted(() => ({ native: true }))
+vi.mock('@capacitor/core', () => ({
+ Capacitor: { getPlatform: () => (h.native ? 'android' : 'web'), isNativePlatform: () => h.native },
+ CapacitorHttp: { request: () => Promise.reject(new Error('mixed content')) },
+ registerPlugin: () => ({}),
+}))
+
+const { pairRedeem } = await import('./api.js')
+
+afterEach(() => { vi.unstubAllGlobals(); h.native = true })
+const failed = () => Promise.reject(new TypeError('Failed to fetch'))
+const MSG = 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.'
+
+describe('pairRedeem from the phone app with an http:// address', () => {
+ it('says the app needs https://, without probing', async () => {
+ const fetch = vi.fn(failed)
+ vi.stubGlobal('fetch', fetch)
+ const e = await pairRedeem('http://192.168.1.20:8080', 'ABCD2345').catch(x => x)
+ expect(e.code).toBe('insecure')
+ expect(e.message).toBe(MSG)
+ expect(fetch).toHaveBeenCalledTimes(1)
+ })
+
+ it('an https:// address that fails is still probed as before', async () => {
+ vi.stubGlobal('fetch', vi.fn(failed))
+ const e = await pairRedeem('https://gym.example.com', 'ABCD2345', { probeMs: 20 }).catch(x => x)
+ expect(e.code).toBe('unreachable')
+ })
+
+ it('http://localhost counts as secure and is not blamed', async () => {
+ vi.stubGlobal('fetch', vi.fn(failed))
+ const e = await pairRedeem('http://localhost:8080', 'ABCD2345', { probeMs: 20 }).catch(x => x)
+ expect(e.code).toBe('unreachable')
+ })
+
+ it('a server that answers over http:// is passed on as it is', async () => {
+ vi.stubGlobal('fetch', vi.fn(async () => new Response(JSON.stringify({ error: 'invalid or expired code' }), { status: 400, headers: { 'content-type': 'application/json' } })))
+ await expect(pairRedeem('http://192.168.1.20:8080', 'ABCD2345')).rejects.toMatchObject({ status: 400 })
+ })
+
+ it('off the native app the http:// case is not claimed', async () => {
+ h.native = false
+ vi.stubGlobal('fetch', vi.fn(failed))
+ const e = await pairRedeem('http://192.168.1.20:8080', 'ABCD2345', { probeMs: 20 }).catch(x => x)
+ expect(e.code).toBe('unreachable')
+ })
+})
diff --git a/frontend/src/lib/api.pair-probe.test.js b/frontend/src/lib/api.pair-probe.test.js
index 455937248..5fb46d08b 100644
--- a/frontend/src/lib/api.pair-probe.test.js
+++ b/frontend/src/lib/api.pair-probe.test.js
@@ -34,11 +34,28 @@ describe('pairRedeem when the request never gets an answer', () => {
expect(e.code).toBe('cors')
})
- // A static site, another app, a router page: it answers, but /api/health is not openGym's.
+ // Something in front of openGym answered in its place: an SSO login (forward-auth), a proxy
+ // rule, a redirect to a sign-in page. The address is right, the proxy needs to let /api/ through.
+ const PROXY_MSG = 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.'
+ it.each([
+ ['a redirect to a login page', () => new Response(null, { status: 302, headers: { location: 'https://auth.example.com/login' } })],
+ ['a 401', () => new Response('', { status: 401, headers: { 'www-authenticate': 'Basic realm="x"' } })],
+ ['a 403 from a proxy rule', () => new Response('Forbidden', { status: 403, headers: { 'content-type': 'text/plain' } })],
+ ['a login page (HTML, 200)', () => new Response('<!doctype html><title>Sign in</title>', { status: 200, headers: { 'content-type': 'text/html' } })],
+ ['an HTML page with no content type', () => new Response(' <html><body>Authelia</body></html>', { status: 200 })],
+ ['an HTML 404 page', () => new Response('<h1>not found</h1>', { status: 404, headers: { 'content-type': 'text/html' } })],
+ ])('a server that answers with %s: says something in front of openGym answered', async (_, page) => {
+ vi.stubGlobal('fetch', vi.fn((url, init) => (url.endsWith('/api/pair/redeem') ? failed() : init && init.mode === 'no-cors' ? opaque() : Promise.resolve(page()))))
+ const e = await pairRedeem('https://gym.example.com', 'ABCD2345').catch(x => x)
+ expect(e.code).toBe('proxy-answered')
+ expect(e.message).toBe(PROXY_MSG)
+ })
+
+ // Another app, a proxy's own "404 page not found": it answers, but it is not openGym at all.
it.each([
- ['a 404 page', () => new Response('<h1>not found</h1>', { status: 404, headers: { 'content-type': 'text/html' } })],
- ['an HTML page', () => new Response('<h1>static</h1>', { status: 200, headers: { 'content-type': 'text/html' } })],
['another app\'s JSON', () => new Response(JSON.stringify({ status: 'UP' }), { status: 200, headers: { 'content-type': 'application/json' } })],
+ ['a plain-text 404 from a proxy with no route', () => new Response('404 page not found\n', { status: 404, headers: { 'content-type': 'text/plain' } })],
+ ['JSON that is not openGym\'s health', () => new Response(JSON.stringify({ ok: false }), { status: 200, headers: { 'content-type': 'application/json' } })],
])('a server that answers with %s: says it is not an openGym server', async (_, page) => {
vi.stubGlobal('fetch', vi.fn((url, init) => (url.endsWith('/api/pair/redeem') ? failed() : init && init.mode === 'no-cors' ? opaque() : Promise.resolve(page()))))
const e = await pairRedeem('https://gym.example.com', 'ABCD2345').catch(x => x)
@@ -46,6 +63,12 @@ describe('pairRedeem when the request never gets an answer', () => {
expect(e.message).toBe('That address answers, but it isn’t an openGym server. Check the URL.')
})
+ it('in a browser an http:// address is not the phone\'s mixed-content case: still probed', async () => {
+ vi.stubGlobal('fetch', vi.fn(failed))
+ const e = await pairRedeem('http://gym.example.com', 'ABCD2345').catch(x => x)
+ expect(e.code).toBe('unreachable')
+ })
+
it('server not reachable at all: says so, with the address', async () => {
vi.stubGlobal('fetch', vi.fn(failed))
const e = await pairRedeem('https://gym.example.com/sub/', 'ABCD2345').catch(x => x)
diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.js
index 2f31815c1..df2ba7243 100644
--- a/frontend/src/locales/ar.js
+++ b/frontend/src/locales/ar.js
@@ -1845,6 +1845,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'الأعذار لا ترفع الأوزان. احضر غدًا إلى {0}!',
'Your muscles filed a missing-person report. Show up for {0}!': 'عضلاتك أبلغت عن فقدانك. احضر إلى {0}!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'هذا العنوان يستجيب، لكنه ليس خادم openGym. تحقّق من الرابط.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'هذا العنوان يستجيب، لكن صفحة تسجيل دخول أو قاعدة في البروكسي ردّت بدلًا من openGym. اترك /api/ يصل إلى openGym دون تغيير. راجع “Phone app and CORS” في docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'لا يمكن للتطبيق الاقتران إلا بعنوان https://. هاتفك يحظر http:// العادي قبل إرسال أي شيء.',
'Switch sides': 'بدّل الجهة',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'يحفظ نسخة مؤرّخة في «{0}» بعد إنهاء تمرين أو تعديل روتين، ويحتفظ بأحدث {1}.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'يحفظ نسخة مؤرّخة في المجلد الذي اخترته بعد إنهاء تمرين أو تعديل روتين، ويحتفظ بأحدث {0}.',
diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js
index cb0ae287b..ecb0fa742 100644
--- a/frontend/src/locales/de.js
+++ b/frontend/src/locales/de.js
@@ -1812,6 +1812,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'Ausreden stemmen keine Gewichte. Morgen trittst du zu {0} an!',
'Your muscles filed a missing-person report. Show up for {0}!': 'Deine Muskeln haben eine Vermisstenanzeige aufgegeben. Antreten zu {0}!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'Unter dieser Adresse antwortet etwas, aber kein openGym-Server. Prüf die URL.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'Unter dieser Adresse antwortet etwas, aber eine Login-Seite oder Proxy-Regel statt openGym. Lass /api/ unverändert zu openGym durch. Siehe “Phone app and CORS” in docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'Die App kann sich nur mit einer https://-Adresse verbinden. Dein Handy blockiert einfaches http://, bevor überhaupt etwas gesendet wird.',
'Switch sides': 'Seite wechseln',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Speichert nach jedem beendeten Training oder jeder bearbeiteten Routine eine datierte Kopie in „{0}“ und behält die neuesten {1}.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Speichert nach jedem beendeten Training oder jeder bearbeiteten Routine eine datierte Kopie im gewählten Ordner und behält die neuesten {0}.',
diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js
index e07d0ae72..57d0e7b88 100644
--- a/frontend/src/locales/es.js
+++ b/frontend/src/locales/es.js
@@ -1792,6 +1792,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'Las excusas no levantan pesas. ¡Mañana te presentas a {0}!',
'Your muscles filed a missing-person report. Show up for {0}!': 'Tus músculos pusieron una denuncia por desaparición. ¡Preséntate a {0}!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'Esa dirección responde, pero no es un servidor de openGym. Revisa la URL.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'Esa dirección responde, pero contestó una página de inicio de sesión o una regla del proxy en lugar de openGym. Deja pasar /api/ a openGym sin cambios. Mira “Phone app and CORS” en docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'La app solo puede vincularse con una dirección https://. Tu móvil bloquea http:// a secas antes de enviar nada.',
'Switch sides': 'Cambia de lado',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Guarda una copia con fecha en «{0}» al terminar un entreno o editar una rutina, y conserva las {1} más recientes.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Guarda una copia con fecha en la carpeta que elegiste al terminar un entreno o editar una rutina, y conserva las {0} más recientes.',
diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js
index 2e4313e87..e5ea0f378 100644
--- a/frontend/src/locales/fr.js
+++ b/frontend/src/locales/fr.js
@@ -1792,6 +1792,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'Les excuses ne soulèvent pas de poids. Présentez-vous demain pour {0} !',
'Your muscles filed a missing-person report. Show up for {0}!': 'Vos muscles ont signalé votre disparition. Présentez-vous pour {0} !',
'That address answers, but it isn’t an openGym server. Check the URL.': 'Cette adresse répond, mais ce n’est pas un serveur openGym. Vérifie l’URL.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'Cette adresse répond, mais c’est une page de connexion ou une règle du proxy qui a répondu à la place d’openGym. Laisse passer /api/ vers openGym sans modification. Voir “Phone app and CORS” dans docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'L’app ne peut s’associer qu’à une adresse https://. Ton téléphone bloque le simple http:// avant même que quoi que ce soit parte.',
'Switch sides': 'Change de côté',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Enregistre une copie datée dans « {0} » après chaque séance terminée ou routine modifiée, et garde les {1} plus récentes.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Enregistre une copie datée dans le dossier choisi après chaque séance terminée ou routine modifiée, et garde les {0} plus récentes.',
diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js
index be286da49..48b17856c 100644
--- a/frontend/src/locales/hi.js
+++ b/frontend/src/locales/hi.js
@@ -1792,6 +1792,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'बहाने वज़न नहीं उठाते। कल {0} के लिए हाज़िर हो!',
'Your muscles filed a missing-person report. Show up for {0}!': 'आपकी मांसपेशियों ने गुमशुदगी की रिपोर्ट लिखाई है। {0} के लिए हाज़िर हो!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'यह पता जवाब देता है, लेकिन यह openGym सर्वर नहीं है। URL जाँचें।',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'यह पता जवाब देता है, लेकिन openGym की जगह किसी लॉगिन पेज या प्रॉक्सी नियम ने जवाब दिया। /api/ को बिना बदलाव openGym तक जाने दें। docs/SELF_HOSTING.md में “Phone app and CORS” देखें।',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'ऐप सिर्फ़ https:// पते से ही जुड़ सकता है। आपका फ़ोन सादे http:// को कुछ भी भेजे जाने से पहले ही रोक देता है।',
'Switch sides': 'साइड बदलें',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'हर वर्कआउट पूरा होने या रूटीन बदलने के बाद “{0}” में तारीख वाली कॉपी सेव करता है और सबसे नई {1} रखता है।',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'हर वर्कआउट पूरा होने या रूटीन बदलने के बाद आपके चुने फ़ोल्डर में तारीख वाली कॉपी सेव करता है और सबसे नई {0} रखता है।',
diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js
index 58145b0c1..5ca221e15 100644
--- a/frontend/src/locales/hu.js
+++ b/frontend/src/locales/hu.js
@@ -1795,6 +1795,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'A kifogások nem emelnek súlyt. Holnap jelentkezel: {0}!',
'Your muscles filed a missing-person report. Show up for {0}!': 'Az izmaid eltűntként jelentettek. Jelentkezz: {0}!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'Ez a cím válaszol, de nem openGym-szerver. Ellenőrizd az URL-t.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'Ez a cím válaszol, de openGym helyett egy bejelentkezési oldal vagy proxyszabály felelt. Engedd át a /api/ útvonalat változatlanul az openGymhez. Lásd: “Phone app and CORS”, docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'Az app csak https:// címmel tud párosodni. A telefonod a sima http://-t már azelőtt letiltja, hogy bármi elmenne.',
'Switch sides': 'Oldalcsere',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Minden befejezett edzés vagy rutinmódosítás után dátumozott másolatot ment ide: „{0}”, és a legújabb {1} darabot megtartja.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Minden befejezett edzés vagy rutinmódosítás után dátumozott másolatot ment a választott mappába, és a legújabb {0} darabot megtartja.',
diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js
index 16c3d84bf..13cf80de4 100644
--- a/frontend/src/locales/it.js
+++ b/frontend/src/locales/it.js
@@ -1792,6 +1792,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'Le scuse non sollevano pesi. Domani ti presenti a {0}!',
'Your muscles filed a missing-person report. Show up for {0}!': 'I tuoi muscoli hanno denunciato la tua scomparsa. Presentati a {0}!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'Quell’indirizzo risponde, ma non è un server openGym. Controlla l’URL.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'Quell’indirizzo risponde, ma al posto di openGym ha risposto una pagina di login o una regola del proxy. Lascia passare /api/ fino a openGym senza modifiche. Vedi “Phone app and CORS” in docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'L’app può collegarsi solo a un indirizzo https://. Il telefono blocca il semplice http:// prima ancora di inviare qualcosa.',
'Switch sides': 'Cambia lato',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Salva una copia datata in “{0}” dopo ogni allenamento finito o routine modificata, e tiene le {1} più recenti.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Salva una copia datata nella cartella che hai scelto dopo ogni allenamento finito o routine modificata, e tiene le {0} più recenti.',
diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js
index 3d770b8d1..9908ea7cb 100644
--- a/frontend/src/locales/ko.js
+++ b/frontend/src/locales/ko.js
@@ -1792,6 +1792,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': '핑계는 무게를 들지 않는다. 내일 {0}에 집합!',
'Your muscles filed a missing-person report. Show up for {0}!': '근육들이 실종 신고를 냈다. {0}에 출석하라!',
'That address answers, but it isn’t an openGym server. Check the URL.': '이 주소는 응답하지만 openGym 서버가 아닙니다. URL을 확인하세요.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': '이 주소는 응답하지만 openGym 대신 로그인 페이지나 프록시 규칙이 응답했습니다. /api/ 를 그대로 openGym까지 통과시켜 주세요. docs/SELF_HOSTING.md의 “Phone app and CORS”를 참고하세요.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': '앱은 https:// 주소로만 연결할 수 있습니다. 휴대폰이 일반 http:// 요청을 보내기도 전에 차단합니다.',
'Switch sides': '방향 바꾸기',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': '운동을 마치거나 루틴을 수정할 때마다 “{0}”에 날짜가 붙은 사본을 저장하고 최신 {1}개를 보관합니다.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': '운동을 마치거나 루틴을 수정할 때마다 선택한 폴더에 날짜가 붙은 사본을 저장하고 최신 {0}개를 보관합니다.',
diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js
index 9b7b8a9c9..2600c1c92 100644
--- a/frontend/src/locales/pl.js
+++ b/frontend/src/locales/pl.js
@@ -1792,6 +1792,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'Wymówki nie podnoszą ciężarów. Jutro meldujesz się na „{0}”!',
'Your muscles filed a missing-person report. Show up for {0}!': 'Twoje mięśnie zgłosiły twoje zaginięcie. Stawić się na „{0}”!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'Ten adres odpowiada, ale to nie jest serwer openGym. Sprawdź URL.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'Ten adres odpowiada, ale zamiast openGym odpowiedziała strona logowania albo reguła proxy. Przepuść /api/ do openGym bez zmian. Zobacz “Phone app and CORS” w docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'Aplikacja może się połączyć tylko z adresem https://. Telefon blokuje zwykłe http:// zanim cokolwiek zostanie wysłane.',
'Switch sides': 'Zmień stronę',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Zapisuje kopię z datą w „{0}” po każdym zakończonym treningu lub edycji planu i trzyma {1} najnowszych.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Zapisuje kopię z datą w wybranym folderze po każdym zakończonym treningu lub edycji planu i trzyma {0} najnowszych.',
diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.js
index f6262c866..e72ae3b25 100644
--- a/frontend/src/locales/pt-BR.js
+++ b/frontend/src/locales/pt-BR.js
@@ -1113,6 +1113,8 @@ export const PT_BR_OVERRIDES = {
'{1} animated exercises + 1 of your own': '{1} exercícios animados + 1 seu',
'{1} animated exercises + {0} of your own': '{1} exercícios animados + {0} seus',
'That address answers, but it isn’t an openGym server. Check the URL.': 'Esse endereço responde, mas não é um servidor openGym. Verifique a URL.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'Esse endereço responde, mas quem respondeu foi uma página de login ou uma regra do proxy, não o openGym. Deixe o /api/ chegar ao openGym sem alterações. Veja “Phone app and CORS” em docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'O app só consegue parear com um endereço https://. Seu celular bloqueia http:// simples antes de enviar qualquer coisa.',
'Switch sides': 'Troque de lado',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Salva uma cópia datada em “{0}” depois de terminar um treino ou editar uma rotina, e mantém as {1} mais recentes.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Salva uma cópia datada na pasta que você escolheu depois de terminar um treino ou editar uma rotina, e mantém as {0} mais recentes.',
diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js
index 52598e95e..795fbaa2b 100644
--- a/frontend/src/locales/pt.js
+++ b/frontend/src/locales/pt.js
@@ -1792,6 +1792,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'Desculpas não levantam pesos. Amanhã apresentas-te para {0}!',
'Your muscles filed a missing-person report. Show up for {0}!': 'Os teus músculos deram-te como desaparecido. Apresenta-te para {0}!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'Esse endereço responde, mas não é um servidor openGym. Verifica o URL.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'Esse endereço responde, mas foi uma página de login ou uma regra do proxy que respondeu em vez do openGym. Deixa o /api/ chegar ao openGym sem alterações. Vê “Phone app and CORS” em docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'A app só consegue emparelhar com um endereço https://. O telemóvel bloqueia http:// simples antes de enviar seja o que for.',
'Switch sides': 'Troca de lado',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Guarda uma cópia datada em «{0}» depois de terminares um treino ou editares uma rotina, e mantém as {1} mais recentes.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Guarda uma cópia datada na pasta que escolheste depois de terminares um treino ou editares uma rotina, e mantém as {0} mais recentes.',
diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js
index 7b9a83412..be05c073b 100644
--- a/frontend/src/locales/ru.js
+++ b/frontend/src/locales/ru.js
@@ -1796,6 +1796,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'Отговорки не поднимают веса. Завтра явиться на «{0}»!',
'Your muscles filed a missing-person report. Show up for {0}!': 'Ваши мышцы подали заявление о пропаже. Явиться на «{0}»!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'По этому адресу что-то отвечает, но это не сервер openGym. Проверьте URL.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'По этому адресу отвечает страница входа или правило прокси, а не openGym. Пропустите /api/ до openGym без изменений. См. “Phone app and CORS” в docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'Приложение может подключиться только к адресу https://. Телефон блокирует обычный http:// ещё до того, как что-то будет отправлено.',
'Switch sides': 'Смените сторону',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Сохраняет копию с датой в «{0}» после каждой тренировки или правки программы и хранит {1} последних.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Сохраняет копию с датой в выбранную папку после каждой тренировки или правки программы и хранит {0} последних.',
diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js
index 1235ccc9c..749c5250d 100644
--- a/frontend/src/locales/th.js
+++ b/frontend/src/locales/th.js
@@ -1803,6 +1803,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'ข้ออ้างยกน้ำหนักไม่ได้ พรุ่งนี้มารายงานตัวที่ {0}!',
'Your muscles filed a missing-person report. Show up for {0}!': 'กล้ามเนื้อของคุณแจ้งคนหายแล้ว มารายงานตัวที่ {0}!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'ที่อยู่นี้ตอบกลับ แต่ไม่ใช่เซิร์ฟเวอร์ openGym ตรวจสอบ URL อีกครั้ง',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'ที่อยู่นี้ตอบกลับ แต่เป็นหน้าเข้าสู่ระบบหรือกฎของพร็อกซีที่ตอบแทน openGym ให้ /api/ ผ่านไปถึง openGym โดยไม่เปลี่ยนแปลง ดู “Phone app and CORS” ใน docs/SELF_HOSTING.md',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'แอปจับคู่ได้เฉพาะกับที่อยู่ https:// เท่านั้น โทรศัพท์ของคุณบล็อก http:// ธรรมดาก่อนที่จะส่งอะไรออกไปเลย',
'Switch sides': 'สลับข้าง',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'บันทึกสำเนาพร้อมวันที่ไว้ใน “{0}” ทุกครั้งที่จบการออกกำลังกายหรือแก้รูทีน และเก็บไว้ {1} ชุดล่าสุด',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'บันทึกสำเนาพร้อมวันที่ไว้ในโฟลเดอร์ที่คุณเลือกทุกครั้งที่จบการออกกำลังกายหรือแก้รูทีน และเก็บไว้ {0} ชุดล่าสุด',
diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js
index ac10b2b0b..68a64db2b 100644
--- a/frontend/src/locales/tr.js
+++ b/frontend/src/locales/tr.js
@@ -1792,6 +1792,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'Bahaneler ağırlık kaldırmaz. Yarın {0} için hazır ol!',
'Your muscles filed a missing-person report. Show up for {0}!': 'Kasların kayıp ilanı verdi. {0} için içtimaya gel!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'Bu adres yanıt veriyor ama bir openGym sunucusu değil. URL’yi kontrol et.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'Bu adres yanıt veriyor ama openGym yerine bir giriş sayfası ya da proxy kuralı yanıt verdi. /api/ yolunu openGym’e değiştirmeden geçir. docs/SELF_HOSTING.md içinde “Phone app and CORS” bölümüne bak.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'Uygulama yalnızca https:// adresiyle eşleşebilir. Telefonun düz http:// isteğini daha hiçbir şey gönderilmeden engelliyor.',
'Switch sides': 'Taraf değiştir',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Her antrenman bitince veya rutin düzenlenince «{0}» klasörüne tarihli bir kopya kaydeder ve en yeni {1} kopyayı tutar.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Her antrenman bitince veya rutin düzenlenince seçtiğin klasöre tarihli bir kopya kaydeder ve en yeni {0} kopyayı tutar.',
diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.js
index f732a7c80..8ede44ae7 100644
--- a/frontend/src/locales/uk.js
+++ b/frontend/src/locales/uk.js
@@ -1789,6 +1789,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': 'Відмовки не піднімають ваги. Завтра з’явитися на «{0}»!',
'Your muscles filed a missing-person report. Show up for {0}!': 'Твої м’язи заявили про твоє зникнення. З’явитися на «{0}»!',
'That address answers, but it isn’t an openGym server. Check the URL.': 'Ця адреса відповідає, але це не сервер openGym. Перевір URL.',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': 'Ця адреса відповідає, але замість openGym відповіла сторінка входу або правило проксі. Пропусти /api/ до openGym без змін. Див. “Phone app and CORS” у docs/SELF_HOSTING.md.',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'Застосунок може підключитися лише до адреси https://. Телефон блокує звичайний http:// ще до того, як щось буде надіслано.',
'Switch sides': 'Зміни сторону',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': 'Зберігає копію з датою в «{0}» після кожного тренування чи зміни програми й тримає {1} найновіших.',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': 'Зберігає копію з датою у вибрану теку після кожного тренування чи зміни програми й тримає {0} найновіших.',
diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.js
index 9c4e0398c..1f860d0a7 100644
--- a/frontend/src/locales/zh-TW.js
+++ b/frontend/src/locales/zh-TW.js
@@ -1785,6 +1785,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': '藉口舉不起重量。明天準時報到練 {0}!',
'Your muscles filed a missing-person report. Show up for {0}!': '你的肌肉已經報案協尋你了。馬上來練 {0}!',
'That address answers, but it isn’t an openGym server. Check the URL.': '這個位址有回應,但不是 openGym 伺服器。請檢查網址。',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': '這個位址有回應,但回應的是登入頁面或代理規則,而不是 openGym。請讓 /api/ 原封不動地通到 openGym。參見 docs/SELF_HOSTING.md 中的“Phone app and CORS”。',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': 'App 只能與 https:// 位址配對。手機會在送出任何內容之前就擋下一般的 http://。',
'Switch sides': '換邊',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': '每次完成訓練或修改課表後,在「{0}」中儲存一份附日期的副本,並保留最新的 {1} 份。',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': '每次完成訓練或修改課表後,在你選擇的資料夾中儲存一份附日期的副本,並保留最新的 {0} 份。',
diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js
index e5b84b60c..e774010ce 100644
--- a/frontend/src/locales/zh.js
+++ b/frontend/src/locales/zh.js
@@ -1792,6 +1792,8 @@ export default {
'Excuses don’t lift weights. Report for {0} tomorrow!': '借口举不起重量。明天准时报到练{0}!',
'Your muscles filed a missing-person report. Show up for {0}!': '你的肌肉已经报了失踪。马上来练{0}!',
'That address answers, but it isn’t an openGym server. Check the URL.': '该地址有响应,但不是 openGym 服务器。请检查网址。',
+ 'That address answers, but a login page or proxy rule replied instead of openGym. Let /api/ through to openGym unchanged. See “Phone app and CORS” in docs/SELF_HOSTING.md.': '该地址有响应,但回应的是登录页面或代理规则,而不是 openGym。请让 /api/ 原样直达 openGym。参见 docs/SELF_HOSTING.md 中的“Phone app and CORS”。',
+ 'The app can only pair with an https:// address. Your phone blocks plain http:// before anything is even sent.': '应用只能与 https:// 地址配对。手机会在发送任何内容之前就拦截普通的 http://。',
'Switch sides': '换边',
'Saves a dated copy to “{0}” after finishing a workout or editing a routine, and keeps the newest {1}.': '每次完成训练或修改计划后,在“{0}”中保存一份带日期的副本,并保留最新的 {1} 份。',
'Saves a dated copy to the folder you chose after finishing a workout or editing a routine, and keeps the newest {0}.': '每次完成训练或修改计划后,在你选择的文件夹中保存一份带日期的副本,并保留最新的 {0} 份。',