mirror of
https://github.com/joaovitoriasilva/endurain.git
synced 2026-01-08 23:38:01 -05:00
Merge pull request #40 from joaovitoriasilva/feature-garminconnect
Feature garminconnect
This commit is contained in:
164
README.md
164
README.md
@@ -14,28 +14,14 @@
|
||||
<img src="screenshot_01.png" alt="Endurain Screenshot">
|
||||
</div>
|
||||
|
||||
> [!WARNING]
|
||||
> This project is currently in **Alpha** state. You can try it out at your own risk, but be aware that things might break and **DATA LOSS** may occur.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- <a href="https://docs.endurain.com">Endurain documentation</a>
|
||||
- [What is Endurain?](#what-is-endurain)
|
||||
- [Features](#features)
|
||||
- [Planned Features](#planned-features)
|
||||
- [Deployment Instructions](#deployment-instructions)
|
||||
- [API Integration](#api-integration-v030)
|
||||
- [Configuration](#configuration)
|
||||
- [Frontend Environment Variables](#frontend-environment-variables)
|
||||
- [Backend Environment Variables](#backend-environment-variables)
|
||||
- [Volumes](#volumes)
|
||||
- [Bulk import and file upload](#bulk-import-and-file-upload)
|
||||
- [Strava Integration](#strava-integration)
|
||||
- [Log files](#log-files)
|
||||
- [Sponsors](#sponsors)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
- [Help Translate](#help-translate)
|
||||
- [Community & Support](#community--support)
|
||||
|
||||
## What is Endurain?
|
||||
|
||||
@@ -48,153 +34,7 @@ Endurain is a self-hosted fitness tracking service designed to give users full c
|
||||
|
||||
To deploy Endurain, Docker images are 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. More details bellow.
|
||||
|
||||
### Developer's Note
|
||||
|
||||
As a non-professional developer, my journey with Endurain involved learning and implementing new technologies and concepts, with invaluable assistance from ChatGPT. The primary motivation behind this project was to gain hands-on experience and expand my understanding of modern development practices. Second motivation is that I'm an amateur triathlete and I want to keep track of my gear and gear components usage.
|
||||
|
||||
If you have any recommendations or insights on improving any aspect of Endurain, whether related to technology choices, user experience, or any other relevant area, I would greatly appreciate your input. The goal is to create a reliable and user-friendly fitness tracking solution that caters to the needs of individuals who prefer self-hosted applications. Your constructive feedback will undoubtedly contribute to the refinement of Endurain.
|
||||
|
||||
## Features
|
||||
|
||||
Endurain currently supports:
|
||||
|
||||
- Multi-user functionality
|
||||
- Admin and user profiles with adaptable interfaces
|
||||
- Activity import via manual or bulk upload (.gpx and .fit files)
|
||||
- Strava integration for syncing activities and gear
|
||||
- Personalized activity feeds and statistics (week/month)
|
||||
- Basic activity privacy settings
|
||||
- Gear tracking (wetsuits, bicycles, shoes)
|
||||
- User pages with stats and activity histories
|
||||
- Follower features (view activities)
|
||||
- Multi-language support (currently English only)
|
||||
- Dark/light theme switcher
|
||||
- Third-party app support
|
||||
- Weight logging
|
||||
|
||||
## Planned Features
|
||||
|
||||
Upcoming features (in no particular order):
|
||||
|
||||
- Garmin Connect integration
|
||||
- Simplified Docker images
|
||||
- Live tracking
|
||||
- Default gear for activity types
|
||||
- Gear component tracking (e.g., track when components like bike chains need replacing)
|
||||
- Activity comments and likes
|
||||
- Notification system
|
||||
- Potential ActivityPub integration
|
||||
|
||||
## Deployment Instructions
|
||||
|
||||
### Default Credentials
|
||||
|
||||
- **Username:** admin
|
||||
- **Password:** admin
|
||||
|
||||
### Docker Deployment
|
||||
|
||||
Endurain provides Docker images for simplified deployment. To get started, check out the `docker-compose.yml.example` file and adjust it according to your setup.
|
||||
Supported tags are:
|
||||
- **latest:** contains the latest released version;
|
||||
- **version, example "v0.3.0":** contains the app state available at the time of the version specified;
|
||||
- **development version, example "dev_06092024":** contains a development version of the app at the date specified. This is not a stable released and may contain issues and bugs. Please do not open issues if using a version like this unless asked by me.
|
||||
|
||||
## API Integration (v0.3.0+)
|
||||
|
||||
Endurain supports integration with other apps:
|
||||
|
||||
- For **web apps**, the backend sends access/refresh tokens as HTTP-only cookies.
|
||||
- For **mobile apps**, tokens are included in the response body.
|
||||
|
||||
### API Requirements
|
||||
|
||||
- **Add a header:** Every request must include an `X-Client-Type` header with either `web` or `mobile` as the value. Requests with other values will receive a `403` error.
|
||||
- **Activity Upload:** Use the `/activities/create/upload` endpoint (expects a .gpx or .fit file).
|
||||
|
||||
## Configuration
|
||||
|
||||
### Frontend Environment Variables
|
||||
Table below shows supported environment variables. Variables marked with optional "No" should be set to avoid errors.
|
||||
|
||||
| Environment variable | Default value | Optional | Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| MY_APP_BACKEND_PROTOCOL | http | Yes | Needs to be `https` if you want to enable Strava integration. Strava callback relies on this. You may need to update this variable based on docker image spin up (api host or local ip (example: http://192.168.1.10:98)) |
|
||||
| MY_APP_BACKEND_HOST | localhost:98 | Yes | Needs to be set and be Internet faced/resolved if you want to enable Strava integration. Strava callback relies on this. You may need to update this variable based on docker image spin up (api host or local ip (example: http://192.168.1.10:98)) |
|
||||
| MY_APP_STRAVA_CLIENT_ID | changeme | Yes | Needs to be set with your Strava API Client ID if you want to enable Strava integration. |
|
||||
|
||||
Frontend dependencies:
|
||||
- To check npm dependencies used, use npm file (package.json)
|
||||
- User avatars create using DiceBear (https://www.dicebear.com) avataaars style.
|
||||
- Logo created on Canva
|
||||
|
||||
### Backend Environment Variables
|
||||
Table below shows supported environment variables. Variables marked with optional "No" should be set to avoid errors.
|
||||
|
||||
Environment variable | Default value | Optional | Notes |
|
||||
--- | --- | --- | --- |
|
||||
| DB_HOST | mariadb | Yes | N/A |
|
||||
| DB_PORT | 3306 | Yes | N/A |
|
||||
| DB_USER | endurain | Yes | N/A |
|
||||
| DB_PASSWORD | changeme | `No` | N/A |
|
||||
| DB_DATABASE | endurain | Yes | N/A |
|
||||
| SECRET_KEY | changeme | `No` | Run "openssl rand -hex 32" on a terminal to get a secret |
|
||||
| ALGORITHM | HS256 | Yes | Currently only HS256 is supported |
|
||||
| ACCESS_TOKEN_EXPIRE_MINUTES | 15 | Yes | Time in minutes |
|
||||
| REFRESH_TOKEN_EXPIRE_DAYS | 7 | Yes | Time in days |
|
||||
| STRAVA_CLIENT_ID | changeme | `No` | Needed if you want to enable the Strava integration |
|
||||
| STRAVA_CLIENT_SECRET | changeme | `No` | Needed if you want to enable the Strava integration |
|
||||
| STRAVA_AUTH_CODE | changeme | `No` | Needed if you want to enable the Strava integration |
|
||||
| JAEGER_ENABLED | false | Yes | N/A |
|
||||
| JAEGER_PROTOCOL | http | Yes | N/A |
|
||||
| JAEGER_HOST | jaeger | Yes | N/A |
|
||||
| JAGGER_PORT | 4317 | Yes | N/A |
|
||||
| STRAVA_DAYS_ACTIVITIES_ONLINK | 30 | Yes | On Strava integration setup the number of days (including today) to get activities. Strava free API limitations can limit number of days you can query in a given time |
|
||||
| FRONTEND_PROTOCOL | http | Yes | Needs to be set if you want to enable Strava integration. You may need to update this variable based on docker image spin up (frontend host or local ip (example: http://192.168.1.10:8080)) |
|
||||
| FRONTEND_HOST | frontend:8080 | Yes | Needs to be set if you want to enable Strava integration. You may need to update this variable based on docker image spin up (frontend host or local ip (example: http://192.168.1.10:8080)) |
|
||||
| GEOCODES_MAPS_API | changeme | `No` | <a href="https://geocode.maps.co/">Geocode maps</a> offers a free plan consisting of 1 Request/Second. Registration necessary. |
|
||||
|
||||
Table below shows the obligatory environment variables for mariadb container. You should set them based on what was also set for backend container.
|
||||
|
||||
| Environemnt variable | Default value | Optional | Notes |
|
||||
| --- | --- | --- | ---
|
||||
| MYSQL_ROOT_PASSWORD | changeme | `No` | N/A |
|
||||
| MYSQL_DATABASE | endurain | `No` | N/A |
|
||||
| MYSQL_USER | endurain | `No` | N/A |
|
||||
| MYSQL_PASSWORD | changeme | `No` | N/A |
|
||||
|
||||
To check Python backend dependencies used, use poetry file (pyproject.toml)
|
||||
|
||||
## Volumes
|
||||
|
||||
It is recommended to configure the following volumes for data persistence:
|
||||
|
||||
| Volume | Path | Notes |
|
||||
| --- | --- | --- |
|
||||
| /app/files/bulk_import | <local_path>/endurain/backend/files/bulk_import:/app/files/bulk_import | Necessary to enable bulk import of activities. Place here your activities files |
|
||||
| /app/files/processed | <local_path>/endurain/backend/files/processed:/app/files/processed | Necessary for processed original files persistence on container image updates |
|
||||
| /app/user_images | <local_path>/endurain/backend/user_images:/app/user_images | Necessary for user image persistence on container image updates |
|
||||
| /app/logs | <local_path>/endurain/backend/logs:/app/logs | Log files for the backend |
|
||||
|
||||
## Bulk import and file upload
|
||||
|
||||
.fit files are preferred. I noticed that Strava/Garmin Connect process of converting .fit to .gpx introduces additional data to the activity file leading to minor variances in the data, like for example additional meters in distance and elevation gain.
|
||||
Some notes:
|
||||
- After the files are processed, the files are moved to the processed folder.
|
||||
- GEOCODES API has a limit of 1 Request/Second on the free plan, so if you have a large number of files, it might not be possible to import all in the same action.
|
||||
|
||||
## Strava Integration
|
||||
|
||||
To enable Strava integration, ensure your API endpoint is accessible from the internet and follow Strava's [API setup guide](https://developers.strava.com/docs/getting-started/).
|
||||
|
||||
## Log files
|
||||
|
||||
The table bellow details the log files available. These logs are available in the /app/logs folder:
|
||||
|
||||
| Log | Description |
|
||||
| --- | --- |
|
||||
| app.log | General log |
|
||||
| migrations.log | File detailing migrations operations |
|
||||
For more information please see the Endurain's [documentation](https://docs.endurain.com).
|
||||
|
||||
## Sponsors
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ ENV JAEGER_ENABLED="false"
|
||||
ENV JAEGER_HOST="jaeger"
|
||||
ENV JAEGER_PROTOCOL="http"
|
||||
ENV JAGGER_PORT=4317
|
||||
ENV STRAVA_DAYS_ACTIVITIES_ONLINK=30
|
||||
ENV FRONTEND_PROTOCOL="http"
|
||||
ENV FRONTEND_HOST="localhost:8080"
|
||||
ENV GEOCODES_MAPS_API="changeme"
|
||||
|
||||
@@ -19,10 +19,7 @@ logger = logging.getLogger("myLogger")
|
||||
def get_all_activities(db: Session):
|
||||
try:
|
||||
# Get the activities from the database
|
||||
activities = (
|
||||
db.query(models.Activity)
|
||||
.all()
|
||||
)
|
||||
activities = db.query(models.Activity).all()
|
||||
|
||||
# Check if there are activities if not return None
|
||||
if not activities:
|
||||
@@ -103,7 +100,7 @@ def get_user_activities_with_pagination(
|
||||
activity.start_time = activity.start_time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
activity.end_time = activity.end_time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
activity.created_at = activity.created_at.strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
|
||||
# Return the activities
|
||||
return activities
|
||||
|
||||
@@ -431,7 +428,47 @@ def get_activity_by_strava_id_from_user_id(
|
||||
|
||||
except Exception as err:
|
||||
# Log the exception
|
||||
logger.error(f"Error in get_activity_by_id_from_user_id: {err}", exc_info=True)
|
||||
logger.error(
|
||||
f"Error in get_activity_by_strava_id_from_user_id: {err}", exc_info=True
|
||||
)
|
||||
# Raise an HTTPException with a 500 Internal Server Error status code
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
detail="Internal Server Error",
|
||||
) from err
|
||||
|
||||
|
||||
def get_activity_by_garminconnect_id_from_user_id(
|
||||
activity_garminconnect_id: int, user_id: int, db: Session
|
||||
):
|
||||
try:
|
||||
# Get the activities from the database
|
||||
activity = (
|
||||
db.query(models.Activity)
|
||||
.filter(
|
||||
models.Activity.user_id == user_id,
|
||||
models.Activity.garminconnect_activity_id == activity_garminconnect_id,
|
||||
)
|
||||
.first()
|
||||
)
|
||||
|
||||
# Check if there are activities if not return None
|
||||
if not activity:
|
||||
return None
|
||||
|
||||
activity.start_time = activity.start_time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
activity.end_time = activity.end_time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
activity.created_at = activity.created_at.strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
# Return the activities
|
||||
return activity
|
||||
|
||||
except Exception as err:
|
||||
# Log the exception
|
||||
logger.error(
|
||||
f"Error in get_activity_by_garminconnect_id_from_user_id: {err}",
|
||||
exc_info=True,
|
||||
)
|
||||
# Raise an HTTPException with a 500 Internal Server Error status code
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
@@ -512,6 +549,7 @@ def create_activity(activity: activities_schema.Activity, db: Session):
|
||||
gear_id=activity.gear_id,
|
||||
strava_gear_id=activity.strava_gear_id,
|
||||
strava_activity_id=activity.strava_activity_id,
|
||||
garminconnect_activity_id=activity.garminconnect_activity_id,
|
||||
)
|
||||
|
||||
# Add the activity to the database
|
||||
@@ -557,12 +595,14 @@ def edit_activity(user_id: int, activity: activities_schema.Activity, db: Sessio
|
||||
detail="Activity not found",
|
||||
headers={"WWW-Authenticate": "Bearer"},
|
||||
)
|
||||
|
||||
|
||||
# Check if 'activity' is a Pydantic model instance and convert it to a dictionary
|
||||
if isinstance(activity, BaseModel):
|
||||
activity_data = activity.dict(exclude_unset=True)
|
||||
else:
|
||||
activity_data = {key: value for key, value in vars(activity).items() if value is not None}
|
||||
activity_data = {
|
||||
key: value for key, value in vars(activity).items() if value is not None
|
||||
}
|
||||
|
||||
# Iterate over the fields and update the db_activity dynamically
|
||||
for key, value in activity_data.items():
|
||||
@@ -672,7 +712,7 @@ def delete_all_strava_activities_for_user(user_id: int, db: Session):
|
||||
db.query(models.Activity)
|
||||
.filter(
|
||||
models.Activity.user_id == user_id,
|
||||
models.Activity.strava_activity_id is not None,
|
||||
models.Activity.strava_activity_id.isnot(None),
|
||||
)
|
||||
.delete()
|
||||
)
|
||||
|
||||
@@ -35,6 +35,7 @@ class Activity(BaseModel):
|
||||
gear_id: int | None = None
|
||||
strava_gear_id: str | None = None
|
||||
strava_activity_id: int | None = None
|
||||
garminconnect_activity_id: int | None = None
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
@@ -26,12 +26,16 @@ import fit.utils as fit_utils
|
||||
logger = logging.getLogger("myLogger")
|
||||
|
||||
|
||||
async def parse_and_store_activity_from_file(
|
||||
token_user_id: int, file_path: str, db: Session
|
||||
def parse_and_store_activity_from_file(
|
||||
token_user_id: int, file_path: str, db: Session, from_garmin: bool = False
|
||||
):
|
||||
try:
|
||||
# Get file extension
|
||||
_, file_extension = os.path.splitext(file_path)
|
||||
garmin_connect_activity_id = None
|
||||
|
||||
if from_garmin:
|
||||
garmin_connect_activity_id = os.path.basename(file_path).split('_')[0]
|
||||
|
||||
# Open the file and process it
|
||||
with open(file_path, "rb") as file:
|
||||
@@ -53,9 +57,14 @@ async def parse_and_store_activity_from_file(
|
||||
)
|
||||
|
||||
# Create activity objects for each activity in the file
|
||||
created_activities_objects = fit_utils.create_activity_objects(
|
||||
split_records_by_activity, token_user_id
|
||||
)
|
||||
if from_garmin:
|
||||
created_activities_objects = fit_utils.create_activity_objects(
|
||||
split_records_by_activity, token_user_id, int(garmin_connect_activity_id)
|
||||
)
|
||||
else:
|
||||
created_activities_objects = fit_utils.create_activity_objects(
|
||||
split_records_by_activity, token_user_id
|
||||
)
|
||||
|
||||
for activity in created_activities_objects:
|
||||
# Store the activity in the database
|
||||
@@ -494,6 +503,7 @@ def define_activity_type(activity_type):
|
||||
"VirtualRun": 3,
|
||||
"cycling": 4,
|
||||
"Ride": 4,
|
||||
"road": 4,
|
||||
"GravelRide": 5,
|
||||
"gravel_cycling": 5,
|
||||
"MountainBikeRide": 6,
|
||||
@@ -511,6 +521,8 @@ def define_activity_type(activity_type):
|
||||
"hiking": 12,
|
||||
"Rowing": 13,
|
||||
"indoor_rowing": 13,
|
||||
"yoga": 14,
|
||||
"Yoga": 14,
|
||||
}
|
||||
# "AlpineSki",
|
||||
# "BackcountrySki",
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
"""Garmin Connect integration columns
|
||||
|
||||
Revision ID: 241bdc784fef
|
||||
Revises: 1287b0e32297
|
||||
Create Date: 2024-11-16 09:20:18.779220
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '241bdc784fef'
|
||||
down_revision: Union[str, None] = '1287b0e32297'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('activities', sa.Column('garminconnect_activity_id', sa.BigInteger(), nullable=True, comment='Garmin Connect activity ID'))
|
||||
op.create_unique_constraint(None, 'activities', ['garminconnect_activity_id'])
|
||||
op.add_column('users_integrations', sa.Column('garminconnect_oauth1', mysql.JSON(), nullable=True))
|
||||
op.add_column('users_integrations', sa.Column('garminconnect_oauth2', mysql.JSON(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('users_integrations', 'garminconnect_oauth2')
|
||||
op.drop_column('users_integrations', 'garminconnect_oauth1')
|
||||
op.drop_constraint(None, 'activities', type_='unique')
|
||||
op.drop_column('activities', 'garminconnect_activity_id')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,2 +1,2 @@
|
||||
# Constant related to version
|
||||
API_VERSION = "v0.5.3"
|
||||
API_VERSION = "v0.6.0"
|
||||
@@ -12,7 +12,7 @@ import activities.schema as activities_schema
|
||||
logger = logging.getLogger("myLogger")
|
||||
|
||||
|
||||
def create_activity_objects(sessions_records: dict, user_id: int) -> list:
|
||||
def create_activity_objects(sessions_records: dict, user_id: int, garmin_activity_id: int = None) -> list:
|
||||
try:
|
||||
activity_name = "Workout"
|
||||
visibility = 0
|
||||
@@ -74,6 +74,7 @@ def create_activity_objects(sessions_records: dict, user_id: int) -> list:
|
||||
visibility=visibility,
|
||||
strava_gear_id=None,
|
||||
strava_activity_id=None,
|
||||
garminconnect_activity_id=garmin_activity_id,
|
||||
),
|
||||
"is_elevation_set": session_record["is_elevation_set"],
|
||||
"ele_waypoints": session_record["ele_waypoints"],
|
||||
@@ -203,16 +204,16 @@ def split_records_by_activity(parsed_data: dict) -> dict:
|
||||
i
|
||||
]["lat_lon_waypoints"][0]["lon"]
|
||||
|
||||
# Use geocoding API to get city, town, and country based on coordinates
|
||||
location_data = activities_utils.location_based_on_coordinates(
|
||||
session["initial_latitude"], session["initial_longitude"]
|
||||
)
|
||||
# Use geocoding API to get city, town, and country based on coordinates
|
||||
location_data = activities_utils.location_based_on_coordinates(
|
||||
session["initial_latitude"], session["initial_longitude"]
|
||||
)
|
||||
|
||||
# Extract city, town, and country from location data
|
||||
if location_data:
|
||||
parsed_session["session"]["city"] = location_data["city"]
|
||||
parsed_session["session"]["town"] = location_data["town"]
|
||||
parsed_session["session"]["country"] = location_data["country"]
|
||||
# Extract city, town, and country from location data
|
||||
if location_data:
|
||||
parsed_session["session"]["city"] = location_data["city"]
|
||||
parsed_session["session"]["town"] = location_data["town"]
|
||||
parsed_session["session"]["country"] = location_data["country"]
|
||||
|
||||
if is_elevation_set:
|
||||
activity_waypoints[i]["ele_waypoints"] = [
|
||||
|
||||
0
backend/app/garmin/__init__.py
Normal file
0
backend/app/garmin/__init__.py
Normal file
145
backend/app/garmin/activity_utils.py
Normal file
145
backend/app/garmin/activity_utils.py
Normal file
@@ -0,0 +1,145 @@
|
||||
import logging, os
|
||||
import zipfile
|
||||
|
||||
from datetime import datetime, timedelta, date
|
||||
import garminconnect
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
import garmin.utils as garmin_utils
|
||||
|
||||
import activities.utils as activities_utils
|
||||
import activities.crud as activities_crud
|
||||
|
||||
import users.crud as users_crud
|
||||
|
||||
from database import SessionLocal
|
||||
|
||||
# Define a loggger created on main.py
|
||||
mainLogger = logging.getLogger("myLogger")
|
||||
|
||||
|
||||
def fetch_and_process_activities(
|
||||
garminconnect_client: garminconnect.Garmin,
|
||||
start_date: datetime,
|
||||
user_id: int,
|
||||
db: Session,
|
||||
) -> int:
|
||||
# Fetch Garmin Connect activities after the specified start date
|
||||
garmin_activities = garminconnect_client.get_activities_by_date(
|
||||
start_date, date.today()
|
||||
)
|
||||
|
||||
if garmin_activities is None:
|
||||
# Log an informational event if no activities were found
|
||||
mainLogger.info(
|
||||
f"User {user_id}: No new Garmin Connect activities found after {start_date}: garmin_activities is None"
|
||||
)
|
||||
|
||||
# Return 0 to indicate no activities were processed
|
||||
return 0
|
||||
|
||||
# Download activities
|
||||
for activity in garmin_activities:
|
||||
# Get the activity ID
|
||||
activity_id = activity["activityId"]
|
||||
|
||||
# Check if the activity is already stored in the database
|
||||
activity_db = activities_crud.get_activity_by_garminconnect_id_from_user_id(
|
||||
activity_id, user_id, db
|
||||
)
|
||||
|
||||
if activity_db:
|
||||
# Log an informational event if the activity is already stored
|
||||
mainLogger.info(
|
||||
f"User {user_id}: Activity {activity_id} already stored in the database"
|
||||
)
|
||||
continue
|
||||
|
||||
# Download the activity in original format (.zip file)
|
||||
zip_data = garminconnect_client.download_activity(
|
||||
activity_id, dl_fmt=garminconnect_client.ActivityDownloadFormat.ORIGINAL
|
||||
)
|
||||
# Save the zip file
|
||||
output_file = f"files/{str(activity_id)}.zip"
|
||||
|
||||
# Write the ZIP data to the output file
|
||||
with open(output_file, "wb") as fb:
|
||||
fb.write(zip_data)
|
||||
|
||||
# Array to store the names of extracted files
|
||||
extracted_files = []
|
||||
|
||||
# Open the ZIP file
|
||||
with zipfile.ZipFile(output_file, "r") as zip_ref:
|
||||
# Extract all contents to the specified directory
|
||||
zip_ref.extractall("files")
|
||||
# Populate the array with file names
|
||||
extracted_files = zip_ref.namelist()
|
||||
|
||||
os.remove(output_file)
|
||||
|
||||
for file in extracted_files:
|
||||
activities_utils.parse_and_store_activity_from_file(
|
||||
user_id, f"files/{file}", db, True
|
||||
)
|
||||
|
||||
# Return the number of activities processed
|
||||
return len(garmin_activities)
|
||||
|
||||
|
||||
def retrieve_garminconnect_users_activities_for_days(days: int):
|
||||
# Create a new database session
|
||||
db = SessionLocal()
|
||||
|
||||
try:
|
||||
# Get all users
|
||||
users = users_crud.get_all_users(db)
|
||||
finally:
|
||||
# Ensure the session is closed after use
|
||||
db.close()
|
||||
|
||||
# Process the activities for each user
|
||||
for user in users:
|
||||
get_user_garminconnect_activities_by_days(
|
||||
(datetime.utcnow() - timedelta(days=days)).strftime(
|
||||
"%Y-%m-%dT%H:%M:%S"
|
||||
),
|
||||
user.id,
|
||||
)
|
||||
|
||||
|
||||
def get_user_garminconnect_activities_by_days(start_date: datetime, user_id: int):
|
||||
# Create a new database session
|
||||
db = SessionLocal()
|
||||
|
||||
try:
|
||||
# Get the user integrations by user ID
|
||||
user_integrations = garmin_utils.fetch_user_integrations_and_validate_token(
|
||||
user_id, db
|
||||
)
|
||||
|
||||
if user_integrations is None:
|
||||
mainLogger.info(f"User {user_id}: Garmin Connect not linked")
|
||||
return None
|
||||
|
||||
# Log the start of the activities processing
|
||||
mainLogger.info(f"User {user_id}: Started Garmin Connect activities processing")
|
||||
|
||||
# Create a Garmin Connect client with the user's access token
|
||||
garminconnect_client = garmin_utils.login_garminconnect_using_tokens(
|
||||
user_integrations.garminconnect_oauth1,
|
||||
user_integrations.garminconnect_oauth2,
|
||||
)
|
||||
|
||||
# Fetch Garmin Connect activities after the specified start date
|
||||
num_garminconnect_activities_processed = fetch_and_process_activities(
|
||||
garminconnect_client, start_date, user_id, db
|
||||
)
|
||||
|
||||
# Log an informational event for tracing
|
||||
mainLogger.info(
|
||||
f"User {user_id}: {num_garminconnect_activities_processed} Garmin Connect activities processed"
|
||||
)
|
||||
finally:
|
||||
# Ensure the session is closed after use
|
||||
db.close()
|
||||
86
backend/app/garmin/router.py
Normal file
86
backend/app/garmin/router.py
Normal file
@@ -0,0 +1,86 @@
|
||||
import logging
|
||||
from typing import Annotated, Callable
|
||||
from fastapi import APIRouter, Depends, Security, BackgroundTasks
|
||||
from sqlalchemy.orm import Session
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
||||
import session.security as session_security
|
||||
|
||||
import garmin.utils as garmin_utils
|
||||
import garmin.schema as garmin_schema
|
||||
import garmin.activity_utils as garmin_activity_utils
|
||||
|
||||
import database
|
||||
|
||||
# Define the API router
|
||||
router = APIRouter()
|
||||
|
||||
# Define a loggger created on main.py
|
||||
logger = logging.getLogger("myLogger")
|
||||
|
||||
|
||||
@router.put(
|
||||
"/link",
|
||||
)
|
||||
async def garminconnect_link(
|
||||
garmin_user: garmin_schema.GarminLogin,
|
||||
validate_access_token: Annotated[
|
||||
Callable,
|
||||
Depends(session_security.validate_access_token),
|
||||
],
|
||||
check_scopes: Annotated[
|
||||
Callable,
|
||||
Security(session_security.check_scopes, scopes=["profile"]),
|
||||
],
|
||||
token_user_id: Annotated[
|
||||
int,
|
||||
Depends(session_security.get_user_id_from_access_token),
|
||||
],
|
||||
db: Annotated[Session, Depends(database.get_db)],
|
||||
):
|
||||
# Link Garmin Connect account
|
||||
garmin_utils.link_garminconnect(
|
||||
token_user_id, garmin_user.username, garmin_user.password, db
|
||||
)
|
||||
|
||||
# Return success message
|
||||
return {f"Garmin Connect linked for user {token_user_id} successfully"}
|
||||
|
||||
|
||||
@router.get(
|
||||
"/activities/days/{days}",
|
||||
status_code=202,
|
||||
)
|
||||
async def garminconnect_retrieve_activities_days(
|
||||
days: int,
|
||||
validate_access_token: Annotated[
|
||||
Callable,
|
||||
Depends(session_security.validate_access_token),
|
||||
],
|
||||
check_scopes: Annotated[
|
||||
Callable,
|
||||
Security(session_security.check_scopes, scopes=["profile"]),
|
||||
],
|
||||
token_user_id: Annotated[
|
||||
int,
|
||||
Depends(session_security.get_user_id_from_access_token),
|
||||
],
|
||||
# db: Annotated[Session, Depends(database.get_db)],
|
||||
background_tasks: BackgroundTasks,
|
||||
):
|
||||
# Process Garmin Connect activities in the background
|
||||
background_tasks.add_task(
|
||||
garmin_activity_utils.get_user_garminconnect_activities_by_days,
|
||||
(datetime.now(timezone.utc) - timedelta(days=days)).strftime(
|
||||
"%Y-%m-%dT%H:%M:%S"
|
||||
),
|
||||
token_user_id,
|
||||
)
|
||||
|
||||
# Return success message and status code 202
|
||||
logger.info(
|
||||
f"Garmin Connect activities will be processed in the background for user {token_user_id}"
|
||||
)
|
||||
return {
|
||||
"detail": f"Garmin Connect activities will be processed in the background for for {token_user_id}"
|
||||
}
|
||||
5
backend/app/garmin/schema.py
Normal file
5
backend/app/garmin/schema.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
class GarminLogin(BaseModel):
|
||||
username: str
|
||||
password: str
|
||||
164
backend/app/garmin/utils.py
Normal file
164
backend/app/garmin/utils.py
Normal file
@@ -0,0 +1,164 @@
|
||||
import logging
|
||||
import requests
|
||||
|
||||
from fastapi import (
|
||||
HTTPException,
|
||||
status,
|
||||
)
|
||||
import garminconnect
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
import user_integrations.schema as user_integrations_schema
|
||||
import user_integrations.crud as user_integrations_crud
|
||||
|
||||
# Define a loggger created on main.py
|
||||
mainLogger = logging.getLogger("myLogger")
|
||||
|
||||
# Create loggger
|
||||
logger = logging.getLogger("migration_logger")
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
file_handler = logging.FileHandler("logs/garminconnect.log")
|
||||
file_handler.setLevel(logging.DEBUG)
|
||||
|
||||
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
file_handler.setFormatter(formatter)
|
||||
|
||||
logger.addHandler(file_handler)
|
||||
|
||||
|
||||
def link_garminconnect(user_id: int, email: str, password: str, db: Session):
|
||||
try:
|
||||
# Create a new Garmin object
|
||||
garmin = garminconnect.Garmin(email=email, password=password)
|
||||
|
||||
# Login to Garmin Connect portal
|
||||
garmin.login()
|
||||
|
||||
if not garmin.garth.oauth1_token:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="Incorrect Garmin Connect credentials",
|
||||
headers={"WWW-Authenticate": "Bearer"},
|
||||
)
|
||||
|
||||
user_integrations_crud.link_garminconnect_account(
|
||||
user_id,
|
||||
serialize_oauth1_token(garmin.garth.oauth1_token),
|
||||
serialize_oauth2_token(garmin.garth.oauth2_token),
|
||||
db,
|
||||
)
|
||||
except (
|
||||
garminconnect.GarminConnectAuthenticationError,
|
||||
requests.exceptions.HTTPError,
|
||||
) as err:
|
||||
# Print error info to check dedicated log in console
|
||||
print(
|
||||
"There was an authentication error using Garmin Connect. Please check Garmin Connect logs."
|
||||
)
|
||||
# Print error info to check dedicated log in main log
|
||||
mainLogger.error(
|
||||
"There was an authentication error using Garmin Connect. Please check Garmin Connect logs."
|
||||
)
|
||||
# Print error info to check dedicated log in garmin connect log
|
||||
logger.error(f"Error authenticating: {err}")
|
||||
return None
|
||||
|
||||
|
||||
def login_garminconnect_using_tokens(oauth1_token, oauth2_token):
|
||||
try:
|
||||
# Create a new Garmin object
|
||||
garmin = garminconnect.Garmin()
|
||||
|
||||
# Set the tokens directly into the Garmin object
|
||||
garmin.garth.oauth1_token = deserialize_oauth1_token(oauth1_token)
|
||||
garmin.garth.oauth2_token = deserialize_oauth2_token(oauth2_token)
|
||||
|
||||
return garmin
|
||||
except (
|
||||
garminconnect.GarminConnectAuthenticationError,
|
||||
requests.exceptions.HTTPError,
|
||||
) as err:
|
||||
# Print error info to check dedicated log in console
|
||||
print(
|
||||
"There was an authentication error using Garmin Connect. Please check Garmin Connect logs."
|
||||
)
|
||||
# Print error info to check dedicated log in main log
|
||||
mainLogger.error(
|
||||
"There was an authentication error using Garmin Connect. Please check Garmin Connect logs."
|
||||
)
|
||||
# Print error info to check dedicated log in garmin connect log
|
||||
logger.error(f"Error authenticating: {err}")
|
||||
return None
|
||||
|
||||
|
||||
def serialize_oauth1_token(token):
|
||||
return {
|
||||
"oauth_token": token.oauth_token,
|
||||
"oauth_token_secret": token.oauth_token_secret,
|
||||
"mfa_token": token.mfa_token,
|
||||
"mfa_expiration_timestamp": token.mfa_expiration_timestamp,
|
||||
"domain": token.domain,
|
||||
}
|
||||
|
||||
|
||||
def serialize_oauth2_token(token):
|
||||
return {
|
||||
"scope": token.scope,
|
||||
"jti": token.jti,
|
||||
"token_type": token.token_type,
|
||||
"access_token": token.access_token,
|
||||
"refresh_token": token.refresh_token,
|
||||
"expires_in": token.expires_in,
|
||||
"expires_at": token.expires_at,
|
||||
"refresh_token_expires_in": token.refresh_token_expires_in,
|
||||
"refresh_token_expires_at": token.refresh_token_expires_at,
|
||||
}
|
||||
|
||||
|
||||
def deserialize_oauth1_token(data):
|
||||
return garminconnect.garth.auth_tokens.OAuth1Token(
|
||||
oauth_token=data["oauth_token"],
|
||||
oauth_token_secret=data["oauth_token_secret"],
|
||||
mfa_token=data.get("mfa_token"),
|
||||
mfa_expiration_timestamp=data.get("mfa_expiration_timestamp"),
|
||||
domain=data.get("domain"),
|
||||
)
|
||||
|
||||
|
||||
def deserialize_oauth2_token(data):
|
||||
return garminconnect.garth.auth_tokens.OAuth2Token(
|
||||
scope=data["scope"],
|
||||
jti=data["jti"],
|
||||
token_type=data["token_type"],
|
||||
access_token=data["access_token"],
|
||||
refresh_token=data["refresh_token"],
|
||||
expires_in=data["expires_in"],
|
||||
expires_at=data["expires_at"],
|
||||
refresh_token_expires_in=data.get("refresh_token_expires_in"),
|
||||
refresh_token_expires_at=data.get("refresh_token_expires_at"),
|
||||
)
|
||||
|
||||
|
||||
def fetch_user_integrations_and_validate_token(
|
||||
user_id: int, db: Session
|
||||
) -> user_integrations_schema.UserIntegrations | None:
|
||||
# Get the user integrations by user ID
|
||||
user_integrations = user_integrations_crud.get_user_integrations_by_user_id(
|
||||
user_id, db
|
||||
)
|
||||
|
||||
# Check if user integrations is None
|
||||
if user_integrations is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail="User information not found",
|
||||
)
|
||||
|
||||
# Check if user_integrations.garminconnect_oauth1 is None
|
||||
if user_integrations.garminconnect_oauth1 is None:
|
||||
return None
|
||||
|
||||
# Return the user integrations
|
||||
return user_integrations
|
||||
@@ -17,11 +17,7 @@ logger = logging.getLogger("myLogger")
|
||||
|
||||
def get_gear_user_by_id(gear_id: int, db: Session) -> gears_schema.Gear | None:
|
||||
try:
|
||||
gear = (
|
||||
db.query(models.Gear)
|
||||
.filter(models.Gear.id == gear_id)
|
||||
.first()
|
||||
)
|
||||
gear = db.query(models.Gear).filter(models.Gear.id == gear_id).first()
|
||||
|
||||
# Check if gear is None and return None if it is
|
||||
if gear is None:
|
||||
@@ -100,7 +96,9 @@ def get_gear_user(user_id: int, db: Session) -> list[gears_schema.Gear] | None:
|
||||
) from err
|
||||
|
||||
|
||||
def get_gear_user_by_nickname(user_id: int, nickname: str, db: Session) -> list[gears_schema.Gear] | None:
|
||||
def get_gear_user_by_nickname(
|
||||
user_id: int, nickname: str, db: Session
|
||||
) -> list[gears_schema.Gear] | None:
|
||||
try:
|
||||
# Unquote the nickname and change "+" to whitespace
|
||||
parsed_nickname = unquote(nickname).replace("+", " ")
|
||||
@@ -206,7 +204,8 @@ def create_multiple_gears(gears: list[gears_schema.Gear], user_id: int, db: Sess
|
||||
|
||||
# Create a list of gear objects
|
||||
new_gears = [
|
||||
gears_utils.transform_schema_gear_to_model_gear(gear, user_id) for gear in valid_gears
|
||||
gears_utils.transform_schema_gear_to_model_gear(gear, user_id)
|
||||
for gear in valid_gears
|
||||
]
|
||||
|
||||
# Add the gears to the database
|
||||
@@ -289,7 +288,6 @@ def edit_gear(gear_id: int, gear: gears_schema.Gear, db: Session):
|
||||
if gear.created_at is not None:
|
||||
db_gear.created_at = gear.created_at
|
||||
if gear.is_active is not None:
|
||||
print(f"Gear is active value: {gear.is_active}")
|
||||
db_gear.is_active = gear.is_active
|
||||
if gear.strava_gear_id is not None:
|
||||
db_gear.strava_gear_id = gear.strava_gear_id
|
||||
@@ -343,7 +341,9 @@ def delete_all_strava_gear_for_user(user_id: int, db: Session):
|
||||
# Delete the gear records with strava_gear_id not null for the user
|
||||
num_deleted = (
|
||||
db.query(models.Gear)
|
||||
.filter(models.Gear.user_id == user_id, models.Gear.strava_gear_id is not None)
|
||||
.filter(
|
||||
models.Gear.user_id == user_id, models.Gear.strava_gear_id.isnot(None)
|
||||
)
|
||||
.delete()
|
||||
)
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ async def edit_gear(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail=f"Gear ID {gear_id} not found",
|
||||
)
|
||||
|
||||
|
||||
if gear_db.user_id != token_user_id:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
@@ -193,8 +193,8 @@ async def edit_gear(
|
||||
return {"detail": f"Gear ID {gear_id} edited successfully"}
|
||||
|
||||
|
||||
@router.delete("/{gear_id}/delete", tags=["gear"])
|
||||
async def delete_user(
|
||||
@router.delete("/{gear_id}/delete")
|
||||
async def delete_gear(
|
||||
gear_id: int,
|
||||
validate_id: Annotated[Callable, Depends(gears_dependencies.validate_gear_id)],
|
||||
check_scopes: Annotated[
|
||||
@@ -228,4 +228,4 @@ async def delete_user(
|
||||
gears_crud.delete_gear(gear_id, db)
|
||||
|
||||
# Return success message
|
||||
return {"detail": f"Gear ID {gear_id} deleted successfully"}
|
||||
return {"detail": f"Gear ID {gear_id} deleted successfully"}
|
||||
|
||||
@@ -170,7 +170,7 @@ async def edit_health_weight_data(
|
||||
return health_data_crud.edit_health_weight_data(health_data, db)
|
||||
|
||||
|
||||
@router.post("/weight/{health_data_id}")
|
||||
@router.delete("/weight/{health_data_id}")
|
||||
async def delete_health_weight_data(
|
||||
health_data_id: int,
|
||||
check_scopes: Annotated[
|
||||
|
||||
@@ -20,6 +20,8 @@ from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
|
||||
import strava.utils as strava_utils
|
||||
import strava.activity_utils as strava_activity_utils
|
||||
|
||||
import garmin.activity_utils as garmin_activity_utils
|
||||
|
||||
import migrations.utils as migrations_utils
|
||||
|
||||
from config import API_VERSION
|
||||
@@ -53,6 +55,14 @@ def startup_event():
|
||||
retrieve_strava_user_activities_for_last_day, "interval", minutes=60
|
||||
)
|
||||
|
||||
# Add scheduler jobs to retrieve last day activities from Garmin Connect
|
||||
logger.info(
|
||||
"Added scheduler job to retrieve last day Garmin Connect users activities every 60 minutes"
|
||||
)
|
||||
scheduler.add_job(
|
||||
retrieve_garminconnect_user_activities_for_last_day, "interval", minutes=60
|
||||
)
|
||||
|
||||
|
||||
def shutdown_event():
|
||||
print("Backend shutdown event")
|
||||
@@ -91,6 +101,11 @@ def retrieve_strava_user_activities_for_last_day():
|
||||
strava_activity_utils.retrieve_strava_users_activities_for_days(1)
|
||||
|
||||
|
||||
def retrieve_garminconnect_user_activities_for_last_day():
|
||||
# Get last day users Garmin Connect activities
|
||||
garmin_activity_utils.retrieve_garminconnect_users_activities_for_days(1)
|
||||
|
||||
|
||||
# Create loggger
|
||||
logger = logging.getLogger("myLogger")
|
||||
logger.setLevel(logging.DEBUG)
|
||||
@@ -121,7 +136,6 @@ required_env_vars = [
|
||||
"JAEGER_PROTOCOL",
|
||||
"JAEGER_HOST",
|
||||
"JAGGER_PORT",
|
||||
"STRAVA_DAYS_ACTIVITIES_ONLINK",
|
||||
"FRONTEND_PROTOCOL",
|
||||
"FRONTEND_HOST",
|
||||
"GEOCODES_MAPS_API",
|
||||
@@ -141,6 +155,7 @@ app = FastAPI(
|
||||
redoc_url="/redoc",
|
||||
title="Endurain",
|
||||
summary="Endurain API for the Endurain app",
|
||||
root_path="/api/v1",
|
||||
version=API_VERSION,
|
||||
license_info={
|
||||
"name": "GNU General Public License v3.0",
|
||||
@@ -198,3 +213,19 @@ app.add_event_handler("startup", startup_event)
|
||||
|
||||
# Register the shutdown event handler
|
||||
app.add_event_handler("shutdown", shutdown_event)
|
||||
|
||||
@app.get(
|
||||
"/about",
|
||||
)
|
||||
async def about(
|
||||
):
|
||||
# Return the gear
|
||||
return {
|
||||
"name": "Endurain API",
|
||||
"version": API_VERSION,
|
||||
"license": {
|
||||
"name": "GNU General Public License v3.0",
|
||||
"identifier": "GPL-3.0-or-later",
|
||||
"url": "https://spdx.org/licenses/GPL-3.0-or-later.html",
|
||||
},
|
||||
}
|
||||
@@ -60,8 +60,8 @@ def process_migration_1(db: Session):
|
||||
|
||||
try:
|
||||
activities = activities_crud.get_all_activities(db)
|
||||
except Exception as e:
|
||||
logger.error(f"Error fetching activities: {e}")
|
||||
except Exception as err:
|
||||
logger.error(f"Error fetching activities: {err}")
|
||||
return
|
||||
|
||||
if activities:
|
||||
|
||||
@@ -19,7 +19,9 @@ class Migration(Base):
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
name = Column(String(length=250), nullable=False, comment="Migration name")
|
||||
description = Column(String(length=2500), nullable=False, comment="Migration description")
|
||||
description = Column(
|
||||
String(length=2500), nullable=False, comment="Migration description"
|
||||
)
|
||||
executed = Column(
|
||||
Boolean,
|
||||
nullable=False,
|
||||
@@ -180,6 +182,12 @@ class UserIntegrations(Base):
|
||||
default=False,
|
||||
comment="Whether Strava gear is to be synced",
|
||||
)
|
||||
garminconnect_oauth1 = Column(
|
||||
JSON, default=None, nullable=True, doc="Garmin OAuth1 token"
|
||||
)
|
||||
garminconnect_oauth2 = Column(
|
||||
JSON, default=None, nullable=True, doc="Garmin OAuth2 token"
|
||||
)
|
||||
|
||||
# Define a relationship to the User model
|
||||
user = relationship("User", back_populates="users_integrations")
|
||||
@@ -332,6 +340,9 @@ class Activity(Base):
|
||||
strava_activity_id = Column(
|
||||
BigInteger, unique=True, nullable=True, comment="Strava activity ID"
|
||||
)
|
||||
garminconnect_activity_id = Column(
|
||||
BigInteger, unique=True, nullable=True, comment="Garmin Connect activity ID"
|
||||
)
|
||||
|
||||
# Define a relationship to the User model
|
||||
user = relationship("User", back_populates="activities")
|
||||
@@ -418,4 +429,4 @@ class HealthTargets(Base):
|
||||
)
|
||||
|
||||
# Define a relationship to the User model
|
||||
user = relationship("User", back_populates="health_targets")
|
||||
user = relationship("User", back_populates="health_targets")
|
||||
|
||||
@@ -56,6 +56,7 @@ async def read_users_me(
|
||||
)
|
||||
|
||||
user.is_strava_linked = 1 if user_integrations.strava_token else 0
|
||||
user.is_garminconnect_linked = 1 if user_integrations.garminconnect_oauth1 else 0
|
||||
|
||||
# Return the user
|
||||
return user
|
||||
|
||||
@@ -8,6 +8,7 @@ import activity_streams.router as activity_streams_router
|
||||
import gears.router as gears_router
|
||||
import followers.router as followers_router
|
||||
import strava.router as strava_router
|
||||
import garmin.router as garmin_router
|
||||
import health_data.router as health_data_router
|
||||
import health_targets.router as health_targets_router
|
||||
|
||||
@@ -64,6 +65,11 @@ router.include_router(
|
||||
prefix="/strava",
|
||||
tags=["strava"],
|
||||
)
|
||||
router.include_router(
|
||||
garmin_router.router,
|
||||
prefix="/garminconnect",
|
||||
tags=["garminconnect"],
|
||||
)
|
||||
router.include_router(
|
||||
health_data_router.router,
|
||||
prefix="/health",
|
||||
|
||||
@@ -130,6 +130,14 @@ def unlink_strava_account(user_id: int, db: Session):
|
||||
# Get the user integrations by the user id
|
||||
user_integrations = get_user_integrations_by_user_id(user_id, db)
|
||||
|
||||
# Check if user_integrations is None and return None if it is
|
||||
if user_integrations is None:
|
||||
# If the user was not found, return a 404 Not Found error
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail="User integrations not found",
|
||||
)
|
||||
|
||||
# Set the user integrations Strava tokens to None
|
||||
user_integrations.strava_token = None
|
||||
user_integrations.strava_refresh_token = None
|
||||
@@ -157,6 +165,14 @@ def set_user_strava_state(user_id: int, state: str, db: Session):
|
||||
# Get the user integrations by the user id
|
||||
user_integrations = get_user_integrations_by_user_id(user_id, db)
|
||||
|
||||
# Check if user_integrations is None and return None if it is
|
||||
if user_integrations is None:
|
||||
# If the user was not found, return a 404 Not Found error
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail="User integrations not found",
|
||||
)
|
||||
|
||||
# Set the user Strava state
|
||||
user_integrations.strava_state = state
|
||||
|
||||
@@ -193,6 +209,77 @@ def set_user_strava_sync_gear(user_id: int, strava_sync_gear: bool, db: Session)
|
||||
# Log the exception
|
||||
logger.error(f"Error in set_user_strava_state: {err}", exc_info=True)
|
||||
|
||||
# Raise an HTTPException with a 500 Internal Server Error status code
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
detail="Internal Server Error",
|
||||
) from err
|
||||
|
||||
|
||||
def link_garminconnect_account(
|
||||
user_id: int,
|
||||
oauth1_token: dict,
|
||||
oauth2_token: dict,
|
||||
db: Session,
|
||||
):
|
||||
try:
|
||||
# Get the user integrations by the user id
|
||||
user_integrations = get_user_integrations_by_user_id(user_id, db)
|
||||
|
||||
# Check if user_integrations is None and return None if it is
|
||||
if user_integrations is None:
|
||||
# If the user was not found, return a 404 Not Found error
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail="User integrations not found",
|
||||
)
|
||||
|
||||
# Update the user integrations with the tokens
|
||||
user_integrations.garminconnect_oauth1 = oauth1_token
|
||||
user_integrations.garminconnect_oauth2 = oauth2_token
|
||||
|
||||
# Commit the changes to the database
|
||||
db.commit()
|
||||
except Exception as err:
|
||||
# Rollback the transaction
|
||||
db.rollback()
|
||||
|
||||
# Log the exception
|
||||
logger.error(f"Error in link_garminconnect_account: {err}", exc_info=True)
|
||||
|
||||
# Raise an HTTPException with a 500 Internal Server Error status code
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
detail="Internal Server Error",
|
||||
) from err
|
||||
|
||||
|
||||
def unlink_garminconnect_account(user_id: int, db: Session):
|
||||
try:
|
||||
# Get the user integrations by the user id
|
||||
user_integrations = get_user_integrations_by_user_id(user_id, db)
|
||||
|
||||
# Check if user_integrations is None and return None if it is
|
||||
if user_integrations is None:
|
||||
# If the user was not found, return a 404 Not Found error
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail="User integrations not found",
|
||||
)
|
||||
|
||||
# Set the user integrations Garmin Connect tokens to None
|
||||
user_integrations.garminconnect_oauth1 = None
|
||||
user_integrations.garminconnect_oauth2 = None
|
||||
|
||||
# Commit the changes to the database
|
||||
db.commit()
|
||||
except Exception as err:
|
||||
# Rollback the transaction
|
||||
db.rollback()
|
||||
|
||||
# Log the exception
|
||||
logger.error(f"Error in unlink_garminconnect_account: {err}", exc_info=True)
|
||||
|
||||
# Raise an HTTPException with a 500 Internal Server Error status code
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
|
||||
@@ -9,6 +9,8 @@ class UserIntegrations(BaseModel):
|
||||
strava_refresh_token: str | None = None
|
||||
strava_token_expires_at: str | None = None
|
||||
strava_sync_gear: bool
|
||||
garminconnect_oauth1: dict | None = None
|
||||
garminconnect_oauth2: dict | None = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
@@ -281,9 +281,7 @@ def edit_user(user_id: int, user: users_schema.User, db: Session):
|
||||
detail="User not found",
|
||||
headers={"WWW-Authenticate": "Bearer"},
|
||||
)
|
||||
|
||||
# Update the user
|
||||
|
||||
|
||||
# Dictionary of the fields to update if they are not None
|
||||
user_data = user.dict(exclude_unset=True)
|
||||
# Iterate over the fields and update the db_user dynamically
|
||||
|
||||
@@ -25,6 +25,7 @@ class UserCreate(User):
|
||||
|
||||
class UserMe(User):
|
||||
is_strava_linked: int | None = None
|
||||
is_garminconnect_linked: int | None = None
|
||||
|
||||
class UserEditPassword(BaseModel):
|
||||
password: str
|
||||
237
backend/poetry.lock
generated
237
backend/poetry.lock
generated
@@ -525,6 +525,37 @@ typing-extensions = "*"
|
||||
[package.extras]
|
||||
test = ["pytest", "pytest-cov", "pytest-mpl", "pytest-subtests"]
|
||||
|
||||
[[package]]
|
||||
name = "garminconnect"
|
||||
version = "0.2.19"
|
||||
description = "Python 3 API wrapper for Garmin Connect"
|
||||
optional = false
|
||||
python-versions = ">=3.10"
|
||||
files = [
|
||||
{file = "garminconnect-0.2.19-py3-none-any.whl", hash = "sha256:d1b6fc17147c8d7f4229a986908ae7a7f0e9484851e1f2edd33fdc2fdf616b57"},
|
||||
{file = "garminconnect-0.2.19.tar.gz", hash = "sha256:2451818cd49646a604cadb0ace0e3895f7659bf85ac118e357d2465f4e4b5dfa"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
garth = ">=0.4.46"
|
||||
withings-sync = ">=4.2.4"
|
||||
|
||||
[[package]]
|
||||
name = "garth"
|
||||
version = "0.4.46"
|
||||
description = "Garmin SSO auth + Connect client"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "garth-0.4.46-py3-none-any.whl", hash = "sha256:c209192bac793f42764f0f06131dc503f74783d41af326f29187a1f6394dc5ff"},
|
||||
{file = "garth-0.4.46.tar.gz", hash = "sha256:5ae19e67612083285b10321b8e0e1f7c815a8f60f21e2f13be8c21a22e64d8eb"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
pydantic = ">=1.10.12,<3.0.0"
|
||||
requests = ">=2.0.0,<3.0.0"
|
||||
requests-oauthlib = ">=1.3.1,<2.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "geographiclib"
|
||||
version = "2.0"
|
||||
@@ -805,6 +836,160 @@ cryptography = "*"
|
||||
[package.extras]
|
||||
drafts = ["pycryptodome"]
|
||||
|
||||
[[package]]
|
||||
name = "lxml"
|
||||
version = "5.3.0"
|
||||
description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API."
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
files = [
|
||||
{file = "lxml-5.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:dd36439be765e2dde7660212b5275641edbc813e7b24668831a5c8ac91180656"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ae5fe5c4b525aa82b8076c1a59d642c17b6e8739ecf852522c6321852178119d"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:501d0d7e26b4d261fca8132854d845e4988097611ba2531408ec91cf3fd9d20a"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb66442c2546446944437df74379e9cf9e9db353e61301d1a0e26482f43f0dd8"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9e41506fec7a7f9405b14aa2d5c8abbb4dbbd09d88f9496958b6d00cb4d45330"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f7d4a670107d75dfe5ad080bed6c341d18c4442f9378c9f58e5851e86eb79965"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:41ce1f1e2c7755abfc7e759dc34d7d05fd221723ff822947132dc934d122fe22"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:44264ecae91b30e5633013fb66f6ddd05c006d3e0e884f75ce0b4755b3e3847b"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-manylinux_2_28_ppc64le.whl", hash = "sha256:3c174dc350d3ec52deb77f2faf05c439331d6ed5e702fc247ccb4e6b62d884b7"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-manylinux_2_28_s390x.whl", hash = "sha256:2dfab5fa6a28a0b60a20638dc48e6343c02ea9933e3279ccb132f555a62323d8"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:b1c8c20847b9f34e98080da785bb2336ea982e7f913eed5809e5a3c872900f32"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:2c86bf781b12ba417f64f3422cfc302523ac9cd1d8ae8c0f92a1c66e56ef2e86"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:c162b216070f280fa7da844531169be0baf9ccb17263cf5a8bf876fcd3117fa5"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:36aef61a1678cb778097b4a6eeae96a69875d51d1e8f4d4b491ab3cfb54b5a03"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f65e5120863c2b266dbcc927b306c5b78e502c71edf3295dfcb9501ec96e5fc7"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-win32.whl", hash = "sha256:ef0c1fe22171dd7c7c27147f2e9c3e86f8bdf473fed75f16b0c2e84a5030ce80"},
|
||||
{file = "lxml-5.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:052d99051e77a4f3e8482c65014cf6372e61b0a6f4fe9edb98503bb5364cfee3"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:74bcb423462233bc5d6066e4e98b0264e7c1bed7541fff2f4e34fe6b21563c8b"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a3d819eb6f9b8677f57f9664265d0a10dd6551d227afb4af2b9cd7bdc2ccbf18"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5b8f5db71b28b8c404956ddf79575ea77aa8b1538e8b2ef9ec877945b3f46442"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2c3406b63232fc7e9b8783ab0b765d7c59e7c59ff96759d8ef9632fca27c7ee4"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2ecdd78ab768f844c7a1d4a03595038c166b609f6395e25af9b0f3f26ae1230f"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:168f2dfcfdedf611eb285efac1516c8454c8c99caf271dccda8943576b67552e"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa617107a410245b8660028a7483b68e7914304a6d4882b5ff3d2d3eb5948d8c"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:69959bd3167b993e6e710b99051265654133a98f20cec1d9b493b931942e9c16"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-manylinux_2_28_ppc64le.whl", hash = "sha256:bd96517ef76c8654446fc3db9242d019a1bb5fe8b751ba414765d59f99210b79"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-manylinux_2_28_s390x.whl", hash = "sha256:ab6dd83b970dc97c2d10bc71aa925b84788c7c05de30241b9e96f9b6d9ea3080"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:eec1bb8cdbba2925bedc887bc0609a80e599c75b12d87ae42ac23fd199445654"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6a7095eeec6f89111d03dabfe5883a1fd54da319c94e0fb104ee8f23616b572d"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:6f651ebd0b21ec65dfca93aa629610a0dbc13dbc13554f19b0113da2e61a4763"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:f422a209d2455c56849442ae42f25dbaaba1c6c3f501d58761c619c7836642ec"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:62f7fdb0d1ed2065451f086519865b4c90aa19aed51081979ecd05a21eb4d1be"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-win32.whl", hash = "sha256:c6379f35350b655fd817cd0d6cbeef7f265f3ae5fedb1caae2eb442bbeae9ab9"},
|
||||
{file = "lxml-5.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:9c52100e2c2dbb0649b90467935c4b0de5528833c76a35ea1a2691ec9f1ee7a1"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:e99f5507401436fdcc85036a2e7dc2e28d962550afe1cbfc07c40e454256a859"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:384aacddf2e5813a36495233b64cb96b1949da72bef933918ba5c84e06af8f0e"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:874a216bf6afaf97c263b56371434e47e2c652d215788396f60477540298218f"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:65ab5685d56914b9a2a34d67dd5488b83213d680b0c5d10b47f81da5a16b0b0e"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aac0bbd3e8dd2d9c45ceb82249e8bdd3ac99131a32b4d35c8af3cc9db1657179"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b369d3db3c22ed14c75ccd5af429086f166a19627e84a8fdade3f8f31426e52a"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c24037349665434f375645fa9d1f5304800cec574d0310f618490c871fd902b3"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:62d172f358f33a26d6b41b28c170c63886742f5b6772a42b59b4f0fa10526cb1"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-manylinux_2_28_ppc64le.whl", hash = "sha256:c1f794c02903c2824fccce5b20c339a1a14b114e83b306ff11b597c5f71a1c8d"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-manylinux_2_28_s390x.whl", hash = "sha256:5d6a6972b93c426ace71e0be9a6f4b2cfae9b1baed2eed2006076a746692288c"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:3879cc6ce938ff4eb4900d901ed63555c778731a96365e53fadb36437a131a99"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:74068c601baff6ff021c70f0935b0c7bc528baa8ea210c202e03757c68c5a4ff"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ecd4ad8453ac17bc7ba3868371bffb46f628161ad0eefbd0a855d2c8c32dd81a"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:7e2f58095acc211eb9d8b5771bf04df9ff37d6b87618d1cbf85f92399c98dae8"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e63601ad5cd8f860aa99d109889b5ac34de571c7ee902d6812d5d9ddcc77fa7d"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-win32.whl", hash = "sha256:17e8d968d04a37c50ad9c456a286b525d78c4a1c15dd53aa46c1d8e06bf6fa30"},
|
||||
{file = "lxml-5.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:c1a69e58a6bb2de65902051d57fde951febad631a20a64572677a1052690482f"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8c72e9563347c7395910de6a3100a4840a75a6f60e05af5e58566868d5eb2d6a"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e92ce66cd919d18d14b3856906a61d3f6b6a8500e0794142338da644260595cd"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d04f064bebdfef9240478f7a779e8c5dc32b8b7b0b2fc6a62e39b928d428e51"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c2fb570d7823c2bbaf8b419ba6e5662137f8166e364a8b2b91051a1fb40ab8b"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0c120f43553ec759f8de1fee2f4794452b0946773299d44c36bfe18e83caf002"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:562e7494778a69086f0312ec9689f6b6ac1c6b65670ed7d0267e49f57ffa08c4"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:423b121f7e6fa514ba0c7918e56955a1d4470ed35faa03e3d9f0e3baa4c7e492"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:c00f323cc00576df6165cc9d21a4c21285fa6b9989c5c39830c3903dc4303ef3"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-manylinux_2_28_ppc64le.whl", hash = "sha256:1fdc9fae8dd4c763e8a31e7630afef517eab9f5d5d31a278df087f307bf601f4"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-manylinux_2_28_s390x.whl", hash = "sha256:658f2aa69d31e09699705949b5fc4719cbecbd4a97f9656a232e7d6c7be1a367"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:1473427aff3d66a3fa2199004c3e601e6c4500ab86696edffdbc84954c72d832"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a87de7dd873bf9a792bf1e58b1c3887b9264036629a5bf2d2e6579fe8e73edff"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:0d7b36afa46c97875303a94e8f3ad932bf78bace9e18e603f2085b652422edcd"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:cf120cce539453ae086eacc0130a324e7026113510efa83ab42ef3fcfccac7fb"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:df5c7333167b9674aa8ae1d4008fa4bc17a313cc490b2cca27838bbdcc6bb15b"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-win32.whl", hash = "sha256:c802e1c2ed9f0c06a65bc4ed0189d000ada8049312cfeab6ca635e39c9608957"},
|
||||
{file = "lxml-5.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:406246b96d552e0503e17a1006fd27edac678b3fcc9f1be71a2f94b4ff61528d"},
|
||||
{file = "lxml-5.3.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:8f0de2d390af441fe8b2c12626d103540b5d850d585b18fcada58d972b74a74e"},
|
||||
{file = "lxml-5.3.0-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1afe0a8c353746e610bd9031a630a95bcfb1a720684c3f2b36c4710a0a96528f"},
|
||||
{file = "lxml-5.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56b9861a71575f5795bde89256e7467ece3d339c9b43141dbdd54544566b3b94"},
|
||||
{file = "lxml-5.3.0-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:9fb81d2824dff4f2e297a276297e9031f46d2682cafc484f49de182aa5e5df99"},
|
||||
{file = "lxml-5.3.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:2c226a06ecb8cdef28845ae976da407917542c5e6e75dcac7cc33eb04aaeb237"},
|
||||
{file = "lxml-5.3.0-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:7d3d1ca42870cdb6d0d29939630dbe48fa511c203724820fc0fd507b2fb46577"},
|
||||
{file = "lxml-5.3.0-cp36-cp36m-win32.whl", hash = "sha256:094cb601ba9f55296774c2d57ad68730daa0b13dc260e1f941b4d13678239e70"},
|
||||
{file = "lxml-5.3.0-cp36-cp36m-win_amd64.whl", hash = "sha256:eafa2c8658f4e560b098fe9fc54539f86528651f61849b22111a9b107d18910c"},
|
||||
{file = "lxml-5.3.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cb83f8a875b3d9b458cada4f880fa498646874ba4011dc974e071a0a84a1b033"},
|
||||
{file = "lxml-5.3.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:25f1b69d41656b05885aa185f5fdf822cb01a586d1b32739633679699f220391"},
|
||||
{file = "lxml-5.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23e0553b8055600b3bf4a00b255ec5c92e1e4aebf8c2c09334f8368e8bd174d6"},
|
||||
{file = "lxml-5.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ada35dd21dc6c039259596b358caab6b13f4db4d4a7f8665764d616daf9cc1d"},
|
||||
{file = "lxml-5.3.0-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:81b4e48da4c69313192d8c8d4311e5d818b8be1afe68ee20f6385d0e96fc9512"},
|
||||
{file = "lxml-5.3.0-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:2bc9fd5ca4729af796f9f59cd8ff160fe06a474da40aca03fcc79655ddee1a8b"},
|
||||
{file = "lxml-5.3.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:07da23d7ee08577760f0a71d67a861019103e4812c87e2fab26b039054594cc5"},
|
||||
{file = "lxml-5.3.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:ea2e2f6f801696ad7de8aec061044d6c8c0dd4037608c7cab38a9a4d316bfb11"},
|
||||
{file = "lxml-5.3.0-cp37-cp37m-win32.whl", hash = "sha256:5c54afdcbb0182d06836cc3d1be921e540be3ebdf8b8a51ee3ef987537455f84"},
|
||||
{file = "lxml-5.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:f2901429da1e645ce548bf9171784c0f74f0718c3f6150ce166be39e4dd66c3e"},
|
||||
{file = "lxml-5.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c56a1d43b2f9ee4786e4658c7903f05da35b923fb53c11025712562d5cc02753"},
|
||||
{file = "lxml-5.3.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ee8c39582d2652dcd516d1b879451500f8db3fe3607ce45d7c5957ab2596040"},
|
||||
{file = "lxml-5.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fdf3a3059611f7585a78ee10399a15566356116a4288380921a4b598d807a22"},
|
||||
{file = "lxml-5.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:146173654d79eb1fc97498b4280c1d3e1e5d58c398fa530905c9ea50ea849b22"},
|
||||
{file = "lxml-5.3.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:0a7056921edbdd7560746f4221dca89bb7a3fe457d3d74267995253f46343f15"},
|
||||
{file = "lxml-5.3.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:9e4b47ac0f5e749cfc618efdf4726269441014ae1d5583e047b452a32e221920"},
|
||||
{file = "lxml-5.3.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:f914c03e6a31deb632e2daa881fe198461f4d06e57ac3d0e05bbcab8eae01945"},
|
||||
{file = "lxml-5.3.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:213261f168c5e1d9b7535a67e68b1f59f92398dd17a56d934550837143f79c42"},
|
||||
{file = "lxml-5.3.0-cp38-cp38-win32.whl", hash = "sha256:218c1b2e17a710e363855594230f44060e2025b05c80d1f0661258142b2add2e"},
|
||||
{file = "lxml-5.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:315f9542011b2c4e1d280e4a20ddcca1761993dda3afc7a73b01235f8641e903"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1ffc23010330c2ab67fac02781df60998ca8fe759e8efde6f8b756a20599c5de"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2b3778cb38212f52fac9fe913017deea2fdf4eb1a4f8e4cfc6b009a13a6d3fcc"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4b0c7a688944891086ba192e21c5229dea54382f4836a209ff8d0a660fac06be"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:747a3d3e98e24597981ca0be0fd922aebd471fa99d0043a3842d00cdcad7ad6a"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86a6b24b19eaebc448dc56b87c4865527855145d851f9fc3891673ff97950540"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b11a5d918a6216e521c715b02749240fb07ae5a1fefd4b7bf12f833bc8b4fe70"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:68b87753c784d6acb8a25b05cb526c3406913c9d988d51f80adecc2b0775d6aa"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:109fa6fede314cc50eed29e6e56c540075e63d922455346f11e4d7a036d2b8cf"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-manylinux_2_28_ppc64le.whl", hash = "sha256:02ced472497b8362c8e902ade23e3300479f4f43e45f4105c85ef43b8db85229"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-manylinux_2_28_s390x.whl", hash = "sha256:6b038cc86b285e4f9fea2ba5ee76e89f21ed1ea898e287dc277a25884f3a7dfe"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:7437237c6a66b7ca341e868cda48be24b8701862757426852c9b3186de1da8a2"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7f41026c1d64043a36fda21d64c5026762d53a77043e73e94b71f0521939cc71"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:482c2f67761868f0108b1743098640fbb2a28a8e15bf3f47ada9fa59d9fe08c3"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:1483fd3358963cc5c1c9b122c80606a3a79ee0875bcac0204149fa09d6ff2727"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:2dec2d1130a9cda5b904696cec33b2cfb451304ba9081eeda7f90f724097300a"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-win32.whl", hash = "sha256:a0eabd0a81625049c5df745209dc7fcef6e2aea7793e5f003ba363610aa0a3ff"},
|
||||
{file = "lxml-5.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:89e043f1d9d341c52bf2af6d02e6adde62e0a46e6755d5eb60dc6e4f0b8aeca2"},
|
||||
{file = "lxml-5.3.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7b1cd427cb0d5f7393c31b7496419da594fe600e6fdc4b105a54f82405e6626c"},
|
||||
{file = "lxml-5.3.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:51806cfe0279e06ed8500ce19479d757db42a30fd509940b1701be9c86a5ff9a"},
|
||||
{file = "lxml-5.3.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ee70d08fd60c9565ba8190f41a46a54096afa0eeb8f76bd66f2c25d3b1b83005"},
|
||||
{file = "lxml-5.3.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:8dc2c0395bea8254d8daebc76dcf8eb3a95ec2a46fa6fae5eaccee366bfe02ce"},
|
||||
{file = "lxml-5.3.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:6ba0d3dcac281aad8a0e5b14c7ed6f9fa89c8612b47939fc94f80b16e2e9bc83"},
|
||||
{file = "lxml-5.3.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:6e91cf736959057f7aac7adfc83481e03615a8e8dd5758aa1d95ea69e8931dba"},
|
||||
{file = "lxml-5.3.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:94d6c3782907b5e40e21cadf94b13b0842ac421192f26b84c45f13f3c9d5dc27"},
|
||||
{file = "lxml-5.3.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c300306673aa0f3ed5ed9372b21867690a17dba38c68c44b287437c362ce486b"},
|
||||
{file = "lxml-5.3.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78d9b952e07aed35fe2e1a7ad26e929595412db48535921c5013edc8aa4a35ce"},
|
||||
{file = "lxml-5.3.0-pp37-pypy37_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:01220dca0d066d1349bd6a1726856a78f7929f3878f7e2ee83c296c69495309e"},
|
||||
{file = "lxml-5.3.0-pp37-pypy37_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:2d9b8d9177afaef80c53c0a9e30fa252ff3036fb1c6494d427c066a4ce6a282f"},
|
||||
{file = "lxml-5.3.0-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:20094fc3f21ea0a8669dc4c61ed7fa8263bd37d97d93b90f28fc613371e7a875"},
|
||||
{file = "lxml-5.3.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ace2c2326a319a0bb8a8b0e5b570c764962e95818de9f259ce814ee666603f19"},
|
||||
{file = "lxml-5.3.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:92e67a0be1639c251d21e35fe74df6bcc40cba445c2cda7c4a967656733249e2"},
|
||||
{file = "lxml-5.3.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd5350b55f9fecddc51385463a4f67a5da829bc741e38cf689f38ec9023f54ab"},
|
||||
{file = "lxml-5.3.0-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:4c1fefd7e3d00921c44dc9ca80a775af49698bbfd92ea84498e56acffd4c5469"},
|
||||
{file = "lxml-5.3.0-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:71a8dd38fbd2f2319136d4ae855a7078c69c9a38ae06e0c17c73fd70fc6caad8"},
|
||||
{file = "lxml-5.3.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:97acf1e1fd66ab53dacd2c35b319d7e548380c2e9e8c54525c6e76d21b1ae3b1"},
|
||||
{file = "lxml-5.3.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:68934b242c51eb02907c5b81d138cb977b2129a0a75a8f8b60b01cb8586c7b21"},
|
||||
{file = "lxml-5.3.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b710bc2b8292966b23a6a0121f7a6c51d45d2347edcc75f016ac123b8054d3f2"},
|
||||
{file = "lxml-5.3.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:18feb4b93302091b1541221196a2155aa296c363fd233814fa11e181adebc52f"},
|
||||
{file = "lxml-5.3.0-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:3eb44520c4724c2e1a57c0af33a379eee41792595023f367ba3952a2d96c2aab"},
|
||||
{file = "lxml-5.3.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:609251a0ca4770e5a8768ff902aa02bf636339c5a93f9349b48eb1f606f7f3e9"},
|
||||
{file = "lxml-5.3.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:516f491c834eb320d6c843156440fe7fc0d50b33e44387fcec5b02f0bc118a4c"},
|
||||
{file = "lxml-5.3.0.tar.gz", hash = "sha256:4e109ca30d1edec1ac60cdbe341905dc3b8f55b16855e03a54aaf59e51ec8c6f"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
cssselect = ["cssselect (>=0.7)"]
|
||||
html-clean = ["lxml-html-clean"]
|
||||
html5 = ["html5lib"]
|
||||
htmlsoup = ["BeautifulSoup4"]
|
||||
source = ["Cython (>=3.0.11)"]
|
||||
|
||||
[[package]]
|
||||
name = "mako"
|
||||
version = "1.3.6"
|
||||
@@ -975,6 +1160,22 @@ files = [
|
||||
{file = "numpy-2.1.3.tar.gz", hash = "sha256:aa08e04e08aaf974d4458def539dece0d28146d866a39da5639596f4921fd761"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "oauthlib"
|
||||
version = "3.2.2"
|
||||
description = "A generic, spec-compliant, thorough implementation of the OAuth request-signing logic"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
files = [
|
||||
{file = "oauthlib-3.2.2-py3-none-any.whl", hash = "sha256:8139f29aac13e25d502680e9e19963e83f16838d48a0d71c287fe40e7067fbca"},
|
||||
{file = "oauthlib-3.2.2.tar.gz", hash = "sha256:9859c40929662bec5d64f34d01c99e093149682a3f38915dc0655d5a633dd918"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
rsa = ["cryptography (>=3.0.0)"]
|
||||
signals = ["blinker (>=1.4.0)"]
|
||||
signedtoken = ["cryptography (>=3.0.0)", "pyjwt (>=2.0.0,<3)"]
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry-api"
|
||||
version = "1.28.0"
|
||||
@@ -1448,6 +1649,24 @@ urllib3 = ">=1.21.1,<3"
|
||||
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
|
||||
use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
|
||||
|
||||
[[package]]
|
||||
name = "requests-oauthlib"
|
||||
version = "1.3.1"
|
||||
description = "OAuthlib authentication support for Requests."
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
files = [
|
||||
{file = "requests-oauthlib-1.3.1.tar.gz", hash = "sha256:75beac4a47881eeb94d5ea5d6ad31ef88856affe2332b9aafb52c6452ccf0d7a"},
|
||||
{file = "requests_oauthlib-1.3.1-py2.py3-none-any.whl", hash = "sha256:2577c501a2fb8d05a304c09d090d6e47c306fef15809d102b327cf8364bddab5"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
oauthlib = ">=3.0.0"
|
||||
requests = ">=2.0.0"
|
||||
|
||||
[package.extras]
|
||||
rsa = ["oauthlib[signedtoken] (>=3.0.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "six"
|
||||
version = "1.16.0"
|
||||
@@ -1691,6 +1910,22 @@ h11 = ">=0.8"
|
||||
[package.extras]
|
||||
standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "watchfiles (>=0.13)", "websockets (>=10.4)"]
|
||||
|
||||
[[package]]
|
||||
name = "withings-sync"
|
||||
version = "4.2.5"
|
||||
description = "A tool for synchronisation of Withings (ex. Nokia Health Body) to Garmin Connect and Trainer Road."
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
files = [
|
||||
{file = "withings_sync-4.2.5.tar.gz", hash = "sha256:ed98da96e3779d166a9bdb7c0d67bd9a250d57146a684ffd21c62fc190f2b849"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
garth = ">=0.4.32"
|
||||
lxml = "*"
|
||||
python-dotenv = "*"
|
||||
requests = "*"
|
||||
|
||||
[[package]]
|
||||
name = "wrapt"
|
||||
version = "1.16.0"
|
||||
@@ -1792,4 +2027,4 @@ type = ["pytest-mypy"]
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.11"
|
||||
content-hash = "79732d813444425db4aea149cb1a3431e7aad0a0f94032e203fc12c80dcee78e"
|
||||
content-hash = "bf15ed86ef3b1402197615a24916fa4626bd307919db4b15d99879f54c8dea7b"
|
||||
|
||||
@@ -30,6 +30,7 @@ geopy = "^2.4.1"
|
||||
flexparser = "0.3"
|
||||
pydantic-core = "^2.26.0"
|
||||
importlib-metadata = "^8.5.0"
|
||||
garminconnect = "^0.2.19"
|
||||
|
||||
|
||||
[build-system]
|
||||
|
||||
681
docs/about/license.md
Normal file
681
docs/about/license.md
Normal file
@@ -0,0 +1,681 @@
|
||||
<h1 align="center">
|
||||
License
|
||||
</h1>
|
||||
|
||||
<hr>
|
||||
|
||||
# Endurain license (GPL-3.0)
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
1
docs/assets/logo.svg
Normal file
1
docs/assets/logo.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 13 KiB |
16
docs/developer-guide.md
Normal file
16
docs/developer-guide.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Developer guide
|
||||
|
||||
---
|
||||
|
||||
## API Integration (v0.3.0+)
|
||||
|
||||
Endurain supports integration with other apps:
|
||||
|
||||
- For **web apps**, the backend sends access/refresh tokens as HTTP-only cookies.
|
||||
- For **mobile apps**, tokens are included in the response body.
|
||||
|
||||
### API Requirements
|
||||
|
||||
- **Add a header:** Every request must include an `X-Client-Type` header with either `web` or `mobile` as the value. Requests with other values will receive a `403` error.
|
||||
- **Login and refresh endpoint**: `/api/v1/token` and `/api/v1/refresh`.
|
||||
- **Activity Upload:** Use the `/api/v1/activities/create/upload` endpoint (expects a .gpx or .fit file).
|
||||
87
docs/getting-started.md
Normal file
87
docs/getting-started.md
Normal file
@@ -0,0 +1,87 @@
|
||||
# Getting started
|
||||
|
||||
---
|
||||
|
||||
## Default Credentials
|
||||
|
||||
- **Username:** admin
|
||||
- **Password:** admin
|
||||
|
||||
## Docker Deployment
|
||||
|
||||
Endurain provides Docker images for simplified deployment. To get started, check out the `docker-compose.yml.example` file in the project repository and adjust it according to your setup.
|
||||
Supported tags are:
|
||||
|
||||
- **latest:** contains the latest released version;
|
||||
- **version, example "v0.3.0":** contains the app state available at the time of the version specified;
|
||||
- **development version, example "dev_06092024":** contains a development version of the app at the date specified. This is not a stable released and may contain issues and bugs. Please do not open issues if using a version like this unless asked by me.
|
||||
|
||||
## Frontend Environment Variables
|
||||
Table below shows supported environment variables. Variables marked with optional "No" should be set to avoid errors.
|
||||
|
||||
| Environment variable | Default value | Optional | Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| MY_APP_BACKEND_PROTOCOL | http | Yes | Needs to be `https` if you want to enable Strava integration. Strava callback relies on this. You may need to update this variable based on docker image spin up (api host or local ip (example: http://192.168.1.10:98)) |
|
||||
| MY_APP_BACKEND_HOST | localhost:98 | Yes | Needs to be set and be Internet faced/resolved if you want to enable Strava integration. Strava callback relies on this. You may need to update this variable based on docker image spin up (api host or local ip (example: http://192.168.1.10:98)) |
|
||||
| MY_APP_STRAVA_CLIENT_ID | changeme | Yes | Needs to be set with your Strava API Client ID if you want to enable Strava integration. |
|
||||
|
||||
Frontend dependencies:
|
||||
|
||||
- To check npm dependencies used, use npm file (package.json)
|
||||
- User avatars create using DiceBear (https://www.dicebear.com) avataaars style.
|
||||
- Logo created on Canva
|
||||
|
||||
## Backend Environment Variables
|
||||
Table below shows supported environment variables. Variables marked with optional "No" should be set to avoid errors.
|
||||
|
||||
Environment variable | Default value | Optional | Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| DB_HOST | mariadb | Yes | N/A |
|
||||
| DB_PORT | 3306 | Yes | N/A |
|
||||
| DB_USER | endurain | Yes | N/A |
|
||||
| DB_PASSWORD | changeme | `No` | N/A |
|
||||
| DB_DATABASE | endurain | Yes | N/A |
|
||||
| SECRET_KEY | changeme | `No` | Run "openssl rand -hex 32" on a terminal to get a secret |
|
||||
| ALGORITHM | HS256 | Yes | Currently only HS256 is supported |
|
||||
| ACCESS_TOKEN_EXPIRE_MINUTES | 15 | Yes | Time in minutes |
|
||||
| REFRESH_TOKEN_EXPIRE_DAYS | 7 | Yes | Time in days |
|
||||
| STRAVA_CLIENT_ID | changeme | `No` | Needed if you want to enable the Strava integration |
|
||||
| STRAVA_CLIENT_SECRET | changeme | `No` | Needed if you want to enable the Strava integration |
|
||||
| STRAVA_AUTH_CODE | changeme | `No` | Needed if you want to enable the Strava integration |
|
||||
| JAEGER_ENABLED | false | Yes | N/A |
|
||||
| JAEGER_PROTOCOL | http | Yes | N/A |
|
||||
| JAEGER_HOST | jaeger | Yes | N/A |
|
||||
| JAGGER_PORT | 4317 | Yes | N/A |
|
||||
| FRONTEND_PROTOCOL | http | Yes | Needs to be set if you want to enable Strava integration. You may need to update this variable based on docker image spin up (frontend host or local ip (example: http://192.168.1.10:8080)) |
|
||||
| FRONTEND_HOST | frontend:8080 | Yes | Needs to be set if you want to enable Strava integration. You may need to update this variable based on docker image spin up (frontend host or local ip (example: http://192.168.1.10:8080)) |
|
||||
| GEOCODES_MAPS_API | changeme | `No` | <a href="https://geocode.maps.co/">Geocode maps</a> offers a free plan consisting of 1 Request/Second. Registration necessary. |
|
||||
|
||||
Table below shows the obligatory environment variables for mariadb container. You should set them based on what was also set for backend container.
|
||||
|
||||
| Environemnt variable | Default value | Optional | Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| MYSQL_ROOT_PASSWORD | changeme | `No` | N/A |
|
||||
| MYSQL_DATABASE | endurain | `No` | N/A |
|
||||
| MYSQL_USER | endurain | `No` | N/A |
|
||||
| MYSQL_PASSWORD | changeme | `No` | N/A |
|
||||
|
||||
To check Python backend dependencies used, use poetry file (pyproject.toml)
|
||||
|
||||
## Volumes
|
||||
|
||||
It is recommended to configure the following volumes for data persistence:
|
||||
|
||||
| Volume | Path | Notes |
|
||||
| --- | --- | --- |
|
||||
| /app/files/bulk_import | <local_path>/endurain/backend/files/bulk_import:/app/files/bulk_import | Necessary to enable bulk import of activities. Place here your activities files |
|
||||
| /app/files/processed | <local_path>/endurain/backend/files/processed:/app/files/processed | Necessary for processed original files persistence on container image updates |
|
||||
| /app/user_images | <local_path>/endurain/backend/user_images:/app/user_images | Necessary for user image persistence on container image updates |
|
||||
| /app/logs | <local_path>/endurain/backend/logs:/app/logs | Log files for the backend |
|
||||
|
||||
## Bulk import and file upload
|
||||
|
||||
.fit files are preferred. I noticed that Strava/Garmin Connect process of converting .fit to .gpx introduces additional data to the activity file leading to minor variances in the data, like for example additional meters in distance and elevation gain.
|
||||
Some notes:
|
||||
|
||||
- After the files are processed, the files are moved to the processed folder.
|
||||
- GEOCODES API has a limit of 1 Request/Second on the free plan, so if you have a large number of files, it might not be possible to import all in the same action.
|
||||
91
docs/index.md
Normal file
91
docs/index.md
Normal file
@@ -0,0 +1,91 @@
|
||||
<div align="center">
|
||||
<p>
|
||||
<img src="assets/logo.svg" width="150" height="150">
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="https://crowdin.com/project/endurain">
|
||||
<img src="https://badges.crowdin.net/endurain/localized.svg" alt="Crowdin">
|
||||
</a>
|
||||
<img src="https://img.shields.io/github/license/joaovitoriasilva/endurain" alt="License">
|
||||
<a href="https://github.com/joaovitoriasilva/endurain/releases">
|
||||
<img src="https://img.shields.io/github/v/release/joaovitoriasilva/endurain" alt="GitHub release">
|
||||
</a>
|
||||
<a href="https://github.com/joaovitoriasilva/endurain/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/joaovitoriasilva/endurain.svg?style=social&label=Star" alt="GitHub stars">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
Endurain
|
||||
</h2>
|
||||
<p>
|
||||
A self-hosted fitness tracking service - <a href="https://fosstodon.org/@endurain">Mastodon profile</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## 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, stravalib and python-garminconnect for Strava and Garmin Connect integration, gpxpy and fitdecode for .gpx and .fit file import respectively
|
||||
- **Database:** MariaDB for efficient user data management
|
||||
- **Observability:** Jaeger for basic tracing and monitoring
|
||||
|
||||
To deploy Endurain, Docker images are available, and a comprehensive example can be found in the "docker-compose.yml.example" file provided in the project repository. Configuration is facilitated through environment variables, ensuring flexibility and ease of customization. More details bellow.
|
||||
|
||||
## Developer's Note
|
||||
|
||||
As a non-professional developer, my journey with Endurain involved learning and implementing new technologies and concepts, with invaluable assistance from ChatGPT. The primary motivation behind this project was to gain hands-on experience and expand my understanding of modern development practices. Second motivation is that I'm an amateur triathlete and I want to keep track of my gear and gear components usage.
|
||||
|
||||
If you have any recommendations or insights on improving any aspect of Endurain, whether related to technology choices, user experience, or any other relevant area, I would greatly appreciate your input. The goal is to create a reliable and user-friendly fitness tracking solution that caters to the needs of individuals who prefer self-hosted applications. Your constructive feedback will undoubtedly contribute to the refinement of Endurain.
|
||||
|
||||
## Features
|
||||
|
||||
Endurain currently supports:
|
||||
|
||||
- Multi-user functionality
|
||||
- Admin and user profiles with adaptable interfaces
|
||||
- Activity import via manual or bulk upload (.gpx and .fit files)
|
||||
- Strava integration for syncing activities and gear
|
||||
- Garmin Connect integration for syncing activities
|
||||
- Personalized activity feeds and statistics (week/month)
|
||||
- Basic activity privacy settings
|
||||
- Gear tracking (wetsuits, bicycles, shoes)
|
||||
- User pages with stats and activity histories
|
||||
- Follower features (view activities)
|
||||
- Multi-language support (currently English only)
|
||||
- Dark/light theme switcher
|
||||
- Third-party app support
|
||||
- Weight logging
|
||||
|
||||
## Planned Features
|
||||
|
||||
Upcoming features (in no particular order):
|
||||
|
||||
- Simplified Docker images
|
||||
- Live tracking
|
||||
- Default gear for activity types
|
||||
- Gear component tracking (e.g., track when components like bike chains need replacing)
|
||||
- Activity comments and likes
|
||||
- Notification system
|
||||
- Potential ActivityPub integration
|
||||
|
||||
## Sponsors
|
||||
|
||||
A huge thank you to our sponsors! Your support helps keep this project going.
|
||||
|
||||
Consider [sponsoring Endurain on GitHub](https://github.com/sponsors/joaovitoriasilva) to ensure continuous development.
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are welcomed! Please open an issue to discuss any changes or improvements before submitting a PR. Check out the [Contributing Guidelines](https://github.com/joaovitoriasilva/endurain/blob/master/CONTRIBUTING.md) for more details.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the GPL-3.0 License - see the [LICENSE](https://github.com/joaovitoriasilva/endurain/tree/master?tab=GPL-3.0-1-ov-file) file for details.
|
||||
|
||||
## Help Translate
|
||||
|
||||
Endurain has multi-language support, and you can help translate it into more languages via [Crowdin](https://crowdin.com/project/endurain). Currently, only English is available.
|
||||
9
docs/integrations/3rd-party-apps.md
Normal file
9
docs/integrations/3rd-party-apps.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# 3rd party services
|
||||
|
||||
---
|
||||
|
||||
## RunnerUp Integration
|
||||
|
||||
[RunnerUp](https://github.com/jonasoreland/runnerup) an app for tracking your sport activities with your Android phone, can automatically sync your activities recorded with it to your Endurain instance.
|
||||
|
||||
RunnerUp is supported until version v0.5.3 of Endurain. An [issue](https://github.com/jonasoreland/runnerup/issues/1205) is opened to get support for v0.6.0+.
|
||||
17
docs/integrations/3rd-party-services.md
Normal file
17
docs/integrations/3rd-party-services.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# 3rd party services
|
||||
|
||||
---
|
||||
|
||||
## Strava Integration
|
||||
|
||||
To enable Strava integration, ensure your API endpoint is accessible from the internet and follow Strava's [API setup guide](https://developers.strava.com/docs/getting-started/). After the integration is successful the access and refresh tokens are stored in the DB. Each user will have his/hers own pair.
|
||||
|
||||
On Strava unlink action every data imported from Strava, i.e. activities and gears, will be deleted according to Strava [API Agreement](https://www.strava.com/legal/api).
|
||||
|
||||
For Strava integration [stravalib](https://github.com/stravalib/stravalib) Python module is used.
|
||||
|
||||
## Garmin Connect Integration
|
||||
|
||||
To enable Garmin Connect integration, Endurain will ask for your Garmin Connect credentials. These credentials are not stored, but the authentication tokens (access and refresh tokens) are stored in the DB, similar to the Strava integration. The credentials are sent from the frontend to the backend in plain text, so the use of HTTPS is highly recommended.
|
||||
|
||||
For Garmin Connect integration [python-garminconnect](https://github.com/cyberjunky/python-garminconnect) Python module is used.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 262 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
@@ -31,40 +31,44 @@
|
||||
|
||||
<!-- Display the activity type -->
|
||||
<span v-if="activity.activity_type == 1 || activity.activity_type == 2">
|
||||
<font-awesome-icon :icon="['fas', 'person-running']" />
|
||||
<font-awesome-icon class="me-1" :icon="['fas', 'person-running']" />
|
||||
</span>
|
||||
<span v-else-if="activity.activity_type == 3">
|
||||
<font-awesome-icon :icon="['fas', 'person-running']" /> (Virtual)
|
||||
<font-awesome-icon class="me-1" :icon="['fas', 'person-running']" />(Virtual)
|
||||
</span>
|
||||
<span v-else-if="activity.activity_type == 4 || activity.activity_type == 5 || activity.activity_type == 6">
|
||||
<font-awesome-icon :icon="['fas', 'fa-person-biking']" />
|
||||
<font-awesome-icon class="me-1" :icon="['fas', 'fa-person-biking']" />
|
||||
</span>
|
||||
<span v-else-if="activity.activity_type == 7">
|
||||
<font-awesome-icon :icon="['fas', 'fa-person-biking']" /> (Virtual)
|
||||
<font-awesome-icon class="me-1" :icon="['fas', 'fa-person-biking']" />(Virtual)
|
||||
</span>
|
||||
<span v-else-if="activity.activity_type == 8 || activity.activity_type == 9">
|
||||
<font-awesome-icon :icon="['fas', 'fa-person-swimming']" />
|
||||
<font-awesome-icon class="me-1" :icon="['fas', 'fa-person-swimming']" />
|
||||
</span>
|
||||
<span v-else-if="activity.activity_type == 11">
|
||||
<font-awesome-icon :icon="['fas', 'person-walking']" />
|
||||
<font-awesome-icon class="me-1" :icon="['fas', 'person-walking']" />
|
||||
</span>
|
||||
<span v-else-if="activity.activity_type == 12">
|
||||
<font-awesome-icon :icon="['fas', 'person-hiking']" />
|
||||
<font-awesome-icon class="me-1" :icon="['fas', 'person-hiking']" />
|
||||
</span>
|
||||
<span v-else-if="activity.activity_type == 13">
|
||||
<font-awesome-icon :icon="['fas', 'sailboat']" />
|
||||
<font-awesome-icon class="me-1" :icon="['fas', 'sailboat']" />
|
||||
</span>
|
||||
<span v-else-if="activity.activity_type == 14">
|
||||
<font-awesome-icon class="me-1" :icon="['fas', 'hands-praying']" />
|
||||
</span>
|
||||
<span v-else>
|
||||
<font-awesome-icon :icon="['fas', 'fa-dumbbell']" />
|
||||
<font-awesome-icon class="me-1" :icon="['fas', 'fa-dumbbell']" />
|
||||
</span>
|
||||
|
||||
<!-- Display the date and time -->
|
||||
<span class="ms-1">{{ formatDate(activity.start_time) }}</span> @
|
||||
<span>{{ formatDate(activity.start_time) }}</span> @
|
||||
<span>{{ formatTime(activity.start_time) }}</span>
|
||||
<!-- Conditionally display city and country -->
|
||||
<span v-if="activity.city || activity.country">
|
||||
<span v-if="activity.town || activity.city || activity.country">
|
||||
-
|
||||
<span v-if="activity.town">{{ activity.town }},</span>
|
||||
<span v-else-if="activity.city">{{ activity.city }},</span>
|
||||
<span v-if="activity.country">{{ " " + activity.country }}</span>
|
||||
</span>
|
||||
</h6>
|
||||
@@ -74,6 +78,9 @@
|
||||
<a class="btn btn-link btn-lg link-body-emphasis" :href="`https://www.strava.com/activities/${activity.strava_activity_id}`" role="button" v-if="activity.strava_activity_id">
|
||||
<font-awesome-icon :icon="['fab', 'fa-strava']" />
|
||||
</a>
|
||||
<a class="btn btn-link btn-lg link-body-emphasis" :href="`https://connect.garmin.com/modern/activity/${activity.garminconnect_activity_id}`" role="button" v-if="activity.garminconnect_activity_id">
|
||||
<img src="/src/assets/garminconnect/Garmin_Connect_app_1024x1024-02.png" alt="Garmin Connect logo" height="22" />
|
||||
</a>
|
||||
<div v-if="sourceProp === 'activity'">
|
||||
<button class="btn btn-link btn-lg link-body-emphasis" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<font-awesome-icon :icon="['fas', 'fa-ellipsis-vertical']" />
|
||||
@@ -86,7 +93,7 @@
|
||||
</li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<a class="dropdown-item" :class="{ disabled: activity.strava_activity_id }" href="#" data-bs-toggle="modal" data-bs-target="#deleteActivityModal">
|
||||
<a class="dropdown-item" :class="{ disabled: activity.strava_activity_id || activity.garminconnect_activity_id }" href="#" data-bs-toggle="modal" data-bs-target="#deleteActivityModal">
|
||||
{{ $t("activitySummary.buttonDeleteActivity") }}
|
||||
</a>
|
||||
</li>
|
||||
@@ -136,7 +143,7 @@
|
||||
|
||||
<!-- Activity summary -->
|
||||
<div class="row d-flex mt-3">
|
||||
<div class="col" v-if="activity.activity_type != 10">
|
||||
<div class="col" v-if="activity.activity_type != 10 && activity.activity_type != 14">
|
||||
<span class="fw-lighter">
|
||||
{{ $t("activitySummary.activityDistance") }}
|
||||
</span>
|
||||
@@ -164,14 +171,14 @@
|
||||
<span>{{ calculateTimeDifference(activity.start_time, activity.end_time) }}</span>
|
||||
</div>
|
||||
<div class="col border-start border-opacity-50">
|
||||
<div v-if="activity.activity_type != 1 && activity.activity_type != 2 && activity.activity_type != 3 && activity.activity_type != 8 && activity.activity_type != 9 && activity.activity_type != 10 && activity.activity_type != 13">
|
||||
<div v-if="activity.activity_type != 1 && activity.activity_type != 2 && activity.activity_type != 3 && activity.activity_type != 8 && activity.activity_type != 9 && activity.activity_type != 10 && activity.activity_type != 13 && activity.activity_type != 14">
|
||||
<span class="fw-lighter">
|
||||
{{ $t("activitySummary.activityElevationGain") }}
|
||||
</span>
|
||||
<br>
|
||||
<span>{{ activity.elevation_gain }} m</span>
|
||||
</div>
|
||||
<div v-else-if="activity.activity_type != 10">
|
||||
<div v-else-if="activity.activity_type != 10 && activity.activity_type != 14">
|
||||
<span class="fw-lighter">
|
||||
{{ $t("activitySummary.activityPace") }}
|
||||
</span>
|
||||
@@ -188,7 +195,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-flex mt-3" v-if="sourceProp === 'activity' && activity.activity_type != 10">
|
||||
<div class="row d-flex mt-3" v-if="sourceProp === 'activity' && activity.activity_type != 10 && activity.activity_type != 14">
|
||||
<!-- avg_power running and cycling activities-->
|
||||
<div class="col" v-if="activity.activity_type == 1 || activity.activity_type == 2 || activity.activity_type == 3 || activity.activity_type == 4 || activity.activity_type == 5 || activity.activity_type == 6 || activity.activity_type == 7">
|
||||
<span class="fw-lighter">
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
<option value="10">{{ $t("editActivityModalComponent.modalEditActivityTypeOption10") }}</option>
|
||||
<option value="11">{{ $t("editActivityModalComponent.modalEditActivityTypeOption11") }}</option>
|
||||
<option value="12">{{ $t("editActivityModalComponent.modalEditActivityTypeOption12") }}</option>
|
||||
<option value="13">{{ $t("editActivityModalComponent.modalEditActivityTypeOption13") }}</option>
|
||||
<option value="14">{{ $t("editActivityModalComponent.modalEditActivityTypeOption14") }}</option>
|
||||
</select>
|
||||
<!-- visibility fields -->
|
||||
<label for="activityVisibilityEdit"><b>* {{ $t("editActivityModalComponent.modalEditActivityVisibilityLabel") }}</b></label>
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="mt-3 col">
|
||||
<p class="text-center text-muted">© {{ new Date().getFullYear() === 2023 ? '2023' : '2023 - ' + new Date().getFullYear() }} Endurain • <a class="link-body-emphasis" href="https://github.com/joaovitoriasilva/endurain" role="button"><font-awesome-icon :icon="['fab', 'fa-github']" /></a> • <a class="link-body-emphasis" href="https://fosstodon.org/@endurain"><font-awesome-icon :icon="['fab', 'fa-mastodon']" /></a> • v0.5.3</p>
|
||||
<p class="text-center text-muted"><img src="/src/assets/strava/api_logo_cptblWith_strava_horiz_light.png" alt="Compatible with STRAVA image" height="25" /></p>
|
||||
<p class="text-center text-muted">© {{ new Date().getFullYear() === 2023 ? '2023' : '2023 - ' + new Date().getFullYear() }} Endurain • <a class="link-body-emphasis" href="https://github.com/joaovitoriasilva/endurain" role="button"><font-awesome-icon :icon="['fab', 'fa-github']" /></a> • <a class="link-body-emphasis" href="https://docs.endurain.com"><font-awesome-icon :icon="['fas', 'book']" /></a> • <a class="link-body-emphasis" href="https://fosstodon.org/@endurain"><font-awesome-icon :icon="['fab', 'fa-mastodon']" /></a> • v0.6.0</p>
|
||||
<p class="text-center text-muted"><img src="/src/assets/strava/api_logo_cptblWith_strava_horiz_light.png" alt="Compatible with STRAVA image" height="25" /> • <img src="/src/assets/garminconnect/Garmin_connect_badge_print_RESOURCE_FILE-01.png" alt="Works with Garmin Connect image" height="25" /></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<!-- Modal Garmin Connect authentication -->
|
||||
<div class="modal fade" id="garminConnectAuthModal" tabindex="-1" aria-labelledby="garminConnectAuthModal" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="garminConnectAuthModal">{{ $t("garminConnectLoginModalComponent.garminConnectAuthModalTitle") }}</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form @submit.prevent="submitConnectGarminConnect">
|
||||
<div class="modal-body">
|
||||
<label for="userUsernameAdd"><b>* {{ $t("garminConnectLoginModalComponent.garminConnectAuthModalUsernameLabel") }}</b></label>
|
||||
<input class="form-control" type="text" name="userUsernameAdd" :placeholder='$t("garminConnectLoginModalComponent.garminConnectAuthModalUsernamePlaceholder")' v-model="garminConnectUsername" required>
|
||||
<!-- password fields -->
|
||||
<label for="passUserAdd"><b>* {{ $t("garminConnectLoginModalComponent.garminConnectAuthModalPasswordLabel") }}</b></label>
|
||||
<input class="form-control" type="password" name="passUserAdd" :placeholder='$t("garminConnectLoginModalComponent.garminConnectAuthModalPasswordPlaceholder")' v-model="garminConnectPassword" required>
|
||||
<p>* {{ $t("generalItems.requiredField") }}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ $t("generalItems.buttonClose") }}</button>
|
||||
<button type="submit" class="btn btn-success" data-bs-dismiss="modal">{{ $t("garminConnectLoginModalComponent.garminConnectAuthModalLoginButton") }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
// Importing the stores
|
||||
import { useAuthStore } from "@/stores/authStore";
|
||||
// Import Notivue push
|
||||
import { push } from "notivue";
|
||||
// Importing the services
|
||||
import { garminConnect } from "@/services/garminConnectService";
|
||||
|
||||
//import Modal from 'bootstrap/js/dist/modal';
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
setup() {
|
||||
const authStore = useAuthStore();
|
||||
const { locale, t } = useI18n();
|
||||
const garminConnectUsername = ref("");
|
||||
const garminConnectPassword = ref("");
|
||||
|
||||
async function submitConnectGarminConnect() {
|
||||
// Set the loading message
|
||||
const notification = push.promise(t('garminConnectLoginModalComponent.processingMessageLinkGarminConnect'));
|
||||
try {
|
||||
const data = {
|
||||
username: garminConnectUsername.value,
|
||||
password: garminConnectPassword.value,
|
||||
};
|
||||
await garminConnect.linkGarminConnect(data);
|
||||
|
||||
// Set the user object with the is_garminconnect_linked property set to 1.
|
||||
const user = authStore.user;
|
||||
user.is_garminconnect_linked = 1;
|
||||
authStore.setUser(user, locale);
|
||||
|
||||
// Show success message
|
||||
notification.resolve(t("garminConnectLoginModalComponent.successMessageLinkGarminConnect"));
|
||||
} catch (error) {
|
||||
// If there is an error, show the error alert.
|
||||
notification.reject(
|
||||
`${t("garminConnectLoginModalComponent.errorMessageUnableToLinkGarminConnect")} - ${error}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
t,
|
||||
garminConnectUsername,
|
||||
garminConnectPassword,
|
||||
submitConnectGarminConnect,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -25,12 +25,16 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<!-- retrieve strava activities by days -->
|
||||
<a class="dropdown-item" href="#" role="button" data-bs-toggle="modal" data-bs-target="#retrieveStravaActivitiesByDaysModal">{{ $t("settingsIntegrationsZone.buttonStravaRetrieveActivitiesByDays") }}</a>
|
||||
<a class="dropdown-item" href="#" role="button" data-bs-toggle="modal" data-bs-target="#retrieveStravaActivitiesByDaysModal">{{ $t("settingsIntegrationsZone.modalRetrieveActivitiesByDaysTitle") }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<!-- retrieve gear -->
|
||||
<a href="#" class="dropdown-item" @click="submitRetrieveStravaGear">{{ $t("settingsIntegrationsZone.buttonStravaRetrieveGear") }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<!-- unlink Strava -->
|
||||
<a href="#" class="dropdown-item" role="button" data-bs-toggle="modal" data-bs-target="#unlinkStravaModal">{{ $t("settingsIntegrationsZone.buttonStravaUnlink") }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,22 +54,55 @@
|
||||
<!-- import button -->
|
||||
<a href="#" class="btn btn-primary" role="button" @click="submitBulkImport">{{ $t("settingsIntegrationsZone.buttonBulkImport") }}</a>
|
||||
</div>
|
||||
</li>
|
||||
<!-- Garmin Connect zone -->
|
||||
<li class="list-group-item d-flex justify-content-between">
|
||||
<div class="d-flex align-items-center">
|
||||
<!--<font-awesome-icon :icon="['fas', 'file-import']" size="2x" />-->
|
||||
<img src="/src/assets/garminconnect/Garmin_Connect_app_1024x1024-02.png" alt="Garmin Connect logo" height="32" />
|
||||
<div class="ms-3">
|
||||
<div class="fw-bold">
|
||||
{{ $t("settingsIntegrationsZone.garminConnectIntegrationTitle") }}
|
||||
</div>
|
||||
{{ $t("settingsIntegrationsZone.garminConnectIntegrationBody") }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
<!-- connect button -->
|
||||
<a href="#" class="btn btn-primary" v-if="authStore.user.is_garminconnect_linked == 0" data-bs-toggle="modal" data-bs-target="#garminConnectAuthModal">{{ $t("settingsIntegrationsZone.buttonConnect") }}</a>
|
||||
|
||||
<!-- retrieve activities and other buttons -->
|
||||
<div class="dropdown" v-else>
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
{{ $t("settingsIntegrationsZone.buttonDropdownOptions") }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<!-- retrieve garmin connect activities by days -->
|
||||
<a class="dropdown-item" href="#" role="button" data-bs-toggle="modal" data-bs-target="#retrieveGarminConnectActivitiesByDaysModal">{{ $t("settingsIntegrationsZone.modalRetrieveActivitiesByDaysTitle") }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- modal garmin connect auth -->
|
||||
<GarminConnectLoginModalComponent />
|
||||
|
||||
<!-- modal retrieve strava activities by days -->
|
||||
<div class="modal fade" id="retrieveStravaActivitiesByDaysModal" tabindex="-1" aria-labelledby="retrieveStravaActivitiesByDaysModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="retrieveStravaActivitiesByDaysModalLabel">{{ $t("settingsIntegrationsZone.buttonStravaRetrieveActivitiesByDays") }}</h1>
|
||||
<h1 class="modal-title fs-5" id="retrieveStravaActivitiesByDaysModalLabel">{{ $t("settingsIntegrationsZone.modalRetrieveActivitiesByDaysTitle") }}</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form @submit.prevent="submitRetrieveStravaActivities">
|
||||
<div class="modal-body">
|
||||
<!-- number of days fields -->
|
||||
<label for="daysToRetrieve"><b>* {{ $t("settingsIntegrationsZone.modalRetrieveActivitiesByDaysLabel") }}</b></label>
|
||||
<input class="form-control" type="number" name="daysToRetrieve" :placeholder='$t("settingsIntegrationsZone.modalRetrieveActivitiesByDaysPlaceholder")' v-model="daysToRetrieve" required>
|
||||
<input class="form-control" type="number" name="daysToRetrieve" :placeholder='$t("settingsIntegrationsZone.modalRetrieveActivitiesByDaysPlaceholder")' v-model="daysToRetrieveStrava" required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" name="retrieveStravaActivities" data-bs-dismiss="modal">{{ $t("generalItems.buttonClose") }}</button>
|
||||
@@ -75,6 +112,31 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- modal retrieve garmin connect activities by days -->
|
||||
<div class="modal fade" id="retrieveGarminConnectActivitiesByDaysModal" tabindex="-1" aria-labelledby="retrieveGarminConnectActivitiesByDaysModal" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="retrieveGarminConnectActivitiesByDaysModal">{{ $t("settingsIntegrationsZone.modalRetrieveActivitiesByDaysTitle") }}</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form @submit.prevent="submitRetrieveGarminConnectActivities">
|
||||
<div class="modal-body">
|
||||
<!-- number of days fields -->
|
||||
<label for="daysToRetrieve"><b>* {{ $t("settingsIntegrationsZone.modalRetrieveActivitiesByDaysLabel") }}</b></label>
|
||||
<input class="form-control" type="number" name="daysToRetrieve" :placeholder='$t("settingsIntegrationsZone.modalRetrieveActivitiesByDaysPlaceholder")' v-model="daysToRetrieveGarmin" required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" name="retrieveStravaActivities" data-bs-dismiss="modal">{{ $t("generalItems.buttonClose") }}</button>
|
||||
<button type="submit" class="btn btn-success" data-bs-dismiss="modal">{{ $t("settingsIntegrationsZone.modalRetrieveButton") }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ModalComponent modalId="unlinkStravaModal" :title="t('settingsIntegrationsZone.modalUnlinkStravaTitle')" :body="`${t('settingsIntegrationsZone.modalUnlinkStravaBody')}`" :actionButtonType="`danger`" :actionButtonText="t('settingsIntegrationsZone.modalUnlinkStravaTitle')" @submitAction="buttonStravaUnlink"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -88,15 +150,25 @@ import { useAuthStore } from "@/stores/authStore";
|
||||
// Importing the services
|
||||
import { strava } from "@/services/stravaService";
|
||||
import { activities } from "@/services/activitiesService";
|
||||
import { garminConnect } from "@/services/garminConnectService";
|
||||
// Import the components
|
||||
import ModalComponent from "@/components/Modals/ModalComponent.vue";
|
||||
import GarminConnectLoginModalComponent from "./SettingsIntegrations/GarminConnectLoginModalComponent.vue";
|
||||
|
||||
//import Modal from 'bootstrap/js/dist/modal';
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
components: {
|
||||
ModalComponent,
|
||||
GarminConnectLoginModalComponent,
|
||||
},
|
||||
setup() {
|
||||
const authStore = useAuthStore();
|
||||
const { t } = useI18n();
|
||||
const daysToRetrieve = ref(7);
|
||||
const { locale, t } = useI18n();
|
||||
const daysToRetrieveStrava = ref(7);
|
||||
const daysToRetrieveGarmin = ref(7);
|
||||
const garminConnectUsername = ref("");
|
||||
const garminConnectPassword = ref("");
|
||||
|
||||
async function submitConnectStrava() {
|
||||
const array = new Uint8Array(16);
|
||||
@@ -110,7 +182,7 @@ export default {
|
||||
|
||||
strava.linkStrava(state);
|
||||
} catch (error) {
|
||||
// If there is an error, set the error message and show the error alert.
|
||||
// If there is an error, show the error alert.
|
||||
push.error(
|
||||
`${t("settingsIntegrationsZone.errorMessageUnableToLinkStrava")} - ${error}`,
|
||||
);
|
||||
@@ -119,28 +191,16 @@ export default {
|
||||
|
||||
async function submitRetrieveStravaActivities() {
|
||||
try {
|
||||
await strava.getStravaActivitiesLastDays(daysToRetrieve.value);
|
||||
await strava.getStravaActivitiesLastDays(daysToRetrieveStrava.value);
|
||||
|
||||
// Set the loading message and show the loading alert.
|
||||
// Show the loading alert.
|
||||
push.info(
|
||||
t(
|
||||
"settingsIntegrationsZone.loadingMessageRetrievingStravaActivities",
|
||||
),
|
||||
);
|
||||
|
||||
// Ensure modal element and instance are correctly referenced
|
||||
//const myModalEl = document.getElementById('retrieveStravaActivitiesByDaysModal');
|
||||
//const myModal = Modal.getInstance(myModalEl) || new Modal(myModalEl); // Ensure an instance exists
|
||||
|
||||
// Add the event listener for 'hidden.bs.modal' before hiding the modal
|
||||
//myModalEl.addEventListener('hidden.bs.modal', () => {
|
||||
// myModal.dispose(); // Dispose of the modal instance when it is fully hidden
|
||||
//});
|
||||
|
||||
// Hide the modal programmatically
|
||||
//myModal.hide();
|
||||
} catch (error) {
|
||||
// If there is an error, set the error message and show the error alert.
|
||||
// If there is an error, show the error alert.
|
||||
push.error(
|
||||
`${t("settingsIntegrationsZone.errorMessageUnableToGetStravaActivities")} - ${error}`,
|
||||
);
|
||||
@@ -151,40 +211,84 @@ export default {
|
||||
try {
|
||||
await strava.getStravaGear();
|
||||
|
||||
// Set the loading message and show the loading alert.
|
||||
// Show the loading alert.
|
||||
push.success(
|
||||
t("settingsIntegrationsZone.loadingMessageRetrievingStravaGear"),
|
||||
);
|
||||
} catch (error) {
|
||||
// If there is an error, set the error message and show the error alert.
|
||||
// If there is an error, show the error alert.
|
||||
push.error(
|
||||
`${t("settingsIntegrationsZone.errorMessageUnableToGetStravaGear")} - ${error}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function buttonStravaUnlink() {
|
||||
// Set the loading message
|
||||
const notification = push.promise(t('settingsIntegrationsZone.processingMessageUnlinkStrava'));
|
||||
try {
|
||||
await strava.unlinkStrava();
|
||||
|
||||
// Set the user object with the is_strava_linked property set to 0.
|
||||
const user = authStore.user;
|
||||
user.is_strava_linked = 0;
|
||||
authStore.setUser(user, locale);
|
||||
|
||||
// Show the success alert.
|
||||
notification.resolve(t("settingsIntegrationsZone.successMessageStravaUnlinked"));
|
||||
} catch (error) {
|
||||
// If there is an error, show the error alert.
|
||||
notification.reject(
|
||||
`${t("settingsIntegrationsZone.errorMessageUnableToUnlinkStrava")} - ${error}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function submitBulkImport() {
|
||||
try {
|
||||
await activities.bulkImportActivities();
|
||||
|
||||
// Set the loading message and show the loading alert.
|
||||
// Show the loading alert.
|
||||
push.info(t("settingsIntegrationsZone.loadingMessageBulkImport"));
|
||||
} catch (error) {
|
||||
// If there is an error, set the error message and show the error alert.
|
||||
// If there is an error, show the error alert.
|
||||
push.error(
|
||||
`${t("settingsIntegrationsZone.errorMessageUnableToImportActivities")} - ${error}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function submitRetrieveGarminConnectActivities() {
|
||||
try {
|
||||
await garminConnect.getGarminConnectActivitiesLastDays(daysToRetrieveGarmin.value);
|
||||
|
||||
// Show the loading alert.
|
||||
push.info(
|
||||
t(
|
||||
"settingsIntegrationsZone.loadingMessageRetrievingGarminConnectActivities",
|
||||
),
|
||||
);
|
||||
} catch (error) {
|
||||
// If there is an error, show the error alert.
|
||||
push.error(
|
||||
`${t("settingsIntegrationsZone.errorMessageUnableToGetGarminConnectActivities")} - ${error}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
authStore,
|
||||
t,
|
||||
submitConnectStrava,
|
||||
submitRetrieveStravaActivities,
|
||||
daysToRetrieve,
|
||||
daysToRetrieveStrava,
|
||||
submitRetrieveStravaGear,
|
||||
buttonStravaUnlink,
|
||||
submitBulkImport,
|
||||
garminConnectUsername,
|
||||
garminConnectPassword,
|
||||
submitRetrieveGarminConnectActivities,
|
||||
daysToRetrieveGarmin,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -73,6 +73,9 @@
|
||||
<option value="1">{{ $t("settingsUsersZone.addUserModalGenderOption1") }}</option>
|
||||
<option value="2">{{ $t("settingsUsersZone.addUserModalGenderOption2") }}</option>
|
||||
</select>
|
||||
<!-- height fields -->
|
||||
<label for="userHeightEdit"><b>{{ $t("settingsUsersZone.addUserModalHeightLabel") }}</b></label>
|
||||
<input class="form-control" type="number" name="userHeightEdit" :placeholder='$t("settingsUsersZone.addUserModalHeightPlaceholder")' v-model="editUserHeight">
|
||||
<!-- preferred language fields -->
|
||||
<label for="userPreferredLanguageEdit"><b>* {{ $t("settingsUsersZone.addUserModalUserPreferedLanguageLabel") }}</b></label>
|
||||
<select class="form-control" name="userPreferredLanguageEdit" v-model="editUserPreferredLanguage" required>
|
||||
@@ -90,28 +93,42 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<!-- user name -->
|
||||
<h2>{{ authStore.user.name }}</h2>
|
||||
<!-- user username -->
|
||||
<p><b>{{ $t("settingsUsersZone.addUserModalUsernameLabel") }}: </b>{{ authStore.user.username }}</p>
|
||||
<!-- user email -->
|
||||
<p><b>{{ $t("settingsUsersZone.addUserModalEmailLabel") }}: </b>{{ authStore.user.email }}</p>
|
||||
<!-- user city -->
|
||||
<p>
|
||||
<b>{{ $t("settingsUsersZone.addUserModalTownLabel") }}: </b>
|
||||
<span v-if="authStore.user.city">{{ authStore.user.city }}</span>
|
||||
<span v-else>N/A</span>
|
||||
</p>
|
||||
<!-- user birthdate -->
|
||||
<p>
|
||||
<b>{{ $t("settingsUsersZone.addUserModalBirthdayLabel") }}: </b>
|
||||
<span v-if="authStore.user.birthdate">{{ authStore.user.birthdate }}</span>
|
||||
<span v-else>N/A</span>
|
||||
</p>
|
||||
<!-- user gender -->
|
||||
<p>
|
||||
<b>{{ $t("settingsUsersZone.addUserModalGenderLabel") }}: </b>
|
||||
<span v-if="authStore.user.gender == 1">{{ $t("settingsUsersZone.addUserModalGenderOption1") }}</span>
|
||||
<span v-else>{{ $t("settingsUsersZone.addUserModalGenderOption2") }}</span>
|
||||
</p>
|
||||
<!-- user height -->
|
||||
<p>
|
||||
<b>{{ $t("settingsUsersZone.addUserModalHeightLabel") }}: </b>
|
||||
<span v-if="authStore.user.height">{{ authStore.user.height }}cm</span>
|
||||
<span v-else>N/A</span>
|
||||
</p>
|
||||
<!-- user preferred language -->
|
||||
<p>
|
||||
<b>{{ $t("settingsUsersZone.addUserModalUserPreferedLanguageLabel") }}: </b>
|
||||
<span v-if="authStore.user.preferred_language == 'us'">{{ $t("settingsUsersZone.addUserModalPreferredLanguageOption1") }}</span>
|
||||
</p>
|
||||
<!-- user type -->
|
||||
<p>
|
||||
<b>{{ $t("settingsUsersZone.addUserModalUserTypeLabel") }}: </b>
|
||||
<span v-if="authStore.user.access_type == 1">{{ $t("settingsUsersZone.addUserModalUserTypeOption1") }}</span>
|
||||
@@ -148,6 +165,7 @@ export default {
|
||||
const editUserTown = ref(authStore.user.city);
|
||||
const editUserBirthdate = ref(authStore.user.birthdate);
|
||||
const editUserGender = ref(authStore.user.gender);
|
||||
const editUserHeight = ref(authStore.user.height);
|
||||
const editUserPreferredLanguage = ref(authStore.user.preferred_language);
|
||||
const editUserAccessType = ref(authStore.user.access_type);
|
||||
|
||||
@@ -165,6 +183,7 @@ export default {
|
||||
city: editUserTown.value,
|
||||
birthdate: editUserBirthdate.value,
|
||||
gender: editUserGender.value,
|
||||
height: editUserHeight.value,
|
||||
preferred_language: editUserPreferredLanguage.value,
|
||||
access_type: editUserAccessType.value,
|
||||
photo_path: null,
|
||||
@@ -229,6 +248,7 @@ export default {
|
||||
editUserTown,
|
||||
editUserBirthdate,
|
||||
editUserGender,
|
||||
editUserHeight,
|
||||
editUserPreferredLanguage,
|
||||
editUserAccessType,
|
||||
submitEditUserForm,
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
<option value="1">{{ $t("settingsUsersZone.addUserModalGenderOption1") }}</option>
|
||||
<option value="2">{{ $t("settingsUsersZone.addUserModalGenderOption2") }}</option>
|
||||
</select>
|
||||
<!-- height fields -->
|
||||
<label for="userHeightAdd"><b>{{ $t("settingsUsersZone.addUserModalHeightLabel") }}</b></label>
|
||||
<input class="form-control" type="number" name="userHeightAdd" :placeholder='$t("settingsUsersZone.addUserModalHeightPlaceholder")' v-model="newUserHeight">
|
||||
<!-- preferred language fields -->
|
||||
<label for="userPreferredLanguageAdd"><b>* {{ $t("settingsUsersZone.addUserModalUserPreferedLanguageLabel") }}</b></label>
|
||||
<select class="form-control" name="userPreferredLanguageAdd" v-model="newUserPreferredLanguage" required>
|
||||
@@ -151,6 +154,7 @@ export default {
|
||||
const newUserTown = ref(null);
|
||||
const newUserBirthDate = ref(null);
|
||||
const newUserGender = ref(1);
|
||||
const newUserHeight = ref(null);
|
||||
const newUserPreferredLanguage = ref("us");
|
||||
const newUserAccessType = ref(1);
|
||||
const usersArray = ref([]);
|
||||
@@ -196,6 +200,7 @@ export default {
|
||||
birthdate: newUserBirthDate.value,
|
||||
preferred_language: newUserPreferredLanguage.value,
|
||||
gender: newUserGender.value,
|
||||
height: newUserHeight.value,
|
||||
access_type: newUserAccessType.value,
|
||||
photo_path: null,
|
||||
is_active: 1,
|
||||
@@ -311,6 +316,7 @@ export default {
|
||||
newUserTown,
|
||||
newUserBirthDate,
|
||||
newUserGender,
|
||||
newUserHeight,
|
||||
newUserPreferredLanguage,
|
||||
newUserAccessType,
|
||||
submitAddUserForm,
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span class="badge bg-secondary-subtle border border-secondary-subtle text-secondary-emphasis align-middle me-2" v-if="user.id == authStore.user.id">{{ $t("usersListComponent.userListUserIsMeBadge") }}</span>
|
||||
<span class="badge bg-warning-subtle border border-warning-subtle text-warning-emphasis align-middle me-2" v-if="user.access_type == 2">{{ $t("usersListComponent.userListUserIsAdminBadge") }}</span>
|
||||
<span class="badge bg-success-subtle border border-success-subtle text-success-emphasis align-middle" v-if="user.is_active == 1">{{ $t("usersListComponent.userListUserIsActiveBadge") }}</span>
|
||||
<span class="badge bg-danger-subtle border border-danger-subtle text-danger-emphasis align-middle" v-else>{{ $t("usersListComponent.userListUserIsInactiveBadge") }}</span>
|
||||
@@ -108,7 +109,10 @@
|
||||
<select class="form-control" name="userGenderEdit" v-model="editUserGender" required>
|
||||
<option value="1">{{ $t("settingsUsersZone.addUserModalGenderOption1") }}</option>
|
||||
<option value="2">{{ $t("settingsUsersZone.addUserModalGenderOption2") }}</option>
|
||||
</select>
|
||||
</select>
|
||||
<!-- height fields -->
|
||||
<label for="userHeightEdit"><b>{{ $t("settingsUsersZone.addUserModalHeightLabel") }}</b></label>
|
||||
<input class="form-control" type="number" name="userHeightEdit" :placeholder='$t("settingsUsersZone.addUserModalHeightPlaceholder")' v-model="editUserHeight">
|
||||
<!-- preferred language fields -->
|
||||
<label for="userPreferredLanguageEdit"><b>* {{ $t("settingsUsersZone.addUserModalUserPreferedLanguageLabel") }}</b></label>
|
||||
<select class="form-control" name="userPreferredLanguageEdit" v-model="editUserPreferredLanguage" required>
|
||||
@@ -211,6 +215,7 @@ export default {
|
||||
const editUserTown = ref(userProp.value.city);
|
||||
const editUserBirthdate = ref(userProp.value.birthdate);
|
||||
const editUserGender = ref(userProp.value.gender);
|
||||
const editUserHeight = ref(userProp.value.height);
|
||||
const editUserPreferredLanguage = ref(userProp.value.preferred_language);
|
||||
const editUserAccessType = ref(userProp.value.access_type);
|
||||
const editUserIsActive = ref(userProp.value.is_active);
|
||||
@@ -253,6 +258,7 @@ export default {
|
||||
city: editUserTown.value,
|
||||
birthdate: editUserBirthdate.value,
|
||||
gender: editUserGender.value,
|
||||
height: editUserHeight.value,
|
||||
preferred_language: editUserPreferredLanguage.value,
|
||||
access_type: editUserAccessType.value,
|
||||
photo_path: null,
|
||||
@@ -282,6 +288,7 @@ export default {
|
||||
userProp.value.city = editUserTown.value;
|
||||
userProp.value.birthdate = editUserBirthdate.value;
|
||||
userProp.value.gender = editUserGender.value;
|
||||
userProp.value.height = editUserHeight.value;
|
||||
userProp.value.preferred_language = editUserPreferredLanguage.value;
|
||||
userProp.value.access_type = editUserAccessType.value;
|
||||
userProp.value.is_active = editUserIsActive.value;
|
||||
@@ -340,6 +347,7 @@ export default {
|
||||
editUserTown,
|
||||
editUserBirthdate,
|
||||
editUserGender,
|
||||
editUserHeight,
|
||||
editUserPreferredLanguage,
|
||||
editUserAccessType,
|
||||
editUserIsActive,
|
||||
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
emits: ['userDeleted'],
|
||||
setup(props) {
|
||||
const altText = ref('User Avatar');
|
||||
const userPhotoUrl = ref(`${import.meta.env.VITE_BACKEND_PROTOCOL}://${import.meta.env.VITE_BACKEND_HOST}/${props.userProp.photo_path}`);
|
||||
const userPhotoUrl = ref(`${import.meta.env.VITE_BACKEND_PROTOCOL}://${import.meta.env.VITE_BACKEND_HOST}/api/v1/${props.userProp.photo_path}`);
|
||||
const alignTopValue = ref(props.alignTop);
|
||||
|
||||
return {
|
||||
|
||||
@@ -23,6 +23,7 @@ import usSettingsLanguageSwitcherComponent from './us/components/settings/settin
|
||||
import usSettingsUserProfileZoneComponent from './us/components/settings/settingsUserProfileZoneComponent.json';
|
||||
import usSettingsSecurityZoneComponent from './us/components/settings/settingsSecurityZoneComponent.json';
|
||||
import usSettingsIntegrationsZoneComponent from './us/components/settings/settingsIntegrationsZoneComponent.json';
|
||||
import usGarminConnectLoginModalComponent from './us/components/settings/settingsIntegrationsZone/garminConnectLoginModalComponent.json';
|
||||
import usUsersListComponent from './us/components/settings/settingsUsersZone/usersListComponent.json';
|
||||
// General components
|
||||
import usNoItemsFoundComponent from './us/components/noItemsFoundComponent.json';
|
||||
@@ -64,6 +65,7 @@ const messages = {
|
||||
settingsUserProfileZone: usSettingsUserProfileZoneComponent,
|
||||
settingsSecurityZone: usSettingsSecurityZoneComponent,
|
||||
settingsIntegrationsZone: usSettingsIntegrationsZoneComponent,
|
||||
garminConnectLoginModalComponent: usGarminConnectLoginModalComponent,
|
||||
usersListComponent: usUsersListComponent,
|
||||
// General components
|
||||
noItemsFoundComponent: usNoItemsFoundComponent,
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
"modalEditActivityTypeOption10": "Workout",
|
||||
"modalEditActivityTypeOption11": "Walk",
|
||||
"modalEditActivityTypeOption12": "Hike",
|
||||
"modalEditActivityTypeOption13": "Rowing",
|
||||
"modalEditActivityTypeOption14": "Yoga",
|
||||
"modalEditActivityVisibilityLabel": "Visibility",
|
||||
"modalEditActivityVisibilityOption0": "Public",
|
||||
"modalEditActivityVisibilityOption1": "Followers",
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"garminConnectAuthModalTitle": "Link Garmin Connect account",
|
||||
"garminConnectAuthModalUsernameLabel": "Garmin Connect email",
|
||||
"garminConnectAuthModalUsernamePlaceholder": "Garmin Connect email",
|
||||
"garminConnectAuthModalPasswordLabel": "Garmin Connect password",
|
||||
"garminConnectAuthModalPasswordPlaceholder": "Garmin Connect password",
|
||||
"garminConnectAuthModalLoginButton": "Login",
|
||||
"processingMessageLinkGarminConnect": "Linking Garmin Connect account...",
|
||||
"successMessageLinkGarminConnect": "Garmin Connect account linked",
|
||||
"errorMessageUnableToLinkGarminConnect": "Unable to link Garmin Connect account"
|
||||
}
|
||||
@@ -3,11 +3,12 @@
|
||||
"stravaIntegrationBody": "Strava is an American internet service for tracking physical exercise which incorporates social network features.",
|
||||
"buttonConnect": "Connect",
|
||||
"buttonDropdownOptions": "Options",
|
||||
"buttonStravaRetrieveActivitiesByDays": "Retrieve activities by days",
|
||||
"modalRetrieveActivitiesByDaysTitle": "Retrieve activities by days",
|
||||
"modalRetrieveActivitiesByDaysLabel": "Days",
|
||||
"modalRetrieveActivitiesByDaysPlaceholder": "Days",
|
||||
"modalRetrieveButton": "Retrieve",
|
||||
"buttonStravaRetrieveGear": "Retrieve gear",
|
||||
"buttonStravaUnlink": "Unlink",
|
||||
"errorMessageUnableToLinkStrava": "Unable to link Strava account",
|
||||
"successMessageStravaAccountLinked": "Strava account linked",
|
||||
"errorMessageUnableToUnSetStravaState": "Unable to unset Strava state",
|
||||
@@ -15,9 +16,18 @@
|
||||
"errorMessageUnableToGetStravaGear": "Unable to get Strava gear",
|
||||
"loadingMessageRetrievingStravaActivities": "Retrieving Strava activities",
|
||||
"loadingMessageRetrievingStravaGear": "Retrieving Strava gear",
|
||||
"processingMessageUnlinkStrava": "Unlinking Strava account...",
|
||||
"successMessageStravaUnlinked": "Strava account unlinked",
|
||||
"errorMessageUnableToUnlinkStrava": "Unable to unlink Strava account",
|
||||
"modalUnlinkStravaTitle": "Unlink Strava",
|
||||
"modalUnlinkStravaBody": "Are you sure you want to unlink your Strava account? Unlinking your Strava account will remove all your Strava activities and gear from Endurain.",
|
||||
"bulkImportIntegrationTitle": "Bulk import",
|
||||
"bulkImportIntegrationBody": "Bulk import activities from files stored in the bulk_import folder",
|
||||
"buttonBulkImport": "Import",
|
||||
"errorMessageUnableToImportActivities": "An error occurred while importing activities",
|
||||
"loadingMessageBulkImport": "Importing activities"
|
||||
"loadingMessageBulkImport": "Importing activities",
|
||||
"garminConnectIntegrationTitle": "Garmin Connect",
|
||||
"garminConnectIntegrationBody": "Garmin Connect is a health and fitness activity platform for users of Garmin devices",
|
||||
"loadingMessageRetrievingGarminConnectActivities": "Retrieving Garmin Connect activities",
|
||||
"errorMessageUnableToGetGarminConnectActivities": "Unable to get Garmin Connect activities"
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
"userListAccessTypeLabel": "Access type: ",
|
||||
"userListAccessTypeOption1": "Regular user",
|
||||
"userListAccessTypeOption2": "Administrator",
|
||||
"userListUserIsMeBadge": "Me",
|
||||
"userListUserIsAdminBadge": "Admin",
|
||||
"userListUserIsActiveBadge": "Active",
|
||||
"userListUserIsInactiveBadge": "Inactive",
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
"addUserModalTownLabel": "Town/city",
|
||||
"addUserModalTownPlaceholder": "Town/city (max 45 characters)",
|
||||
"addUserModalBirthdayLabel": "Birthday",
|
||||
"addUserModalHeightLabel": "Height (cm)",
|
||||
"addUserModalHeightPlaceholder": "Height (cm)",
|
||||
"addUserModalGenderLabel": "Gender",
|
||||
"addUserModalGenderOption1": "Male",
|
||||
"addUserModalGenderOption2": "Female",
|
||||
|
||||
10
frontend/app/src/services/garminConnectService.js
Normal file
10
frontend/app/src/services/garminConnectService.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { fetchGetRequest, fetchPutRequest } from '@/utils/serviceUtils';
|
||||
|
||||
export const garminConnect = {
|
||||
linkGarminConnect(data) {
|
||||
return fetchPutRequest("garminconnect/link", data)
|
||||
},
|
||||
getGarminConnectActivitiesLastDays(days) {
|
||||
return fetchGetRequest(`garminconnect/activities/days/${days}`);
|
||||
},
|
||||
};
|
||||
@@ -1,11 +1,11 @@
|
||||
import { fetchGetRequest, fetchPutRequest } from '@/utils/serviceUtils';
|
||||
import { fetchGetRequest, fetchPutRequest, fetchDeleteRequest } from '@/utils/serviceUtils';
|
||||
|
||||
export const strava = {
|
||||
setUniqueUserStateStravaLink(state) {
|
||||
return fetchPutRequest(`strava/set-user-unique-state/${state}`)
|
||||
},
|
||||
unsetUniqueUserStateStravaLink() {
|
||||
return fetchPutRequest(`strava/unset-user-unique-state`)
|
||||
return fetchPutRequest("strava/unset-user-unique-state")
|
||||
},
|
||||
linkStrava(state) {
|
||||
const stravaClientId = `${import.meta.env.VITE_STRAVA_CLIENT_ID}`;
|
||||
@@ -23,5 +23,8 @@ export const strava = {
|
||||
},
|
||||
getStravaGear() {
|
||||
return fetchGetRequest('strava/gear');
|
||||
},
|
||||
unlinkStrava() {
|
||||
return fetchDeleteRequest('strava/unlink');
|
||||
}
|
||||
};
|
||||
@@ -11,10 +11,12 @@ export const useAuthStore = defineStore('auth', {
|
||||
birthdate: null,
|
||||
preferred_language: '',
|
||||
gender: null,
|
||||
height: null,
|
||||
access_type: null,
|
||||
photo_path: '',
|
||||
is_active: null,
|
||||
is_strava_linked: null,
|
||||
is_garminconnect_linked: null,
|
||||
},
|
||||
isAuthenticated: false,
|
||||
}),
|
||||
@@ -36,10 +38,12 @@ export const useAuthStore = defineStore('auth', {
|
||||
birthdate: null,
|
||||
preferred_language: '',
|
||||
gender: null,
|
||||
height: null,
|
||||
access_type: null,
|
||||
photo_path: '',
|
||||
is_active: null,
|
||||
is_strava_linked: null,
|
||||
is_garminconnect_linked: null,
|
||||
};
|
||||
this.isAuthenticated = false;
|
||||
localStorage.removeItem('user');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const API_URL = `${import.meta.env.VITE_BACKEND_PROTOCOL}://${import.meta.env.VITE_BACKEND_HOST}/`;
|
||||
const API_URL = `${import.meta.env.VITE_BACKEND_PROTOCOL}://${import.meta.env.VITE_BACKEND_HOST}/api/v1/`;
|
||||
|
||||
async function fetchWithRetry(url, options) {
|
||||
try {
|
||||
|
||||
@@ -98,9 +98,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span class="badge bg-success-subtle border border-success-subtle text-success-emphasis align-middle" v-if="gear.is_active == 1">{{ $t("gearsView.activeState") }}</span>
|
||||
<span class="badge bg-danger-subtle border border-danger-subtle text-danger-emphasis align-middle" v-else>{{ $t("gearsView.inactiveState") }}</span>
|
||||
<span class="badge bg-primary-subtle border border-primary-subtle text-primary-emphasis align-middle ms-2" v-if="gear.strava_gear_id">{{ $t("gearsView.gearFromStrava") }}</span>
|
||||
<!--<span class="badge bg-success-subtle border border-success-subtle text-success-emphasis align-middle" v-if="gear.is_active == 1">{{ $t("gearsView.activeState") }}</span>-->
|
||||
<span class="badge bg-danger-subtle border border-danger-subtle text-danger-emphasis align-middle" v-if="gear.is_active == 0">{{ $t("gearsView.inactiveState") }}</span>
|
||||
<span class="badge bg-primary-subtle border border-primary-subtle text-primary-emphasis align-middle ms-2" v-if="gear.strava_gear_id"><font-awesome-icon :icon="['fab', 'fa-strava']" /> {{ $t("gearsView.gearFromStrava") }}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
15
mkdocs.yml
Normal file
15
mkdocs.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
site_name: Endurain documentation
|
||||
repo_url: https://github.com/joaovitoriasilva/endurain
|
||||
theme:
|
||||
name: mkdocs
|
||||
color_mode: auto
|
||||
user_color_mode_toggle: true
|
||||
nav:
|
||||
- Home: index.md
|
||||
- Getting started: getting-started.md
|
||||
- Integrations:
|
||||
- 3rd party apps: integrations/3rd-party-apps.md
|
||||
- 3rd party services: integrations/3rd-party-services.md
|
||||
- Developer guide: developer-guide.md
|
||||
- About:
|
||||
- License: about/license.md
|
||||
Reference in New Issue
Block a user