openGym: Open-Source-Release als Self-Hosting-App
Rebranding GymLog → openGym. Ein-Befehl-Self-Hosting via Docker Compose: web (nginx serviert App + Proxy /api → api, ein Origin für Passkeys), api (Node/WebAuthn), media-Service lädt Übungs-GIFs beim ersten Start automatisch. Passkey-Domain über .env konfigurierbar (RP_ID/ORIGIN/WEB_PORT/RP_NAME), Secure-Cookie nur bei HTTPS (http://localhost funktioniert). MIT-Lizenz, README fürs Self-Hosting, docs/SELF_HOSTING.md, CONTRIBUTING.md. Standalone-Stack Ende-zu-Ende getestet (Passkey-Register/-Login, Daten-Sync, User-Isolation über den Proxy auf http://localhost).
This commit is contained in:
1 parent
0a0f2a004f
commit
3333b4decd
15 files changed
+436
-71
No files matched your search
+7
-7
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
/* ============================================================
|
||||
GymLog — personal gym & body-weight tracker
|
||||
openGym — personal gym & body-weight tracker
|
||||
Static SPA, localStorage, exercise data from data.js (EXDB)
|
||||
============================================================ */
|
||||
|
||||
@@ -557,14 +557,14 @@ function viewLogin(app) {
|
||||
app.innerHTML = `
|
||||
<div class="narrow" style="display:flex;flex-direction:column;justify-content:center;min-height:78vh;text-align:center">
|
||||
<div style="font-size:4rem">🏋️</div>
|
||||
<h1 style="font-size:2.2rem;font-weight:800;letter-spacing:-.02em;margin:8px 0 4px">GymLog</h1>
|
||||
<h1 style="font-size:2.2rem;font-weight:800;letter-spacing:-.02em;margin:8px 0 4px">openGym</h1>
|
||||
<div class="muted" style="margin-bottom:34px">Your workouts. Your weights. Your profile.</div>
|
||||
${webauthnOK() ? `
|
||||
<button class="btn primary" id="lg-in">👤 Sign in with passkey</button>
|
||||
<div style="height:10px"></div>
|
||||
<button class="btn" id="lg-new">✨ Create new profile</button>
|
||||
<div style="height:10px"></div>` : `
|
||||
<div class="card small muted" style="text-align:left">This browser doesn't support passkeys — you can still use GymLog locally on this device.</div>`}
|
||||
<div class="card small muted" style="text-align:left">This browser doesn't support passkeys — you can still use openGym locally on this device.</div>`}
|
||||
<button class="btn ghost dim" id="lg-guest">Continue without account</button>
|
||||
<div class="dim small" style="margin-top:26px;line-height:1.5">Passkeys use ${BIO} — no passwords.<br>Each profile keeps its own plan, workouts & body weight.</div>
|
||||
</div>`;
|
||||
@@ -653,7 +653,7 @@ function viewHome(app) {
|
||||
|
||||
app.innerHTML = `
|
||||
<div class="hdr">
|
||||
<div><h1>${USER ? 'Hi ' + esc(USER.name) + ' 💪' : 'GymLog 🏋️'}</h1><div class="sub">${today.toLocaleDateString('en-GB', {weekday:'long', day:'numeric', month:'long'})}</div></div>
|
||||
<div><h1>${USER ? 'Hi ' + esc(USER.name) + ' 💪' : 'openGym 🏋️'}</h1><div class="sub">${today.toLocaleDateString('en-GB', {weekday:'long', day:'numeric', month:'long'})}</div></div>
|
||||
<button class="iconbtn" id="btn-settings">⚙️</button>
|
||||
</div>
|
||||
|
||||
@@ -1821,9 +1821,9 @@ function viewSettings(app) {
|
||||
|
||||
<div class="card">
|
||||
<h2>Tip</h2>
|
||||
<div class="small muted" style="line-height:1.5">📱 ${IS_ANDROID ? 'In Chrome: <b>⋮ menu → Add to Home screen</b>' : 'In Safari: <b>Share → Add to Home Screen</b>'} to install GymLog as a full-screen app. ${USER ? 'Your data syncs with your profile — sign in anywhere to see it.' : 'Guest data stays on this device — export a backup now and then!'}</div>
|
||||
<div class="small muted" style="line-height:1.5">📱 ${IS_ANDROID ? 'In Chrome: <b>⋮ menu → Add to Home screen</b>' : 'In Safari: <b>Share → Add to Home Screen</b>'} to install openGym as a full-screen app. ${USER ? 'Your data syncs with your profile — sign in anywhere to see it.' : 'Guest data stays on this device — export a backup now and then!'}</div>
|
||||
</div>
|
||||
<div class="dim small" style="text-align:center;margin-top:8px">GymLog · exercise data: hasaneyldrm/exercises-dataset (CC)</div>
|
||||
<div class="dim small" style="text-align:center;margin-top:8px">openGym · exercise data: hasaneyldrm/exercises-dataset (CC)</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -1857,7 +1857,7 @@ function viewSettings(app) {
|
||||
rd.onload = () => {
|
||||
try {
|
||||
const data = JSON.parse(rd.result);
|
||||
if (!data.workouts || !data.routines) throw new Error('not a GymLog backup');
|
||||
if (!data.workouts || !data.routines) throw new Error('not a openGym backup');
|
||||
if (!confirm('Replace all current data with this backup?')) return;
|
||||
S = Object.assign(JSON.parse(JSON.stringify(DEF)), data);
|
||||
save(); toast('Backup imported ✓'); route();
|
||||
|
||||
+5
-5
@@ -3,17 +3,17 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover,user-scalable=no">
|
||||
<title>GymLog</title>
|
||||
<title>openGym</title>
|
||||
<meta name="description" content="Personal gym & body weight tracker">
|
||||
<meta name="theme-color" content="#0c0e12">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="apple-mobile-web-app-title" content="GymLog">
|
||||
<meta name="apple-mobile-web-app-title" content="openGym">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<link rel="apple-touch-icon" href="icon-180.png">
|
||||
<link rel="icon" type="image/png" href="icon-180.png">
|
||||
<link rel="stylesheet" href="style.css?v=13">
|
||||
<link rel="stylesheet" href="style.css?v=14">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><div style="padding-top:42vh;text-align:center;font-size:2.2rem">🏋️</div></div>
|
||||
@@ -45,7 +45,7 @@
|
||||
<div id="modal-root"></div>
|
||||
<div id="toast"></div>
|
||||
|
||||
<script src="data.js?v=13"></script>
|
||||
<script src="app.js?v=13"></script>
|
||||
<script src="data.js?v=14"></script>
|
||||
<script src="app.js?v=14"></script>
|
||||
</body>
|
||||
</html>
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "GymLog",
|
||||
"short_name": "GymLog",
|
||||
"name": "openGym",
|
||||
"short_name": "openGym",
|
||||
"description": "Personal gym & body weight tracker",
|
||||
"start_url": "./",
|
||||
"scope": "./",
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/* GymLog — mobile-first dark theme */
|
||||
/* openGym — mobile-first dark theme */
|
||||
:root{
|
||||
--bg:#0c0e12; --bg2:#14171d; --card:#1a1e26; --card2:#222733;
|
||||
--line:#2b3140; --txt:#eef1f6; --mut:#8b94a7; --dim:#5c6475;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* GymLog service worker — network-first for app shell, cache-first for media */
|
||||
const CACHE = 'gymlog-v13';
|
||||
const SHELL = ['./', 'index.html', 'style.css?v=13', 'app.js?v=13', 'data.js?v=13', 'manifest.json'];
|
||||
/* openGym service worker — network-first for app shell, cache-first for media */
|
||||
const CACHE = 'opengym-v14';
|
||||
const SHELL = ['./', 'index.html', 'style.css?v=14', 'app.js?v=14', 'data.js?v=14', 'manifest.json'];
|
||||
|
||||
self.addEventListener('install', e => {
|
||||
e.waitUntil(caches.open(CACHE).then(c => c.addAll(SHELL)).then(() => self.skipWaiting()));
|
||||
|
||||
Reference in new issue
Block a user