Repository navigation
openGym: new service - #393
Draft
jackspiering wants to merge 2 commits into
Draft
jackspiering wants to merge 2 commits into
jackspiering wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds openGym, a self-hosted gym and body-weight tracker, as a new stack in
services/opengym/, with a row in the rootREADME.md(Food and wellness).application(nginx web server, Serve target on port8080) andapi(app-<service>-api, port3000). Both are listed under "Deviations from the standard setup".tailscaleortailscaled(which tailscale tailscaledreturns nothing inopengym-webandopengym-api).ghcr.io/duartesantos8/.TAILNET_NAMEis required, because passkeys are bound to the exacthttps://<SERVICE>.<TAILNET_NAME>.ts.netaddress (RP_IDandORIGIN). The README lists it under "Before you start"..env, not the whole.envfile as in upstream's compose file, soTS_AUTHKEYstays out of the application containers.HEALTHCHECK, socompose.yamldoes not override them. The checks run every five minutes, so Compose showsstartingfor the first five minutes.TRUST_PROXY=1is not set. Its API is reachable only through nginx there, but here it also listens on the Tailscale IP of the device, so a Tailnet client could forge the forwarded address. The README notes the consequence (added after review): every visitor reaches the API as127.0.0.1, so the per-address limits on wrong passwords, invite codes, and device links apply to everyone together.TRUST_PROXY=1would not change that, because the web image overwritesX-Forwarded-Forwith its own$remote_addr, which is Serve.Related Issues
Verification
docker compose config --quietfromservices/opengym, with a dummy value forTAILNET_NAME(exit 0)application, andapiare all healthy, and the service is reachable through Tailscale Serve (https://<SERVICE>.<tailnet>.ts.net/returns 200,/api/healthreturns{"ok":true,...}). The request ran inside the network namespace, because test nodes are not reachable from the host.docker exec(wget --spideragainst the web port and against/api/health). Both containers reporthealthyafter the five-minute interval.PASSWORD_LOGIN=1andFIRST_USER_ADMIN=1in the copy, I registered a profile (it became admin), wrote a routine, and read it back. Afterdocker compose downandup -d, I signed in again and the routine was still there.portsblock: the page and/api/healthload on127.0.0.1:8080, and sign-in from that address is refused as cross-origin, as the README says.rumdl check --config .markdownlint.yml .(0.2.78) on the whole repository, andgit diff --check origin/mainTRUST_PROXY=1set. I removed it afterwards, which restores the upstream default (off). Nothing else changed after the test except comments and theopenGymspelling.Impact on existing users
Checklist
Additional Context
mediacontainer and no download at first start. The images also moved fromregistry.gitlab.com/duartesantos8/opengym/toghcr.io/duartesantos8/opengym-webandopengym-api.IMAGE_URLand the API image is set incompose.yaml. Both uselatest, as upstream's compose file does.