Docs - add new features

This commit is contained in:
Sam 2023-03-04 17:49:02 +01:00
parent fbb539d584
commit f902313127
6 changed files with 107 additions and 30 deletions

View File

@ -18,4 +18,8 @@ Authentication
auth.update_user_account, auth.update_user_account,
auth.update_password, auth.update_password,
auth.update_email, auth.update_email,
auth.logout_user auth.logout_user,
auth.accept_privacy_policy,
auth.get_user_data_export,
auth.request_user_data_export,
auth.download_data_export

View File

@ -104,3 +104,39 @@ Modify a user account (admin rights, active status, email and password).
- Reset user password (a new password will be displayed). - Reset user password (a new password will be displayed).
* - ``--update-email EMAIL`` * - ``--update-email EMAIL``
- Update user email. - Update user email.
``ftcli users clean_archives``
""""""""""""""""""""""""""""""
.. versionadded:: 0.7.13
Delete export requests and related archives created more than provided number of days.
.. cssclass:: table-bordered
.. list-table::
:widths: 25 50
:header-rows: 1
* - Options
- Description
* - ``--days``
- Number of days.
``ftcli users export_archives``
"""""""""""""""""""""""""""""""
.. versionadded:: 0.7.13
Process incomplete user export requests.
Can be used if redis is not set (no dramatiq workers running).
.. cssclass:: table-bordered
.. list-table::
:widths: 25 50
:header-rows: 1
* - Options
- Description
* - ``--max``
- Maximum number of export requests to process.

View File

@ -74,9 +74,10 @@ Workouts
Account & preferences Account & preferences
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
- A user can create, update and deleted his account. - A user can create, update and deleted his account.
- The user must accept the privacy policy to register. If the privacy change, a message is displayed on the dashboard to review the new version and validate it (*new in 0.7.13*).
- On registration, the user account is created with selected language in dropdown as user preference (*new in 0.6.9*). - On registration, the user account is created with selected language in dropdown as user preference (*new in 0.6.9*).
- After registration, the user account is inactive and an email with confirmation instructions is sent to activate it. - After registration, the user account is inactive and an email with confirmation instructions is sent to activate it.
A user with an inactive account cannot log in. (*new in 0.6.0*) A user with an inactive account cannot log in. (*new in 0.6.0*).
.. note:: .. note::
In case email sending is not configured, a `command line <cli.html#ftcli-users-update>`__ allows to activate users account. In case email sending is not configured, a `command line <cli.html#ftcli-users-update>`__ allows to activate users account.
@ -98,42 +99,66 @@ Account & preferences
| A workout with a disabled sport will still be displayed in the application. | A workout with a disabled sport will still be displayed in the application.
- A user can create `clients <apps.html>`__ for third-party applications (*new in 0.7.0*). - A user can create `clients <apps.html>`__ for third-party applications (*new in 0.7.0*).
- A user can request a data export (*new in 0.7.13*).
Administration Administration
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
(*new in 0.3.0*) (*new in 0.3.0*)
- **Application** Application
"""""""""""
The following parameters can be set: **Configuration**
- active users limit. If 0, registration is enabled (no limit defined) The following parameters can be set:
- maximum size of gpx file (individually uploaded or in a zip archive) (*changed in 0.7.4*)
- maximum size of zip archive
- maximum number of files in the zip archive (*changed in 0.7.4*)
- administrator email for contact (*new in 0.6.0*)
.. warning:: - active users limit. If 0, registration is enabled (no limit defined).
Updating server configuration may be necessary to handle large files (like `nginx <https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size>`_ for instance). - maximum size of gpx file (individually uploaded or in a zip archive) (*changed in 0.7.4*)
- maximum size of zip archive
- maximum number of files in the zip archive (*changed in 0.7.4*)
- administrator email for contact (*new in 0.6.0*)
.. note:: .. warning::
If email sending is disabled, a warning is displayed. Updating server configuration may be necessary to handle large files (like `nginx <https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size>`_ for instance).
.. note::
If email sending is disabled, a warning is displayed.
**About**
(*new in 0.7.13*)
| It is possible displayed additional information that may be useful to users in **About** page.
| Markdown syntax can be used.
- **Users** **Privacy policy**
- display and filter users list (*new in 0.7.13*)
- edit a user to:
- add/remove administration rights
- activate his account (*new in 0.6.0*)
- update his email (in case his account is locked) (*new in 0.6.0*)
- reset his password (in case his account is locked) (*new in 0.6.0*). If email sending is disabled, it is only possible via CLI.
- delete a user
- **Sports** | A default privacy policy is available (originally adapted from the `Discourse <https://github.com/discourse/discourse>`__ privacy policy).
| A custom privacy policy can set if needed (Markdown syntax can be used). A policy update will display a message on users dashboard to review and validate it.
- enable or disable a sport (a sport can be disabled even if workout with this sport exists) .. note::
Only the default privacy policy is translated (if translation is available).
Users
"""""
- display and filter users list
- edit a user to:
- add/remove administration rights
- activate his account (*new in 0.6.0*)
- update his email (in case his account is locked) (*new in 0.6.0*)
- reset his password (in case his account is locked) (*new in 0.6.0*). If email sending is disabled, it is only possible via CLI.
- delete a user
Sports
""""""
- enable or disable a sport (a sport can be disabled even if workout with this sport exists)
Translations Translations

