Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
551b072c54 | ||
|
|
e007f76d43 | ||
|
|
e28345dd13 | ||
|
|
ba412cb36d | ||
|
|
f554b6b004 | ||
|
|
09949686c2 | ||
|
|
7c69e57b4f | ||
|
|
663e0b3987 | ||
|
|
5a0345c905 | ||
|
|
1e86d6ace2 | ||
|
|
a5e360cde5 | ||
|
|
00b4f543a3 | ||
|
|
4afffcb248 | ||
|
|
c33ff15d9d | ||
|
|
8de55ce0d9 | ||
|
|
aefb13b544 | ||
|
|
7354b1ca0c | ||
|
|
f5562febca | ||
|
|
1f40230727 | ||
|
|
de65e1099a | ||
|
|
be2fb2dd1d | ||
|
|
611987545a | ||
|
|
accc3c1038 | ||
|
|
1574811af0 | ||
|
|
b45dbca2a6 | ||
|
|
3a120df205 | ||
|
|
051a37abbf | ||
|
|
8440cf3546 | ||
|
|
b0d176aba3 | ||
|
|
42ac8c8513 | ||
|
|
f232b5ba7e | ||
|
|
caaf61d91e | ||
|
|
4c829b6d1f | ||
|
|
c5e131f81c | ||
|
|
248da53dca | ||
|
|
42d3659615 | ||
|
|
ca917f0320 | ||
|
|
54fb14be13 | ||
|
|
6905117352 | ||
|
|
0c6c22c04b | ||
|
|
4e27461b7e | ||
|
|
fa978a1bb4 | ||
|
|
c08381e558 | ||
|
|
c5172d0633 | ||
|
|
c3929b0a70 | ||
|
|
eb582e3c7b | ||
|
|
6714b16e6a | ||
|
|
6aaf2a3eea | ||
|
|
4143ab8676 | ||
|
|
92914dea43 | ||
|
|
fadeb17b6c | ||
|
|
ab0c98ba85 | ||
|
|
b15f7d9ec4 | ||
|
|
5c846b92d5 | ||
|
|
c248ca3bae | ||
|
|
8e1d3b96a6 | ||
|
|
ec46c7e20d | ||
|
|
a54bad2641 | ||
|
|
0818f1b32b | ||
|
|
62a0b00fbb | ||
|
|
827c0f8505 | ||
|
|
43d5495007 | ||
|
|
3d5b00cecd | ||
|
|
c8a68e37e1 | ||
|
|
238b435c2b | ||
|
|
af9289dcd9 | ||
|
|
211fb86480 | ||
|
|
6f557399b1 | ||
|
|
17c2324f74 | ||
|
|
41f17934a9 | ||
|
|
df91727dcf | ||
|
|
ae399cd1dd | ||
|
|
becd2357ff | ||
|
|
768dee50ca | ||
|
|
4888fed0c4 | ||
|
|
ee2be743b0 | ||
|
|
389315625c | ||
|
|
fac45f9af9 | ||
|
|
cd77cfdd84 | ||
|
|
e9bf38f39b | ||
|
|
3c5bcd5957 | ||
|
|
b28a58930c |
No files matched your search
@@ -34,6 +34,16 @@ RP_NAME=openGym
|
||||
#
|
||||
# INVITE_ONLY=1
|
||||
|
||||
# ── Session length (optional) ──────────────────────────────────────────────
|
||||
# How long a sign-in lasts, in days. Default 90 — long enough that people who
|
||||
# train regularly never see a login screen, short enough that a stolen cookie
|
||||
# doesn't stay good forever. Lower it for an instance on the open internet,
|
||||
# raise it for a private one. Only affects new sign-ins; cookies already handed
|
||||
# out keep the lifetime they were issued with. Users can end every session on
|
||||
# every device themselves with "Sign out everywhere" in Settings.
|
||||
#
|
||||
# SESSION_DAYS=90
|
||||
|
||||
# ── Notifications (optional) ───────────────────────────────────────────────
|
||||
# Push works out of the box — nothing to set. VAPID keys are generated on first
|
||||
# run and saved to ./data/vapid.json. Each user's browser reports its own
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# Puts a "Sponsor" button on the repo header. The GitHub entry only works once the account is
|
||||
# enrolled in GitHub Sponsors (github.com/sponsors — identity check, Stripe payout account and
|
||||
# a tax form); until then the button is simply not shown.
|
||||
github: DuarteSantos8
|
||||
@@ -1,5 +1,14 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Questions & contributing
|
||||
- name: Question or self-hosting help
|
||||
url: https://github.com/DuarteSantos8/openGym/discussions/categories/q-a
|
||||
about: Login/passkey trouble, reverse proxies, Docker, "how do I…" — ask in Q&A, not in an issue.
|
||||
- name: Idea or feature request to talk through
|
||||
url: https://github.com/DuarteSantos8/openGym/discussions/categories/ideas
|
||||
about: Not sure it belongs in the app yet? Float it in Ideas first — issues are for agreed work.
|
||||
- name: Show your setup
|
||||
url: https://github.com/DuarteSantos8/openGym/discussions/categories/show-and-tell
|
||||
about: Running openGym somewhere interesting, or built something on top of it? Show it off.
|
||||
- name: Contributing guide
|
||||
url: https://github.com/DuarteSantos8/openGym/blob/main/CONTRIBUTING.md
|
||||
about: Read the project layout, dev setup, and guidelines before opening an issue.
|
||||
about: Project layout, dev setup and guidelines before you open a PR.
|
||||
@@ -0,0 +1,102 @@
|
||||
# Dependency updates, deliberately quiet.
|
||||
#
|
||||
# openGym is dependency-light on purpose: the frontend is React + Router + Zustand, and api/
|
||||
# has two runtime dependencies. A default Dependabot setup would still open a PR per package
|
||||
# per week, which on a solo project means the alerts stop being read — the opposite of what
|
||||
# this is for. So: monthly, everything in an ecosystem grouped into a single PR, and a low
|
||||
# cap on open PRs. Security advisories are unaffected by any of this; GitHub raises those
|
||||
# regardless of schedule.
|
||||
#
|
||||
# Only manifests that actually exist here are listed. Deliberately NOT covered:
|
||||
# - gradle (frontend/android) and cocoapods (frontend/ios) — Capacitor generates those shells
|
||||
# and pins the native versions to the @capacitor/* npm packages. Bumping them independently
|
||||
# desyncs the two and breaks the mobile build; they follow the npm update instead.
|
||||
version: 2
|
||||
|
||||
updates:
|
||||
# Frontend app — frontend/package.json
|
||||
- package-ecosystem: npm
|
||||
directory: /frontend
|
||||
schedule:
|
||||
interval: monthly
|
||||
open-pull-requests-limit: 3
|
||||
groups:
|
||||
# Routine bumps arrive as one PR. Runtime and build tooling move together anyway (a Vite
|
||||
# bump usually wants its plugin bumped), and splitting them doubles the review without
|
||||
# splitting the risk.
|
||||
frontend:
|
||||
patterns: ['*']
|
||||
update-types: ['minor', 'patch']
|
||||
# Majors get their own PR. The first grouped run bundled a Capacitor 7 → 8 migration in
|
||||
# with six siblings, where it read as housekeeping — and CI would have gone green on it,
|
||||
# because the test workflow builds the web app and never touches the mobile flavour. A
|
||||
# major that lands alone is at least obviously a decision.
|
||||
frontend-major:
|
||||
patterns: ['*']
|
||||
update-types: ['major']
|
||||
ignore:
|
||||
# Capacitor 8 needs Node >= 22 (its own `engines` field) and the build host is on 20, and
|
||||
# `frontend/android` + `frontend/ios` are committed, so a major also means migrating the
|
||||
# native projects — Gradle/AGP, the Podfile. That is a deliberate piece of work, not a
|
||||
# dependency bump. Drop this ignore once the build host is on Node 22 and you want it.
|
||||
- dependency-name: '@capacitor/*'
|
||||
update-types: ['version-update:semver-major']
|
||||
|
||||
# Backend — api/package.json (@simplewebauthn/server, web-push)
|
||||
- package-ecosystem: npm
|
||||
directory: /api
|
||||
schedule:
|
||||
interval: monthly
|
||||
open-pull-requests-limit: 3
|
||||
groups:
|
||||
api:
|
||||
patterns: ['*']
|
||||
update-types: ['minor', 'patch']
|
||||
# Two dependencies, but one of them verifies passkeys — a major there is worth reading on
|
||||
# its own rather than alongside anything else.
|
||||
api-major:
|
||||
patterns: ['*']
|
||||
update-types: ['major']
|
||||
|
||||
# Base images — api/Dockerfile (node:22-alpine)
|
||||
- package-ecosystem: docker
|
||||
directory: /api
|
||||
schedule:
|
||||
interval: monthly
|
||||
open-pull-requests-limit: 1
|
||||
ignore:
|
||||
# Odd-numbered Node majors are "Current", never LTS — they stop getting fixes in about
|
||||
# six months. Dependabot's first run offered 22 → 25, which for something other people
|
||||
# self-host is a stability downgrade for nothing. Even majors (22 → 24 → 26) still get
|
||||
# proposed, which is the move actually worth reviewing.
|
||||
- dependency-name: node
|
||||
versions: ['25.x', '27.x', '29.x', '31.x', '33.x']
|
||||
|
||||
# Base images — web/Dockerfile (node:22-alpine build stage + nginx:alpine)
|
||||
- package-ecosystem: docker
|
||||
directory: /web
|
||||
schedule:
|
||||
interval: monthly
|
||||
open-pull-requests-limit: 1
|
||||
ignore:
|
||||
- dependency-name: node
|
||||
versions: ['25.x', '27.x', '29.x', '31.x', '33.x']
|
||||
|
||||
# Workflow actions — everything under .github/workflows/
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule:
|
||||
interval: monthly
|
||||
open-pull-requests-limit: 2
|
||||
groups:
|
||||
# These are all first-party actions/* and docker/* pinned to a major tag; they update
|
||||
# in lockstep and none of them is worth a PR of its own.
|
||||
actions:
|
||||
patterns: ['*']
|
||||
update-types: ['minor', 'patch']
|
||||
# Action majors are usually a runner or Node-version change and usually harmless — but
|
||||
# these workflows publish the ghcr images and deploy the live demo, so the blast radius
|
||||
# is real. Separate PR, so a failure has an obvious cause.
|
||||
actions-major:
|
||||
patterns: ['*']
|
||||
update-types: ['major']
|
||||
@@ -23,22 +23,22 @@ jobs:
|
||||
context: .
|
||||
file: ./web/Dockerfile
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- name: Lowercase owner (registry names must be lowercase)
|
||||
id: repo
|
||||
run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/setup-qemu-action@v4
|
||||
- uses: docker/setup-buildx-action@v4
|
||||
|
||||
- uses: docker/login-action@v3
|
||||
- uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: docker/metadata-action@v5
|
||||
- uses: docker/metadata-action@v6
|
||||
id: meta
|
||||
with:
|
||||
images: ghcr.io/${{ steps.repo.outputs.owner }}/opengym-${{ matrix.image }}
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- uses: docker/build-push-action@v6
|
||||
- uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: ${{ matrix.context }}
|
||||
file: ${{ matrix.file }}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
# Publishes the browser-only demo to GitHub Pages: https://duartesantos8.github.io/openGym/
|
||||
#
|
||||
# Pages serves static files only, so this build has no backend — VITE_DEMO=1 makes the app
|
||||
# boot straight into guest mode with a seeded example history (see frontend/src/lib/demo.js).
|
||||
# The exercise images/GIFs (~140 MB) are never committed here; the demo build points at the
|
||||
# upstream dataset on jsDelivr instead, pinned to a commit so the CDN can cache it forever.
|
||||
name: Deploy demo to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'frontend/**'
|
||||
- '.github/workflows/pages.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
DATASET: https://cdn.jsdelivr.net/gh/hasaneyldrm/exercises-dataset@7455efae41b330c265e7cd4b78dfa848e7ce5ebd
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
cache-dependency-path: frontend/package-lock.json
|
||||
- run: npm ci
|
||||
working-directory: frontend
|
||||
- run: npm run build
|
||||
working-directory: frontend
|
||||
env:
|
||||
VITE_DEMO: '1'
|
||||
VITE_IMG_BASE: ${{ env.DATASET }}/images/
|
||||
VITE_GIF_BASE: ${{ env.DATASET }}/videos/
|
||||
- uses: actions/configure-pages@v6
|
||||
- uses: actions/upload-pages-artifact@v5
|
||||
with:
|
||||
path: frontend/dist
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deploy.outputs.page_url }}
|
||||
steps:
|
||||
- id: deploy
|
||||
uses: actions/deploy-pages@v5
|
||||
@@ -0,0 +1,65 @@
|
||||
# Runs on pull requests too — the other two workflows only fire on push to main, so
|
||||
# contributed changes used to reach main without anything ever having been run.
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'frontend/**'
|
||||
- 'mcp/**'
|
||||
- '.github/workflows/test.yml'
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'frontend/**'
|
||||
- 'mcp/**'
|
||||
- '.github/workflows/test.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: test-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
# node:22-alpine in web/Dockerfile and api/Dockerfile — CI must match production.
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
cache-dependency-path: frontend/package-lock.json
|
||||
- run: npm ci
|
||||
working-directory: frontend
|
||||
- run: npm test
|
||||
working-directory: frontend
|
||||
# A broken import or bad JSX fails the build long before any test covers it.
|
||||
- run: npm run build
|
||||
working-directory: frontend
|
||||
- run: node scripts/check-locales.mjs
|
||||
working-directory: frontend
|
||||
|
||||
mcp:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
cache-dependency-path: mcp/package-lock.json
|
||||
- run: npm ci
|
||||
working-directory: mcp
|
||||
- run: npm test
|
||||
working-directory: mcp
|
||||
# The one check the vitest suite structurally cannot make. The MCP server is a bare node
|
||||
# process, but vitest runs its tests through Vite — import.meta.glob, .jsx imports and
|
||||
# ?raw all resolve happily there. That is how a Vite-only import reached a shared lib
|
||||
# module with 33 green tests standing over a server that died on startup.
|
||||
- run: npm run check:node-loadable
|
||||
working-directory: mcp
|
||||
@@ -1,5 +1,391 @@
|
||||
# Changelog
|
||||
|
||||
## v1.2.5 — 2026-08-04
|
||||
|
||||
Nothing in the app itself changed. This release adds an optional side door: a small server that
|
||||
lets an AI assistant you already run — Claude Desktop, Cursor, Cline — answer questions about
|
||||
your own training, off the same files your instance already writes. If you don't use one, this
|
||||
release is invisible to you.
|
||||
|
||||
### Ask an AI about your training, without the data leaving your box (#19)
|
||||
|
||||
- 🤖 **An MCP server (`mcp/`)** — opt-in, read-only, and not part of the Docker build. Your LLM
|
||||
client spawns it as a local process, it reads `./data` directly, and it exits when the client
|
||||
disconnects. No new container, no extra auth on the api, no third-party service, nothing over
|
||||
the network. *"What did I bench last week?", "what's my estimated 1RM on deadlift?", "which
|
||||
muscles have I been neglecting?"*
|
||||
- **The answers match the Stats screen because they are the same numbers.** The server calls the
|
||||
very functions in `frontend/src/lib/` the app already computes with, rather than reimplementing
|
||||
them. Eight tools: routines, the week plan, workouts, one session in detail, body weight,
|
||||
estimated 1RM and muscle balance.
|
||||
- **Read-only on purpose.** Logging a workout from an assistant needs a long-lived token the api
|
||||
does not have yet, plus a lock against the web UI's read-modify-write. Until both exist, the
|
||||
server answers questions and does nothing else. It never reads passkey material, VAPID keys or
|
||||
session state — only the profile it was pointed at.
|
||||
- `docker-compose.yml` is untouched and nothing new enters the image, so an instance that ignores
|
||||
this ships exactly what it shipped before. Setup is in [mcp/README.md](mcp/README.md).
|
||||
|
||||
### Under the hood
|
||||
|
||||
- The pure half of `i18n.js` — the language state, the constants, the readers — moved into
|
||||
`i18n-core.js`, so the helpers under `frontend/src/lib/` can be loaded by a plain Node process
|
||||
and not only by Vite. `i18n.js` keeps the Vite-only parts (the locale-pack loader, the React
|
||||
hook) and re-exports the rest, so nothing that imports it had to change.
|
||||
- The shared lib modules that only need `t` now take it from the core directly. A Vite-only
|
||||
import inside a shared module is invisible under vitest, which transforms it, and fatal to the
|
||||
MCP server, which does not — so the shared half stays clear of the bundler half by
|
||||
construction rather than by remembering to.
|
||||
- `npm run check:node-loadable` in `mcp/` walks the server's import graph under a bare `node`,
|
||||
which is the one thing the test suite cannot do from inside Vite. CI runs it, alongside the
|
||||
MCP tests — neither had ever run there before.
|
||||
|
||||
The MCP server was contributed by [@Pengboi](https://github.com/Pengboi) — the first feature in
|
||||
openGym written by someone other than me. Thank you.
|
||||
|
||||
## v1.2.4 — 2026-08-01
|
||||
|
||||
The effort ratings you have been recording since v1.2.3 now answer questions, and bodyweight
|
||||
training stops being treated as barbell training with the weight left at zero. Plus: creating a
|
||||
profile from Settings works on an invite-only instance, which it never has.
|
||||
|
||||
### The effort ratings, read back as statistics
|
||||
|
||||
v1.2.3 let you rate how hard a set was. Nothing then read that rating back — it lived in the set
|
||||
label and nowhere else. Stats now answers the question the number was recorded for.
|
||||
|
||||
- 📊 **An Effort card in Stats** over 30d / 90d / 1Y / all time: average effort, the share of sets
|
||||
taken close to failure, and — always alongside them — how much of your training was rated at
|
||||
all. Rating is optional and off by default, so a partly rated history is normal; an average
|
||||
without its denominator would quietly speak for sets you never rated.
|
||||
- **Week by week.** The weekly average with that week's set count in the tooltip, because the
|
||||
pair is the reading: volume up with effort up is fatigue accumulating, volume up with effort
|
||||
flat is the adaptation you were training for. Weeks resting on a single rated set are dropped
|
||||
rather than drawn.
|
||||
- **Where the sets land.** The spread across the scale, not just the middle of it. Half your sets
|
||||
at failure and half in warm-up territory average out to a healthy-looking number; this is the
|
||||
chart that shows it.
|
||||
- 🔥 **Hard-sets mode on the muscle map.** The same body diagram, counting only sets taken near
|
||||
failure — "where did the stimulus go" rather than "where did the volume go". A muscle can lead
|
||||
on set count and still never be trained hard.
|
||||
- **Effort on the exercise curve.** Each session's dot on the top-set chart fills in as less is
|
||||
left in the tank, so the same weight moved with more in reserve stops reading as a flat line.
|
||||
Exercises with enough ratings also get an Effort curve of their own.
|
||||
- **One history, whichever scale you use.** Everything aggregates internally in RIR and converts
|
||||
back for display, so a history that mixes your own RIR logs with imported RPE averages as one
|
||||
series instead of two half-empty ones. RIR charts count downward on the axis, so harder sets
|
||||
sit higher.
|
||||
- Translated into all 12 UI languages.
|
||||
|
||||
### Bodyweight training, logged the way it is done
|
||||
|
||||
A push-up has no weight to type, and the app asked for one anyway — every set, on a quarter of
|
||||
the catalogue. Three reports (#31, #32, #33) turned out to be the same gap: the app assumed
|
||||
progress lived in the load. It doesn't, for the exercises most people actually start with.
|
||||
|
||||
- 💪 **Exercises know they are bodyweight.** Seeded from the equipment the dataset already
|
||||
records, so push-ups, pull-ups, dips and 300-odd others arrive marked. The weight column is
|
||||
not shown, the set row is one stepper instead of two, and the "confirm your working weight"
|
||||
prompt at the end of an exercise stops asking about a weight that was never there. (#32)
|
||||
- **Added weight when there is any.** A dip belt or a weighted vest is entered once in the
|
||||
exercise settings and reads as an addition — "+10 × 8", not "10×8" — everywhere it is shown
|
||||
back. With load on the belt the normal progression rules take over again, because now there
|
||||
is something to add.
|
||||
- 📈 **Reps and sets are the progression.** Clean session, one more rep. Set a top of the range
|
||||
and reaching it adds a set and starts the reps over instead of climbing forever; at six sets
|
||||
it says what it should have said all along, which is that it is time for weight or a harder
|
||||
variation. No ceiling set keeps the old behaviour exactly. (#33)
|
||||
- ↔️ **Reps per side.** For lunges, single-arm rows and every other unilateral movement. You
|
||||
log what you did — 16, the total — and the app shows the split, "8 per side", so the set in
|
||||
front of you is unambiguous without the rep count meaning one thing here and another there.
|
||||
The target steps in twos, 16 → 18 → 20, because half of an odd total is a rep one side never
|
||||
gets. (#31)
|
||||
- Both settings travel with a shared plan, and are written to a plan file only when they
|
||||
disagree with the catalogue — every existing plan, workout and backup is read unchanged and
|
||||
none of it needs migrating.
|
||||
- Translated into all 12 UI languages.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Creating a profile from Settings on an invite-only instance.** The sign-in screen asks for
|
||||
the invite code when the server needs one; the same registration reached from Settings never
|
||||
did, so it was refused with nothing on screen explaining why. It now asks on the same terms.
|
||||
- **A long value no longer runs through its own label** in a settings row — "Follow the routine
|
||||
(Linear progression)" overlapped "Rule" rather than shortening itself.
|
||||
|
||||
## v1.2.3 — 2026-07-31
|
||||
|
||||
How hard a set was, in whichever of the two scales you already think in — and the ratings your
|
||||
old app recorded come across with the rest of your history. Plus: the phone stops locking itself
|
||||
mid-workout, the rest timer can hand time back as well as take it, and Settings is grouped by
|
||||
what each thing actually affects.
|
||||
|
||||
### The screen stays on while you train
|
||||
|
||||
- ☀️ **Keep screen awake — Settings → *During a workout*, on by default.** Locking, unlocking
|
||||
and finding your place again between every set was the single most annoying thing about
|
||||
logging on a phone. The screen now stays lit for as long as a workout is running and lets go
|
||||
the moment you finish it, so nothing is held while you are not training.
|
||||
- **It survives a tab switch.** Browsers release the lock whenever the page stops being visible,
|
||||
which is exactly what happens when you glance at a message. The lock is taken again each time
|
||||
the app comes back, rather than dying the first time you look away.
|
||||
- **It follows the workout, not the screen you are on.** Checking Stats mid-session keeps the
|
||||
screen awake.
|
||||
- **Where it isn't available, it says so.** iOS grants no wake lock in Low Power Mode, and older
|
||||
browsers have no Wake Lock API at all — the first is silent, the second shows the row disabled
|
||||
rather than offering a switch that does nothing. Needs HTTPS, like every other modern browser
|
||||
capability.
|
||||
|
||||
### Rest timer: take 15 seconds off, too
|
||||
|
||||
- ⏳ **A −15s button next to +15s.** The timer could only ever be extended or skipped outright;
|
||||
now it goes both ways. Taking off more than is left finishes the rest rather than counting
|
||||
into the negative — the same thing Skip does.
|
||||
- **Rearranged so three controls fit.** The clock and the progress bar take the top row and the
|
||||
controls sit underneath: −15 and +15 together in number-line order, Skip pushed to the far
|
||||
edge so the button that ends the rest is not next to the one you tap to buy more time. On a
|
||||
wide screen it stays on one line. Tap targets are bigger than they were.
|
||||
- **The bar is nearly opaque.** The set rows underneath were reading through it and making the
|
||||
clock hard to pick out.
|
||||
|
||||
### Settings, grouped by what it affects
|
||||
|
||||
- **General** (language, units) · **During a workout** (rest timer, keep screen awake, sounds,
|
||||
effort per set) · **Notifications** · **Appearance** (theme, body diagram, accent) · **Data**.
|
||||
- The old grouping mixed axes: "Units & timer" put a display preference next to two workout
|
||||
behaviours, language sat under Appearance, and *Load starter plan* was buried between the
|
||||
backup actions and the destructive reset. Data now reads in the order you would use it — fill
|
||||
the plan, bring history over from another app, restore a backup, export one, wipe everything.
|
||||
- Nothing was removed and no setting changed its meaning.
|
||||
|
||||
### Effort per set: RIR or RPE (#21)
|
||||
|
||||
- 🎯 **A third column on a working set, off by default.** Settings → *Effort per set* switches
|
||||
it between **Off**, **RIR** and **RPE**. It only appears on weighted rep sets: a plank or a
|
||||
treadmill row has nowhere to put it.
|
||||
- **Two names for the same judgement.** RIR counts the reps you left in the tank; RPE reads the
|
||||
same effort off a 10-point scale, so RPE ≈ 10 − RIR. The setting has an (i) that lays the two
|
||||
scales side by side in a conversion table rather than explaining them in a paragraph.
|
||||
- **Each set keeps the scale it was logged with.** Switching the setting changes what new sets
|
||||
ask for and nothing else — history is never silently rewritten, and a set logged as RIR 2
|
||||
still reads back as RIR 2 years later.
|
||||
- **An unrated set stays unrated.** Blank and 0 are different things: RIR 0 says the set went to
|
||||
failure. So `−` on an untouched cell leaves it empty, `+` starts at the bottom of the scale
|
||||
and walks up in even steps, and stepping back off the bottom clears the cell again — a mistap
|
||||
is always undoable.
|
||||
- **Nothing else reads the value.** Progression rules and estimated 1RM are unaffected; the
|
||||
rating is yours to look at, not an input to the maths.
|
||||
- Upgrading keeps the column you had: a profile still carrying the old `showRir` flag — from
|
||||
this device, a sync, or a backup restored later — comes across as RIR.
|
||||
|
||||
### Import brings your ratings with it
|
||||
|
||||
- 📥 **The RPE Hevy and Strong export is no longer dropped.** An `RPE` column is read into the
|
||||
set, as is an `RIR` column if a file has one, and the import summary says how many sets
|
||||
arrived with a rating — plus where to switch the column on if it's off.
|
||||
- A blank cell stays unrated rather than becoming 0. A written-out `0` counts as a rating on the
|
||||
RIR scale (a set to failure) but not on RPE, which starts at 1 — apps write 0 there to mean
|
||||
"nothing here", and reading it as an effort would stamp one on every unrated set in the file.
|
||||
- Ratings above the scale are capped instead of thrown away, and junk in the column is ignored
|
||||
without losing the set.
|
||||
- Backups already carried both fields and the setting, since a backup is the whole state — there
|
||||
are now tests pinning that, so it can't quietly stop being true.
|
||||
|
||||
## v1.2.2 — 2026-07-25
|
||||
|
||||
Training that moves on its own: an exercise can now be logged by time instead of reps, the
|
||||
next weight follows a progression rule you choose rather than a single hard-coded hint, and
|
||||
every lift carries an estimated 1RM. Plus a standalone mobile app, a shareable plan, and an
|
||||
importer for your history from other apps.
|
||||
|
||||
### Timed sets and a timer for the set itself (#16)
|
||||
|
||||
- ⏱️ **Reps or time, per exercise.** Planks, hangs, wall sits, dead hangs and loaded
|
||||
carries no longer have to be filed under cardio to be timed. Each exercise in a routine
|
||||
picks its own mode, and a timed set can still carry weight for a weighted plank or a
|
||||
farmer's walk.
|
||||
- ▶️ **A work timer, separate from the rest timer.** Start a timed set and it counts the
|
||||
hold down, beeping and buzzing at zero exactly as the rest timer does, then checks the
|
||||
set off itself. The two timers can never run at once — they mean opposite things.
|
||||
- Finishing a hold early logs **the time you actually held**, not the target. A 38-second
|
||||
hold against a 45-second target is recorded as 38 seconds.
|
||||
- The mode travels everywhere it should: routine editor, workout, history, exercise
|
||||
statistics (timed exercises chart their longest hold), the printable plan and the shared
|
||||
plan file.
|
||||
- Plans made before this release are read exactly as they always were — nothing to migrate.
|
||||
|
||||
### Progression rules you can read (#17)
|
||||
|
||||
- 📈 **Pick a rule per routine, override it per exercise.** Linear progression, **Greyskull
|
||||
LP** (two straight sets plus an AMRAP final set, with double jumps and a 10 % reset),
|
||||
double progression through a rep range, or adding time for timed work. Or none at all.
|
||||
- 🧾 **Every target explains itself.** "Every rep last time — 2.5 kg more." "Missed reps
|
||||
3 sessions running — reset to 55 kg and work back up." The rule is visible before you
|
||||
train, not after.
|
||||
- The session opens with the right weights already in the rows, instead of suggesting them
|
||||
once you are standing at the bar.
|
||||
- 🚫 **A bad session can't look like a good one.** Short reps count as a miss even when you
|
||||
checked the set off; a set you never checked counts as a miss because you did not do it.
|
||||
Nothing advances the load on a session that fell apart.
|
||||
- Stalls and deloads are worked out from your log every time they are needed. Nothing is
|
||||
written back into a finished workout and no counters are stored, so fixing a mistyped set
|
||||
immediately produces the right next target.
|
||||
- Lower-body lifts step up in larger jumps than upper-body ones by default, and any
|
||||
exercise can set its own step.
|
||||
- Bodyweight exercises progress in **reps**, because there is no load to add to a push-up
|
||||
and no load to take off it either.
|
||||
|
||||
### Estimated 1RM (#18)
|
||||
|
||||
- 💪 **An estimated one-rep max for every lift**, in the exercise progress card (with its
|
||||
own curve you can switch to) and in the exercise detail sheet.
|
||||
- It always names the set it came from — "from 90 kg × 5 on 15 Jul" — because an estimate
|
||||
off a heavy triple and one off a set of ten are very different claims.
|
||||
- 🧮 **A calculator** for a set you have not done yet, so the number is reachable before
|
||||
there is any history.
|
||||
- Epley by default, and it **refuses to guess above 12 reps**, where the common formulas
|
||||
disagree by double digits.
|
||||
- A new best estimate is reported at the end of a workout separately from a weight PR —
|
||||
same weight for more reps is real progress, but it is not a heavier lift.
|
||||
|
||||
### Share a plan
|
||||
|
||||
- 📤 **Send someone your plan.** Plan → *Share your plan* writes a small file with your
|
||||
routines, the week schedule and any custom exercises they use — and nothing else. No
|
||||
workouts, no weigh-ins, no settings.
|
||||
- Importing **merges**: shared routines arrive as new ones with fresh ids, custom exercises
|
||||
are matched by name so they are not duplicated, and your own plan is never overwritten.
|
||||
Taking the week schedule with it is optional.
|
||||
- 🖨️ **A printable plan** (Save as PDF) laid out so a single exercise never breaks across
|
||||
a page.
|
||||
|
||||
### Fixes
|
||||
|
||||
- A shared plan file naming an exercise this build doesn't have can no longer take the app
|
||||
down. Unknown ids are dropped on import, anything that slips through renders as a
|
||||
placeholder you can delete, and an error boundary around the screens means a bad state is
|
||||
recoverable by switching tabs instead of reloading.
|
||||
- Importing from another app converts weights **per row**, not per file. FitNotes writes the
|
||||
unit on each set, so a mixed export used to land 185 lb as 185 kg.
|
||||
- Numbers follow the UI language instead of a hardcoded locale, which was putting Swiss
|
||||
apostrophes ("7'535 kg") in front of everyone. Volume stays in your own unit rather than
|
||||
switching to tonnes, which was wrong for pound profiles.
|
||||
- Taking over a week schedule from a shared plan now really replaces Monday–Sunday instead
|
||||
of only the days the shared file happened to fill.
|
||||
- The body-weight slider's ceiling follows your unit (300 kg / 660 lb).
|
||||
- "Best: 85 Kg" is capitalised correctly again.
|
||||
|
||||
### One codebase, two flavors
|
||||
|
||||
openGym is also a standalone mobile app — and it ships as a direct APK download, not
|
||||
through app stores.
|
||||
|
||||
- 📱 **Standalone mobile app.** The same frontend now also builds as a native iPhone /
|
||||
Android app (Capacitor) — the install-and-done flavor of openGym: no account, no server,
|
||||
no sync. Everything stays on the phone.
|
||||
- State is mirrored into a file in the app's private storage on every change, so your
|
||||
log survives even when the OS evicts WebView storage (iOS does).
|
||||
- The workout-day reminder becomes a **native notification** scheduled on the weekdays
|
||||
your plan actually has a routine — no push server involved.
|
||||
- Backups go out through the OS **share sheet** (Files, AirDrop, mail…).
|
||||
- Exercise images/animations load from the same CDN as the live demo.
|
||||
- `npm run build:mobile`, then open `android/` in Android Studio or `ios/` in Xcode —
|
||||
see **docs/MOBILE.md**. `NOTICE.md` now carries an AGPL §7 app-store exception.
|
||||
- 🤖 **Android APK, no Play Store.** The official build is a signed, sideloadable APK
|
||||
(~4.5 MB) from [opengym.duarte-santos.ch](https://opengym.duarte-santos.ch) — deliberately
|
||||
store-free. docs/MOBILE.md covers building and signing your own.
|
||||
- 🍎 **iOS reality check.** Apple permits no installs outside the App Store, so there is no
|
||||
iOS download; the docs explain the free options (self-hosted PWA on the home screen, or
|
||||
running the native app onto your own iPhone from Xcode).
|
||||
|
||||
- 📥 **Import your history from another app.** Settings → Data → *Import from another app*
|
||||
reads an export from **FitNotes** (both the Android and the FitNotes 2 iOS format),
|
||||
**Strong** and **Hevy**, and pulls body-weight history out of an **Apple Health** export.
|
||||
Anything else with a date, an exercise name and weight/reps columns is read too.
|
||||
- Every row becomes a set, grouped into workouts by date, so your history arrives with
|
||||
its real dates rather than as one lump. Hevy and Strong also carry session length, so
|
||||
the activity heatmap fills in properly.
|
||||
- Exercise names are matched against the 1,324-exercise library — parenthetical
|
||||
qualifiers like "(Barbell)" and shorthand like BB/DB are normalised, and a curated
|
||||
table covers the plain names people actually log ("Bench Press", "Squat", "RDL").
|
||||
Where a name is genuinely ambiguous it is *not* guessed at: it becomes one of your own
|
||||
exercises instead, because filing years of training under the wrong lift is worse than
|
||||
an unmatched name you can see and fix.
|
||||
- A summary shows what will happen — workouts, sets, how many exercises matched, which
|
||||
ones didn't, and whether weights need converting — before anything is written.
|
||||
- Importing is idempotent: days you already have data for are left alone, so running it
|
||||
twice, or importing from two apps, never duplicates a workout.
|
||||
|
||||
## v1.2.1 — 2026-07-23
|
||||
|
||||
A muscle map across the app, and a live demo you can try without installing anything.
|
||||
|
||||
- 💪 **Muscle map.** Three places now show which muscles your training actually reaches, drawn on a
|
||||
front-and-back body diagram shaded like the activity heatmap — more accent means more work.
|
||||
- **Stats → Muscle balance** aggregates a week, 30 days, 90 days or everything, lists your
|
||||
hardest-worked muscles with their set counts, and names the ones that got *nothing* in that
|
||||
period. That last list is the point of the card: the gaps are what you'd otherwise never notice.
|
||||
Tap any muscle to read its name and volume.
|
||||
- **Routine editor** previews what a session hits as you build it, so a hole in the plan shows up
|
||||
before you train around it for a month.
|
||||
- **The finish screen** shows what you just trained.
|
||||
- Load is counted in *effective sets* — a set counts fully for the exercise's target muscle and
|
||||
partially for its supporting ones — not in kilograms, because 100 kg of leg press and 12 kg of
|
||||
lateral raise say nothing about which muscle worked harder. Shading is relative within the
|
||||
period you're looking at, so the map always reads as a balance rather than an absolute.
|
||||
- Settings → Appearance → **Body diagram** switches between a male and female figure.
|
||||
- The exercise dataset spells muscles inconsistently ("delts", "deltoids" and "shoulders" are one
|
||||
muscle); all 50 spellings it uses are normalised onto the 18 the diagram can draw. Custom
|
||||
exercises, which only carry a body part, fall back to it. The geometry is ~90 kB and loads on
|
||||
demand, so the initial bundle is unchanged.
|
||||
- 🐛 **Fixed: finishing a workout from its last exercise could blank the whole app.** The
|
||||
per-exercise weight sheet read the running workout without checking it was still there, and
|
||||
finishing clears it while that sheet is still on screen.
|
||||
- ▶️ **Live demo** at [duartesantos8.github.io/openGym](https://duartesantos8.github.io/openGym/) —
|
||||
a browser-only build (`VITE_DEMO=1`) published to GitHub Pages on every push to `main`. It boots
|
||||
into guest mode with a seeded example profile (12 weeks of Push/Pull/Legs, weigh-ins, PRs) so
|
||||
every screen has something to show, and it never talks to a server. Passkeys, sync and the admin
|
||||
dashboard stay exclusive to self-hosted instances, which is where the backend lives.
|
||||
- 🖼️ Builds can point the exercise media elsewhere via `VITE_IMG_BASE` / `VITE_GIF_BASE` — the demo
|
||||
serves the ~140 MB dataset from a CDN instead of shipping it. The default (`img/` and `gif/` next
|
||||
to the app) is unchanged.
|
||||
|
||||
## v1.2.0 — 2026-07-23
|
||||
|
||||
A complete visual redesign. Same app, same data — every screen redrawn.
|
||||
|
||||
### A designed interface, not an assembled one
|
||||
|
||||
- 🎨 **Rebuilt design system.** One type scale carrying hierarchy through size instead of making
|
||||
everything bold, a neutral surface ramp instead of saturated blue-greys, hairline separators
|
||||
instead of outlined boxes, and motion that acknowledges a press rather than animating for
|
||||
decoration. Light and dark are both first-class, and the eight accent colours now pick their
|
||||
label colour by measured contrast — the default green in light mode was failing WCAG AA on
|
||||
every primary button before.
|
||||
- ✏️ **A hand-drawn icon set** (77 icons, single stroke weight, drawn on one 24×24 grid) replaces
|
||||
every emoji in the interface. Emoji render differently on each platform, sit on their own
|
||||
baseline and can't take a theme colour, which is what made the old UI feel stitched together.
|
||||
Icons inherit the surrounding text colour and optical size.
|
||||
- 🏋️ **Routine icons.** Picking an icon for a routine now offers a grouped set — strength,
|
||||
equipment, cardio, recovery — instead of an emoji keyboard. Routines you already made keep
|
||||
their look: the old emoji are mapped forward automatically, so nothing to migrate and nothing
|
||||
to redo.
|
||||
- ▶️ **New tab bar** with a raised Start button that turns into a pulsing orange Resume while a
|
||||
workout is running.
|
||||
- 🏠 **Home reads as a plan for today** — week strip, today's session as one tappable row, body
|
||||
weight, and your streak.
|
||||
|
||||
### Charts
|
||||
|
||||
- 📈 **Axis labels, gridlines and the target-weight line are visible again** in dark mode. They
|
||||
were painted with colour variables that no longer existed, which silently fell back to black
|
||||
on black — and to no stroke at all for the lines.
|
||||
- 💬 **The hover readout stays on screen.** It used to be positioned with a fixed offset that
|
||||
assumed one label width, so the first and last point pushed it under the chart's clip; it's now
|
||||
placed from its measured size and kept inside the frame, dropping below the point when the
|
||||
point sits high enough that the label would cover the value it reports.
|
||||
- 🖱️ **It also goes away again** — moving off the chart now clears the readout, crosshair and
|
||||
marker, which previously stayed until you hovered somewhere else.
|
||||
|
||||
## v1.1.3 — 2026-07-22
|
||||
|
||||
Admin dashboard for self-hosters (opt-in — off by default), equipment filtering, and
|
||||
|
||||
@@ -7,10 +7,14 @@ to keep it that way — easy to read, easy to self-host.
|
||||
|
||||
```
|
||||
frontend/ React + Vite app (src/views, src/components, src/store, src/lib). Builds to static files.
|
||||
android/ + ios/ are the Capacitor shells for the standalone mobile app (docs/MOBILE.md).
|
||||
api/ backend — server.js (Node, no framework), one dependency (@simplewebauthn/server).
|
||||
web/ multi-stage Dockerfile (builds frontend → nginx) + nginx.conf (serves app, proxies /api).
|
||||
media/ exercise img/gif (gitignored, fetched at runtime).
|
||||
docs/ self-hosting guide.
|
||||
mcp/ optional Model Context Protocol server — read-only stdio bridge for LLM apps
|
||||
(Claude Desktop, Cursor, …) to query a user's workouts/1RM/muscle balance. Not in
|
||||
the Docker build; only runs when an LLM client spawns it. See mcp/README.md.
|
||||
```
|
||||
|
||||
## Running for development
|
||||
@@ -20,25 +24,45 @@ cp .env.example .env
|
||||
docker compose up -d --build # api + web + media on :8080
|
||||
# frontend hot reload:
|
||||
cd frontend && npm install && npm run dev
|
||||
# training logic (progression rules, 1RM, how a session is read back):
|
||||
cd frontend && npm test
|
||||
```
|
||||
|
||||
## Guidelines
|
||||
|
||||
- **Keep it dependency-light.** The frontend uses React + Router + Zustand and nothing else;
|
||||
new deps (front or back) are a hard sell. `api/` has exactly one dependency — keep it that way.
|
||||
new deps (front or back) are a hard sell. `api/` has two (`@simplewebauthn/server` for passkeys,
|
||||
`web-push` for notifications) — keep it near that.
|
||||
- **Match the style.** Small components, clear names, comments only where the "why" isn't obvious.
|
||||
State lives in the Zustand store (`src/store`); pure helpers in `src/lib`.
|
||||
- **Don't commit** the exercise media (`media/`) or `data/` — they're gitignored.
|
||||
- **Test the flow** you touched — click through the affected screens (and the workout flow) in a
|
||||
browser before opening a PR.
|
||||
- **Training logic gets a unit test.** Anything deciding what you lift next, or reading a logged
|
||||
session back, belongs in a pure helper in `src/lib` with tests beside it (`npm test`). These
|
||||
rules are easy to get subtly wrong and nearly impossible to verify by clicking — the
|
||||
progression engine grew two real bugs that only a test pinned down.
|
||||
|
||||
## Good first issues
|
||||
|
||||
- Additional starter plans (upper/lower, full-body, 5×5…)
|
||||
- More languages for the exercise instructions (the dataset ships several)
|
||||
- Importers from other trackers (Strong, Hevy CSV → openGym JSON)
|
||||
- Percentage / training-max programming (5/3/1-style) on top of the progression engine in
|
||||
`src/lib/progression.js` — the policy interface is already there
|
||||
- Accessibility passes on the workout and chart screens
|
||||
|
||||
## Where to ask what
|
||||
|
||||
| You have | Goes to |
|
||||
| --- | --- |
|
||||
| A question, or self-hosting that won't behave | [Discussions → Q&A](https://github.com/DuarteSantos8/openGym/discussions/categories/q-a) |
|
||||
| An idea you're not sure about yet | [Discussions → Ideas](https://github.com/DuarteSantos8/openGym/discussions/categories/ideas) |
|
||||
| A reproducible bug | [Issues](https://github.com/DuarteSantos8/openGym/issues) |
|
||||
| A change you've already built | A pull request |
|
||||
|
||||
An answered question in Q&A is worth more than the same answer buried in a closed issue — the
|
||||
next person searching "passkey login fails behind my reverse proxy" actually finds it.
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
Open an issue with: what you did, what you expected, what happened, and your browser/OS. If it's
|
||||
|
||||
@@ -3,6 +3,47 @@
|
||||
openGym — Copyright (C) 2026 Duarte Santos.
|
||||
openGym's own code is licensed under the **GNU AGPL v3.0** (see [LICENSE](LICENSE)).
|
||||
|
||||
## App store exception
|
||||
|
||||
As an additional permission under section 7 of the AGPL v3.0, the copyright holder permits
|
||||
distribution of the openGym mobile application through app store platforms (such as the
|
||||
Apple App Store and Google Play) whose terms of service would otherwise be incompatible
|
||||
with the AGPL, provided the corresponding source code remains available under the AGPL at
|
||||
the project repository. This permission applies to the distribution channel only and does
|
||||
not otherwise limit the license.
|
||||
|
||||
## Body diagram geometry
|
||||
|
||||
The muscle outlines the body maps are drawn from (`frontend/src/lib/body-paths.js`) are derived
|
||||
from [**MuscleMap**](https://github.com/melihcolpan/MuscleMap) by Melih Colpan, used under the
|
||||
**MIT License** and reproduced below. MuscleMap ships its path data as Swift source rather than
|
||||
`.svg` files; the paths were converted to a JSON module, its sub-group shapes were dropped, and
|
||||
nothing else about the artwork was changed.
|
||||
|
||||
```
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Melih Colpan
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
||||
|
||||
## Exercise data & media
|
||||
|
||||
The exercise names, instructions (English in `frontend/src/lib/exercises-data.js`, other
|
||||
|
||||
@@ -37,6 +37,16 @@ No account on someone else's server, no subscription, no ads. Just `docker compo
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
### [🌐 opengym.duarte-santos.ch](https://opengym.duarte-santos.ch) · [▶ Try the live demo](https://duartesantos8.github.io/openGym/)
|
||||
|
||||
No signup, nothing to install — it runs entirely in your browser on example data.<br>
|
||||
<sub>There's no server behind the demo, so passkey sign-in, sync across devices and the
|
||||
admin dashboard only exist in a self-hosted instance.</sub>
|
||||
|
||||
</div>
|
||||
|
||||
## Why
|
||||
|
||||
Most workout apps lock your data behind a login on their servers, nag you to upgrade, or
|
||||
@@ -50,13 +60,29 @@ as a home-screen app, passkey sign-in, offline support, sync across your phone a
|
||||
- 🏋️ **Weekly plan** — a routine per weekday, over a library of **1,324 exercises** (searchable, with animated demos)
|
||||
- 🗓️ **Reschedule any day** — sick, missed a session, or fewer gym days this week? Move a workout to another day without touching your weekly plan
|
||||
- ▶️ **Guided workouts** — it knows what day it is and starts today's session; asks your body weight first, pre-fills your weights from last time, rest timer, PR detection, per-exercise weight tracking
|
||||
- ☀️ **The screen stays awake while you train** — no unlocking the phone and finding your place again between every set. On for as long as a workout is running, released the moment you finish it, and switchable off in Settings
|
||||
- 🔗 **Supersets** — build them, and log them back-to-back with a rest only after the pair
|
||||
- ⏱️ **Timed exercises** — planks, hangs, wall sits and loaded carries are logged by time, not reps, with a work timer that counts the set itself (separate from the rest timer) and logs the time you actually held. They can carry weight too
|
||||
- 📈 **Progression that follows a rule** — pick one per routine, override it per exercise: linear, **Greyskull LP** (AMRAP top set, double jumps, 10 % resets), double progression through a rep range, or adding time. Your weights are already right when the session opens, and every target says *why* it's that number. Missed reps never advance the load, stalls trigger a deload, and bodyweight exercises progress in reps instead
|
||||
- 💪 **Estimated 1RM** — per exercise, from your best eligible set (it names which one), with its own progress curve and a calculator for sets you haven't done. Won't guess above 12 reps
|
||||
- 🎯 **Effort per set, in your scale** — an optional third column rating how hard a set was, as **RIR** (reps left in the tank) or **RPE** (the same judgement on a 10-point scale). Off by default; each set keeps the scale it was logged with, and nothing else reads the value — your progression and 1RM are unaffected
|
||||
- 💪 **Bodyweight exercises, logged as bodyweight** — push-ups, pull-ups, dips and 300-odd others arrive knowing they carry no load, so there's no weight column and no working-weight prompt: one stepper, log the reps. Add a dip belt and it reads as an addition, and progression goes back to following the weight. Without one, reps climb — and past a ceiling you set, a set is added instead of a rep, up to the point where the honest advice is load or a harder variation
|
||||
- ↔️ **Reps per side** — for lunges, single-arm rows and the rest. You log the total, the app shows the split ("8 per side"), and the target steps in twos so it never lands on a number one side can't have
|
||||
- 🏃 **Cardio** — log time + speed, not just weight × reps
|
||||
- 📤 **Share a plan** — send someone your routines and week schedule as a small file (no workouts, no weigh-ins), or print it as a clean PDF. Importing merges, so their plan is never overwritten
|
||||
- 🔧 **Filter by equipment** — narrow the library to what you actually own; the options adapt to what you've picked, so every combination on screen has results behind it
|
||||
- ✨ **Your own exercises** — a name and a body part is enough; they behave like built-in ones everywhere, with an optional description instead of an animation
|
||||
- 🟩 **Activity heatmap** — a GitHub-style year view, shaded by time spent training
|
||||
- 💪 **Muscle map** — a front-and-back body diagram shaded by how much work each muscle got, over a week, a month or all time. It names the muscles you *haven't* trained in that period, previews what a routine hits while you build it, and shows what you just trained when you finish. Male or female figure, your pick
|
||||
- 🔔 **Push notifications** — rest-timer alerts even with the app closed, plus an optional reminder on days you have a workout planned but haven't logged one. Opt in per profile; keys are generated on first run, nothing to configure
|
||||
- 🔑 **Passkeys, not passwords** — Face ID / Touch ID / fingerprint login; each profile keeps its own data, synced across devices
|
||||
- 🎨 **Themes** — light/dark + 8 accent colors, saved to your profile
|
||||
- 🛠️ **Admin dashboard** (optional) — for whoever runs the instance: who's training right now, per-user history, disable accounts, and invite-only signup. Off by default, so a fresh instance stays open with no admin
|
||||
- 🎨 **Designed, not assembled** — light/dark themes and 8 accent colors saved to your profile, over a hand-drawn icon set instead of emoji, so it looks the same on every phone
|
||||
- 🌍 **12 languages** — full UI translation (EN, DE, ES, FR, IT, PT, PL, TR, RU, ZH, KO, HI); exercise instructions localized in 10 of them, loaded on demand so the app stays fast
|
||||
- 📥 **Bring your history with you** — import from **FitNotes** (Android and iOS), **Strong** and **Hevy**, or body weight straight out of an **Apple Health** export. Exercise names are matched against the library and anything unrecognised becomes one of your own exercises, so nothing in the file is dropped
|
||||
- 📦 **Yours to keep** — one-tap JSON export/import, guest mode, **no telemetry**
|
||||
- 🤖 **Ask an AI about your training** (optional) — an [MCP server](mcp/README.md) lets a client like Claude Desktop or Cursor read your history in your own words: *"what did I bench last week?"*. Read-only, spawned locally by the client, nothing leaves your box. Not in the Docker build — if you don't use an AI assistant, it isn't there
|
||||
- 📱 **Standalone Android app** — the whole tracker as a sideloadable APK: no account, no server, data on the phone, native workout reminders ([download](https://opengym.duarte-santos.ch))
|
||||
|
||||
## Quick start (self-host)
|
||||
|
||||
@@ -78,6 +104,19 @@ a build step locally either way.
|
||||
> Want it reachable from your phone over the internet with passkeys? You'll need an HTTPS
|
||||
> domain — a two-line change in `.env`. See **[docs/SELF_HOSTING.md](docs/SELF_HOSTING.md)**.
|
||||
|
||||
## Mobile app (no server at all)
|
||||
|
||||
The same codebase also builds a **standalone mobile app** (Capacitor): no account, no sync,
|
||||
no backend — everything stays on the phone, with native workout-day reminders and share-sheet
|
||||
backups. Self-hosting gets you multi-device sync and profiles for friends & family; the
|
||||
mobile app is the install-and-done flavor.
|
||||
|
||||
- **Android:** [**download the APK**](https://opengym.duarte-santos.ch) and sideload it —
|
||||
openGym is deliberately not on the Play Store. Or build it yourself: **[docs/MOBILE.md](docs/MOBILE.md)**.
|
||||
- **iPhone:** Apple doesn't allow installing apps outside the App Store, so there is no iOS
|
||||
download. Self-host and add it to your home screen from Safari (it's a full PWA), or build
|
||||
the native app onto your own device from Xcode — see **[docs/MOBILE.md](docs/MOBILE.md)**.
|
||||
|
||||
## How it works
|
||||
|
||||
```
|
||||
@@ -108,19 +147,28 @@ server — they stay in your phone's secure hardware / your password manager.
|
||||
|
||||
All via `.env` (see `.env.example`):
|
||||
|
||||
| Variable | What it is | Default |
|
||||
|------------|-----------------------------------|-------------------------|
|
||||
| `RP_ID` | Hostname passkeys are bound to | `localhost` |
|
||||
| `ORIGIN` | Full URL the app is served from | `http://localhost:8080` |
|
||||
| `WEB_PORT` | Host port for the web UI | `8080` |
|
||||
| `RP_NAME` | Name shown in the passkey prompt | `openGym` |
|
||||
| Variable | What it is | Default |
|
||||
|---------------|------------------------------------------------------|-------------------------|
|
||||
| `RP_ID` | Hostname passkeys are bound to | `localhost` |
|
||||
| `ORIGIN` | Full URL the app is served from | `http://localhost:8080` |
|
||||
| `WEB_PORT` | Host port for the web UI | `8080` |
|
||||
| `RP_NAME` | Name shown in the passkey prompt | `openGym` |
|
||||
| `ADMIN_UIDS` | User ids that get the admin dashboard (comma-separated) | *(none)* |
|
||||
| `INVITE_ONLY` | Require an invite code to create a profile | *(off)* |
|
||||
|
||||
Push notification keys are generated on first run and saved to `./data/vapid.json` — nothing to set.
|
||||
|
||||
## Roadmap
|
||||
|
||||
Rough, community-driven — ideas and PRs welcome:
|
||||
|
||||
- [x] Standalone mobile app — Android APK to sideload ([download](https://opengym.duarte-santos.ch)); on iOS as a self-hosted PWA (no store listings planned)
|
||||
- [x] Automatic progression programs (linear, Greyskull LP, double progression) with stalls and deloads
|
||||
- [x] Estimated 1RM per exercise
|
||||
- [ ] Percentage / training-max programming (5/3/1-style) on top of the progression engine
|
||||
- [ ] More starter plans (upper/lower, full-body, 5×5)
|
||||
- [ ] Importers from Strong / Hevy (CSV → openGym JSON)
|
||||
- [x] Importers from FitNotes / Strong / Hevy (including the RPE they record), and body weight from Apple Health
|
||||
- [x] Effort per set — RIR or RPE, whichever scale you think in
|
||||
- [ ] Body measurements (waist, arms…) alongside weight
|
||||
- [ ] Per-exercise notes & plate calculator
|
||||
- [ ] Exercise instructions in German & Portuguese (UI is translated; upstream dataset doesn't ship these yet)
|
||||
@@ -132,11 +180,36 @@ WebAuthn · exercise data from [hasaneyldrm/exercises-dataset](https://github.co
|
||||
No database server, no cloud dependencies — the frontend builds inside Docker, so self-hosting
|
||||
stays a one-command `docker compose up`.
|
||||
|
||||
The training logic — progression rules, 1RM estimation, how a logged session is read back —
|
||||
lives in pure functions under `frontend/src/lib/` with tests next to them: `npm test` in
|
||||
`frontend/`. Vitest is a dev dependency; the app itself ships no runtime dependencies beyond
|
||||
React, the router and Zustand.
|
||||
|
||||
The same pure helpers power an optional MCP server (`mcp/`) that lets an LLM client like
|
||||
Claude Desktop read your data over stdio — see [mcp/README.md](mcp/README.md). Opt-in, not
|
||||
in the Docker build.
|
||||
|
||||
## Community
|
||||
|
||||
- **[Q&A](https://github.com/DuarteSantos8/openGym/discussions/categories/q-a)** — self-hosting
|
||||
help, passkey/login trouble, "how do I…". Most login problems turn out to be an `RP_ID`/`ORIGIN`
|
||||
mismatch.
|
||||
- **[Ideas](https://github.com/DuarteSantos8/openGym/discussions/categories/ideas)** — features
|
||||
worth talking through before anyone writes code.
|
||||
- **[Show and tell](https://github.com/DuarteSantos8/openGym/discussions/categories/show-and-tell)**
|
||||
— your setup, your plan templates, whatever you built on top.
|
||||
- **[Issues](https://github.com/DuarteSantos8/openGym/issues)** — bugs, and work that's already
|
||||
been agreed on.
|
||||
|
||||
## Contributing
|
||||
|
||||
Issues and PRs welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Good first issues: more starter
|
||||
plans, exercise-data languages, import from other trackers. **A ⭐ helps more people find it.**
|
||||
|
||||
openGym is free and stays free: AGPL, no subscription, no paid tier, nothing held back for
|
||||
sponsors. If it replaced a paid tracker for you and you want to chip in, the Sponsor button at the
|
||||
top of the page is there — a star, a bug report or a PR is worth just as much.
|
||||
|
||||
## License
|
||||
|
||||
[GNU AGPL v3.0](LICENSE) — free and open source. You can self-host, use, modify and share it;
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
# Security policy
|
||||
|
||||
openGym is a self-hosted app: you run the server, you hold the data. This file says which
|
||||
versions get fixes, how to report something privately, and — the part most people actually
|
||||
need — what the app protects you from and what it doesn't.
|
||||
|
||||
## Supported versions
|
||||
|
||||
Only the **latest release**. Releases are semver tags (`v1.0.0` → `v1.2.3`, see
|
||||
[CHANGELOG.md](CHANGELOG.md)); there is no LTS or maintenance branch and older tags are never
|
||||
patched. A fix ships in the next release and in the `latest` images on ghcr.io.
|
||||
|
||||
Updating a self-hosted instance:
|
||||
|
||||
```bash
|
||||
git pull && docker compose pull && docker compose up -d
|
||||
```
|
||||
|
||||
## Reporting a vulnerability
|
||||
|
||||
Use GitHub's private vulnerability reporting — repo **Security** tab → **Report a vulnerability**:
|
||||
|
||||
<https://github.com/DuarteSantos8/openGym/security/advisories/new>
|
||||
|
||||
> Private reporting has to be switched on in the repository settings for that link to work
|
||||
> (Settings → Advanced Security → Private vulnerability reporting). If it 404s, open a normal
|
||||
> issue saying only *"I need a private channel for a security report"* — no details, no repro —
|
||||
> and it will be enabled.
|
||||
|
||||
Please don't put a working exploit in a public issue if it can be used against other people's
|
||||
instances. Everything else (a crash you can only trigger on your own box, a scanner warning)
|
||||
is fine as a normal issue.
|
||||
|
||||
Useful in a report: the version or commit, whether you're running the prebuilt images or a
|
||||
source build, your `RP_ID`/`ORIGIN` and what sits in front of the app, steps to reproduce, and
|
||||
what an attacker gets out of it.
|
||||
|
||||
**On response times:** this is a hobby project maintained by one person alongside school. There
|
||||
is no SLA and no bounty. Expect days rather than hours, and longer during exam periods. If a
|
||||
week goes by with no reply, comment on the advisory thread — it's more likely to be a missed
|
||||
notification than a decision. If a report goes unfixed and you want to disclose publicly, say so
|
||||
in the thread; there's no objection, and no request to sit on it indefinitely.
|
||||
|
||||
## In scope
|
||||
|
||||
- **`api/server.js`** — forging or replaying a session cookie, bypassing passkey verification,
|
||||
reading or writing another user's data through `/api/data`, reaching `/api/admin/*` without
|
||||
being an admin, or creating a profile without a valid code while `INVITE_ONLY=1`.
|
||||
- **Frontend** — XSS in the React app, or anything that lets a page on another origin read or
|
||||
change a signed-in user's data.
|
||||
- **Shipped deployment config** — `docker-compose.yml`, `web/nginx.conf`, the two Dockerfiles:
|
||||
a default that exposes something a self-hoster wouldn't expect to be exposed.
|
||||
- **The published images** `ghcr.io/duartesantos8/opengym-api` and `-web`.
|
||||
|
||||
## Out of scope
|
||||
|
||||
- Anything that already assumes access to the host, to `./data`, or to the Docker socket. The
|
||||
operator is trusted by design — see the security model below.
|
||||
- Admins reading their users' workout history. That is the documented purpose of the admin
|
||||
dashboard, not a leak.
|
||||
- **Missing rate limiting**, brute force, or "I sent 100k requests and it got slow". The app
|
||||
has no rate limiting at all and doesn't pretend to; that belongs in the reverse proxy you put
|
||||
in front of it. Genuine amplification (one small request causing unbounded work) *is* in scope.
|
||||
- **Missing security headers** (CSP, HSTS, X-Frame-Options) — `web/nginx.conf` sets none; TLS
|
||||
and headers are the reverse proxy's job. A concrete attack that headers would have stopped is
|
||||
still worth reporting.
|
||||
- Instances served over plain `http://` on a LAN IP. Unsupported: passkeys don't work there and
|
||||
the session cookie isn't marked `Secure`.
|
||||
- Scanner output with no working exploit, and `npm audit` findings in build-time
|
||||
devDependencies (Vite, Vitest, Capacitor CLI) that never reach a running instance.
|
||||
- The GitHub Pages demo build — it has no backend at all, everything stays in that browser.
|
||||
- Third-party content: the exercise image/GIF dataset and the CDN it's fetched from.
|
||||
|
||||
## Security model
|
||||
|
||||
Read this before hosting openGym for anyone other than yourself.
|
||||
|
||||
### What it does
|
||||
|
||||
- **Passkeys only.** No passwords, no email addresses, no reset flow. Registration and login are
|
||||
verified server-side by `@simplewebauthn/server` against `expectedOrigin: ORIGIN` and
|
||||
`expectedRPID: RP_ID`, and the authenticator's signature counter is stored and updated on every
|
||||
login (`api/server.js:292-318`, `api/server.js:338-358`).
|
||||
- **Sessions are a signed cookie.** `gymsid` carries `<uid>:<expiry>:<version>` plus an
|
||||
HMAC-SHA256 tag over it, compared in constant time (`api/server.js:148-161`). The key is 32
|
||||
random bytes generated on first run and written to `./data/secret` with mode `0600`
|
||||
(`api/server.js:34-36`). The cookie is `HttpOnly` and `SameSite=Lax`, and gets `Secure` **only
|
||||
when `ORIGIN` starts with `https:`** (`api/server.js:29`, `api/server.js:198-201`).
|
||||
- **Any user can end every session they have.** `POST /api/logout/all` increments that account's
|
||||
session version, and every authenticated request checks the version in the cookie against the
|
||||
one on the user record (`api/server.js:167`, `api/server.js:187-188`), so every cookie ever
|
||||
issued for the account — on every device, including a copy someone walked off with — stops
|
||||
verifying at once. Passkeys are untouched; signing back in works immediately.
|
||||
- **Data is isolated per user by the session's uid.** `GET`/`PUT /api/data` only ever touch
|
||||
`state-<uid>.json` for the caller (`api/server.js:375-392`); no route lets a normal user name
|
||||
another user.
|
||||
- **Disabling an account takes effect immediately.** Every authenticated request and every login
|
||||
is rejected for a disabled user (`api/server.js:184`, `api/server.js:357`).
|
||||
|
||||
### What it does not do
|
||||
|
||||
- **Nothing in `./data` is encrypted.** It holds `db.json` (users, passkey public keys, push
|
||||
subscriptions, invite codes), one `state-<uid>.json` per user with their complete workout
|
||||
history and body-weight log, `secret`, and `vapid.json`. Anyone who can read that folder — you,
|
||||
whoever holds the backups, whoever gets into the host — can read every user's data, and with
|
||||
`secret` can mint a valid session cookie for any account. **If you host openGym for other
|
||||
people, they are trusting you exactly as much as they'd trust any server operator.**
|
||||
- **Admins can read everything.** A user listed in `ADMIN_UIDS` (or flagged `admin: true` in
|
||||
`db.json`) gets every user's full history and body weight, can disable accounts, and can create
|
||||
or revoke invite codes (`api/server.js:460-540`). Off by default — a fresh instance has no admin.
|
||||
- **Sessions can't be revoked one device at a time.** Revocation is per *account*, not per
|
||||
session: `POST /api/logout/all` kills all of them at once and there is no device list to pick
|
||||
from. `POST /api/logout` on its own only clears the cookie in that one browser
|
||||
(`api/server.js:361`) — a copy taken beforehand keeps working. Sessions last **90 days** by
|
||||
default, settable with `SESSION_DAYS` (`api/server.js:26`); each cookie carries the lifetime it
|
||||
was issued with, so changing the setting doesn't reach cookies that are already out. Deleting
|
||||
`./data/secret` and restarting still works as the instance-wide reset, and disabling an account
|
||||
still locks out one user completely.
|
||||
- **CSRF protection is `SameSite=Lax` and nothing else.** There are no CSRF tokens.
|
||||
- **User verification is preferred, not required.** Both handshakes pass
|
||||
`requireUserVerification: false` (`api/server.js:297`, `api/server.js:343`), so a passkey
|
||||
released without a biometric or PIN is still accepted. In practice: unlocked device ≈ account
|
||||
access.
|
||||
- **One passkey per profile, and no recovery.** Every successful registration creates a *new*
|
||||
profile (`api/server.js:309-319`); there is no route to attach a second passkey to an existing
|
||||
one, and no email or reset path. Lose the passkey and that profile is unreachable — only direct
|
||||
surgery on `./data` gets it back.
|
||||
- **Disabling someone isn't a ban.** They can still register a fresh profile with a new passkey
|
||||
unless `INVITE_ONLY=1` is set.
|
||||
- **HTTPS is required and the app doesn't provide it.** The API container speaks plain HTTP and
|
||||
nginx listens on `:80` (`web/nginx.conf`); TLS is your reverse proxy's job. Without it,
|
||||
browsers won't do passkeys at all (except on `http://localhost`) and the session cookie is sent
|
||||
in the clear.
|
||||
- **No rate limiting anywhere.** Nothing throttles logins, registrations or writes, and
|
||||
`POST /api/register/options` still answers whether an invite code is valid
|
||||
(`api/server.js:272`), so an invite-only instance on the open internet should have a rate limit
|
||||
in front of it. New invite codes are 16 hex characters — 64 bits (`api/server.js:525`) — which
|
||||
makes guessing one impractical even unthrottled; codes generated by earlier versions are 8
|
||||
characters / 32 bits and still work, so revoke and reissue any that are still unused. The only
|
||||
hard limit
|
||||
in the app is a 5 MB request body (`api/server.js:27`).
|
||||
- **A few endpoints answer without a session:** `/api/health` (which includes the total user
|
||||
count), `/api/config` (whether invite-only is on), `/api/push/public-key`, and the
|
||||
register/login handshakes.
|
||||
- **Changing `RP_ID` invalidates every existing passkey.** They were bound to the old hostname
|
||||
and will fail verification against the new one. The data stays on disk but is unreachable until
|
||||
each user registers again — as a *new* profile. Choose your hostname before anyone registers.
|
||||
- **Guest mode never reaches the backend.** That data lives unencrypted in the browser's
|
||||
`localStorage` and is gone when the browser storage is cleared.
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gym-api",
|
||||
"version": "1.1.1",
|
||||
"version": "1.2.5",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "server.js",
|
||||
|
||||
@@ -19,7 +19,11 @@ const RP_NAME = process.env.RP_NAME || 'openGym';
|
||||
// code the admin generates. Both default off so a fresh self-hosted instance stays open.
|
||||
const ADMIN_UIDS = (process.env.ADMIN_UIDS || '').split(',').map(s => s.trim()).filter(Boolean);
|
||||
const INVITE_ONLY = /^(1|true|yes|on)$/i.test(process.env.INVITE_ONLY || '');
|
||||
const SESSION_DAYS = 365;
|
||||
// 90 days keeps someone who trains a few times a week permanently signed in without a stolen
|
||||
// cookie staying good for a year. Overridable because a family instance and one on the open
|
||||
// internet don't want the same number. Only affects cookies minted from now on — the expiry is
|
||||
// baked into each cookie when it's issued, so lowering this never cuts an existing session short.
|
||||
const SESSION_DAYS = Math.max(1, +(process.env.SESSION_DAYS || 90) || 90);
|
||||
const MAX_BODY = 5 * 1024 * 1024;
|
||||
// Secure cookies require HTTPS; over plain http://localhost the flag would drop the cookie
|
||||
const SECURE = /^https:/i.test(ORIGIN) ? ' Secure;' : '';
|
||||
@@ -155,9 +159,15 @@ function verifySig(token) {
|
||||
} catch { return null; }
|
||||
return payload;
|
||||
}
|
||||
function makeSession(uid) {
|
||||
// Session payload is `<uid>:<expiry>:<version>`, where the version is the user's `sv` counter.
|
||||
// Bumping `sv` (POST /api/logout/all) makes every cookie ever handed out for that account stop
|
||||
// verifying, which is the only revocation there was before short of deleting ./data/secret and
|
||||
// signing out the whole instance. Cookies minted before `sv` existed have no third field and are
|
||||
// read as version 0, matching a user who has never bumped — they stay valid until they expire.
|
||||
const sessionVersion = user => user.sv || 0;
|
||||
function makeSession(user) {
|
||||
const exp = Date.now() + SESSION_DAYS * 86400000;
|
||||
return sign(uid + ':' + exp);
|
||||
return sign(user.id + ':' + exp + ':' + sessionVersion(user));
|
||||
}
|
||||
function readSession(req) {
|
||||
const cookies = Object.fromEntries((req.headers.cookie || '').split(';').map(c => {
|
||||
@@ -167,10 +177,15 @@ function readSession(req) {
|
||||
if (!tok) return null;
|
||||
const payload = verifySig(tok);
|
||||
if (!payload) return null;
|
||||
const [uid, exp] = payload.split(':');
|
||||
const [uid, exp, ver] = payload.split(':');
|
||||
if (!uid || +exp < Date.now()) return null;
|
||||
const user = db.users.find(u => u.id === uid) || null;
|
||||
if (user && user.disabled) return null; // disabled accounts are locked out everywhere
|
||||
if (!user) return null;
|
||||
if (user.disabled) return null; // disabled accounts are locked out everywhere
|
||||
// Missing third field = pre-versioning cookie = version 0. Anything non-numeric is a malformed
|
||||
// payload (it still had to pass the HMAC, so this is belt-and-braces) and is refused outright.
|
||||
const claimed = ver === undefined ? 0 : Number(ver);
|
||||
if (!Number.isInteger(claimed) || claimed !== sessionVersion(user)) return null;
|
||||
return user;
|
||||
}
|
||||
// Guard for /api/admin/* — resolves the caller and 401/403s if they aren't an admin.
|
||||
@@ -180,8 +195,8 @@ function requireAdmin(req, res) {
|
||||
if (!isAdmin(user)) { json(res, 403, { error: 'forbidden' }); return null; }
|
||||
return user;
|
||||
}
|
||||
function sessionCookie(uid) {
|
||||
return `gymsid=${makeSession(uid)}; Path=/; Max-Age=${SESSION_DAYS * 86400}; HttpOnly;${SECURE} SameSite=Lax`;
|
||||
function sessionCookie(user) {
|
||||
return `gymsid=${makeSession(user)}; Path=/; Max-Age=${SESSION_DAYS * 86400}; HttpOnly;${SECURE} SameSite=Lax`;
|
||||
}
|
||||
const clearCookie = `gymsid=; Path=/; Max-Age=0; HttpOnly;${SECURE} SameSite=Lax`;
|
||||
|
||||
@@ -301,7 +316,7 @@ const routes = {
|
||||
transports: body.credential?.response?.transports || []
|
||||
});
|
||||
saveDb();
|
||||
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } }, { 'Set-Cookie': sessionCookie(user.id) });
|
||||
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } }, { 'Set-Cookie': sessionCookie(user) });
|
||||
},
|
||||
|
||||
'POST /api/login/options': async (req, res) => {
|
||||
@@ -340,11 +355,23 @@ const routes = {
|
||||
const user = db.users.find(u => u.id === cred.userId);
|
||||
if (!user) return json(res, 500, { error: 'user missing' });
|
||||
if (user.disabled) return json(res, 403, { error: 'this account has been disabled' });
|
||||
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } }, { 'Set-Cookie': sessionCookie(user.id) });
|
||||
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } }, { 'Set-Cookie': sessionCookie(user) });
|
||||
},
|
||||
|
||||
'POST /api/logout': async (req, res) => json(res, 200, { ok: true }, { 'Set-Cookie': clearCookie }),
|
||||
|
||||
// "Sign out everywhere" — bumps this user's session version, which invalidates every cookie
|
||||
// ever issued for the account, on every device, including a copy someone else walked off with.
|
||||
// The caller's own cookie is cleared here too, so the browser doing it doesn't sit on a token
|
||||
// it no longer accepts. Passkeys are untouched: signing back in works immediately.
|
||||
'POST /api/logout/all': async (req, res) => {
|
||||
const user = readSession(req);
|
||||
if (!user) return json(res, 401, { error: 'not signed in' });
|
||||
user.sv = sessionVersion(user) + 1;
|
||||
saveDb();
|
||||
json(res, 200, { ok: true }, { 'Set-Cookie': clearCookie });
|
||||
},
|
||||
|
||||
'GET /api/data': async (req, res) => {
|
||||
const user = readSession(req);
|
||||
if (!user) return json(res, 401, { error: 'not signed in' });
|
||||
@@ -491,7 +518,11 @@ const routes = {
|
||||
const admin = requireAdmin(req, res); if (!admin) return;
|
||||
const body = await readBody(req);
|
||||
let code;
|
||||
do { code = crypto.randomBytes(4).toString('hex').toUpperCase(); } while (db.invites.some(i => i.code === code));
|
||||
// 16 hex chars = 64 bits, up from 8 chars / 32 bits. The app has no rate limiting by design
|
||||
// (that's the reverse proxy's job) and /api/register/options tells a caller whether a code is
|
||||
// good, so the code itself has to be the thing that isn't worth guessing. Codes already in
|
||||
// db.json keep working — validation is an exact string compare, never a length or format check.
|
||||
do { code = crypto.randomBytes(8).toString('hex').toUpperCase(); } while (db.invites.some(i => i.code === code));
|
||||
const invite = { code, note: String(body.note || '').slice(0, 60), createdBy: admin.id, created: new Date().toISOString() };
|
||||
db.invites.push(invite);
|
||||
saveDb();
|
||||
|
||||
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 175 KiB |
|
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 320 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 225 KiB After Width: | Height: | Size: 381 KiB |
@@ -0,0 +1,104 @@
|
||||
# Building the mobile app (iOS / Android)
|
||||
|
||||
openGym ships in two flavors from the same codebase:
|
||||
|
||||
| | **Self-hosted** (this repo's default) | **Mobile app** (`VITE_MOBILE=1`) |
|
||||
|---|---|---|
|
||||
| Runs | in any browser, against your own server | natively on iPhone / Android (Capacitor shell) |
|
||||
| Accounts | passkey sign-in, one profile per person | none — the phone *is* the account |
|
||||
| Data | synced to your server, readable on desktop | stays on the device (file in the app's private storage) |
|
||||
| Reminders | Web Push from your server | native local notifications, no server involved |
|
||||
| Exercise media | served by your server (`img/`, `gif/`) | loaded from the jsDelivr CDN |
|
||||
|
||||
The mobile flavor never talks to a backend: no sign-in screen, no sync, no telemetry.
|
||||
State is mirrored from `localStorage` into `opengym-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.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Node 20+
|
||||
- **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.
|
||||
|
||||
## Build & run
|
||||
|
||||
```sh
|
||||
cd frontend
|
||||
npm install
|
||||
npm run build:mobile # VITE_MOBILE build + `cap sync` into android/ and ios/
|
||||
|
||||
npx cap open android # opens Android Studio → run on emulator or device
|
||||
npx cap open ios # opens Xcode (Mac only) → set your signing team, then run
|
||||
```
|
||||
|
||||
`npm run build:mobile` bakes the CDN media base into the bundle and copies the web build
|
||||
into both native projects — re-run it after every web-code change before building natively.
|
||||
|
||||
> **Heads-up:** after `build:mobile`, `frontend/dist` contains the *mobile* bundle.
|
||||
> Run a plain `npm run build` again before deploying `dist` to a server.
|
||||
|
||||
## App icons & splash screens
|
||||
|
||||
`frontend/resources/icon.svg` is the 1024×1024 source (the app's dumbbell glyph on the
|
||||
app background). Generate all platform assets from it on a machine with the tooling:
|
||||
|
||||
```sh
|
||||
cd frontend
|
||||
npx @capacitor/assets generate --iconBackgroundColor '#0c0e12' --splashBackgroundColor '#0c0e12'
|
||||
```
|
||||
|
||||
(If the generator won't take the SVG directly, export it to `resources/icon.png` at
|
||||
1024×1024 first — any image tool can do it.)
|
||||
|
||||
## 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
|
||||
accounts, no store rules, no yearly fees between you and an open-source app.
|
||||
|
||||
### Android — sideload the APK
|
||||
|
||||
The official signed APK is at **[opengym.duarte-santos.ch](https://opengym.duarte-santos.ch)**.
|
||||
Android asks you to allow installs from the browser the first time — that's standard for any
|
||||
app outside the Play Store.
|
||||
|
||||
To build and sign your own:
|
||||
|
||||
```sh
|
||||
cd frontend && npm run build:mobile
|
||||
cd android && ./gradlew assembleRelease # → app/build/outputs/apk/release/app-release-unsigned.apk
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
```
|
||||
|
||||
### iPhone — what's actually possible
|
||||
|
||||
Apple does not allow installing apps outside the App Store, so there is no `.ipa` download
|
||||
that would simply install. Your free options:
|
||||
|
||||
- **Self-host + PWA** (recommended): open your instance in Safari → Share → *Add to Home
|
||||
Screen*. Full-screen app, no expiry, plus sync and passkeys.
|
||||
- **Xcode free signing:** open `ios/` in Xcode with a free Apple ID as the team and run it
|
||||
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.
|
||||
|
||||
### 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.
|
||||
- **License:** openGym 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
|
||||
on, and (on Android) declares `SCHEDULE_EXACT_ALARM` so the reminder fires to the minute
|
||||
where the user allows it.
|
||||
@@ -87,9 +87,25 @@ Visit `https://gym.example.com`, create your profile, and add it to your home sc
|
||||
|
||||
## 4. Multiple users
|
||||
|
||||
Anyone who can reach the URL can create their own profile — each gets isolated data. There's no
|
||||
admin/invite system by design; if you want it private, keep it behind your VPN, an auth proxy
|
||||
(Authelia, Cloudflare Access…), or just don't share the URL.
|
||||
Anyone who can reach the URL can create their own profile — each gets isolated data. That's the
|
||||
default: open signup, no admin.
|
||||
|
||||
If you'd rather control who gets in, two optional settings in `.env` turn that around:
|
||||
|
||||
```bash
|
||||
ADMIN_UIDS=youruserid # comma-separated; these users get the admin dashboard
|
||||
INVITE_ONLY=1 # new profiles need an invite code
|
||||
```
|
||||
|
||||
Register your own passkey profile first, then find your id in `./data/db.json` under `users[].id`
|
||||
and put it in `ADMIN_UIDS`. You'll get an **Admin dashboard** link in Settings: who's training
|
||||
right now, each user's workout history and body weight, the ability to disable an account (signed
|
||||
out and locked out everywhere until you re-enable it), and — with `INVITE_ONLY=1` — generating and
|
||||
revoking invite codes. Existing accounts keep working when you switch invite-only on. Admin access
|
||||
is gated by your passkey and enforced server-side, so it needs no separate login.
|
||||
|
||||
Prefer to keep the whole thing off the open internet? A VPN or an auth proxy (Authelia, Cloudflare
|
||||
Access…) in front still works, and composes with the above.
|
||||
|
||||
## 5. Backups
|
||||
|
||||
@@ -114,6 +130,11 @@ first run and saved to `./data/vapid.json`, and each user's browser reports its
|
||||
automatically when they turn the reminder on — it fires at their local time, and follows them if
|
||||
they travel, regardless of what timezone the server itself runs in.
|
||||
|
||||
**Keep screen awake** (Settings → *During a workout*) has the same transport requirement: the
|
||||
Wake Lock API is only available over HTTPS or on `http://localhost`, so on a plain-LAN-IP
|
||||
instance the switch shows as unsupported. Nothing to configure server-side either way, and iOS
|
||||
refuses the lock while the phone is in Low Power Mode.
|
||||
|
||||
## 7. Updating
|
||||
|
||||
Running prebuilt images:
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
|
||||
|
||||
# Built application files
|
||||
*.apk
|
||||
*.aar
|
||||
*.ap_
|
||||
*.aab
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
# Uncomment the following line in case you need and you don't have the release build type files in your app
|
||||
# release/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/gradle.xml
|
||||
.idea/assetWizardSettings.xml
|
||||
.idea/dictionaries
|
||||
.idea/libraries
|
||||
# Android Studio 3 in .gitignore file.
|
||||
.idea/caches
|
||||
.idea/modules.xml
|
||||
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
|
||||
.idea/navEditor.xml
|
||||
|
||||
# Keystore files
|
||||
# Uncomment the following lines if you do not want to check your keystore files in.
|
||||
#*.jks
|
||||
#*.keystore
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
.cxx/
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
# google-services.json
|
||||
|
||||
# Freeline
|
||||
freeline.py
|
||||
freeline/
|
||||
freeline_project_description.json
|
||||
|
||||
# fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/test_output
|
||||
fastlane/readme.md
|
||||
|
||||
# Version control
|
||||
vcs.xml
|
||||
|
||||
# lint
|
||||
lint/intermediates/
|
||||
lint/generated/
|
||||
lint/outputs/
|
||||
lint/tmp/
|
||||
# lint/reports/
|
||||
|
||||
# Android Profiling
|
||||
*.hprof
|
||||
|
||||
# Cordova plugins for Capacitor
|
||||
capacitor-cordova-android-plugins
|
||||
|
||||
# Copied web assets
|
||||
app/src/main/assets/public
|
||||
|
||||
# Generated Config files
|
||||
app/src/main/assets/capacitor.config.json
|
||||
app/src/main/assets/capacitor.plugins.json
|
||||
app/src/main/res/xml/config.xml
|
||||
@@ -0,0 +1,2 @@
|
||||
/build/*
|
||||
!/build/.npmkeep
|
||||
@@ -0,0 +1,54 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
namespace "ch.duartesantos.opengym"
|
||||
compileSdk rootProject.ext.compileSdkVersion
|
||||
defaultConfig {
|
||||
applicationId "ch.duartesantos.opengym"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 6
|
||||
versionName "1.2.5"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
|
||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir{
|
||||
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
||||
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
||||
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
||||
implementation project(':capacitor-android')
|
||||
testImplementation "junit:junit:$junitVersion"
|
||||
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
||||
implementation project(':capacitor-cordova-android-plugins')
|
||||
}
|
||||
|
||||
apply from: 'capacitor.build.gradle'
|
||||
|
||||
try {
|
||||
def servicesJSON = file('google-services.json')
|
||||
if (servicesJSON.text) {
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
}
|
||||
} catch(Exception e) {
|
||||
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
|
||||
|
||||
android {
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
}
|
||||
|
||||
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
||||
dependencies {
|
||||
implementation project(':capacitor-filesystem')
|
||||
implementation project(':capacitor-local-notifications')
|
||||
implementation project(':capacitor-share')
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (hasProperty('postBuildExtras')) {
|
||||
postBuildExtras()
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.getcapacitor.myapp;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
|
||||
assertEquals("com.getcapacitor.app", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation"
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/title_activity_main"
|
||||
android:theme="@style/AppTheme.NoActionBarLaunch"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
<!-- Permissions -->
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<!-- Workout-day reminder: lets the local-notifications plugin fire at the exact minute
|
||||
on Android 12+. Where it isn't granted, scheduling silently falls back to inexact
|
||||
alarms — the reminder still arrives, just not to the minute. -->
|
||||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
||||
</manifest>
|
||||
@@ -0,0 +1,5 @@
|
||||
package ch.duartesantos.opengym;
|
||||
|
||||
import com.getcapacitor.BridgeActivity;
|
||||
|
||||
public class MainActivity extends BridgeActivity {}
|
||||
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 52 KiB |
@@ -0,0 +1,34 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="78.5885"
|
||||
android:endY="90.9159"
|
||||
android:startX="48.7653"
|
||||
android:startY="61.0927"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1" />
|
||||
</vector>
|
||||
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillColor="#26A69A"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
</vector>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<WebView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background>
|
||||
<inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
|
||||
</background>
|
||||
<foreground>
|
||||
<inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
|
||||
</foreground>
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background>
|
||||
<inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
|
||||
</background>
|
||||
<foreground>
|
||||
<inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
|
||||
</foreground>
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 913 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 379 B |
|
After Width: | Height: | Size: 333 B |
|
After Width: | Height: | Size: 530 B |
|
After Width: | Height: | Size: 623 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 564 B |
|
After Width: | Height: | Size: 745 B |
|
After Width: | Height: | Size: 839 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FFFFFF</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<string name="app_name">openGym</string>
|
||||
<string name="title_activity_main">openGym</string>
|
||||
<string name="package_name">ch.duartesantos.opengym</string>
|
||||
<string name="custom_url_scheme">ch.duartesantos.opengym</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:background">@null</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
|
||||
<item name="android:background">@drawable/splash</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-path name="my_images" path="." />
|
||||
<cache-path name="my_cache_images" path="." />
|
||||
</paths>
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.getcapacitor.myapp;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
|
||||
@Test
|
||||
public void addition_isCorrect() throws Exception {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.7.2'
|
||||
classpath 'com.google.gms:google-services:4.4.2'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
apply from: "variables.gradle"
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
|
||||
include ':capacitor-android'
|
||||
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
|
||||
|
||||
include ':capacitor-filesystem'
|
||||
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')
|
||||
|
||||
include ':capacitor-local-notifications'
|
||||
project(':capacitor-local-notifications').projectDir = new File('../node_modules/@capacitor/local-notifications/android')
|
||||
|
||||
include ':capacitor-share'
|
||||
project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android')
|
||||
@@ -0,0 +1,22 @@
|
||||
# Project-wide Gradle settings.
|
||||
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -0,0 +1,252 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
@@ -0,0 +1,94 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -0,0 +1,5 @@
|
||||
include ':app'
|
||||
include ':capacitor-cordova-android-plugins'
|
||||
project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/')
|
||||
|
||||
apply from: 'capacitor.settings.gradle'
|
||||
@@ -0,0 +1,16 @@
|
||||
ext {
|
||||
minSdkVersion = 23
|
||||
compileSdkVersion = 35
|
||||
targetSdkVersion = 35
|
||||
androidxActivityVersion = '1.9.2'
|
||||
androidxAppCompatVersion = '1.7.0'
|
||||
androidxCoordinatorLayoutVersion = '1.2.0'
|
||||
androidxCoreVersion = '1.15.0'
|
||||
androidxFragmentVersion = '1.8.4'
|
||||
coreSplashScreenVersion = '1.0.1'
|
||||
androidxWebkitVersion = '1.12.1'
|
||||
junitVersion = '4.13.2'
|
||||
androidxJunitVersion = '1.2.1'
|
||||
androidxEspressoCoreVersion = '3.6.1'
|
||||
cordovaAndroidVersion = '10.1.1'
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"appId": "ch.duartesantos.opengym",
|
||||
"appName": "openGym",
|
||||
"webDir": "dist",
|
||||
"backgroundColor": "#0c0e12",
|
||||
"android": {
|
||||
"allowMixedContent": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
App/build
|
||||
App/Pods
|
||||
App/output
|
||||
App/App/public
|
||||
DerivedData
|
||||
xcuserdata
|
||||
|
||||
# Cordova plugins for Capacitor
|
||||
capacitor-cordova-ios-plugins
|
||||
|
||||
# Generated Config files
|
||||
App/App/capacitor.config.json
|
||||
App/App/config.xml
|
||||