Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Analytics: Umami auf der Website, im Frontend nur wenn beim Build gesetzt

Duarte Santos4b25a8035672
diff --git a/frontend/vite.config.js b/frontend/vite.config.js
index e57eaa49b..0aa29c5b5 100644
--- a/frontend/vite.config.js
+++ b/frontend/vite.config.js
@@ -4,8 +4,26 @@ import react from '@vitejs/plugin-react'
const backend = process.env.API_TARGET || 'http://127.0.0.1:3000'
const media = process.env.MEDIA_TARGET || 'http://127.0.0.1:8888'
+// Optional web analytics (Umami). Injected only when BOTH vars are set at build time,
+// so a plain `npm run build` — and every self-hosted install — stays telemetry-free.
+// Set for the public instance: VITE_UMAMI_SRC=https://stats.example/script.js VITE_UMAMI_ID=<uuid>
+const umamiSrc = process.env.VITE_UMAMI_SRC
+const umamiId = process.env.VITE_UMAMI_ID
+
+const umami = {
+ name: 'opengym-umami',
+ transformIndexHtml() {
+ if (!umamiSrc || !umamiId) return
+ return [{
+ tag: 'script',
+ attrs: { defer: true, src: umamiSrc, 'data-website-id': umamiId },
+ injectTo: 'head'
+ }]
+ }
+}
+
export default defineConfig({
- plugins: [react()],
+ plugins: [react(), umami],
base: './',
server: {
proxy: {
diff --git a/website/about.html b/website/about.html
index 63f4b3165..751902748 100644
--- a/website/about.html
+++ b/website/about.html
@@ -10,6 +10,8 @@
<link rel="icon" type="image/png" sizes="180x180" href="icon-180.png">
<link rel="apple-touch-icon" href="icon-180.png">
<link rel="stylesheet" href="styles.css">
+<!-- Umami web analytics for opengym.duarte-santos.ch (self-hosted, cookieless). -->
+<script defer src="https://stats.duarte-santos.ch/script.js" data-website-id="db36019e-50f4-453c-9c56-d0588aefe233"></script>
</head>
<body>
diff --git a/website/docs.html b/website/docs.html
index 4cadfdd18..acebdfa2c 100644
--- a/website/docs.html
+++ b/website/docs.html
@@ -10,6 +10,8 @@
<link rel="icon" type="image/png" sizes="180x180" href="icon-180.png">
<link rel="apple-touch-icon" href="icon-180.png">
<link rel="stylesheet" href="styles.css">
+<!-- Umami web analytics for opengym.duarte-santos.ch (self-hosted, cookieless). -->
+<script defer src="https://stats.duarte-santos.ch/script.js" data-website-id="db36019e-50f4-453c-9c56-d0588aefe233"></script>
</head>
<body>
diff --git a/website/index.html b/website/index.html
index affb3dad0..08c427356 100644
--- a/website/index.html
+++ b/website/index.html
@@ -15,6 +15,8 @@
<link rel="icon" type="image/png" sizes="180x180" href="icon-180.png">
<link rel="apple-touch-icon" href="icon-180.png">
<link rel="stylesheet" href="styles.css">
+<!-- Umami web analytics for opengym.duarte-santos.ch (self-hosted, cookieless). -->
+<script defer src="https://stats.duarte-santos.ch/script.js" data-website-id="db36019e-50f4-453c-9c56-d0588aefe233"></script>
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"SoftwareApplication","name":"openGym",
"operatingSystem":"Android, Web","applicationCategory":"HealthApplication",
@@ -128,7 +130,7 @@
<li class="no">No cross-device sync</li>
</ul>
<a class="btn" href="openGym.apk" download>Download for Android</a>
- <p class="meta">v1.2.6 · 4.3 MB · Android 6.0+ · signed APK, sideload (your browser will ask — that's normal outside the Play Store)</p>
+ <p class="meta">v1.2.7 · 4.3 MB · Android 6.0+ · signed APK, sideload (your browser will ask — that's normal outside the Play Store)</p>
<p class="meta"><b>iPhone?</b> Apple doesn't allow installs outside the App Store — use the
self-hosted version as a home-screen app instead, or see <a href="docs.html#iphone">the docs</a>.</p>
</div>