Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9007aeefb6 | ||
|
|
71b22b3216 | ||
|
|
5bf149e60b | ||
|
|
c17632ea3d | ||
|
|
aac6b185ec | ||
|
|
3b720b0332 | ||
|
|
8fe980343d | ||
|
|
8323e06819 | ||
|
|
55b9dcb864 | ||
|
|
76a2d3b7a5 | ||
|
|
09baee49a7 | ||
|
|
374f6bdadc | ||
|
|
32c9a2380d | ||
|
|
9976b7a278 | ||
|
|
d4169690a6 | ||
|
|
55de70ad23 | ||
|
|
f860edd24a | ||
|
|
329eed4ce0 | ||
|
|
5d7e13361c | ||
|
|
274a0276e0 | ||
|
|
1ba378b632 | ||
|
|
0e00e1029c | ||
|
|
011a3f7790 | ||
|
|
4e842b00e1 | ||
|
|
f3ba7de479 | ||
|
|
57f04febbe | ||
|
|
23a5b6c228 | ||
|
|
ed666df237 | ||
|
|
a95104b675 | ||
|
|
edde72f9cb | ||
|
|
237d1c5cf2 | ||
|
|
b42d2baa6e | ||
|
|
f32c4d0b73 | ||
|
|
528cb70a79 | ||
|
|
a7d7f5c24b | ||
|
|
fe585097c8 | ||
|
|
d8c734a2b6 | ||
|
|
087ce34674 | ||
|
|
157ca90f3b | ||
|
|
15c29029c1 | ||
|
|
030a609427 | ||
|
|
8bbf59c001 | ||
|
|
b29a3f6bb0 | ||
|
|
bee9b64b78 | ||
|
|
35181af2aa | ||
|
|
01072ef5e3 | ||
|
|
86ac937d5d | ||
|
|
9cc645c755 | ||
|
|
cbb3630423 | ||
|
|
0109857249 | ||
|
|
edb3e42c43 | ||
|
|
577c86b487 | ||
|
|
13ed730a0c | ||
|
|
7e60ac20f2 | ||
|
|
06a1e0a709 | ||
|
|
d99f0ef2f1 | ||
|
|
d0075eeddf | ||
|
|
86f3476f5f | ||
|
|
9daf637044 | ||
|
|
b2b3577744 | ||
|
|
84e98425cc | ||
|
|
941d911fa9 | ||
|
|
5b5d65b63e | ||
|
|
6c91adefcd | ||
|
|
d1cede21d3 | ||
|
|
9af028bde3 | ||
|
|
eeee4b461c | ||
|
|
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 |
No files matched your search
@@ -33,9 +33,46 @@ RP_NAME=openGym
|
||||
# generate the codes from the admin dashboard):
|
||||
#
|
||||
# INVITE_ONLY=1
|
||||
#
|
||||
# Remove the "Continue without account" button, so a profile is the only way in.
|
||||
# Guest mode keeps everything in the browser and never touches this server, but
|
||||
# on an instance meant for a known set of people it is still the wrong front
|
||||
# door. Anyone already inside as a guest is signed out on their next visit; the
|
||||
# data they made stays in that browser. Defaults to on (guests allowed):
|
||||
#
|
||||
# ALLOW_GUEST=0
|
||||
|
||||
# ── 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
|
||||
|
||||
# ── Fitting into an existing stack (optional) ──────────────────────────────
|
||||
# The defaults assume openGym is on its own: an API service called `api` on
|
||||
# port 3000, and nginx listening on 80 inside the web container. If you are
|
||||
# merging this into a compose file that already has an `api`, or you front the
|
||||
# web container with your own reverse proxy, move them here. The web image
|
||||
# renders its nginx config at start-up, so these apply to a prebuilt image and
|
||||
# need no rebuild. BACKEND and PORT together are what /api is proxied to, so
|
||||
# they must name a service the web container can reach on your network:
|
||||
#
|
||||
# NGINX_PORT=80
|
||||
# BACKEND=api
|
||||
# PORT=3000
|
||||
|
||||
# ── 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
|
||||
# timezone automatically, so the workout-day reminder fires at their local
|
||||
# time regardless of where the server runs or where they're travelling.
|
||||
#
|
||||
# Push services want a contact address for whoever operates the server, in case
|
||||
# they need to get in touch about your pushes. Defaults to your ORIGIN, which is
|
||||
# fine; set a mailto: if you would rather they mailed you:
|
||||
#
|
||||
# VAPID_SUBJECT=mailto:you@example.com
|
||||
@@ -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']
|
||||
@@ -1,9 +1,14 @@
|
||||
name: Publish Docker images
|
||||
|
||||
# Images are published from a *published release*, never from a bare tag push.
|
||||
# A tag that is later deleted (the versioning rule consolidates unreleased tags)
|
||||
# would otherwise leave its image tags behind in GHCR forever, and dependency
|
||||
# bots read those as a newer version. See issue #87.
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ['v*']
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
@@ -23,22 +28,35 @@ 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
|
||||
- name: Set version metadata
|
||||
id: version_meta
|
||||
run: |
|
||||
# On a release the ref is refs/tags/vX.Y.Z; on a main push it is a branch ref,
|
||||
# which would otherwise label the image "refs/heads/main".
|
||||
case "$GITHUB_REF" in
|
||||
refs/tags/*) VERSION="${GITHUB_REF#refs/tags/}" ;;
|
||||
*) VERSION="main-${GITHUB_SHA::7}" ;;
|
||||
esac
|
||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "VCS_REF=${GITHUB_SHA}" >> $GITHUB_OUTPUT
|
||||
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: docker/login-action@v3
|
||||
- uses: docker/setup-qemu-action@v4
|
||||
- uses: docker/setup-buildx-action@v4
|
||||
|
||||
- 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,11 +65,15 @@ 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 }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
build-args: |
|
||||
VERSION=${{ steps.version_meta.outputs.VERSION }}
|
||||
VCS_REF=${{ steps.version_meta.outputs.VCS_REF }}
|
||||
BUILD_DATE=${{ steps.version_meta.outputs.BUILD_DATE }}
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
@@ -30,8 +30,8 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
@@ -44,8 +44,8 @@ jobs:
|
||||
VITE_DEMO: '1'
|
||||
VITE_IMG_BASE: ${{ env.DATASET }}/images/
|
||||
VITE_GIF_BASE: ${{ env.DATASET }}/videos/
|
||||
- uses: actions/configure-pages@v5
|
||||
- uses: actions/upload-pages-artifact@v3
|
||||
- uses: actions/configure-pages@v6
|
||||
- uses: actions/upload-pages-artifact@v5
|
||||
with:
|
||||
path: frontend/dist
|
||||
|
||||
@@ -57,4 +57,4 @@ jobs:
|
||||
url: ${{ steps.deploy.outputs.page_url }}
|
||||
steps:
|
||||
- id: deploy
|
||||
uses: actions/deploy-pages@v4
|
||||
uses: actions/deploy-pages@v5
|
||||
@@ -0,0 +1,74 @@
|
||||
# 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
|
||||
# check-locales compares the packs to each other, so a key missing from ALL of them is
|
||||
# invisible to it. This walks src/ instead. Report-only for now: there is a known
|
||||
# backlog of untranslated demo-view strings to clear before it can fail the build.
|
||||
- run: node scripts/check-source-strings.mjs
|
||||
working-directory: frontend
|
||||
# The fatigue model must never read higher after a rest day than before it.
|
||||
# Property probe over ~108k comparisons; too slow for the unit suite, cheap here.
|
||||
- run: npm run test:fatigue-probe
|
||||
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
|
||||
@@ -13,3 +13,4 @@ frontend/dist/
|
||||
node_modules/
|
||||
*.log
|
||||
.DS_Store
|
||||
node_modules
|
||||
@@ -1,5 +1,510 @@
|
||||
# Changelog
|
||||
|
||||
## v1.2.7 — 2026-08-18
|
||||
|
||||
The muscle map answers a third question. Balance showed where the volume went and Fatigue what was
|
||||
still recovering; Strength now names the exercises behind a muscle and what each one is worth in
|
||||
estimated 1RM. Fatigue itself got harder to fool — a set counts for more the closer it is to your
|
||||
maximum, and it can no longer creep upward across a rest week. In a session, supersets finally
|
||||
behave: pair them as you go, rest once per round, and drop an exercise you have decided against.
|
||||
|
||||
### The muscle map, read as strength
|
||||
|
||||
- **A per-muscle exercise breakdown** behind the muscle card — estimated 1RM per exercise, decay
|
||||
bars, and primary/secondary tags, with a best-weight fallback for holds and carries that have no
|
||||
reps to work from. Contributed by [@Space-Hermes](https://github.com/Space-Hermes) in
|
||||
[#92](https://github.com/DuarteSantos8/openGym/pull/92),
|
||||
[#93](https://github.com/DuarteSantos8/openGym/pull/93) and
|
||||
[#94](https://github.com/DuarteSantos8/openGym/pull/94).
|
||||
- **Fatigue is now intensity-weighted**, not volume alone: a set counts for more the closer it is
|
||||
to your estimated maximum. It also reads against a stable historical reference, so fatigue can no
|
||||
longer *rise* across a rest week, and bodyweight movements no longer register as zero load. A
|
||||
property probe over 108,000 comparisons runs in CI to keep it that way. Contributed by
|
||||
[@Space-Hermes](https://github.com/Space-Hermes) in
|
||||
[#55](https://github.com/DuarteSantos8/openGym/pull/55).
|
||||
|
||||
### In a session
|
||||
|
||||
- 🔗 **Supersets advance properly.** Completing a set moves to the next member of the group, the
|
||||
active exercise scrolls into view, and rest starts once the whole round is done rather than after
|
||||
each set. Contributed by [@Space-Hermes](https://github.com/Space-Hermes) in
|
||||
[#80](https://github.com/DuarteSantos8/openGym/pull/80).
|
||||
- ➖ **Remove an exercise from a running session**, with a superset-aware picker and a confirmation.
|
||||
Contributed by [@Space-Hermes](https://github.com/Space-Hermes) in
|
||||
[#83](https://github.com/DuarteSantos8/openGym/pull/83).
|
||||
- ⬅️ **The Android back button closes the open sheet** instead of leaving the screen or the app
|
||||
([#63]). Each open sheet gets its own history entry, so stacked sheets unwind one at a time.
|
||||
Contributed by [@Space-Hermes](https://github.com/Space-Hermes) in
|
||||
[#85](https://github.com/DuarteSantos8/openGym/pull/85).
|
||||
|
||||
### Self-hosting
|
||||
|
||||
- 🐳 **The API service no longer has to be called `api`** ([#99]). The web image builds its nginx
|
||||
config at startup from `BACKEND`, `PORT` and `NGINX_PORT`, all defaulted to today's values, so
|
||||
existing compose files are unaffected. Reported and fixed by
|
||||
[@GAS85](https://github.com/GAS85) in [#100](https://github.com/DuarteSantos8/openGym/pull/100).
|
||||
- **…and the shipped `docker-compose.yml` now actually passes those through.** The `web` service
|
||||
had no environment of its own and published a hardcoded `:80`, so setting `BACKEND` or
|
||||
`NGINX_PORT` in `.env` did nothing at all on the stock stack — the setting existed, the wiring
|
||||
did not. Both services now read `PORT` from the same place, so nginx cannot end up proxying to a
|
||||
port the API is not listening on. Defaults are unchanged, so an existing `.env` behaves exactly
|
||||
as before.
|
||||
- 🏷️ **Health checks and OCI image labels** on both images — source, licence, version, revision and
|
||||
build date, so image tooling can tell what it is holding. Contributed by
|
||||
[@GAS85](https://github.com/GAS85) in [#98](https://github.com/DuarteSantos8/openGym/pull/98).
|
||||
- **Images are published from a release, not from any tag** ([#87]). A tag that gets consolidated
|
||||
away before it becomes a release used to leave its image tags behind in the registry, where
|
||||
dependency bots read them as newer versions.
|
||||
|
||||
### Fixes
|
||||
|
||||
- **Imported warm-up sets were counted as work.** The importer marks them with `phase`, but several
|
||||
places still read the older boolean, so warm-ups from FitNotes/Strong/Hevy history inflated set
|
||||
counts, progression and the fatigue map.
|
||||
|
||||
[#63]: https://github.com/DuarteSantos8/openGym/issues/63
|
||||
[#87]: https://github.com/DuarteSantos8/openGym/issues/87
|
||||
[#99]: https://github.com/DuarteSantos8/openGym/issues/99
|
||||
|
||||
## v1.2.6 — 2026-08-11
|
||||
|
||||
The muscle map learned to answer a second question — not just where the volume went, but what is
|
||||
still recovering from it. Plus: a freestyle session no longer starts from blanks, the rest timer
|
||||
can reach you in another app, and a self-hosted instance can insist that everyone using it has an
|
||||
account.
|
||||
|
||||
### The muscle map, read as recovery (#44)
|
||||
|
||||
- 🔥 **A `Balance | Fatigue | Strength` switch on the Stats muscle card.** Balance is the map you
|
||||
already had and is untouched. Fatigue shades each muscle by how much of the recent training it
|
||||
is still carrying; Strength shades it by how long it has been since you trained it at all, with
|
||||
the weeks-since count spelled out underneath.
|
||||
- **Fatigue is volume-sensitive and fades smoothly.** A hard twelve-set chest day starts near the
|
||||
top and takes about six days to read ready again; a single set barely registers and is gone in
|
||||
two. It decays continuously on a 36-hour half-life rather than expiring at a window edge, so the
|
||||
map never flips from "fatigued" to "ready" between one look and the next.
|
||||
- **Strength holds for two weeks, then decays toward a floor.** A muscle you have not trained in
|
||||
months reads detrained rather than absent, which is the state that actually tells you something.
|
||||
- Both views are pure functions over your existing history — no new stored data, no schema change,
|
||||
nothing sent anywhere.
|
||||
|
||||
### The rest timer can reach you in another app (#49)
|
||||
|
||||
- ⏰ **A system notification when rest is over**, on top of the beep, for when you have switched to
|
||||
another tab or app mid-session. Permission is asked the first time a rest starts, and everything
|
||||
degrades quietly where notifications are unsupported or refused.
|
||||
- It goes through the service worker where the browser requires that — which is most phones — and
|
||||
falls back to the direct API elsewhere. No new dependencies; the existing server push path is
|
||||
untouched.
|
||||
|
||||
### Rows now strain the rear delts (#51)
|
||||
|
||||
- **Four row variations gained rear-deltoid secondaries** — barbell, dumbbell, inverted and cable
|
||||
seated rows — so the muscle map spreads their load the way the lift actually does. The overrides
|
||||
live in a small table that survives a regeneration of the exercise dataset rather than being
|
||||
edited into the generated data.
|
||||
|
||||
### An instance can require an account (#42)
|
||||
|
||||
- 🔒 **`ALLOW_GUEST=0` removes the "Continue without account" button.** Guest mode keeps everything
|
||||
in the browser and never touches the server — no account, no sync, nothing the admin dashboard
|
||||
can see — so on an instance meant for a known set of people it was a door leading nowhere
|
||||
useful, and until now there was no way to close it.
|
||||
- **It also ends guest sessions that already exist.** Guests never authenticate, so there is no
|
||||
request for the server to start refusing; the switch reaches someone already inside on their
|
||||
next visit, when the app checks the config and returns them to the login screen. Their data is
|
||||
not deleted — it stays in that browser, and moves into a real profile if they create one on the
|
||||
same device.
|
||||
- **A server it cannot reach is not a server that said no.** The button is only withdrawn on an
|
||||
explicit `allow_guest: false`; a failed config request, or a server too old to send the flag at
|
||||
all, leaves guest mode exactly as it was. An instance that is merely offline for a moment does
|
||||
not lock out everyone who never made an account.
|
||||
- **Default is on, so nothing changes for existing instances.** Set it alongside `INVITE_ONLY=1`:
|
||||
invite-only governs who may *create a profile* and says nothing about the guest button, which
|
||||
never creates one.
|
||||
|
||||
### Freestyle sessions start where you left off
|
||||
|
||||
- 🏋️ **Adding an exercise to an empty workout now prefills it from the last time you trained
|
||||
it** — the same number of sets, with each row's reps and weight carried across by position.
|
||||
Cardio brings its duration and speed, a hold brings its seconds. Until now every row opened on
|
||||
the config-sheet defaults, so the first thing a freestyle session asked of you was to retype
|
||||
what you already did last week.
|
||||
- **The config sheet agrees with the rows it is about to create.** It opens on the last target you
|
||||
actually trained rather than the generic default, so the set count you confirm is the set count
|
||||
you get.
|
||||
- **Planned sessions are untouched.** A routine-driven workout still runs the progression logic and
|
||||
still applies its prescription; only the freestyle path — which has no prescription to apply —
|
||||
reads from history instead.
|
||||
|
||||
Contributed by [@Space-Hermes](https://github.com/Space-Hermes) in
|
||||
[#50](https://github.com/DuarteSantos8/openGym/pull/50).
|
||||
|
||||
### Pair exercises into a superset mid-session (#64)
|
||||
|
||||
- 🔗 **"Make superset with previous / next" on each exercise card.** Two exercises paired in the
|
||||
session collapse into a single *Superset* card — do them back-to-back, rest once at the end —
|
||||
with an **Unpair** button in the header. No planning ahead required; pair them when you decide
|
||||
to, in the workout.
|
||||
- **Groups are any size.** Pairing the end of one group to the start of another merges them, and
|
||||
the header wording stays correct past two exercises.
|
||||
- **Unpairing cleans up after itself.** A group reduced to one exercise is dissolved rather than
|
||||
left as a superset of one, and the pairing helpers never mutate the running session.
|
||||
- Session-only by design: pairings drive the workout, and history stores the sets.
|
||||
|
||||
Contributed by [@Space-Hermes](https://github.com/Space-Hermes) in
|
||||
[#64](https://github.com/DuarteSantos8/openGym/pull/64).
|
||||
|
||||
### The muscle map stops rewriting the catalogue (#67)
|
||||
|
||||
- **The curated secondary-muscle additions are now an overlay, not a mutation.** The four row
|
||||
exercises that strain the rear delts used to get that written into the shared exercise dataset
|
||||
at import time, which meant export, print and import saw a catalogue that had been edited
|
||||
underneath them. They are derived at the read points instead, so the dataset stays pristine.
|
||||
- The detail sheet's tag row reads through the same overlay, so those muscles still show where
|
||||
they always did.
|
||||
|
||||
Contributed by [@Space-Hermes](https://github.com/Space-Hermes) in
|
||||
[#67](https://github.com/DuarteSantos8/openGym/pull/67).
|
||||
|
||||
### Fixes
|
||||
|
||||
- 🖼️ **Exercise images and animations were blank on the routine screen** ([#79]). The media paths
|
||||
were relative, and `/plan/r/:id` is the app's only two-segment route — so the browser asked for
|
||||
`/plan/r/img/…` and got a 404 with nothing in the console to say why. Every other screen was
|
||||
fine, which is what made it look like a one-screen mystery. Reported with the root cause already
|
||||
found, by [@lemi1000](https://github.com/lemi1000).
|
||||
- 📥 **Imports mapped more of what other apps export** ([#74]). Treadmill, Goblet Squat, Cycling and
|
||||
Cable Core Pallof Press arrived as *custom* exercises rather than catalogue ones — no word
|
||||
overlap could reach the names openGym stores them under. Those and their neighbours are now in
|
||||
the alias table. Already-imported history stays custom; new imports resolve. Reported by
|
||||
[@KiloOscarSix](https://github.com/KiloOscarSix).
|
||||
- **A progression edge case that could loop forever** ([#60]). An entry left with nothing but
|
||||
warm-up rows seeded the set-growth loop from a warm-up, which could never satisfy its own exit
|
||||
condition. It leaves the entry alone instead. Contributed by
|
||||
[@Space-Hermes](https://github.com/Space-Hermes).
|
||||
- Documented that `VITE_IMG_BASE` / `VITE_GIF_BASE` are build-time values, so setting them next to
|
||||
`docker compose` does nothing on a prebuilt image.
|
||||
|
||||
[#79]: https://github.com/DuarteSantos8/openGym/issues/79
|
||||
[#74]: https://github.com/DuarteSantos8/openGym/issues/74
|
||||
[#60]: https://github.com/DuarteSantos8/openGym/pull/60
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -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,15 @@
|
||||
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
|
||||
|
||||
@@ -39,7 +39,7 @@ No account on someone else's server, no subscription, no ads. Just `docker compo
|
||||
|
||||
<div align="center">
|
||||
|
||||
### [▶ Try the live demo](https://duartesantos8.github.io/openGym/)
|
||||
### [🌐 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
|
||||
@@ -60,18 +60,32 @@ 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
|
||||
- 🔗 **Supersets** — build them, and log them back-to-back with a rest only after the pair
|
||||
- ☀️ **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** — plan them into a routine or pair two exercises *mid-session* with “make superset with previous/next”, then work through the group back-to-back with a single rest at the end of each round. Unpair at any time; a group of one dissolves itself
|
||||
- 🔥 **Warm-up sets** — mark the ramp-up rows as warm-ups and they stay out of the numbers that should not see them: no effect on your estimated 1RM, your progression, or the fatigue map, while still being there in the session where you need them. A weight change cascades down the rows that share their phase, not across the divide
|
||||
- ➖ **Change your mind mid-session** — add an exercise you decided to do, or remove one you didn't, without ending the workout. Removing a member of a superset asks which one
|
||||
- ⏱️ **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
|
||||
- 🎲 **Freestyle sessions** — train without a plan and pick exercises as you go. Each one arrives prefilled from the last time you did it — same sets, same reps and weight by position — so an unplanned session doesn't start by asking you to retype last week
|
||||
- 🏃 **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
|
||||
- 💪 **Muscle map, three ways** — a front-and-back body diagram you can read as **Balance** (where the volume went, over a week, a month or all time — naming the muscles you *haven't* trained), **Fatigue** (what is still recovering, weighted by how close each set was to your maximum, decaying smoothly rather than expiring at a window edge) or **Strength** (how long since you trained each muscle, and behind every one the exercises that built it with their estimated 1RM). It 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
|
||||
- 🔑 **Passkeys, not passwords** — Face ID / Touch ID / fingerprint login; each profile keeps its own data, synced across devices. Sign-ins last 90 days by default (configurable), and “sign out everywhere” in Settings ends every session on every device at once
|
||||
- 🛠️ **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)
|
||||
|
||||
@@ -93,6 +107,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
|
||||
|
||||
```
|
||||
@@ -109,7 +136,7 @@ a build step locally either way.
|
||||
```
|
||||
|
||||
- **frontend/** — React + Vite (React Router + Zustand), built to static files **inside Docker**
|
||||
- **api/** — Node with no framework, one dependency (`@simplewebauthn/server`), storing everything as plain JSON files under `./data`
|
||||
- **api/** — Node with no framework, two dependencies (`@simplewebauthn/server` for passkeys, `web-push` for notifications), storing everything as plain JSON files under `./data`
|
||||
- **web/** — a multi-stage image that builds the frontend and serves it with nginx, proxying `/api` to the backend so it's all on **one origin** (passkeys require this)
|
||||
|
||||
## Your data
|
||||
@@ -128,18 +155,31 @@ All via `.env` (see `.env.example`):
|
||||
| `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` |
|
||||
| `NGINX_PORT` | Port the web container listens on, inside the container | `80` |
|
||||
| `BACKEND` | Name of the API service that `/api` is proxied to — change it if yours isn't called `api` | `api` |
|
||||
| `PORT` | Port the API listens on; the web container proxies to the same value | `3000` |
|
||||
| `RP_NAME` | Name shown in the passkey prompt | `openGym` |
|
||||
| `SESSION_DAYS`| How long a sign-in lasts, in days | `90` |
|
||||
| `ADMIN_UIDS` | User ids that get the admin dashboard (comma-separated) | *(none)* |
|
||||
| `INVITE_ONLY` | Require an invite code to create a profile | *(off)* |
|
||||
| `ALLOW_GUEST` | Offer "Continue without account" — set `0` to require a profile | *(on)* |
|
||||
| `VAPID_SUBJECT` | Contact URL sent with push notifications | your `ORIGIN` |
|
||||
|
||||
Push notification keys are generated on first run and saved to `./data/vapid.json` — nothing to set.
|
||||
`DATA_DIR` is pinned to `/data` by `docker-compose.yml` and mapped to `./data` on the host; change the
|
||||
host side of that volume, not the variable.
|
||||
|
||||
## 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)
|
||||
@@ -151,11 +191,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,8 +1,32 @@
|
||||
FROM node:22-alpine
|
||||
|
||||
ARG VERSION=dev
|
||||
ARG VCS_REF=dev
|
||||
ARG BUILD_DATE=unknown
|
||||
|
||||
LABEL maintainer="Duarte Santos https://github.com/DuarteSantos8" \
|
||||
org.opencontainers.image.title="opengym-api" \
|
||||
org.opencontainers.image.description="Backend for Self-hosted gym & body-weight tracker — plan routines, log workouts (supersets & cardio too), track your weight and progress, passkey login. Your data, your server." \
|
||||
org.opencontainers.image.source="https://github.com/DuarteSantos8/openGym" \
|
||||
org.opencontainers.image.url="https://ghcr.io/duartesantos8/opengym-api" \
|
||||
org.opencontainers.image.documentation="https://github.com/DuarteSantos8/openGym#readme" \
|
||||
org.opencontainers.image.licenses="AGPL-3.0-or-later" \
|
||||
org.opencontainers.image.version=$VERSION \
|
||||
org.opencontainers.image.revision=$VCS_REF \
|
||||
org.opencontainers.image.created=$BUILD_DATE
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm install --omit=dev && npm cache clean --force
|
||||
COPY server.js ./
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3000
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
HEALTHCHECK --interval=5m \
|
||||
--timeout=5s \
|
||||
--retries=3 \
|
||||
CMD wget --spider -q "http://127.0.0.1:${PORT}/api/health" || exit 1
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gym-api",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.7",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "server.js",
|
||||
|
||||
@@ -19,7 +19,16 @@ 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;
|
||||
// Guest mode ("Continue without account") keeps everything in the browser and never touches this
|
||||
// server — but on an instance meant for a known set of people, an entrance nobody can walk back
|
||||
// out of is still the wrong front door (#42). Default ON, so existing instances are unchanged;
|
||||
// the polarity is inverted from INVITE_ONLY because the safe default here is the permissive one.
|
||||
const ALLOW_GUEST = !/^(0|false|no|off)$/i.test(process.env.ALLOW_GUEST || '');
|
||||
// 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 +164,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 +182,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 +200,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`;
|
||||
|
||||
@@ -241,7 +261,7 @@ const routes = {
|
||||
'GET /api/health': async (req, res) => json(res, 200, { ok: true, users: db.users.length }),
|
||||
|
||||
// Public config the login screen needs before anyone is signed in.
|
||||
'GET /api/config': async (req, res) => json(res, 200, { invite_only: INVITE_ONLY }),
|
||||
'GET /api/config': async (req, res) => json(res, 200, { invite_only: INVITE_ONLY, allow_guest: ALLOW_GUEST }),
|
||||
|
||||
'GET /api/me': async (req, res) => {
|
||||
const user = readSession(req);
|
||||
@@ -301,7 +321,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 +360,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 +523,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: 175 KiB After Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 320 KiB After Width: | Height: | Size: 320 KiB |
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 296 KiB |
|
Before Width: | Height: | Size: 381 KiB After Width: | Height: | Size: 246 KiB |
@@ -29,7 +29,9 @@ services:
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
environment:
|
||||
- PORT=3000 # internal port (nginx proxies here) — do not change
|
||||
# The port the API listens on. web proxies to this same value, so the two
|
||||
# cannot drift — change it in .env and both follow.
|
||||
- PORT=${PORT:-3000}
|
||||
- DATA_DIR=/data
|
||||
volumes:
|
||||
- ./data:/data # users, passkeys, per-user state, session secret — BACK THIS UP
|
||||
@@ -48,7 +50,14 @@ services:
|
||||
api:
|
||||
condition: service_started
|
||||
ports:
|
||||
- "${WEB_PORT:-8080}:80"
|
||||
- "${WEB_PORT:-8080}:${NGINX_PORT:-80}"
|
||||
# nginx renders its config at start-up from these (web/nginx.conf.template),
|
||||
# so the API service does not have to be called `api`. Defaults are the old
|
||||
# hardcoded values, so an existing .env and an existing stack are unaffected.
|
||||
environment:
|
||||
- NGINX_PORT=${NGINX_PORT:-80}
|
||||
- BACKEND=${BACKEND:-api}
|
||||
- PORT=${PORT:-3000}
|
||||
volumes:
|
||||
- ./media/img:/usr/share/nginx/html/img:ro
|
||||
- ./media/gif:/usr/share/nginx/html/gif:ro
|
||||
@@ -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.
|
||||
@@ -8,14 +8,14 @@ This guide takes you from "just cloned it" to "using it from my phone over the i
|
||||
Requirements: [Docker](https://docs.docker.com/get-docker/) with the Compose plugin.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/DuarteSantos8/gym-app opengym
|
||||
cd opengym
|
||||
git clone https://github.com/DuarteSantos8/openGym
|
||||
cd openGym
|
||||
cp .env.example .env
|
||||
docker compose pull # prebuilt images from ghcr.io (amd64 + arm64) — or skip and build from source
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
- First start downloads the exercise images/GIFs (~140 MB) once into `app/img` and `app/gif`.
|
||||
- First start downloads the exercise images/GIFs (~140 MB) once into `media/img` and `media/gif`.
|
||||
- Open **http://localhost:8080** and create a profile with a passkey.
|
||||
- Rather build from source than pull prebuilt images? Skip `docker compose pull` and run
|
||||
`docker compose up -d --build` instead — no Node needed locally either way.
|
||||
@@ -90,11 +90,12 @@ Visit `https://gym.example.com`, create your profile, and add it to your home sc
|
||||
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:
|
||||
If you'd rather control who gets in, three 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
|
||||
ALLOW_GUEST=0 # remove "Continue without account"
|
||||
```
|
||||
|
||||
Register your own passkey profile first, then find your id in `./data/db.json` under `users[].id`
|
||||
@@ -104,10 +105,43 @@ out and locked out everywhere until you re-enable it), and — with `INVITE_ONLY
|
||||
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.
|
||||
|
||||
`INVITE_ONLY=1` and `ALLOW_GUEST=0` answer different questions and are usually set together.
|
||||
Invite-only controls who may *create a profile*; it says nothing about the **Continue without
|
||||
account** button, which never creates one. Guest mode keeps everything in that browser and never
|
||||
talks to the server — there is no account, no sync and nothing for the admin dashboard to show —
|
||||
so on an instance meant for a known set of people it is a door that leads nowhere useful. With
|
||||
`ALLOW_GUEST=0` the button is gone, and anyone already using the app as a guest is returned to the
|
||||
login screen on their next visit. Their data is not deleted: it stays in that browser and comes
|
||||
back if you ever switch guests on again, or moves into a real profile if they create one on the
|
||||
same device.
|
||||
|
||||
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
|
||||
## 5. Fitting it into an existing stack
|
||||
|
||||
The defaults assume openGym is the only thing here: a service called `api` on port 3000, and nginx
|
||||
on port 80 inside its container. If you are merging this into a compose file that already has an
|
||||
`api`, or you put the web container behind your own reverse proxy on a different port, four
|
||||
settings in `.env` move those without editing any config file:
|
||||
|
||||
```bash
|
||||
WEB_PORT=8080 # host port — what you browse to
|
||||
NGINX_PORT=80 # port the web container listens on, inside the container
|
||||
BACKEND=api # name of the API service that /api is proxied to
|
||||
PORT=3000 # port the API listens on; web proxies to the same value
|
||||
SESSION_DAYS=90 # how long a sign-in lasts
|
||||
```
|
||||
|
||||
The web image renders its nginx config from these when the container starts, so they take effect
|
||||
on a **prebuilt image** — no rebuild. `BACKEND` and `PORT` together are what `/api` is proxied to,
|
||||
so they have to name a service the web container can actually reach on your compose network.
|
||||
|
||||
Note the difference from `VITE_IMG_BASE` / `VITE_GIF_BASE` (see Troubleshooting): those are
|
||||
build-time values baked into the frontend bundle, and setting them next to `docker compose` does
|
||||
nothing to an image you pulled.
|
||||
|
||||
## 6. Backups
|
||||
|
||||
Everything is in `./data`:
|
||||
|
||||
@@ -118,7 +152,7 @@ tar czf opengym-backup-$(date +%F).tar.gz data/
|
||||
That archive contains all profiles, passkeys and workout history. Restore by unpacking it back
|
||||
into the project folder. (Individual users can also export their own data as JSON from Settings.)
|
||||
|
||||
## 6. Notifications
|
||||
## 7. Notifications
|
||||
|
||||
openGym can push two kinds of alert to your phone/desktop, even when the app isn't open:
|
||||
rest-timer-over, and a reminder on days you have a workout planned but haven't logged one yet.
|
||||
@@ -130,7 +164,16 @@ 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.
|
||||
|
||||
## 7. Updating
|
||||
**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.
|
||||
|
||||
Push services like a contact address for whoever runs the server, in case they ever need to reach
|
||||
you about your pushes. openGym sends your `ORIGIN` by default; set `VAPID_SUBJECT=mailto:you@example.com`
|
||||
in `.env` if you would rather they had an inbox.
|
||||
|
||||
## 8. Updating
|
||||
|
||||
Running prebuilt images:
|
||||
|
||||
@@ -159,6 +202,17 @@ downloaded media are untouched.
|
||||
| Media didn't download | `docker compose logs media`. Re-run `docker compose up -d`, or run `./scripts/fetch-media.sh`. |
|
||||
| Port 8080 already used | Set `WEB_PORT=9090` in `.env` (and update `ORIGIN` for local testing). |
|
||||
| No "Notifications" option in Settings | Requires a signed-in profile and HTTPS (or `localhost`) — guest mode and plain HTTP over LAN can't subscribe. |
|
||||
| Day reminder fires at the wrong time | Toggle it off and on in Settings so it re-detects your browser's timezone (also happens automatically on every app load — see section 6). |
|
||||
| Day reminder fires at the wrong time | Toggle it off and on in Settings so it re-detects your browser's timezone (also happens automatically on every app load — see section 7). |
|
||||
| Want to reset a stuck login | Delete the cookie in your browser; sessions are just signed cookies. |
|
||||
| `docker compose pull` fails with "denied" / "unauthorized" | The prebuilt images aren't published yet, or need to be, or the GHCR package is still private — build from source instead (`docker compose up -d --build`). |
|
||||
| Exercise images/GIFs blank when a routine is open | Fixed in current images (issue #79). On an older build, see the note below. |
|
||||
|
||||
### `VITE_IMG_BASE` / `VITE_GIF_BASE` are build-time, not run-time
|
||||
|
||||
These two are read by Vite when the frontend is **compiled**, so their values are baked into
|
||||
the shipped JavaScript bundle. Setting them in the `.env` next to `docker compose` has no
|
||||
effect on an already-built image — the bundle has already made up its mind.
|
||||
|
||||
They are only useful if you build the frontend yourself (`docker compose up -d --build`, or a
|
||||
`npm run build` with the variables exported). If you need to redirect media on a prebuilt
|
||||
image, do it in your reverse proxy instead.
|
||||
@@ -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 8
|
||||
versionName "1.2.7"
|
||||
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'
|
||||