• Python 80.2%
  • Vue 16.9%
  • JavaScript 2.1%
  • TypeScript 0.5%
Find a file
João Vitória Silva 47a8fa476b
Some checks are pending
Deploy documentation / deploy (push) Waiting to run
Lint Backend / Backend (ruff) (push) Waiting to run
Lint Frontend / Frontend (eslint + prettier + type-check) (push) Waiting to run
Test Backend / Backend (pytest) (push) Waiting to run
feat(garmin): add support for China accounts in Garmin Connect integration (#731)
## What does this PR do?

Adds support for Garmin Connect China (`connect.garmin.cn`) accounts. Users can now check a "China account" option when linking their Garmin account, which instructs the `garminconnect` library to use the China-specific endpoints for both initial authentication and all subsequent data fetches (activities, health, gear).

The `is_cn` flag is persisted in the encrypted token stored per user, so the correct regional endpoint is used automatically on every sync, no re-linking needed after the initial setup.

## Related issue

Closes #722

## Type of change

- [ ] Bug fix
- [x] New feature (exception during freeze; link prior discussion/acknowledgment)
- [ ] Documentation
- [ ] Refactor / code quality
- [ ] Translation
- [ ] Other (describe below)

> Acknowledged by maintainer in [#722](https://codeberg.org/endurain-project/endurain/issues/722) prior to implementation.

## Checklist

- [x] This PR is focused on a single concern
- [x] An issue was opened and acknowledged before writing this code (if not a small fix)
- [x] If this PR introduces a new feature during freeze, it was discussed and explicitly acknowledged first
- [x] The PR is under ~300 lines changed, excluding lock files, migrations, and generated code
- [ ] Tests have been added or updated where applicable
- [ ] Documentation has been updated where applicable
- [x] Commit messages follow Conventional Commits format

## Notes for the reviewer

- The `garminconnect` library already supports `is_cn` via a constructor parameter, no new dependency required.
- `is_cn` defaults to `False`, so all existing linked accounts continue to work without re-linking.
- The flag is stored alongside the encrypted token dict in the DB column, making it transparent to the rest of the data flow.
- All 13 locale i18n files were updated with a translated label for the new checkbox.

Co-authored-by: hugobatista <hugobatista@noreply.codeberg.org>
Co-authored-by: emon <emon@masto.top>
Reviewed-on: https://codeberg.org/endurain-project/endurain/pulls/731
2026-06-26 08:05:46 +02:00
.forgejo fix(docker): adjust latest manifest publishing condition for non-prerelease events 2026-06-23 12:09:32 +01:00
.github refactor(auth): complete auth/users boundary consolidation (#685) 2026-06-12 00:49:07 +02:00
aux_scripts fix: update translation links to Codeberg Translate and remove Crowdin references 2026-04-29 16:50:48 +01:00
backend feat(garmin): add support for China accounts in Garmin Connect integration (#731) 2026-06-26 08:05:46 +02:00
docker ci: harden dependency supply chain with pinning, renovate automations, and npm hardening (#670) 2026-06-07 12:27:19 +02:00
docs feat(ci): add major.minor Docker manifest tags for version pinning (#724) 2026-06-23 13:05:03 +02:00
frontend/app feat(garmin): add support for China accounts in Garmin Connect integration (#731) 2026-06-26 08:05:46 +02:00
.dockerignore Add .dockerignore and update .gitignore; fix Garmin activities retrieval 2025-05-28 15:51:00 +02:00
.env.example fix(csp): allow extra connect-src origins for forward-auth proxies (#552) (#710) 2026-06-17 17:41:49 +02:00
.gitignore fix: strip trailing whitespace in Strava CSV gear values for bulk import matching (#657) (#668) 2026-06-06 00:21:56 +02:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2025-05-03 23:07:45 +01:00
CONTRIBUTING.md ci: harden dependency supply chain with pinning, renovate automations, and npm hardening (#670) 2026-06-07 12:27:19 +02:00
docker-compose.yml-multiple-backends.example ci: harden dependency supply chain with pinning, renovate automations, and npm hardening (#670) 2026-06-07 12:27:19 +02:00
docker-compose.yml.example ci: harden dependency supply chain with pinning, renovate automations, and npm hardening (#670) 2026-06-07 12:27:19 +02:00
docker-compose.yml.secrets.example ci: harden dependency supply chain with pinning, renovate automations, and npm hardening (#670) 2026-06-07 12:27:19 +02:00
LICENSE Change license from GPL 3.0 to AGPL 3.0 or later 2024-12-28 21:47:29 +00:00
mkdocs.yml docs: fix references and fix module placement at reference to mimic codebase structure 2026-06-12 10:16:37 +01:00
README.md fix: update feature freeze documentation link to correct date 2026-05-23 21:34:13 +01:00
renovate.json fix: enforce 30-day minimumReleaseAge for docker digest and pinDigest updates (#689) 2026-06-10 12:02:47 +02:00
ROADMAP.md Update docs and roadmap for features and trademark 2025-12-08 16:02:56 +00:00
screenshot_01.png Update gallery photos with v0.14.0 changes 2025-09-06 18:22:41 +01:00
SECURITY.md Add user IdP linking and MFA setup modals 2025-10-17 16:19:57 +01:00
TRADEMARK.md Update TRADEMARK.md 2025-12-03 22:24:47 +00:00

Note

GitHub Mirror - If you are viewing this on GitHub, please be aware that this repository is a read-only mirror. Issues, pull requests, and all project activity are tracked on Codeberg: https://codeberg.org/endurain-project/endurain

Note

Endurain is on a temporary feature freeze - The project is not paused. The focus is shifting from new features to strengthening the foundations. More details here

Endurain

Translation status License Release Stars Trademark Policy

A self-hosted fitness tracking service
Visit Endurain's Mastodon profile and Discord server.

Endurain Screenshot

🚀 Try the Demo

Experience Endurain without installation:

Demo URL: https://demo.endurain.com

  • Username: admin
  • Password: admin
  • Reset Schedule: Daily at midnight (Europe/Lisbon timezone)

⚠️ Note: The demo environment resets every day. Do not store important data.

Table of Contents

What is Endurain?

Endurain is a self-hosted fitness tracking service designed to give users full control over their data and hosting environment. It's similar to Strava but focused on privacy and customization. Built with:

  • Frontend: Vue.js, Notivue and Bootstrap CSS
  • Backend: Python FastAPI, Alembic, SQLAlchemy, Apprise, stravalib and python-garminconnect for Strava and Garmin Connect integration, gpxpy, tcxreader and fitdecode for .gpx, .tcx and .fit file import respectively
  • Database: PostgreSQL for efficient data management
  • Observability: Jaeger for basic tracing and monitoring
  • Integrations: Supports Strava and Garmin Connect. Manual upload of activities using .gpx, .tcx and .fit files are also supported

To deploy Endurain, a Docker image is available, and a comprehensive example can be found in the "docker-compose.yml.example" file provided. Configuration is facilitated through environment variables, ensuring flexibility and ease of customization.

For more information please see the Endurain's documentation.

Sponsors

A huge thank you to the project sponsors! Your support helps keep this project going.

Support Endurain's development on:

Contributing

Contributions are welcomed! Please open an issue to discuss any changes or improvements before submitting a PR. Check out the Contributing Guidelines for more details.

Help Translate

Endurain has multi-language support, and you can help translate it into more languages via Codeberg Translate.

License

This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.

Trademark Notice

Endurain® is a trademark of João Vitória Silva.

You are welcome to self-host Endurain and use the name and logo, including for personal, educational, research, or community (non-commercial) use.
Commercial use of the Endurain name or logos (such as offering paid hosting, products, or services) is not permitted without prior written permission.

See TRADEMARK.md for full details.

Built with ❤️ from Portugal | Part of the Endurain ecosystem