diff --git a/.dockerignore b/.dockerignore
index db3149bac..3b52e2738 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -7,6 +7,10 @@
.coverage
.eslintcache
docker-compose-dev.yml
+docker-compose.yml
Makefile.custom.config
*.log
-data
\ No newline at end of file
+data
+
+**/__pycache__/
+**/*.py[cod]
diff --git a/.env.docker b/.env.docker.dev
similarity index 91%
rename from .env.docker
rename to .env.docker.dev
index 7658d08c5..97f56cf37 100644
--- a/.env.docker
+++ b/.env.docker.dev
@@ -7,8 +7,8 @@ export FLASK_SKIP_DOTENV=1
export APP_SETTINGS=fittrackee.config.DevelopmentConfig
export APP_SECRET_KEY='just for test'
# export APP_WORKERS=
-export APP_LOG=fittrackee.log
-export UPLOAD_FOLDER=/usr/src/app/uploads
+export APP_LOG=/usr/src/app/data/logs/fittrackee.log
+export UPLOAD_FOLDER=/usr/src/app/data/uploads
# PostgreSQL
export DATABASE_URL=postgresql://fittrackee:fittrackee@fittrackee-db:5432/fittrackee
diff --git a/.env.docker.example b/.env.docker.example
new file mode 100644
index 000000000..59f76453f
--- /dev/null
+++ b/.env.docker.example
@@ -0,0 +1,44 @@
+# Custom variables initialisation
+
+# Docker volumes
+# export UPLOAD_DIR=
+# export LOG_DIR=
+# export DATABASE_DIR=
+# export REDIS_DIR=
+
+# Application
+export FLASK_APP=fittrackee
+export FLASK_SKIP_DOTENV=1
+# export APP_PORT=5000
+export APP_SECRET_KEY='PLEASE CHANGE ME'
+export APP_LOG=/usr/src/app/logs/fittrackee.log
+export UPLOAD_FOLDER=/usr/src/app/uploads
+
+# PostgreSQL
+export POSTGRES_USER=fittrackee
+export POSTGRES_PASSWORD=
+export POSTGRES_DB=fittrackee
+export DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@fittrackee-db:5432/${POSTGRES_DB}
+# export DATABASE_DISABLE_POOLING=
+
+# Redis (required for API rate limits and email sending)
+export REDIS_URL=redis://redis:6379
+
+# API rate limits
+# export API_RATE_LIMITS="300 per 5 minutes"
+
+# Emails
+export UI_URL=
+export EMAIL_URL=
+export SENDER_EMAIL=
+
+# Workouts
+# export TILE_SERVER_URL=
+# export STATICMAP_SUBDOMAINS=
+# export MAP_ATTRIBUTION=
+# export DEFAULT_STATICMAP=False
+
+# Weather
+# available weather API providers: visualcrossing
+# export WEATHER_API_PROVIDER=
+# export WEATHER_API_KEY=
\ No newline at end of file
diff --git a/.github/workflows/.e2e-tests.yml b/.github/workflows/.e2e-tests.yml
new file mode 100644
index 000000000..bbac6015d
--- /dev/null
+++ b/.github/workflows/.e2e-tests.yml
@@ -0,0 +1,85 @@
+on:
+ workflow_call:
+ inputs:
+ python-version:
+ type: string
+ default: 3.13
+ postgres-version:
+ type: string
+ default: 17
+ previous-version:
+ type: boolean
+ default: false
+
+jobs:
+ test_package:
+ runs-on: ubuntu-latest
+ container: python:${{ inputs.python-version }}
+ services:
+ postgres:
+ image: postgres:${{ inputs.postgres-version }}
+ env:
+ POSTGRES_DB: fittrackee_test
+ POSTGRES_USER: fittrackee
+ POSTGRES_PASSWORD: fittrackee
+ options: >-
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+ selenium:
+ image: selenium/standalone-firefox
+ mailhog:
+ image: mailhog/mailhog:latest
+ redis:
+ image: redis:latest
+ env:
+ APP_SETTINGS: fittrackee.config.End2EndTestingConfig
+ DATABASE_TEST_URL: "postgresql://fittrackee:fittrackee@postgres:5432/fittrackee_test"
+ FLASK_APP: fittrackee
+ EMAIL_URL: "smtp://mailhog:1025"
+ REDIS_URL: "redis://redis:6379"
+ HOST: "0.0.0.0"
+ PORT: 5000
+ SENDER_EMAIL: fittrackee@example.com
+ steps:
+
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ - name: Install previous version of FitTrackee from PyPI
+ if: inputs.python-version.previous-version
+ run: python3 -m pip install fittrackee
+
+ - name: Run migrations
+ if: inputs.python-version.previous-version
+ run: ftcli db upgrade
+
+ - name: Download all the dists
+ uses: actions/download-artifact@v4
+ with:
+ name: python-package-distributions
+ path: dist/
+
+ - name: Create and source virtual environment
+ run: |
+ python3 -m venv .venv
+ . .venv/bin/activate
+
+ - name: Install fittrackee package
+ run: python3 -m pip install dist/fittrackee-$(cat VERSION).tar.gz
+
+ - name: Run migrations
+ run: ftcli db upgrade
+
+ - name: Install pytest and selenium
+ run: python3 -m pip install pytest==8.2.0 pytest-selenium==4.1.0 selenium==4.20.0 pytest-html==4.1.1
+
+ - name: Start application and run tests with Selenium
+ run: |
+ setsid nohup fittrackee >> nohup.out 2>&1 &
+ export TEST_APP_URL=http://$(hostname --ip-address):5000
+ sleep 5
+ nohup flask worker --processes=1 >> nohup.out 2>&1 &
+ pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444 --maxfail=1
diff --git a/.github/workflows/.tests-and-publish-python.yml b/.github/workflows/.tests-and-publish-python.yml
new file mode 100644
index 000000000..75d8edf6f
--- /dev/null
+++ b/.github/workflows/.tests-and-publish-python.yml
@@ -0,0 +1,331 @@
+name: Python CI
+
+on:
+ push:
+ paths-ignore: ['docs/**', 'docsrc/**', 'docker/**', 'fittrackee_client/**', '*.md']
+ pull_request:
+ paths-ignore: ['docs/**', 'docsrc/**', 'docker/**', 'fittrackee_client/**', '*.md']
+ types: [opened, synchronize, reopened]
+
+env:
+ APP_SETTINGS: fittrackee.config.TestingConfig
+ DATABASE_TEST_URL: "postgresql://fittrackee:fittrackee@postgres:5432/fittrackee_test"
+ EMAIL_URL: "smtp://none:none@0.0.0.0:1025"
+ FLASK_APP: fittrackee/__main__.py
+ SENDER_EMAIL: fittrackee@example.com
+ GITHUB_REGISTRY: ghcr.io
+ GITHUB_IMAGE_NAME: ${{ github.repository }}
+
+jobs:
+ python:
+ if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
+ name: python ${{ matrix.python-version }} (postgresql 17)
+ runs-on: ubuntu-latest
+ container: python:${{ matrix.python-version }}
+ services:
+ postgres:
+ image: postgres:17
+ env:
+ POSTGRES_PASSWORD: postgres
+ options: >-
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+ strategy:
+ matrix:
+ python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
+ steps:
+
+ - uses: actions/checkout@v4
+
+ - name: Install Poetry and Dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install --quiet poetry
+ poetry config virtualenvs.create false
+ poetry install --no-interaction --quiet
+
+ - name: Create test databases
+ run: python db/create_ci_test_db.py
+
+ - name: Bandit
+ if: matrix.python-version == '3.13'
+ run: bandit -r fittrackee -c pyproject.toml
+
+ - name: Lint
+ if: matrix.python-version == '3.13'
+ run: ruff check fittrackee e2e
+
+ - name: Mypy
+ if: matrix.python-version == '3.13'
+ run: mypy fittrackee
+
+ - name: Pytest
+ run: pytest fittrackee -n auto --maxprocesses=2 -p no:warnings --cov fittrackee --cov-report term-missing --maxfail=1
+
+ postgresql:
+ if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
+ name: postgresql ${{ matrix.psql-version }} (python 3.13)
+ runs-on: ubuntu-latest
+ container: python:3.13
+ services:
+ postgres:
+ image: postgres:${{ matrix.psql-version }}
+ env:
+ POSTGRES_PASSWORD: postgres
+ options: >-
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+ strategy:
+ matrix:
+ psql-version: [ "12", "13", "14", "15", "16" ]
+ steps:
+
+ - uses: actions/checkout@v4
+
+ - name: Install Poetry and Dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install --quiet poetry
+ poetry config virtualenvs.create false
+ poetry install --no-interaction --quiet
+
+ - name: Create test databases
+ run: python db/create_ci_test_db.py
+
+ - name: Pytest
+ run: pytest fittrackee -n auto --maxprocesses=2 -p no:warnings --cov fittrackee --cov-report term-missing --maxfail=1
+
+ end2end:
+ if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
+ name: e2e tests with sources
+ runs-on: ubuntu-latest
+ needs: ["python"]
+ container: python:3.13
+ services:
+ postgres:
+ image: postgres:17
+ env:
+ POSTGRES_DB: fittrackee_test
+ POSTGRES_USER: fittrackee
+ POSTGRES_PASSWORD: fittrackee
+ options: >-
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+ selenium:
+ image: selenium/standalone-firefox
+ mailhog:
+ image: mailhog/mailhog:latest
+ redis:
+ image: redis:latest
+ env:
+ APP_SETTINGS: fittrackee.config.End2EndTestingConfig
+ EMAIL_URL: "smtp://mailhog:1025"
+ REDIS_URL: "redis://redis:6379"
+ steps:
+
+ - uses: actions/checkout@v4
+
+ - name: Install Poetry and Dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install --quiet poetry
+ poetry config virtualenvs.create false
+ poetry install --no-interaction --quiet
+
+ - name: Run migrations
+ run: flask db upgrade --directory fittrackee/migrations
+
+ - name: Start application and run tests with Selenium
+ run: |
+ setsid nohup flask run --with-threads -h 0.0.0.0 -p 5000 >> nohup.out 2>&1 &
+ export TEST_APP_URL=http://$(hostname --ip-address):5000
+ sleep 5
+ nohup flask worker --processes=1 >> nohup.out 2>&1 &
+ pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444 --maxfail=1
+
+ build_package:
+ needs: ["python"]
+ runs-on: ubuntu-latest
+ steps:
+
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ - name: Use Node.js 23.x
+ uses: actions/setup-node@v4
+ with:
+ node-version: 23.x
+
+ - name: Install yarn and dependencies
+ working-directory: fittrackee_client
+ run: |
+ npm install --global yarn
+ yarn install
+
+ - name: Build dist files
+ working-directory: fittrackee_client
+ run: yarn build
+
+ - name: Set up Python 3.13
+ uses: actions/setup-python@v5
+ with:
+ python-version: 3.13
+
+ - name: Install poetry
+ run: >-
+ python3 -m
+ pip install
+ poetry
+ --user
+
+ - name: Build a binary wheel and a source tarball
+ run: poetry build
+
+ - name: Store the distribution packages
+ uses: actions/upload-artifact@v4
+ with:
+ name: python-package-distributions
+ path: dist/
+ retention-days: 5
+
+ end2end_package:
+ if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
+ name: e2e tests with package
+ needs: ["build_package"]
+ uses: ./.github/workflows/.e2e-tests.yml
+
+ end2end_package_update:
+ if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
+ name: e2e tests after FitTrackee update
+ needs: ["build_package"]
+ uses: ./.github/workflows/.e2e-tests.yml
+ with:
+ previous-version: true
+
+ publish-to-pypi:
+ if: github.repository == 'SamR1/FitTrackee' && startsWith(github.ref, 'refs/tags/v')
+ name: Publish Python distribution to PyPI
+ needs: ["end2end", "end2end_package", "end2end_package_update"]
+ runs-on: ubuntu-latest
+ environment:
+ name: pypi
+ url: https://pypi.org/p/fittrackee
+ permissions:
+ id-token: write
+
+ steps:
+ - name: Download all the dists
+ uses: actions/download-artifact@v4
+ with:
+ name: python-package-distributions
+ path: dist/
+
+ - name: Publish distribution to PyPI
+ uses: pypa/gh-action-pypi-publish@release/v1
+
+ github-release:
+ if: github.repository == 'SamR1/FitTrackee' && startsWith(github.ref, 'refs/tags/v')
+ name: Upload distribution to GitHub Release
+ needs: ["publish-to-pypi"]
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: write
+ id-token: write
+
+ steps:
+ - name: Download all the dists
+ uses: actions/download-artifact@v4
+ with:
+ name: python-package-distributions
+ path: dist/
+
+ - name: Sign the dists with Sigstore
+ uses: sigstore/gh-action-sigstore-python@v3.0.0
+ with:
+ inputs: >-
+ ./dist/*.tar.gz
+ ./dist/*.whl
+
+ - name: Create GitHub draft release
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ run: >-
+ gh release create
+ "$GITHUB_REF_NAME"
+ --repo "$GITHUB_REPOSITORY"
+ --draft
+ --notes "wip"
+
+ - name: Upload artifact signatures to GitHub Release
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ run: >-
+ gh release upload
+ "$GITHUB_REF_NAME" dist/**
+ --repo "$GITHUB_REPOSITORY"
+
+ push_to_registries:
+ if: github.repository == 'SamR1/FitTrackee' && startsWith(github.ref, 'refs/tags/v')
+ name: Push Docker image to multiple registries
+ needs: ["end2end", "end2end_package", "end2end_package_update"]
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: write
+ attestations: write
+ id-token: write
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v3
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ${{ env.GITHUB_REGISTRY }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Extract metadata (tags, labels) for Docker
+ id: meta
+ uses: docker/metadata-action@v5
+ with:
+ images: |
+ fittrackee/fittrackee
+ ${{ env.GITHUB_REGISTRY }}/${{ env.GITHUB_IMAGE_NAME}}
+
+ - name: Build and push Docker images
+ id: push
+ uses: docker/build-push-action@v6
+ with:
+ context: .
+ platforms: linux/amd64,linux/arm64
+ push: true
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+
+ - name: Generate artifact attestation
+ uses: actions/attest-build-provenance@v2
+ with:
+ subject-name: ${{ env.GITHUB_REGISTRY }}/${{ env.GITHUB_IMAGE_NAME}}
+ subject-digest: ${{ steps.push.outputs.digest }}
+ push-to-registry: true
diff --git a/.github/workflows/.tests-python.yml b/.github/workflows/.tests-python.yml
deleted file mode 100644
index a4c578fd8..000000000
--- a/.github/workflows/.tests-python.yml
+++ /dev/null
@@ -1,245 +0,0 @@
-name: Python CI
-
-on:
- push:
- paths-ignore: ['docs/**', 'docsrc/**', 'docker/**', 'fittrackee_client/**', '*.md']
- pull_request:
- paths-ignore: ['docs/**', 'docsrc/**', 'docker/**', 'fittrackee_client/**', '*.md']
- types: [opened, synchronize, reopened]
-
-env:
- APP_SETTINGS: fittrackee.config.TestingConfig
- DATABASE_TEST_URL: "postgresql://fittrackee:fittrackee@postgres:5432/fittrackee_test"
- EMAIL_URL: "smtp://none:none@0.0.0.0:1025"
- FLASK_APP: fittrackee/__main__.py
- SENDER_EMAIL: fittrackee@example.com
-
-jobs:
- python:
- if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
- name: python ${{ matrix.python-version }} (postgresql 15)
- runs-on: ubuntu-latest
- container: python:${{ matrix.python-version }}
- services:
- postgres:
- image: postgres:15
- env:
- POSTGRES_PASSWORD: postgres
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- strategy:
- matrix:
- python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
- steps:
- - uses: actions/checkout@v4
- - name: Install Poetry and Dependencies
- run: |
- python -m pip install --upgrade pip
- pip install --quiet poetry
- poetry config virtualenvs.create false
- poetry install --no-interaction --quiet
- - name: Create test databases
- run: python db/create_ci_test_db.py
- - name: Bandit
- if: matrix.python-version == '3.11'
- run: bandit -r fittrackee -c pyproject.toml
- - name: Lint
- if: matrix.python-version == '3.11'
- run: ruff check fittrackee e2e
- - name: Mypy
- if: matrix.python-version == '3.11'
- run: mypy fittrackee
- - name: Pytest
- run: pytest fittrackee -n auto --maxprocesses=2 -p no:warnings --cov fittrackee --cov-report term-missing --maxfail=1
-
- postgresql:
- if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
- name: postgresql ${{ matrix.psql-version }} (python 3.11)
- runs-on: ubuntu-latest
- container: python:3.11
- services:
- postgres:
- image: postgres:${{ matrix.psql-version }}
- env:
- POSTGRES_PASSWORD: postgres
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- strategy:
- matrix:
- psql-version: [ "12", "13", "14", "16", "17" ]
- steps:
- - uses: actions/checkout@v4
- - name: Install Poetry and Dependencies
- run: |
- python -m pip install --upgrade pip
- pip install --quiet poetry
- poetry config virtualenvs.create false
- poetry install --no-interaction --quiet
- - name: Create test databases
- run: python db/create_ci_test_db.py
- - name: Pytest
- run: pytest fittrackee -n auto --maxprocesses=2 -p no:warnings --cov fittrackee --cov-report term-missing --maxfail=1
-
- end2end:
- if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
- name: e2e tests
- runs-on: ubuntu-latest
- needs: ["python"]
- container: python:3.11
- services:
- postgres:
- image: postgres:15
- env:
- POSTGRES_DB: fittrackee_test
- POSTGRES_USER: fittrackee
- POSTGRES_PASSWORD: fittrackee
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- selenium:
- image: selenium/standalone-firefox
- mailhog:
- image: mailhog/mailhog:latest
- redis:
- image: redis:latest
- env:
- APP_SETTINGS: fittrackee.config.End2EndTestingConfig
- EMAIL_URL: "smtp://mailhog:1025"
- REDIS_URL: "redis://redis:6379"
- steps:
- - uses: actions/checkout@v4
- - name: Install Poetry and Dependencies
- run: |
- python -m pip install --upgrade pip
- pip install --quiet poetry
- poetry config virtualenvs.create false
- poetry install --no-interaction --quiet
- - name: Run migrations
- run: flask db upgrade --directory fittrackee/migrations
- - name: Start application and run tests with Selenium
- run: |
- setsid nohup flask run --with-threads -h 0.0.0.0 -p 5000 >> nohup.out 2>&1 &
- export TEST_APP_URL=http://$(hostname --ip-address):5000
- sleep 5
- nohup flask worker --processes=1 >> nohup.out 2>&1 &
- pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444 --maxfail=1
-
- end2end_package:
- if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
- name: e2e tests with package
- runs-on: ubuntu-latest
- needs: ["python"]
- container: python:3.11
- services:
- postgres:
- image: postgres:15
- env:
- POSTGRES_DB: fittrackee_test
- POSTGRES_USER: fittrackee
- POSTGRES_PASSWORD: fittrackee
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- selenium:
- image: selenium/standalone-firefox
- mailhog:
- image: mailhog/mailhog:latest
- redis:
- image: redis:latest
- env:
- APP_SETTINGS: fittrackee.config.End2EndTestingConfig
- EMAIL_URL: "smtp://mailhog:1025"
- REDIS_URL: "redis://redis:6379"
- HOST: "0.0.0.0"
- PORT: 5000
- steps:
- - uses: actions/checkout@v4
- - name: Update pip and install build
- run: python3 -m pip install --upgrade pip build
- - name: Create and source virtual environment
- run: |
- python3 -m venv .venv
- . .venv/bin/activate
- - name: Build fittrackee package
- run: python3 -m build
- - name: Install fittrackee package
- run: python3 -m pip install dist/fittrackee-$(cat VERSION).tar.gz
- - name: Run migrations
- run: ftcli db upgrade
- - name: Install pytest and selenium
- run: python3 -m pip install pytest==8.2.0 pytest-selenium==4.1.0 selenium==4.20.0 pytest-html==4.1.1
- - name: Start application and run tests with Selenium
- run: |
- setsid nohup fittrackee >> nohup.out 2>&1 &
- export TEST_APP_URL=http://$(hostname --ip-address):5000
- sleep 5
- nohup flask worker --processes=1 >> nohup.out 2>&1 &
- pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444 --maxfail=1
-
- end2end_package_update:
- if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
- name: e2e tests after update
- runs-on: ubuntu-latest
- needs: ["python"]
- container: python:3.11
- services:
- postgres:
- image: postgres:15
- env:
- POSTGRES_DB: fittrackee_test
- POSTGRES_USER: fittrackee
- POSTGRES_PASSWORD: fittrackee
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- selenium:
- image: selenium/standalone-firefox
- mailhog:
- image: mailhog/mailhog:latest
- redis:
- image: redis:latest
- env:
- APP_SETTINGS: fittrackee.config.End2EndTestingConfig
- EMAIL_URL: "smtp://mailhog:1025"
- REDIS_URL: "redis://redis:6379"
- HOST: "0.0.0.0"
- PORT: 5000
- steps:
- - uses: actions/checkout@v4
- - name: Update pip and install build
- run: python3 -m pip install --upgrade pip build
- - name: Create and source virtual environment
- run: |
- python3 -m venv .venv
- . .venv/bin/activate
- - name: Install previous version of fittrackee from PyPI
- run: python3 -m pip install fittrackee
- - name: Run migrations
- run: ftcli db upgrade
- - name: Build fittrackee package
- run: python3 -m build
- - name: Install fittrackee package to update instance
- run: python3 -m pip install dist/fittrackee-$(cat VERSION).tar.gz
- - name: Run migrations to update database
- run: ftcli db upgrade
- - name: Install pytest and selenium
- run: python3 -m pip install pytest==8.2.0 pytest-selenium==4.1.0 selenium==4.20.0 pytest-html==4.1.1
- - name: Start application and run tests with Selenium
- run: |
- setsid nohup fittrackee >> nohup.out 2>&1 &
- export TEST_APP_URL=http://$(hostname --ip-address):5000
- sleep 5
- nohup flask worker --processes=1 >> nohup.out 2>&1 &
- pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444 --maxfail=1
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 92790c517..c94095ee0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,38 @@
# Change log
+## Version 0.8.13 (2024/12/29)
+
+### Translations
+
+* [PR#667](https://github.com/SamR1/FitTrackee/pull/667) - Translations update (Galicien)
+
+Translation status:
+- Basque: 100%
+- Bulgarian: 98%
+- Czech: 72%
+- Dutch: 99%
+- English: 100%
+- French: 100%
+- Galician: 100%
+- German: 100%
+- Italian: 81%
+- Norwegian Bokmål: 52%
+- Polish: 100%
+- Portuguese: 97%
+- Russian: 62%
+- Spanish: 100%
+
+### Misc
+
+* [#126](https://github.com/SamR1/FitTrackee/issues/126) - Docker's Container on docker hub
+* [PR#673](https://github.com/SamR1/FitTrackee/pull/673) - Publish package on PyPI using GitHub Actions workflow
+
+
+Thanks to the contributors:
+- @DavidHenryThoreau
+- @xmgz
+
+
## Version 0.8.12 (2024/11/17)
### Bugs Fixed
@@ -11,7 +44,6 @@
* [PR#651](https://github.com/SamR1/FitTrackee/pull/651) - Tests - add databases to parallelize more tests
-
## Version 0.8.11 (2024/10/30)
**FitTrackee** is now available for Python 3.13.
diff --git a/Dockerfile b/Dockerfile
index aa6df7caf..bd48973a8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,22 +1,51 @@
-FROM python:3.10
+FROM node:23-alpine AS node-builder
+
+RUN mkdir -p /usr/src/app/fittrackee_client /usr/src/app/fittrackee
+WORKDIR /usr/src/app/fittrackee_client
+
+ENV PATH=/usr/src/app/fittrackee_client/node_modules/.bin:$PATH
+COPY fittrackee_client/package.json /usr/src/app/fittrackee_client/package.json
+COPY fittrackee_client/yarn.lock /usr/src/app/fittrackee_client/yarn.lock
+RUN yarn install --silent --network-timeout 300000
+
+COPY fittrackee_client/. /usr/src/app/fittrackee_client
+RUN yarn build
+
+FROM python:3.13-alpine AS python-builder
+
+RUN mkdir -p /usr/src/app/
+WORKDIR /usr/src/app/
+
+ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 \
+ POETRY_VIRTUALENVS_CREATE=false \
+ POETRY_NO_INTERACTION=1 \
+ VIRTUAL_ENV=/opt/venv
+
+COPY pyproject.toml poetry.lock README.md /usr/src/app/
+COPY fittrackee/. /usr/src/app/fittrackee/
+RUN rm -rf /usr/src/app/fittrackee/tests
+
+RUN python3 -m venv $VIRTUAL_ENV && pip install --upgrade pip
+RUN pip install poetry==1.8.5 && . $VIRTUAL_ENV/bin/activate && poetry install --only main --no-interaction --quiet
+
+FROM python:3.13-alpine AS runtime
+
+RUN apk add --no-cache tini
+
+RUN addgroup -g 1000 -S fittrackee && \
+ adduser -H -D -u 1000 -S fittrackee -G fittrackee
-# set working directory
-RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
-# copy source files
-COPY . /usr/src/app
-
-# install requirements
-ENV VIRTUAL_ENV=/opt/venv
-RUN python3 -m venv $VIRTUAL_ENV
-ENV PATH="$VIRTUAL_ENV/bin:$PATH"
-RUN pip install --upgrade pip
-RUN pip install poetry
-RUN . $VIRTUAL_ENV/bin/activate && poetry install --no-interaction --quiet
-
-# run fittrackee server
-COPY ./docker-entrypoint.sh /docker-entrypoint.sh
-COPY ./docker/set-admin.sh /usr/bin/set-admin
-RUN chmod +x /usr/bin/set-admin && chmod +x /docker-entrypoint.sh
-ENTRYPOINT [ "/docker-entrypoint.sh" ]
\ No newline at end of file
+ENV VIRTUAL_ENV=/opt/venv PATH="/opt/venv/bin:$PATH"
+
+COPY --chown=fittrackee --from=python-builder /opt/venv "$VIRTUAL_ENV"
+COPY --chown=fittrackee --from=python-builder /usr/src/app/fittrackee /usr/src/app/fittrackee
+COPY --chown=fittrackee --from=node-builder /usr/src/app/fittrackee/dist /usr/src/app/fittrackee/dist
+COPY --chown=fittrackee docker-entrypoint.sh /usr/src/app/
+
+RUN chmod 555 /usr/src/app/docker-entrypoint.sh
+
+USER fittrackee
+
+ENTRYPOINT ["/sbin/tini", "--"]
\ No newline at end of file
diff --git a/Dockerfile-dev b/Dockerfile-dev
new file mode 100644
index 000000000..62d2226a4
--- /dev/null
+++ b/Dockerfile-dev
@@ -0,0 +1,22 @@
+FROM python:3.13-slim
+
+# set working directory
+RUN mkdir -p /usr/src/app/data/uploads /usr/src/app/data/logs
+WORKDIR /usr/src/app
+
+# copy source files
+COPY . /usr/src/app
+
+# install requirements
+ENV VIRTUAL_ENV=/opt/venv
+RUN python3 -m venv $VIRTUAL_ENV
+ENV PATH="$VIRTUAL_ENV/bin:$PATH"
+RUN pip install --upgrade pip
+RUN pip install poetry
+RUN . $VIRTUAL_ENV/bin/activate && poetry install --no-interaction --quiet
+
+# run fittrackee server and workers
+COPY ./docker-entrypoint-dev.sh /docker-entrypoint.sh
+COPY ./docker/set-admin.sh /usr/bin/set-admin
+RUN chmod +x /usr/bin/set-admin && chmod +x /docker-entrypoint.sh
+ENTRYPOINT [ "/docker-entrypoint.sh" ]
\ No newline at end of file
diff --git a/Makefile b/Makefile
index b19c37597..34d6c1c05 100644
--- a/Makefile
+++ b/Makefile
@@ -67,7 +67,8 @@ docker-lint-client:
docker compose -f docker-compose-dev.yml exec fittrackee_client $(NPM) type-check
docker-lint-python: docker-run
- docker compose -f docker-compose-dev.yml exec fittrackee docker/lint-python.sh
+ docker compose -f docker-compose-dev.yml exec fittrackee mypy fittrackee
+ docker compose -f docker-compose-dev.yml exec fittrackee ruff check fittrackee e2e
docker-logs:
docker compose -f docker-compose-dev.yml logs --follow
@@ -95,7 +96,7 @@ docker-set-admin:
docker compose -f docker-compose-dev.yml exec fittrackee ftcli users update $(USERNAME) --set-admin true
docker-shell:
- docker compose -f docker-compose-dev.yml exec fittrackee docker/shell.sh
+ docker compose -f docker-compose-dev.yml exec fittrackee /bin/bash
docker-stop:
docker compose -f docker-compose-dev.yml stop
@@ -114,7 +115,7 @@ docker-test-e2e: docker-run
docker compose -f docker-compose-dev.yml exec fittrackee docker/test-e2e.sh $(PYTEST_ARGS)
docker-test-python: docker-run
- docker compose -f docker-compose-dev.yml exec fittrackee docker/test-python.sh $(PYTEST_ARGS)
+ docker compose -f docker-compose-dev.yml exec fittrackee pytest fittrackee $(PYTEST_ARGS)
docker-type-check:
echo 'Running mypy in docker...'
diff --git a/README.md b/README.md
index 65e90ea2c..2db229d7f 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# FitTrackee
**A simple self-hosted workout/activity tracker.**
-[![PyPI version](https://img.shields.io/pypi/v/fittrackee.svg)](https://pypi.org/project/fittrackee/)
+
[![Python Version](https://img.shields.io/pypi/pyversions/fittrackee.svg)](https://python.org)
[![Flask Version](https://img.shields.io/badge/flask-3.1-brightgreen.svg)](http://flask.pocoo.org/)
[![code formatter: ruff](https://img.shields.io/badge/code%20formatter-ruff-d7ff64)](https://docs.astral.sh/ruff/)
@@ -9,10 +9,10 @@
[![Vue Version](https://img.shields.io/badge/vue-3.5-brightgreen.svg)](https://v3.vuejs.org/)
[![code formatter: prettier](https://img.shields.io/badge/code%20formatter-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Typescript Version](https://img.shields.io/npm/types/typescript)](https://www.typescriptlang.org/)
+[![PyPI version](https://img.shields.io/pypi/v/fittrackee.svg)](https://pypi.org/project/fittrackee/) [![docker: fittrackee/fittrackee](https://img.shields.io/badge/docker-fittrackee/fittrackee-2f7bee)](https://hub.docker.com/r/fittrackee/fittrackee)
[![pipeline status](https://github.com/SamR1/FitTrackee/actions/workflows/.tests-python.yml/badge.svg)](https://github.com/SamR1/FitTrackee/actions/workflows/.tests-python.yml)
[![pipeline status](https://github.com/SamR1/FitTrackee/actions/workflows/.tests-javascript.yml/badge.svg)](https://github.com/SamR1/FitTrackee/actions/workflows/.tests-javascript.yml)
-[![translation status](https://hosted.weblate.org/widgets/fittrackee/-/svg-badge.svg)](https://hosted.weblate.org/engage/fittrackee/)
-
+[![translation status](https://hosted.weblate.org/widgets/fittrackee/-/svg-badge.svg)](https://hosted.weblate.org/engage/fittrackee/)
---
Web application allowing tracking of outdoor activities (workouts) from GPX files, \
diff --git a/VERSION b/VERSION
index 7eff8ab95..c2f73c6ec 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.8.12
+0.8.13
diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml
index 3f4dc2ce6..a4550c182 100644
--- a/docker-compose-dev.yml
+++ b/docker-compose-dev.yml
@@ -1,7 +1,10 @@
+# docker compose for evaluation and development only
+# not suitable for production
+
services:
fittrackee-db:
container_name: fittrackee-db
- image: postgres:13
+ image: postgres:17-alpine
ports:
- "5435:5432"
environment:
@@ -18,11 +21,13 @@ services:
fittrackee:
container_name: fittrackee
- build: .
+ build:
+ context: .
+ dockerfile: Dockerfile-dev
ports:
- "5000:5000"
env_file:
- - .env
+ - .env.docker.dev
depends_on:
fittrackee-db:
condition: service_healthy
@@ -32,7 +37,8 @@ services:
condition: service_started
volumes:
- .:/usr/src/app
- - ./data/uploads:/usr/src/app/uploads
+ - ./data/uploads:/usr/src/app/data/uploads
+ - ./data/logs:/usr/src/app/data/logs
fittrackee_client:
container_name: fittrackee_client
@@ -54,7 +60,7 @@ services:
redis:
container_name: fittrackee-redis
- image: "redis:latest"
+ image: "redis:7.4"
hostname: redis
ports:
- "6379:6379"
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 000000000..5833e64d2
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,99 @@
+# docker compose for production
+# (minimal version: Docker Compose version 2.30.0)
+#
+# minimal application (for single user) only needs fittrackee and fittrackee-db containers.
+#
+# for multi-users application, uncomment the following containers:
+# - fittrackee-workers for email sending (EMAIL_URL must be set in .env to enable emails)
+# - fittrackee-redis container for API rate limits and email sending
+
+services:
+ fittrackee-db:
+ container_name: fittrackee-db
+ image: postgres:17-alpine
+ env_file:
+ - .env
+ volumes:
+ - ${DATABASE_DIR:-./data/db}:/var/lib/postgresql/data
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
+ interval: 5s
+ timeout: 15s
+ retries: 3
+ networks:
+ - internal_network
+ restart: unless-stopped
+
+ fittrackee:
+ container_name: fittrackee
+ env_file:
+ - .env
+# Image from Docker Hub
+ image: fittrackee/fittrackee:v0.8.13
+# Uncomment following line to build image instead of using pre-built image
+# build: .
+ volumes:
+ - ${UPLOAD_DIR:-./data/uploads}:/usr/src/app/uploads
+ - ${UPLOAD_LOG:-./data/logs}:/usr/src/app/logs
+ post_start:
+ - command: chown -R fittrackee:fittrackee /usr/src/app/uploads /usr/src/app/logs
+ user: root
+ ports:
+ - "${APP_PORT:-5000}:5000"
+ command: 'sh docker-entrypoint.sh'
+ depends_on:
+ fittrackee-db:
+ condition: service_healthy
+# Uncomment the following lines for API rate limit and email sending
+# fittrackee-redis:
+# condition: service_healthy
+ healthcheck:
+ test: ["CMD-SHELL", "wget --spider http://127.0.0.1:5000/api/ping || exit 1"]
+ interval: 5s
+ timeout: 15s
+ retries: 3
+ networks:
+ - external_network
+ - internal_network
+ restart: unless-stopped
+
+# Uncomment the following lines for email sending
+# fittrackee-workers:
+# container_name: fittrackee-workers
+# env_file:
+# - .env
+## Image from Docker Hub
+# image: fittrackee/fittrackee:v0.8.13
+## Uncomment following line to build image instead of using pre-built image
+## build: .
+# volumes:
+# - ${UPLOAD_LOG:-./data/logs}:/usr/src/app/logs
+# post_start:
+# - command: chown -R fittrackee:fittrackee /usr/src/app/logs
+# user: root
+# command: "flask worker --processes 2 >> /usr/src/app/logs/dramatiq.log 2>&1"
+# depends_on:
+# fittrackee:
+# condition: service_healthy
+# networks:
+# - internal_network
+# - external_network
+# restart: unless-stopped
+
+# Uncomment the following lines for API rate limit and email sending
+# fittrackee-redis:
+# image: "redis:7.4"
+# container_name: fittrackee-redis
+# hostname: redis
+# volumes:
+# - ${REDIS_DIR:-./data/redis}:/data
+# healthcheck:
+# test: ['CMD', 'redis-cli', 'ping']
+# networks:
+# - internal_network
+# restart: unless-stopped
+
+networks:
+ external_network:
+ internal_network:
+ internal: true
\ No newline at end of file
diff --git a/docker-entrypoint-dev.sh b/docker-entrypoint-dev.sh
new file mode 100644
index 000000000..69856551c
--- /dev/null
+++ b/docker-entrypoint-dev.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -e
+
+# Init database
+echo "Initializing database..."
+ftcli db upgrade || { echo "Failed to upgrade database!"; exit 1; }
+
+# Run workers
+echo "Starting workers..."
+flask worker --processes="${WORKERS_PROCESSES:-1}" >> data/logs/dramatiq.log 2>&1 &
+
+# Wait for workers to start
+sleep 3
+
+# Run app
+echo "Starting app..."
+exec flask run --with-threads --host=0.0.0.0
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 3fe02e0e2..3ba387392 100644
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -1,28 +1,10 @@
#!/bin/bash
set -e
-# Change to the application directory
-cd /usr/src/app || exit 1
-
-# Check if the .env file exists and source it
-if [[ -f .env ]]; then
- source .env
-else
- echo ".env file not found!"
- exit 1
-fi
-
-# Init database
-echo "Initializing database..."
+# Upgrade database
+echo "Upgrading database..."
ftcli db upgrade || { echo "Failed to upgrade database!"; exit 1; }
-# Run workers
-echo "Initializing workers..."
-flask worker --processes="${WORKERS_PROCESSES:-1}" >> dramatiq.log 2>&1 &
-
-# Wait for workers to start
-sleep 3
-
-# Run app
-echo "Initializing app..."
-exec flask run --with-threads --host=0.0.0.0
+# Run app w/ gunicorn
+echo "Running app..."
+exec gunicorn -b 0.0.0.0:5000 "fittrackee:create_app()" --error-logfile /usr/src/app/logs/gunicorn.log
diff --git a/docker/lint-python.sh b/docker/lint-python.sh
deleted file mode 100755
index cbf9435e1..000000000
--- a/docker/lint-python.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-set -e
-cd /usr/src/app
-
-source .env
-
-mypy fittrackee
-ruff check fittrackee e2e
\ No newline at end of file
diff --git a/docker/set-admin.sh b/docker/set-admin.sh
deleted file mode 100755
index 84eeb7c08..000000000
--- a/docker/set-admin.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -e
-cd /usr/src/app
-
-source .env
-
-ftcli users update $1 --set-admin true
diff --git a/docker/shell.sh b/docker/shell.sh
deleted file mode 100755
index 55fd7607d..000000000
--- a/docker/shell.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -e
-cd /usr/src/app
-
-source .env
-
-/bin/bash
\ No newline at end of file
diff --git a/docker/test-e2e.sh b/docker/test-e2e.sh
index 97e26e0cd..09b549cfa 100755
--- a/docker/test-e2e.sh
+++ b/docker/test-e2e.sh
@@ -1,8 +1,5 @@
#!/bin/bash
set -e
-cd /usr/src/app
-
-source .env
export TEST_APP_URL=http://$(hostname --ip-address):5000
pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444 $*
\ No newline at end of file
diff --git a/docker/test-python.sh b/docker/test-python.sh
deleted file mode 100755
index 8058b5041..000000000
--- a/docker/test-python.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -e
-cd /usr/src/app
-
-source .env
-
-pytest fittrackee $*
\ No newline at end of file
diff --git a/docs/en/.buildinfo b/docs/en/.buildinfo
index a081914d9..f966400d1 100644
--- a/docs/en/.buildinfo
+++ b/docs/en/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: 3569b0304590d86389f79e54c10d6b9a
+config: 306a9e16d377977980ae964bbcf57f98
tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/en/_images/fittrackee_screenshot-01.png b/docs/en/_images/fittrackee_screenshot-01.png
index 64b285df2..019b6e67a 100644
Binary files a/docs/en/_images/fittrackee_screenshot-01.png and b/docs/en/_images/fittrackee_screenshot-01.png differ
diff --git a/docs/en/_images/fittrackee_screenshot-02.png b/docs/en/_images/fittrackee_screenshot-02.png
index 62063c1af..788de3486 100644
Binary files a/docs/en/_images/fittrackee_screenshot-02.png and b/docs/en/_images/fittrackee_screenshot-02.png differ
diff --git a/docs/en/_images/fittrackee_screenshot-03.png b/docs/en/_images/fittrackee_screenshot-03.png
index a01d55838..28023a9b0 100644
Binary files a/docs/en/_images/fittrackee_screenshot-03.png and b/docs/en/_images/fittrackee_screenshot-03.png differ
diff --git a/docs/en/_images/fittrackee_screenshot-04.png b/docs/en/_images/fittrackee_screenshot-04.png
index 891ddeaca..20074b206 100644
Binary files a/docs/en/_images/fittrackee_screenshot-04.png and b/docs/en/_images/fittrackee_screenshot-04.png differ
diff --git a/docs/en/_images/fittrackee_screenshot-05.png b/docs/en/_images/fittrackee_screenshot-05.png
index e875f94c9..14a36f288 100644
Binary files a/docs/en/_images/fittrackee_screenshot-05.png and b/docs/en/_images/fittrackee_screenshot-05.png differ
diff --git a/docs/en/_images/fittrackee_screenshot-06.png b/docs/en/_images/fittrackee_screenshot-06.png
index 28b6394c5..932a5d79e 100644
Binary files a/docs/en/_images/fittrackee_screenshot-06.png and b/docs/en/_images/fittrackee_screenshot-06.png differ
diff --git a/docs/en/_images/fittrackee_screenshot-07.png b/docs/en/_images/fittrackee_screenshot-07.png
index aac958342..a7ad2d5f6 100644
Binary files a/docs/en/_images/fittrackee_screenshot-07.png and b/docs/en/_images/fittrackee_screenshot-07.png differ
diff --git a/docs/en/_images/fittrackee_screenshot-08.png b/docs/en/_images/fittrackee_screenshot-08.png
index 6d496cda6..f7ae93f7a 100644
Binary files a/docs/en/_images/fittrackee_screenshot-08.png and b/docs/en/_images/fittrackee_screenshot-08.png differ
diff --git a/docs/en/_images/fittrackee_screenshot-09.png b/docs/en/_images/fittrackee_screenshot-09.png
index 980512de0..c0839682d 100644
Binary files a/docs/en/_images/fittrackee_screenshot-09.png and b/docs/en/_images/fittrackee_screenshot-09.png differ
diff --git a/docs/en/_images/fittrackee_screenshot-10.png b/docs/en/_images/fittrackee_screenshot-10.png
index 94ca28350..fbd566f61 100644
Binary files a/docs/en/_images/fittrackee_screenshot-10.png and b/docs/en/_images/fittrackee_screenshot-10.png differ
diff --git a/docs/en/_images/fittrackee_screenshot-11.png b/docs/en/_images/fittrackee_screenshot-11.png
index 01c18fab1..374ea7f01 100644
Binary files a/docs/en/_images/fittrackee_screenshot-11.png and b/docs/en/_images/fittrackee_screenshot-11.png differ
diff --git a/docs/en/_sources/changelog.md.txt b/docs/en/_sources/changelog.md.txt
index 92790c517..c94095ee0 100644
--- a/docs/en/_sources/changelog.md.txt
+++ b/docs/en/_sources/changelog.md.txt
@@ -1,5 +1,38 @@
# Change log
+## Version 0.8.13 (2024/12/29)
+
+### Translations
+
+* [PR#667](https://github.com/SamR1/FitTrackee/pull/667) - Translations update (Galicien)
+
+Translation status:
+- Basque: 100%
+- Bulgarian: 98%
+- Czech: 72%
+- Dutch: 99%
+- English: 100%
+- French: 100%
+- Galician: 100%
+- German: 100%
+- Italian: 81%
+- Norwegian Bokmål: 52%
+- Polish: 100%
+- Portuguese: 97%
+- Russian: 62%
+- Spanish: 100%
+
+### Misc
+
+* [#126](https://github.com/SamR1/FitTrackee/issues/126) - Docker's Container on docker hub
+* [PR#673](https://github.com/SamR1/FitTrackee/pull/673) - Publish package on PyPI using GitHub Actions workflow
+
+
+Thanks to the contributors:
+- @DavidHenryThoreau
+- @xmgz
+
+
## Version 0.8.12 (2024/11/17)
### Bugs Fixed
@@ -11,7 +44,6 @@
* [PR#651](https://github.com/SamR1/FitTrackee/pull/651) - Tests - add databases to parallelize more tests
-
## Version 0.8.11 (2024/10/30)
**FitTrackee** is now available for Python 3.13.
diff --git a/docs/en/_sources/installation.rst.txt b/docs/en/_sources/installation.rst.txt
index 33a2cc03e..43e0db512 100644
--- a/docs/en/_sources/installation.rst.txt
+++ b/docs/en/_sources/installation.rst.txt
@@ -39,15 +39,23 @@ Prerequisites
~~~~~~~~~~~~~
- mandatory
- - Python 3.9+
- - PostgreSQL 12+
+
+ - installation from sources or package:
+
+ - `Python `__ 3.9+
+ - `PostgreSQL `__ 12+
+
+ - installation with Docker:
+
+ - `Docker `__ and `Docker Compose `__ v2.30+
+
- optional
- - Redis for task queue (if email sending is enabled and for data export requests) and API rate limits
- - SMTP provider (if email sending is enabled)
- - API key from a `weather data provider `__
- - `Poetry `__ 1.2+ (for installation from sources only)
- - `Node `__ 18+ and `Yarn `__ (for development only)
- - Docker and Docker Compose (for development or evaluation purposes)
+
+ - `Redis `__ for task queue (if email sending is enabled and for data export requests) and API rate limits (for installation from sources or package)
+ - SMTP provider (if email sending is enabled)
+ - API key from a `weather data provider `__
+ - `Poetry `__ 1.2+ (for installation from sources only)
+ - `Node `__ 18+ and `Yarn `__ (for development only)
.. note::
| If registration is enabled, it is recommended to set Redis and a SMTP provider for email sending and data export requests.
@@ -260,6 +268,53 @@ deployment method.
.. versionchanged:: 0.7.26 ⚠️ replaces ``VUE_APP_API_URL``
+ **FitTrackee** API URL, only needed in dev environment.
+
+Docker
+^^^^^^
+
+.. versionadded:: 0.8.13
+
+Environment variables for ``docker-compose.yml``
+
+.. envvar:: APP_PORT
+
+ Application container port
+
+
+.. envvar:: DATABASE_DIR
+
+ Host directory for PostgreSQL data volume
+
+
+.. envvar:: POSTGRES_USER
+
+ User for PostgreSQL database
+
+
+.. envvar:: POSTGRES_PASSWORD
+
+ Password for PostgreSQL user
+
+
+.. envvar:: POSTGRES_DB
+
+ Database name for FitTrackee application
+
+
+.. envvar:: REDIS_DIR
+
+ Host directory for redis data volume
+
+
+.. envvar:: LOG_DIR
+
+ Host directory for logs volume
+
+
+.. envvar:: UPLOAD_DIR
+
+ Host directory for uploaded files volume
Emails
@@ -529,13 +584,13 @@ Production environment
.. warning::
| Note that FitTrackee is under heavy development, some features may be unstable.
-- Download the last release (for now, it is the release v0.8.12):
+- Download the last release (for now, it is the release v0.8.13):
.. code:: bash
- $ wget https://github.com/SamR1/FitTrackee/archive/v0.8.12.tar.gz
- $ tar -xzf v0.8.12.tar.gz
- $ mv FitTrackee-0.8.12 FitTrackee
+ $ wget https://github.com/SamR1/FitTrackee/archive/v0.8.13.tar.gz
+ $ tar -xzf v0.8.13.tar.gz
+ $ mv FitTrackee-0.8.13 FitTrackee
$ cd FitTrackee
- Create **.env** from example and update it
@@ -666,13 +721,13 @@ Prod environment
- Change to the directory where FitTrackee directory is located
-- Download the last release (for now, it is the release v0.8.12) and overwrite existing files:
+- Download the last release (for now, it is the release v0.8.13) and overwrite existing files:
.. code:: bash
- $ wget https://github.com/SamR1/FitTrackee/archive/v0.8.12.tar.gz
- $ tar -xzf v0.8.12.tar.gz
- $ cp -R FitTrackee-0.8.12/* FitTrackee/
+ $ wget https://github.com/SamR1/FitTrackee/archive/v0.8.13.tar.gz
+ $ tar -xzf v0.8.13.tar.gz
+ $ cp -R FitTrackee-0.8.13/* FitTrackee/
$ cd FitTrackee
- Update **.env** if needed (see `Environment variables `__).
@@ -834,15 +889,50 @@ Examples:
Docker
~~~~~~
-Installation
-^^^^^^^^^^^^
-
.. versionadded:: 0.4.4
+.. versionchanged:: 0.5.0 add client application for development
+.. versionchanged:: 0.8.13 add docker image for production
+
+
+Production
+^^^^^^^^^^
+
+Images are available on `DockerHub `_ or `Github registry `_.
+
+.. note::
+
+ Images are available for ``linux/amd64`` and ``linux/arm64`` platforms. Only ``linux/amd64`` image has been tested.
+
+- create a ``docker-compose.yml`` file as needed (see the example in the repository):
+
+ - the minimal set up requires at least the database and the web application
+ - to activate the rate limit, redis is required
+ - to send e-mails, redis and workers are required and a valid ``EMAIL_URL`` variable must be set in ``.env``
+
+.. note::
+ The same image is used by the web application and workers.
+
+- create ``.env`` from example (``.env.docker.example``) and update it (see `Environment variables `__).
+
+- to start the application:
-For **evaluation** purposes, docker files are available, installing **FitTrackee** from **sources**.
+.. code:: bash
+
+ $ docker compose up -d
.. warning::
- Docker files are not suitable for production installation.
+
+ Migrations are executed at startup. Please backup data before updating FitTrackee image version.
+
+- to run a CLI command, for instance to give admin rights:
+
+.. code:: bash
+
+ $ docker compose exec fittrackee ftcli users update --set-admin true
+
+
+Development
+^^^^^^^^^^^
- To install and run **FitTrackee**:
@@ -850,7 +940,6 @@ For **evaluation** purposes, docker files are available, installing **FitTrackee
$ git clone https://github.com/SamR1/FitTrackee.git
$ cd FitTrackee
- $ cp .env.docker .env
$ make docker-run
- Open http://localhost:5000 and register.
@@ -878,12 +967,6 @@ Open http://localhost:8025 to access `MailHog interface
- Authentication and account - FitTrackee 0.8.12 documentation
+ Authentication and account - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
diff --git a/docs/en/api/configuration.html b/docs/en/api/configuration.html
index aeccfe3c2..198648c75 100644
--- a/docs/en/api/configuration.html
+++ b/docs/en/api/configuration.html
@@ -6,7 +6,7 @@
- Configuration - FitTrackee 0.8.12 documentation
+ Configuration - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
diff --git a/docs/en/api/equipment_types.html b/docs/en/api/equipment_types.html
index 9830c06fe..e90cf09c4 100644
--- a/docs/en/api/equipment_types.html
+++ b/docs/en/api/equipment_types.html
@@ -6,7 +6,7 @@
- Equipment Types - FitTrackee 0.8.12 documentation
+ Equipment Types - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
diff --git a/docs/en/api/equipments.html b/docs/en/api/equipments.html
index a108688f4..1561ccbb4 100644
--- a/docs/en/api/equipments.html
+++ b/docs/en/api/equipments.html
@@ -6,7 +6,7 @@
- Equipments - FitTrackee 0.8.12 documentation
+ Equipments - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
diff --git a/docs/en/api/index.html b/docs/en/api/index.html
index bddef026f..3a98d63d9 100644
--- a/docs/en/api/index.html
+++ b/docs/en/api/index.html
@@ -6,7 +6,7 @@
- API documentation - FitTrackee 0.8.12 documentation
+ API documentation - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
diff --git a/docs/en/api/oauth2.html b/docs/en/api/oauth2.html
index 36c034ec5..624d86fcf 100644
--- a/docs/en/api/oauth2.html
+++ b/docs/en/api/oauth2.html
@@ -6,7 +6,7 @@
- OAuth2 - FitTrackee 0.8.12 documentation
+ OAuth2 - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
-
+
diff --git a/docs/en/api/records.html b/docs/en/api/records.html
index c733e4aef..539faadf7 100644
--- a/docs/en/api/records.html
+++ b/docs/en/api/records.html
@@ -6,7 +6,7 @@
- Records - FitTrackee 0.8.12 documentation
+ Records - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
-
+
diff --git a/docs/en/api/sports.html b/docs/en/api/sports.html
index 26054e934..36c4085b2 100644
--- a/docs/en/api/sports.html
+++ b/docs/en/api/sports.html
@@ -6,7 +6,7 @@
- Sports - FitTrackee 0.8.12 documentation
+ Sports - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
-
+
diff --git a/docs/en/api/stats.html b/docs/en/api/stats.html
index 23c2baf81..74100d4db 100644
--- a/docs/en/api/stats.html
+++ b/docs/en/api/stats.html
@@ -6,7 +6,7 @@
- Statistics - FitTrackee 0.8.12 documentation
+ Statistics - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
diff --git a/docs/en/api/users.html b/docs/en/api/users.html
index 5f1ab9beb..fc1731dc2 100644
--- a/docs/en/api/users.html
+++ b/docs/en/api/users.html
@@ -6,7 +6,7 @@
- Users - FitTrackee 0.8.12 documentation
+ Users - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
-
+
diff --git a/docs/en/api/workouts.html b/docs/en/api/workouts.html
index 0ddba3a46..1d72cfe25 100644
--- a/docs/en/api/workouts.html
+++ b/docs/en/api/workouts.html
@@ -6,7 +6,7 @@
- Workouts - FitTrackee 0.8.12 documentation
+ Workouts - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@
-
+
diff --git a/docs/en/changelog.html b/docs/en/changelog.html
index f938d7e43..76f3614f7 100644
--- a/docs/en/changelog.html
+++ b/docs/en/changelog.html
@@ -6,7 +6,7 @@
- Change log - FitTrackee 0.8.12 documentation
+ Change log - FitTrackee 0.8.13 documentation
@@ -169,7 +169,7 @@