Rebrand to KuentaGYM, and start a new profile in pounds and Spanish
The app is now KuentaGYM everywhere a user can see it, and a fresh profile no longer starts on upstream's English/kg defaults. Both are this fork's decisions, so both are pinned by tests rather than left to a find-and-replace. Rename (1,270 references, 149 files) - Visible surfaces: the Login/Home/mobile-onboarding wordmark, the Settings version line, the printed plan, the PWA title + manifest, and the 17 branded strings across all 14 locale packs. - Infrastructure: repo links, the container images and the release endpoints now name git.dploy.lol/dsantillan/kuentagym; .gitea/workflows/docker-publish.yml publishes to this forge's registry instead of gitea.com. - The Android/iOS application id stays ch.duartesantos.opengym on purpose: changing it would make the mobile app a different app that could never update an installed copy. Three things the mechanical pass would have broken, fixed here - The update check asked gitlab.com for upstream's releases and would have installed upstream's APK, putting the old name back on the phone. It now reads this fork's Gitea releases API (the assets shape differs), with the tests rewritten to the payload Gitea actually returns. - Renaming the mobile state/pairing files (opengym-state.json, opengym-remote.json) would lose the on-device copy of a history whose WebView storage may have been evicted, and silently unpair the device. Both are read under their old names and written forward under the new ones. - Renaming the exported plan-file marker (openGym_plan) rejected every plan shared before the rename as "not a plan file". Both markers are accepted. Defaults: pounds and Spanish - DEF.unit = 'lb', DEF.lang = 'es', plus every fallback that independently assumed en/kg (the <html lang> attribute, the Settings pickers, the Store, the MCP, the Coach payload). - Server-generated push copy existed only in English and pt-BR, so a Spanish profile would have been notified in English; Spanish added. - The demo seed states unit: 'kg' — its seeded numbers are kilograms, and inheriting the new default would have introduced an 82.4 lb lifter benching 60. - The module-level language in i18n-core stays English: it is the only language whose strings need no pack, so `t()`, dates, numbers and lists agree before a pack loads. Starting there on 'es' formats a Spanish-shaped UI with English strings. Also - api/package.json's test glob missed push-messages.test.js and verify-error.test.js, which sat beside the modules they cover and never ran. - README, docs/, website/ and the issue templates no longer describe upstream's GitLab/GitHub pipeline, Discord, sponsorship or public demo as if they were this fork's; upstream history and attribution are preserved (NOTICE.md).
This commit is contained in:
1 parent
f91cde15a1
commit
87bfd6d4c4
152 files changed
+1784
-1604
No files matched your search
+9
-8
@@ -79,7 +79,7 @@ come back from trying Gemini, and each chip shows a mark when it holds one.
|
||||
|
||||
The model field is never a guess: **List models** asks the endpoint what it actually serves.
|
||||
For an Ollama box that means the admin decides what exists — `ollama pull` anything the
|
||||
hardware can hold and it appears in the picker on the next refresh; nothing in openGym pins
|
||||
hardware can hold and it appears in the picker on the next refresh; nothing in KuentaGYM pins
|
||||
you to a blessed list. The choice is remembered **per provider**, so trying a cloud model for
|
||||
a week and coming back to the local one restores exactly what was set before.
|
||||
|
||||
@@ -118,7 +118,7 @@ API_TARGET=coach docker compose up -d --build api
|
||||
claude setup-token
|
||||
```
|
||||
|
||||
Complete its normal browser sign-in and copy the token it prints. openGym never opens or handles
|
||||
Complete its normal browser sign-in and copy the token it prints. KuentaGYM never opens or handles
|
||||
that flow — it only ever receives the finished token. (Claude also accepts an Anthropic API key
|
||||
here, under the same chip; the setup token is the route for a Claude subscription.)
|
||||
|
||||
@@ -192,7 +192,7 @@ No job runs. That is a refusal, not a warning, on purpose — a warning moves th
|
||||
whoever clicks past it, and the decision is about spending somebody else's personal
|
||||
subscription. It is the same posture the payload allowlist takes.
|
||||
|
||||
**The instance owner is responsible for their provider's terms.** openGym does not interpret
|
||||
**The instance owner is responsible for their provider's terms.** KuentaGYM does not interpret
|
||||
them on a self-hoster's behalf; it makes the shape that doesn't need the interpretation
|
||||
available, and refuses the shape that does.
|
||||
|
||||
@@ -331,8 +331,9 @@ API_TARGET=coach docker compose up --build api
|
||||
|
||||
The SDK sits in `optionalDependencies`, and its runtime ships as a per-platform package — this
|
||||
base is Alpine, so the lockfile resolves `linux-x64-musl` / `linux-arm64-musl`. That resolution
|
||||
is the sort of thing that only fails on somebody else's machine, so CI builds **and runs** both
|
||||
targets: the default one has to boot and serve `/api/config` with the SDK genuinely unimportable,
|
||||
is the sort of thing that only fails on somebody else's machine, and this fork's CI builds only the
|
||||
`default` target and never boots it — so when you touch any of this, build and boot both targets
|
||||
yourself: the default one has to boot and serve `/api/config` with the SDK genuinely unimportable,
|
||||
and the coach one has to report a runnable SDK through the same `check()` the admin card renders.
|
||||
|
||||
An absent runtime is an ordinary state, not a crash: the adapter imports the SDK lazily, `check()`
|
||||
@@ -387,7 +388,7 @@ Three shapes, because the providers work differently:
|
||||
That is `./coach-auth`, mounted at `/coach-auth`, owned by the `coach` user, mode `0700`.
|
||||
|
||||
`./coach-auth` is a **sibling of `./data`, never a folder inside it**, and that placement is the
|
||||
whole point. §5 of `docs/SELF_HOSTING.md` tells owners to back up with `tar czf … data/`.
|
||||
whole point. §6 of `docs/SELF_HOSTING.md` tells owners to back up with `tar czf … data/`.
|
||||
Anything under `./data` is therefore in every backup archive people are instructed to produce —
|
||||
and unlike workout history, a refresh token 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
|
||||
@@ -399,10 +400,10 @@ in a device sync or in a user's own JSON export.
|
||||
|
||||
## On the phone
|
||||
|
||||
The App-Store build has no server of its own, so the Coach there is a choice made in
|
||||
The standalone mobile build has no server of its own, so the Coach there is a choice made in
|
||||
**Settings → AI Coach**, and until it is made nothing AI-related is loaded at all:
|
||||
|
||||
- **Use my self-hosted openGym.** Pair the phone with your instance (the same pairing flow as
|
||||
- **Use my self-hosted KuentaGYM.** Pair the phone with your instance (the same pairing flow as
|
||||
syncing — **Settings → Pair the mobile app** on the site, then the address and code on the
|
||||
phone). A paired phone is an ordinary profile: the Coach runs on your server with whatever
|
||||
provider the admin configured, under the rules above, and nothing on the phone changes.
|
||||
|
||||
+7
-2
@@ -1,14 +1,19 @@
|
||||
# HTTP API
|
||||
|
||||
The complete openGym HTTP API — every route of `api/server.js`, with auth,
|
||||
The complete KuentaGYM HTTP API — every route of `api/server.js`, with auth,
|
||||
request/response schemas and the env-dependent behavior — is documented as a
|
||||
hand-written OpenAPI 3.1 spec:
|
||||
|
||||
- **Spec (source of truth):** [`api/openapi.yaml`](../api/openapi.yaml)
|
||||
- **Browsable (Swagger UI):** https://opengym.duarte-santos.ch/api.html
|
||||
- **Browsable:** `website/api.html` — the same spec rendered as one static page by
|
||||
`node scripts/build-api-docs.mjs`. Nothing deploys that site for this fork yet, so there is no
|
||||
hosted copy to point at: build the page and open the file, or read the spec directly.
|
||||
|
||||
Lint it after changing routes:
|
||||
|
||||
```sh
|
||||
npx --yes @redocly/cli lint api/openapi.yaml
|
||||
```
|
||||
|
||||
A route change also means rebuilding `website/api.html` — it is committed, not rendered at
|
||||
runtime. (`js-yaml` comes from the repo-root `package.json`.)
|
||||
@@ -7,8 +7,10 @@ changes shape.
|
||||
|
||||
Design provenance: Linear map [ENG-9](https://linear.app/factical/issue/ENG-9) and its
|
||||
decision tickets ENG-10 (reader inventory), ENG-11 (`noProg` semantics), ENG-12 (UI
|
||||
surfaces), ENG-14 (data-model invariants), ENG-15 (plan fingerprint / Coach). This document
|
||||
is the assembled hand-off; it describes what to build, not a change already made.
|
||||
surfaces), ENG-14 (data-model invariants), ENG-15 (plan fingerprint / Coach). Those tickets live in
|
||||
an external workspace, not in this fork's tracker, and nothing below depends on being able to open
|
||||
them. This document is the assembled hand-off; it describes what to build, not a change already
|
||||
made.
|
||||
|
||||
---
|
||||
|
||||
|
||||
+10
-4
@@ -8,13 +8,19 @@ The app supports exporting and an export always contain *every* current routine.
|
||||
If you don't want to share every plan that you have currently created, you can either:
|
||||
- edit the exported json with a text editor
|
||||
or (if you don't feel like editing json files):
|
||||
- open the [Demo](https://opengym.duarte-santos.ch/demo/#/home)
|
||||
- do it in the app itself, in **guest mode** — the "Continue without account" button on the login
|
||||
screen, which keeps everything in that browser and never talks to the server:
|
||||
- import your plans
|
||||
- make changes
|
||||
- export a new json file for sharing
|
||||
|
||||
If you are using the standalone app on your mobile, you can use the demo for creating plans on your PC and import them.
|
||||
The demo stores all data in your browser, it is not public or shared in any way.
|
||||
There is no public demo deployment for this fork to point you at, so guest mode on the instance you
|
||||
already run (or on `http://localhost:8080` after `docker compose up`) is the way to do this without
|
||||
touching a text editor.
|
||||
|
||||
If you are using the standalone app on your mobile, you can use guest mode for creating plans on your PC and import them.
|
||||
Guest mode stores all data in your browser, it is not public or shared in any way — nothing is
|
||||
uploaded, and the plan json is what you move between the two.
|
||||
|
||||
Writing a json file yourself will be a bit of a complex task since the IDs of the exercises have to match the IDs in the database.
|
||||
|
||||
@@ -43,7 +49,7 @@ These apps have been tested to work without adjustments to the column names:
|
||||
If you have **Hevy Pro**, you can skip the CSV and import straight from Hevy:
|
||||
|
||||
1. Open [Hevy → Settings → Developer](https://hevy.com/settings?developer) and create an API key
|
||||
2. In openGym: **Settings → Import from Hevy**
|
||||
2. In KuentaGYM: **Settings → Import from Hevy**
|
||||
3. Paste the key (used only for that import — it is not saved)
|
||||
4. Choose whether to bring **workouts**, **routines**, **weigh-ins**, or any mix, then confirm
|
||||
|
||||
|
||||
+31
-48
@@ -1,6 +1,6 @@
|
||||
# Building the mobile app (iOS / Android)
|
||||
|
||||
openGym ships in two flavors from the same codebase:
|
||||
KuentaGYM ships in two flavors from the same codebase:
|
||||
|
||||
| | **Self-hosted** (this repo's default) | **Mobile app** (`VITE_MOBILE=1`) |
|
||||
|---|---|---|
|
||||
@@ -11,7 +11,7 @@ openGym ships in two flavors from the same codebase:
|
||||
| Exercise media | served by your server (`img/`, `gif/`) | loaded from the jsDelivr CDN |
|
||||
|
||||
The mobile flavor never talks to a backend by default: no sign-in screen, no sync, no
|
||||
telemetry. State is mirrored from `localStorage` into `opengym-state.json` in the app's
|
||||
telemetry. State is mirrored from `localStorage` into `kuentagym-state.json` in the app's
|
||||
private data directory on every change (iOS is allowed to evict WebView storage under
|
||||
pressure — the file mirror is the durable copy and is restored on launch). Backups go out
|
||||
through the OS share sheet instead of a browser download.
|
||||
@@ -19,7 +19,7 @@ through the OS share sheet instead of a browser download.
|
||||
### Connecting the app to your own server
|
||||
|
||||
On first launch the app asks how you want to use it. Alongside the fully local mode above,
|
||||
you can instead **connect it to a self-hosted openGym server** — your data then lives there,
|
||||
you can instead **connect it to a self-hosted KuentaGYM server** — your data then lives there,
|
||||
synced the same way the browser PWA does, instead of only on the phone. This is a mode of the
|
||||
same app, not a different build or download.
|
||||
|
||||
@@ -46,7 +46,7 @@ or Settings → **"Connect to my server"** later) to finish. Notes:
|
||||
- **Android:** Android Studio (bundles the SDK). Java 21 for Gradle.
|
||||
- **iOS:** a Mac with Xcode 15+ and CocoaPods (`brew install cocoapods`). A free Apple ID
|
||||
is enough to run the app on your own iPhone (see below); paid membership is only needed
|
||||
for App Store distribution, which openGym doesn't do.
|
||||
for App Store distribution, which KuentaGYM doesn't do.
|
||||
|
||||
## Build & run
|
||||
|
||||
@@ -80,35 +80,20 @@ npx @capacitor/assets generate --iconBackgroundColor '#0c0e12' --splashBackgroun
|
||||
|
||||
## Distribution — deliberately no app stores
|
||||
|
||||
openGym's mobile app is not on the Play Store or App Store, and that's a choice: no store
|
||||
KuentaGYM's mobile app is not on the Play Store or App Store, and that's a choice: no store
|
||||
accounts, no store rules, no yearly fees between you and an open-source app.
|
||||
|
||||
### Android — sideload the APK
|
||||
### Android — build and sideload the APK yourself
|
||||
|
||||
The official signed APK is in four places, all the same file:
|
||||
**This fork publishes no APK.** There is no download page, no package in a registry and no release
|
||||
asset to point at, and no CI job that builds one: the `build:apk` job upstream uses lives in the
|
||||
dormant `.gitlab-ci.yml`, which no host runs for this fork. The in-app update check reads this
|
||||
repository's releases on Gitea and will find nothing until a release carries a signed APK and its
|
||||
`.sha256` (see *Release notes for maintainers* below). Until then the APK you run is the one you
|
||||
build and sign yourself, with your own key.
|
||||
|
||||
- **[opengym.duarte-santos.ch](https://opengym.duarte-santos.ch)** — the download page.
|
||||
- **[GitLab's package registry](https://gitlab.com/DuarteSantos8/opengym/-/packages)** — every
|
||||
build under `opengym-android/<version>/`, with a `.sha256` beside it. Direct link, no login:
|
||||
`https://gitlab.com/api/v4/projects/85678327/packages/generic/opengym-android/<version>/openGym-<version>.apk`
|
||||
- **[The GitHub release](https://github.com/DuarteSantos8/openGym/releases)** for that version,
|
||||
with the APK and its `.sha256` attached as release assets.
|
||||
- **[The GitLab release](https://gitlab.com/DuarteSantos8/opengym/-/releases)** on the mirror,
|
||||
where the file is built; it links to the package registry above.
|
||||
|
||||
Android asks you to allow installs from the browser the first time — that's standard for any
|
||||
app outside the Play Store. Check the `.sha256` if you got the file from anywhere else.
|
||||
|
||||
Both come out of CI: the `build:apk` job in [`.gitlab-ci.yml`](../.gitlab-ci.yml) runs
|
||||
`npm run build:mobile` and `./gradlew assembleRelease`, then `zipalign`s and signs the result
|
||||
with the release key. The job runs on every push to `main` too, so the newest unreleased
|
||||
build is always one click away (signed with the same key, installs over a release):
|
||||
`https://gitlab.com/DuarteSantos8/opengym/-/jobs/artifacts/main/browse?job=build:apk`
|
||||
— a 30-day job artifact, not a package, and not what the in-app updater offers. The key lives in *protected* CI variables (`ANDROID_KEYSTORE_B64`,
|
||||
`ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`), so it only exists on `main` and on `v*`
|
||||
tags — a merge request from a fork can build an APK, but gets an unsigned one and never sees
|
||||
the key. On a `v*` tag the signed APK is also pushed to the generic package registry, which is
|
||||
what the release links to.
|
||||
Android asks you to allow installs from the browser the first time — standard for any app outside the
|
||||
Play Store, and no different for a build you made yourself.
|
||||
|
||||
To build and sign your own:
|
||||
|
||||
@@ -118,11 +103,11 @@ cd android && ./gradlew assembleRelease # → app/build/outputs/apk/r
|
||||
|
||||
# one-time: create a keystore. KEEP IT — updates must be signed with the same key,
|
||||
# or Android refuses to install the new version over the old one.
|
||||
keytool -genkeypair -keystore my.keystore -alias opengym -keyalg RSA -validity 10950
|
||||
keytool -genkeypair -keystore my.keystore -alias kuentagym -keyalg RSA -validity 10950
|
||||
|
||||
# align + sign (zipalign/apksigner ship with the Android SDK build-tools)
|
||||
zipalign -f -p 4 app-release-unsigned.apk aligned.apk
|
||||
apksigner sign --ks my.keystore --ks-key-alias opengym --out openGym.apk aligned.apk
|
||||
apksigner sign --ks my.keystore --ks-key-alias kuentagym --out KuentaGYM.apk aligned.apk
|
||||
```
|
||||
|
||||
### iPhone — what's actually possible
|
||||
@@ -136,28 +121,26 @@ that would simply install. Your free options:
|
||||
onto your own iPhone. Apple expires the signature after 7 days; re-run from Xcode to renew.
|
||||
- **AltStore:** automates that 7-day re-signing over Wi-Fi via a Mac companion app.
|
||||
|
||||
There is a `build:ios` job in [`.gitlab-ci.yml`](../.gitlab-ci.yml) for exactly that path: the
|
||||
same mobile bundle, `xcodebuild archive` without a signing identity, and an *unsigned* `.ipa`
|
||||
(plus `.sha256`) as job artifact — on a tag also under `opengym-ios/<version>/` in the package
|
||||
registry — for AltStore/Sideloadly users to sign with their own Apple ID. It needs a Mac: Xcode
|
||||
does not run on the Linux project runner, and gitlab.com's hosted macOS runners are not on the
|
||||
free tier. To switch it on, register a Mac as a project runner (shell executor; Xcode, CocoaPods
|
||||
and Node installed; give it a tag such as `macos`) and set the CI/CD variable `IOS_RUNNER_TAG`
|
||||
to that tag — the job then appears in every `main` and tag pipeline. Until that variable exists
|
||||
the job is not part of any pipeline, and it has not run yet, so expect a first round of fixes.
|
||||
A signed build (TestFlight, App Store) would additionally need an Apple Developer Program
|
||||
membership, the distribution certificate and profile as protected file variables, and an
|
||||
`-exportArchive` step — none of that is set up.
|
||||
Upstream's pipeline has a `build:ios` job for exactly that path — the same mobile bundle,
|
||||
`xcodebuild archive` without a signing identity, and an *unsigned* `.ipa` (plus `.sha256`) for
|
||||
AltStore/Sideloadly users to sign with their own Apple ID. It needs a Mac, and it lives in the
|
||||
dormant `.gitlab-ci.yml`: no host runs it for this fork, so there is no `.ipa` job, no runner to
|
||||
register and no `IOS_RUNNER_TAG` variable to set. An unsigned `.ipa` is a manual `xcodebuild` run on
|
||||
a Mac and nothing more; nobody here does it for you. A signed build (TestFlight, App Store) would
|
||||
additionally need an Apple Developer Program membership, the distribution certificate and profile,
|
||||
and an `-exportArchive` step — none of that is set up.
|
||||
|
||||
### Release notes for maintainers
|
||||
|
||||
- Bump `versionName`/`versionCode` in `android/app/build.gradle` per release; keep them in
|
||||
step with `frontend/package.json`. `versionCode` must strictly increase or updates won't
|
||||
install over an existing APK. The APK is *named* from `frontend/package.json` (the CI job
|
||||
reads `version` out of it), so the two drifting apart shows up as a misnamed file.
|
||||
- Tagging `vX.Y.Z` is what ships everything: images, APK, release notes. Don't push a version
|
||||
tag you don't mean to release — `v*` tags are protected for that reason.
|
||||
- **License:** openGym is AGPL-3.0, which by itself sits badly with app-store terms of
|
||||
install over an existing APK. Upstream names the APK from `frontend/package.json`; your own
|
||||
build is named whatever you pass to `apksigner`.
|
||||
- A push to `main` and a **published Gitea release** are what build and push the two container
|
||||
images (`.gitea/workflows/docker-publish.yml`). Nothing packages an APK or writes release notes
|
||||
for you: if you publish a release, attach the signed APK and its `.sha256` by hand — that asset
|
||||
is also what the Android build's in-app update check looks for.
|
||||
- **License:** KuentaGYM is AGPL-3.0, which by itself sits badly with app-store terms of
|
||||
service. `NOTICE.md` carries an app-store exception (an additional permission under
|
||||
AGPL §7) granted by the copyright holder — relevant only if store distribution ever happens.
|
||||
- The app requests notification permission only when the workout-day reminder is switched
|
||||
|
||||
+22
-21
@@ -1,6 +1,6 @@
|
||||
# Self-hosting openGym
|
||||
# Self-hosting KuentaGYM
|
||||
|
||||
openGym is two small containers (a web server and an API) plus a folder of your data.
|
||||
KuentaGYM is two small containers (a web server and an API) plus a folder of your data.
|
||||
This guide takes you from "just cloned it" to "using it from my phone over the internet".
|
||||
|
||||
## 1. Run it locally (5 minutes)
|
||||
@@ -8,10 +8,10 @@ This guide takes you from "just cloned it" to "using it from my phone over the i
|
||||
Requirements: [Docker](https://docs.docker.com/get-docker/) with the Compose plugin.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/DuarteSantos8/openGym # or https://gitlab.com/DuarteSantos8/opengym — same repo
|
||||
cd openGym
|
||||
git clone https://git.dploy.lol/dsantillan/kuentagym # this fork, on Gitea
|
||||
cd kuentagym
|
||||
cp .env.example .env
|
||||
docker compose pull # prebuilt images from GitLab's registry (amd64 + arm64; the same images are on ghcr.io) — or skip and build from source
|
||||
docker compose pull # prebuilt images from the fork's own Gitea registry (amd64 + arm64) — or skip and build from source
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
@@ -31,14 +31,14 @@ Logs: `docker compose logs -f`. Stop: `docker compose down`.
|
||||
|
||||
## 2. Understand the passkey requirement (important)
|
||||
|
||||
openGym signs you in with **passkeys** (WebAuthn). Browsers enforce two rules:
|
||||
KuentaGYM signs you in with **passkeys** (WebAuthn). Browsers enforce two rules:
|
||||
|
||||
1. Passkeys are bound to an exact **hostname** (`RP_ID`).
|
||||
2. They only work over **HTTPS** — with one exception: `http://localhost`.
|
||||
|
||||
So `http://localhost:8080` works on the machine running Docker, but **another device (your
|
||||
phone) cannot use `http://<your-LAN-ip>:8080`** — that's neither localhost nor HTTPS, so the
|
||||
passkey prompt won't appear. To use openGym from your phone you need a real HTTPS hostname.
|
||||
passkey prompt won't appear. To use KuentaGYM from your phone you need a real HTTPS hostname.
|
||||
|
||||
(You can still open it over LAN in **guest mode**, which stores data only in that browser.)
|
||||
|
||||
@@ -61,7 +61,7 @@ you're poking at the API directly:
|
||||
|
||||
> Want HTTPS **without** exposing anything to the internet — a valid certificate on a LAN-only address? See [SELF_HOSTING_HTTPS.md](./SELF_HOSTING_HTTPS.md) (wildcard cert via a DNS challenge, Caddy in front).
|
||||
|
||||
Put openGym behind something that terminates TLS for a hostname you control, then point it at
|
||||
Put KuentaGYM behind something that terminates TLS for a hostname you control, then point it at
|
||||
the `web` container. Pick whichever you already run:
|
||||
|
||||
### Option A — Cloudflare Tunnel (no open ports)
|
||||
@@ -80,7 +80,7 @@ gym.example.com {
|
||||
### Option C — Traefik / nginx / Nginx Proxy Manager
|
||||
|
||||
Route `gym.example.com` (HTTPS) → `web:80` (or `<docker-host>:8080`). Any reverse proxy works —
|
||||
openGym only needs the browser to reach it over `https://gym.example.com`. If that proxy caps
|
||||
KuentaGYM only needs the browser to reach it over `https://gym.example.com`. If that proxy caps
|
||||
request bodies (nginx does, at 1 MiB by default), allow at least 5 MiB on `/api/` — the app syncs
|
||||
its whole history in one PUT; the bundled web image already allows 5 MiB, matching the API.
|
||||
|
||||
@@ -91,7 +91,7 @@ Then set your domain in `.env` and restart:
|
||||
RP_ID=gym.example.com
|
||||
ORIGIN=https://gym.example.com
|
||||
WEB_PORT=8080
|
||||
RP_NAME=openGym
|
||||
RP_NAME=KuentaGYM
|
||||
```
|
||||
|
||||
```bash
|
||||
@@ -171,7 +171,7 @@ that is not the default here.
|
||||
|
||||
## 5. Fitting it into an existing stack
|
||||
|
||||
The defaults assume openGym is the only thing here: a service called `api` on port 3000, and nginx
|
||||
The defaults assume KuentaGYM is the only thing here: a service called `api` on port 3000, and nginx
|
||||
on port 80 inside its container. If you are merging this into a compose file that already has an
|
||||
`api`, or you put the web container behind your own reverse proxy on a different port, four
|
||||
settings in `.env` move those without editing any config file:
|
||||
@@ -182,7 +182,7 @@ NGINX_PORT=80 # port the web container listens on, inside the conta
|
||||
BACKEND=api # name of the API service that /api is proxied to
|
||||
PORT=3000 # port the API listens on; web proxies to the same value
|
||||
RESOLVER=127.0.0.11 # DNS nginx resolves BACKEND with — Docker's, unless you are not on Docker
|
||||
BASE_PATH= # subpath openGym is served under, e.g. /gym — see below; empty = site root
|
||||
BASE_PATH= # subpath KuentaGYM is served under, e.g. /gym — see below; empty = site root
|
||||
SESSION_DAYS=90 # how long a sign-in lasts
|
||||
```
|
||||
|
||||
@@ -201,9 +201,9 @@ Note the difference from `VITE_IMG_BASE` / `VITE_GIF_BASE` (see Troubleshooting)
|
||||
build-time values baked into the frontend bundle, and setting them next to `docker compose` does
|
||||
nothing to an image you pulled.
|
||||
|
||||
### Serving openGym under a subpath
|
||||
### Serving KuentaGYM under a subpath
|
||||
|
||||
openGym can live at `https://example.com/gym/` rather than on a host of its own. Which of the two
|
||||
KuentaGYM can live at `https://example.com/gym/` rather than on a host of its own. Which of the two
|
||||
setups below you need depends on one thing: whether your reverse proxy strips the prefix before
|
||||
the container sees the request.
|
||||
|
||||
@@ -214,7 +214,7 @@ and it asks its own address for the API, so everything stays inside the prefix o
|
||||
```caddy
|
||||
example.com {
|
||||
handle_path /gym/* {
|
||||
reverse_proxy opengym-web:80
|
||||
reverse_proxy kuentagym-web:80
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -227,7 +227,7 @@ BASE_PATH=/gym
|
||||
```
|
||||
|
||||
That is a start-up setting like the others above, so it works on a prebuilt image. Forward only
|
||||
the prefix to the container — openGym does not serve itself at the site root as well, and a copy
|
||||
the prefix to the container — KuentaGYM does not serve itself at the site root as well, and a copy
|
||||
reached there would look for an API that is not on that path.
|
||||
|
||||
Either way, keep `ORIGIN` and `RP_ID` pointing at the address in the browser's bar
|
||||
@@ -240,7 +240,7 @@ a passkey scope and can see each other's credentials. Give each its own hostname
|
||||
Everything is in `./data`:
|
||||
|
||||
```bash
|
||||
tar czf opengym-backup-$(date +%F).tar.gz data/
|
||||
tar czf kuentagym-backup-$(date +%F).tar.gz data/
|
||||
```
|
||||
|
||||
That archive contains all profiles, passkeys and workout history — and, if the activity log is
|
||||
@@ -261,7 +261,7 @@ in this archive — and unreadable without the secret next to them, like everyth
|
||||
|
||||
## 7. Notifications
|
||||
|
||||
openGym can push two kinds of alert to your phone/desktop, even when the app isn't open:
|
||||
KuentaGYM can push two kinds of alert to your phone/desktop, even when the app isn't open:
|
||||
rest-timer-over, and a reminder on days you have a workout planned but haven't logged one yet.
|
||||
Turn it on per-profile in **Settings → Notifications** (requires a signed-in passkey profile and
|
||||
HTTPS — see section 3).
|
||||
@@ -272,7 +272,8 @@ automatically when they turn the reminder on — it fires at their local time, a
|
||||
they travel, regardless of what timezone the server itself runs in.
|
||||
|
||||
Where it works: any desktop browser, Android Chrome, and on iOS only the app **added to the Home
|
||||
Screen** (Safari in a tab has no Web Push). The Android APK does not use Web Push at all — its
|
||||
Screen** (Safari in a tab has no Web Push). The standalone Android app (`docs/MOBILE.md`) does not
|
||||
use Web Push at all — its
|
||||
day reminder is a local notification scheduled on the phone, and rest-timer alerts there only
|
||||
sound while the app is in the foreground. A reminder that was due while the server was down or
|
||||
restarting is still sent up to 15 minutes late, once; the browser re-registers its subscription
|
||||
@@ -284,7 +285,7 @@ instance the switch shows as unsupported. Nothing to configure server-side eithe
|
||||
refuses the lock while the phone is in Low Power Mode.
|
||||
|
||||
Push services like a contact address for whoever runs the server, in case they ever need to reach
|
||||
you about your pushes. openGym sends your `ORIGIN` by default; set `VAPID_SUBJECT=mailto:you@example.com`
|
||||
you about your pushes. KuentaGYM sends your `ORIGIN` by default; set `VAPID_SUBJECT=mailto:you@example.com`
|
||||
in `.env` if you would rather they had an inbox.
|
||||
|
||||
## 8. Updating
|
||||
@@ -366,7 +367,7 @@ everybody registers again — which is why it pays to settle the domain before o
|
||||
| Day reminder fires at the wrong time | Toggle it off and on in Settings so it re-detects your browser's timezone (also happens automatically on every app load — see section 7). |
|
||||
| Notifications switch is off although I turned it on | The server no longer holds the subscription (rebuilt `data/db.json`, regenerated `vapid.json`); the app re-registers on the next start, or switch it on again. On iOS, push only works from the Home Screen icon. |
|
||||
| Want to reset a stuck login | Delete the cookie in your browser; sessions are just signed cookies. |
|
||||
| `docker compose pull` fails with "denied" / "unauthorized" | The prebuilt images aren't published yet, or need to be, or the GHCR package is still private — build from source instead (`docker compose up -d --build`). |
|
||||
| `docker compose pull` fails with "denied" / "unauthorized" | The prebuilt images aren't published yet, or the container package is not readable anonymously on the Gitea registry (`git.dploy.lol`) — build from source instead (`docker compose up -d --build`). |
|
||||
| Exercise images/GIFs blank when a routine is open | Fixed in current images (issue #79). On an older build, see the note below. |
|
||||
|
||||
### `VITE_IMG_BASE` / `VITE_GIF_BASE` are build-time, not run-time
|
||||
|
||||
+12
-12
@@ -1,7 +1,7 @@
|
||||
# Selfhosting with HTTPS
|
||||
|
||||
This is a rather complex topic of its own, so it lives apart from the [SELF_HOSTING.md](./SELF_HOSTING.md) which focuses on how to run openGym.
|
||||
This document takes a more general approach on how to achieve "https at home", it is not necessarily focused on openGym and applies to self hosting in general.
|
||||
This is a rather complex topic of its own, so it lives apart from the [SELF_HOSTING.md](./SELF_HOSTING.md) which focuses on how to run KuentaGYM.
|
||||
This document takes a more general approach on how to achieve "https at home", it is not necessarily focused on KuentaGYM and applies to self hosting in general.
|
||||
|
||||
When self-hosting it is often assumed that one needs to expose their services to the internet, this is not necessarily the case.
|
||||
We can have https certificates without having to expose our precious hosts to the world. You can still do that if you want to access your applications from the internet without any VPN, but it's not necessary to take the risk.
|
||||
@@ -59,8 +59,8 @@ We configure the proxy to forward requests to our individual services like so:
|
||||
```mermaid
|
||||
graph TD
|
||||
A[proxy]
|
||||
A <-->B[openGym :8080]
|
||||
A <-->C[openGym-api :3000]
|
||||
A <-->B[KuentaGYM :8080]
|
||||
A <-->C[KuentaGYM-api :3000]
|
||||
A <-->D[Nextcloud :8081]
|
||||
```
|
||||
Now we have a nice URL and can forget about the ports. The proxy reads the URL request and forwards it to the target service/host.
|
||||
@@ -69,7 +69,7 @@ Now we have a nice URL and can forget about the ports. The proxy reads the URL r
|
||||
|
||||
So how does it all come together?
|
||||
|
||||
1. DNS provider translates name to the local IP of homelab (e.g.: `https://opengym.myhomelab.dedyn.io -> http://192.168.0.100:8080`)
|
||||
1. DNS provider translates name to the local IP of homelab (e.g.: `https://kuentagym.myhomelab.dedyn.io -> http://192.168.0.100:8080`)
|
||||
1. the proxy listens to the local IP and provides HTTPS
|
||||
1. Let's encrypt provides certificates with certbot
|
||||
|
||||
@@ -85,12 +85,12 @@ But the main tasks are the same, so you can adapt to your choice.
|
||||
Additional info:
|
||||
- homelab host: 192.168.0.100
|
||||
running services:
|
||||
- opengym on port 8080
|
||||
- kuentagym on port 8080
|
||||
- nextcloud on port 8081
|
||||
|
||||
1. register with desec.io and choose a name (we take `myhomelab` as example)
|
||||
1. create a new A record that points to your service, e.g.: `*.myhomelab.dedyn.io` (Wildcard!) - 192.168.0.100 (the ip of your homelab/mini PC/Raspberry Pi running the proxy)
|
||||
2. A wildcard certificate handles all certificates for that given host. e.g.: `opengym.myhomelab.dedyn.io` and `nextcloud.myhomelab.dedyn.io` can share the same certificates.
|
||||
2. A wildcard certificate handles all certificates for that given host. e.g.: `kuentagym.myhomelab.dedyn.io` and `nextcloud.myhomelab.dedyn.io` can share the same certificates.
|
||||
3. create an API token for the certbot plugin. It only needs to write records inside your domain — leave `Can create domains` and `Can delete domains` **off**; a leaked token should not be able to take your domain apart. Note the token, it is only displayed once.
|
||||
2. install certbot on your host
|
||||
1. most linux distributions provide the packages for this, e.g. debian: `apt install certbot python3-certbot-dns-desec` check the [docs](https://desec.readthedocs.io/en/latest/integrations/lets-encrypt.html)
|
||||
@@ -126,8 +126,8 @@ Additional info:
|
||||
protocols tls1.3
|
||||
}
|
||||
}
|
||||
# reverse proxy config for opengym
|
||||
opengym.myhomelab.dedyn.io {
|
||||
# reverse proxy config for kuentagym
|
||||
kuentagym.myhomelab.dedyn.io {
|
||||
import desec
|
||||
reverse_proxy http://192.168.0.100:8080
|
||||
}
|
||||
@@ -138,13 +138,13 @@ Additional info:
|
||||
}
|
||||
```
|
||||
|
||||
And that's about it. Now you should be able to access your opengym instance from your local network via https with working passkeys.
|
||||
Be sure to update the openGym config accordingly (`RP_ID=opengym.myhomelab.dedyn.io`, `ORIGIN=https://opengym.myhomelab.dedyn.io` — see [SELF_HOSTING.md](./SELF_HOSTING.md#2-understand-the-passkey-requirement-important)).
|
||||
And that's about it. Now you should be able to access your kuentagym instance from your local network via https with working passkeys.
|
||||
Be sure to update the KuentaGYM config accordingly (`RP_ID=kuentagym.myhomelab.dedyn.io`, `ORIGIN=https://kuentagym.myhomelab.dedyn.io` — see [SELF_HOSTING.md](./SELF_HOSTING.md#2-understand-the-passkey-requirement-important)).
|
||||
|
||||
**If the name does not resolve on your phone:** many home routers (Fritz!Box, some ISP boxes) have *DNS rebind protection* and silently drop public names that resolve to a private IP. Add `myhomelab.dedyn.io` to the router's rebind exception list, or run your own resolver.
|
||||
|
||||
usable URLs in this example:
|
||||
- `https://opengym.myhomelab.dedyn.io -> http://192.168.0.100:8080`
|
||||
- `https://kuentagym.myhomelab.dedyn.io -> http://192.168.0.100:8080`
|
||||
- `https://nextcloud.myhomelab.dedyn.io -> http://192.168.0.100:8081`
|
||||
|
||||
Note that the SSL/HTTPS termination is only at the proxy, the service does not have any certificates whatsoever.
|
||||
|
||||
Reference in new issue
Block a user