Self hosted FLOSS fitness/workout, nutrition and weight tracker
Merge branch 'master' into feature/release-2.7
Roland Geider886932650089
diff --cc CHANGELOG.mdindex 9739d636f,06f7ff52a..5ddd369b8--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -1,105 -1,26 +1,114 @@@# Changelog for the next release+> [!IMPORTANT]+> This release comes with some breaking changes for self-hoster. Please read carefully.+## New features+### Sync with Apple Health and Health Connect+The mobile app can now import your body metrics from Apple Health (iOS) and+Health Connect (Android). Once enabled in the settings, the data your smart+scale, blood pressure monitor, smartwatch or what other health apps record+is imported automatically and shows up alongside your manually entered entries.+At the moment we support these:++- body weight+- body fat+- lean body mass+- height+- blood pressure+- heart rate, summarised as one entry per day with the daily average, minimum+ and maximum+- resting heart rate+- blood oxygen, summarised as the daily average+- sleep, with the total per night plus the light, deep, REM and awake phases+- steps, distance and active energy, each as the daily total++Imported entries are marked as such and can only be changed or deleted in the+app they came from, otherwise they could be overwritten in a future import. You+can however still add entries by hand in every category, e.g. your blood pressure+taken from a non-connected device.++### Improvements to the Measurements+To support the data from the health sync, we have revamped the measurements. Each+category can now have a type (body fat, heart rate, etc.), so that we can e.g. show+the correct chart type. Additionally, the category list can be reordered.++It's also possible to save multi-value entries, such as the blood pressure.++Added a range selector for the period you want to look at. This should make loading+measurements be considerably faster, which is noticeable with histories of several+thousand entries.++We have also updated the available charts:+- the line chart now shows a moving average and a trend line besides the measured value+- the chart for body weight, body fat now shows when the different nutrition plans were active+- new bar chart, used for values such as the blood pressure+- heatmap, used for categories such as daily steps+- new change chart, one bar per week showing how far the value moved in it+- new distribution chart, showing how often each value occurred, with the median+ and the newest reading marked++Which chart a category gets follows from its type, but you can also pick it yourself+when you edit the category. Only the charts that suit the type are offered, and a+group is always drawn from what its components are.++### Calculated categories+A measurement category can now be calculated by wger instead of typed in by you.+At the moment there's available:++- BMI, from your body weight entries and the height+- waist to height ratio, from a category you measure your waist in+- the one-rep max of an exercise, estimated from your logged sets+- the total of two to five exercises, the classic being bench press, squat and+ deadlift added up++### Body weight understands units+Every body weight entry now remembers the unit it was entered in and is converted+when needed. Previously, changing the unit in the profile from metric to imperial+silently reinterpreted all past entries.++### OAuth2 provider+wger can now act as an OAuth2 provider itself, so that other applications can let+their users log in with their wger account and access the API on their behalf. This+is switched off by default unless configured, see the docs for the setup.++* <https://wger.readthedocs.io/en/latest/administration/oauth2_provider.html>++### Python client for the API+There is now an official Python client, generated from the openAPI spec, for anyone+writing scripts or tools against a wger instance. For non-python users, the openAPI+spec was cleaned up and expanded, so you can use it to generate clients for your+language.++```bash+pip install wger-api-client+```++* <https://github.com/wger-project/api-client>++### Your own timezone+Streaks, calendar days and trophies are now calculated in your own timezone.+The apps report it automatically, until they have, or for accounts that only+ever use scripts, the server's timezone is used like before.++### Others+* Reworked internal structure for workout sessions. This now allows sessions to span+ midnight, and to log more than one session per day, e.g. morning cardio and evening+ gym.+* New exercise names are checked against the existing ones during submission.+ A name too similar to an existing exercise is rejected with an error+ * Improved openAPI spec. The spec now properly describes the different parts of+ the API and can be used to generate clients.+ * Emails are now send asynchronously via the celery queue, this should make+ registration, password resets, etc. feel a bit snappier. If celery is not configured,+ the emails are send as before+ * Faster and stronger password hashing: passwords are now hashed with argon2 instead+ of PBKDF2. Argon2 is what Django itself recommends, but PBKDF2 is only the default+ because it needs no additional library. Existing passwords keep working and are+ migrated automatically on the next login.-### OAuth2 provider--wger can now act as an OAuth2 provider itself, so that other applications can let-their users log in with their wger account and access the API on their behalf. This-is switched off by default unless configured, see the docs for the setup.--* <https://wger.readthedocs.io/en/latest/administration/oauth2_provider.html>--## Bug fixes+### Bug fixes* Ingredient search now finds matching words in long ingredient names and ranksmore relevant results firstdiff --cc settings/main.pyindex 0ea4a609b,b362eafea..e45c323b9--- a/settings/main.py+++ b/settings/main.py@@@ -197,8 -197,14 +197,15 @@@ WGER_SETTINGS['CACHE_API_EXERCISES_CELEWGER_SETTINGS['CACHE_API_EXERCISES_CELERY_FORCE_UPDATE'] = env.bool('CACHE_API_EXERCISES_CELERY_FORCE_UPDATE', False)++ # Let a worker do the SMTP round trip, it would otherwise happen inside the+ # request that triggered the email (registration, password reset, ...)+ EMAIL_DELIVERY_BACKEND = EMAIL_BACKEND+ if WGER_SETTINGS['USE_CELERY']:+ EMAIL_BACKEND = 'wger.core.mail.CeleryEmailBackend'+WGER_SHOW_APP_STORE_LINKS = env.bool('WGER_SHOW_APP_STORE_LINKS', True)+WGER_MAX_SESSION_LENGTH_HOURS = env.int('WGER_MAX_SESSION_LENGTH_HOURS', 5)## Auth Proxy Authentication