View File

@ -26,7 +26,7 @@ Prerequisites
- Python 3.7+ - Python 3.7+
- PostgreSQL 11+ - PostgreSQL 11+
- optional - optional
- Redis for task queue (if email sending is enabled) and API rate limits - Redis for task queue (if email sending is enabled and for data export requests) and API rate limits
- SMTP provider (if email sending is enabled) - SMTP provider (if email sending is enabled)
- API key from a `weather data provider <installation.html#weather-data>`__ - API key from a `weather data provider <installation.html#weather-data>`__
- `Poetry <https://poetry.eustace.io>`__ (for installation from sources only) - `Poetry <https://poetry.eustace.io>`__ (for installation from sources only)
@ -39,6 +39,9 @@ Prerequisites
| On other OS, some issues can be encountered and adaptations may be | On other OS, some issues can be encountered and adaptations may be
necessary. necessary.
.. warning::
| If registration is enabled, it is recommended to set Redis and a SMTP provider for email sending and data export requests.
Environment variables Environment variables
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
@ -273,11 +276,13 @@ Emails sent by FitTrackee are:
- password reset request - password reset request
- email change (to old and new email adresses) - email change (to old and new email adresses)
- password change - password change
- when a data export archive is ready to download (*new in 0.7.13*)
.. versionchanged:: 0.6.5 .. versionchanged:: 0.6.5
| For single-user instance, it is possible to disable email sending with an empty ``EMAIL_URL`` (in this case, no need to start dramatiq workers). For single-user instance, it is possible to disable email sending with an empty ``EMAIL_URL`` (in this case, no need to start dramatiq workers).
| A `CLI <cli.html#ftcli-users-update>`__ is available to activate account and modify email and password.
A `CLI <cli.html#ftcli-users-update>`__ is available to activate account, modify email and password and handle data export requests.
Map tile server Map tile server

View File

@ -1766,7 +1766,9 @@ def request_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]:
def get_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]: def get_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]:
""" """
Get a data export info for authenticated user if a request exists. Get a data export info for authenticated user if a request exists.
It returns: It returns:
- export creation date - export creation date
- export status ("in_progress", "successful" and "errored") - export status ("in_progress", "successful" and "errored")
- file name and size (in bytes) when export is successful - file name and size (in bytes) when export is successful
@ -1780,13 +1782,13 @@ def get_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]:
**Example response**: **Example response**:
- if a request exists
.. sourcecode:: http .. sourcecode:: http
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
- if a request exists:
{ {
"status": "success", "status": "success",
"request": { "request": {
@ -1797,7 +1799,12 @@ def get_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]:
} }
} }
- if no request: - if no request
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Type: application/json
{ {
"status": "success", "status": "success",

View File

@ -111,7 +111,7 @@ def clean_export_archives(
'--max', '--max',
type=int, type=int,
required=True, required=True,
help='Maximum number of archives to generate.', help='Maximum number of export requests to process.',
) )
def export_archives( def export_archives(
max: int, max: int,