Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Implement MapMyRun #64

Merged
merged 62 commits into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6d6741b
copy everything from original PR
neilboyd Jan 3, 2021
2cd97ce
add variables for key
neilboyd Jan 3, 2021
e01c41f
add key to kubernetes settings
neilboyd Jan 3, 2021
c1e52b9
remove duplicate
neilboyd Jan 3, 2021
ede5686
fix compilation errors
neilboyd Jan 3, 2021
5c16f45
add missing parameters
neilboyd Jan 4, 2021
9f5a7a9
dumb replacement of latest api version urls
neilboyd Jan 4, 2021
891e2ea
do the same as other oauth services
neilboyd Jan 4, 2021
5b18f00
set auth url
neilboyd Jan 4, 2021
d78d066
add method logging
neilboyd Jan 4, 2021
9ac7a76
import
neilboyd Jan 4, 2021
dacf2a7
initial redirect
neilboyd Jan 4, 2021
ef32f20
base on runkeeper
neilboyd Jan 4, 2021
0d607ea
add vscode run config
neilboyd Jan 5, 2021
6004d0a
change for mmf api urls
neilboyd Jan 5, 2021
badebca
add methods to disconnect
neilboyd Jan 5, 2021
6d10923
use header instead of auth
neilboyd Jan 5, 2021
3040663
update url according to docs
neilboyd Jan 5, 2021
a328f40
get activities from MMR
neilboyd Jan 6, 2021
2450582
handle api auth exception the same as runkeeper etc
neilboyd Jan 6, 2021
97f056d
check for next
neilboyd Jan 6, 2021
491d8e0
some api updates
neilboyd Jan 6, 2021
8bcd57c
rename
neilboyd Jan 6, 2021
f206c56
get activity hierarchy
neilboyd Jan 6, 2021
0849c37
get parent activity type
neilboyd Jan 7, 2021
95ddaef
get parent activity type
neilboyd Jan 7, 2021
a0ed920
Merge branch 'mmr' of https://github.com/neilboyd/tapiriik into mmr
neilboyd Jan 11, 2021
bee4349
fix some parameter mismatches
neilboyd Jan 11, 2021
94e9eef
start on DownloadActivity
neilboyd Jan 11, 2021
7d2a8f6
workout properties
neilboyd Jan 12, 2021
17e6602
something with route
neilboyd Jan 12, 2021
e2bc744
get waypoints from api
neilboyd Jan 12, 2021
6e8f612
download waypoints
neilboyd Jan 12, 2021
0838693
check
neilboyd Jan 12, 2021
651f8aa
Merge branch 'master' into mmr
neilboyd Jan 13, 2021
a45573c
mmr is not withdrawn
neilboyd Jan 13, 2021
1b31792
round
neilboyd Jan 13, 2021
58d8fb6
enable option to sync private activities
neilboyd Jan 14, 2021
13568d0
column header
neilboyd Jan 14, 2021
35a1956
undo some stuff that didn't need to change
neilboyd Jan 14, 2021
0c9d61d
typo
neilboyd Jan 14, 2021
ca49d78
throw exception so that it'll retry while I'm coding it
neilboyd Jan 14, 2021
6156785
set stationary and gps to prevent sanity errors
neilboyd Jan 14, 2021
3cae2c5
ignore cache exception
neilboyd Jan 15, 2021
8271dbb
start on MMR UploadActivity - copied from endomondo
neilboyd Jan 20, 2021
ab2f668
some more mmr upload data
neilboyd Jan 21, 2021
7801f38
do MMR as per the doc example
neilboyd Jan 22, 2021
ad54daf
get upload to MMR working, with some missing data, mainly time series
neilboyd Jan 22, 2021
a63982e
start on time series
neilboyd Jan 25, 2021
4e019de
add distance, speed, cadence
neilboyd Jan 25, 2021
4f4000d
more data
neilboyd Jan 25, 2021
47e223e
get more properties from the activity
neilboyd Jan 26, 2021
24c0519
only add non-empty lists to time series
neilboyd Jan 26, 2021
bc195d7
fix units
neilboyd Jan 26, 2021
3534413
update MMR logo
neilboyd Jan 27, 2021
ed6f643
make the image by 50% width of original
neilboyd Jan 27, 2021
83d4f8a
add a new service label
neilboyd Jan 28, 2021
eca94f4
error handling
neilboyd Jan 29, 2021
15e1559
remove excessive logging
neilboyd Jan 29, 2021
acff505
add MMR to list of services on site
neilboyd Feb 1, 2021
6b8ee63
mmr distance is meters
neilboyd Feb 2, 2021
ed9f858
remove recommended extension
neilboyd Feb 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/docker-kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- run

jobs:
build:
Expand Down Expand Up @@ -61,6 +60,8 @@ jobs:
-e 's/SPORTTRACKS_CLIENT_ID/${{ secrets.SPORTTRACKS_CLIENT_ID }}/g' \
-e 's/SPORTTRACKS_CLIENT_SECRET/${{ secrets.SPORTTRACKS_CLIENT_SECRET }}/g' \
-e 's/RWGPS_APIKEY/${{ secrets.RWGPS_APIKEY }}/g' \
-e 's/MAPMYFITNESS_CLIENT_KEY/${{ secrets.MAPMYFITNESS_CLIENT_KEY }}/g' \
-e 's/MAPMYFITNESS_CLIENT_SECRET/${{ secrets.MAPMYFITNESS_CLIENT_SECRET }}/g' \
kubernetes-secrets.yml
sed -i'' -e 's/tapiriik:latest/tapiriik:${{ github.sha }}/g' kubernetes.yml
kubectl apply -f kubernetes-secrets.yml --namespace tapiriik
Expand Down
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-python.python",
"visualstudioexptteam.vscodeintellicode"
]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
}
4 changes: 3 additions & 1 deletion kubernetes-secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ stringData:
strava-client-secret: "STRAVA_CLIENT_SECRET"
sporttracks-client-id: "SPORTTRACKS_CLIENT_ID"
sporttracks-client-secret: "SPORTTRACKS_CLIENT_SECRET"
rwgps-api-key: "RWGPS_APIKEY"
rwgps-api-key: "RWGPS_APIKEY"
mapmyfitness-client-key: "MAPMYFITNESS_CLIENT_KEY"
mapmyfitness-client-secret: "MAPMYFITNESS_CLIENT_SECRET"
20 changes: 20 additions & 0 deletions kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,16 @@ spec:
secretKeyRef:
name: tapiriik-secret
key: rwgps-api-key
- name: MAPMYFITNESS_CLIENT_KEY
valueFrom:
secretKeyRef:
name: tapiriik-secret
key: mapmyfitness-client-key
- name: MAPMYFITNESS_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: tapiriik-secret
key: mapmyfitness-client-secret
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -357,6 +367,16 @@ spec:
secretKeyRef:
name: tapiriik-secret
key: rwgps-api-key
- name: MAPMYFITNESS_CLIENT_KEY
valueFrom:
secretKeyRef:
name: tapiriik-secret
key: mapmyfitness-client-key
- name: MAPMYFITNESS_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: tapiriik-secret
key: mapmyfitness-client-secret
---
apiVersion: v1
kind: Service
Expand Down
1 change: 0 additions & 1 deletion tapiriik/auth/credential_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#### note about tapiriik and credential storage ####
# Some services require a username and password for every action - so they need to be stored in recoverable form
# (namely: Garmin Connect's current "API")
# I've done my best to mitigate the risk that these credentials ever be compromised, but the risk can never be eliminated
# If you're not comfortable with it, you can opt to not have your credentials stored, instead entering them on every sync

Expand Down
3 changes: 3 additions & 0 deletions tapiriik/local_settings.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ TRAININGPEAKS_CLIENT_SECRET = "####"
TRAININGPEAKS_CLIENT_SCOPE = "cats:cuddle dogs:throw-frisbee"
TRAININGPEAKS_API_BASE_URL = "https://api.trainingpeaks.com"
TRAININGPEAKS_OAUTH_BASE_URL = "https://oauth.trainingpeaks.com"

MAPMYFITNESS_CLIENT_KEY = "####"
MAPMYFITNESS_CLIENT_SECRET = "####"
3 changes: 3 additions & 0 deletions tapiriik/local_settings.py.os
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,6 @@ TRAININGPEAKS_CLIENT_SECRET = os.getenv("TRAININGPEAKS_CLIENT_SECRET")
TRAININGPEAKS_CLIENT_SCOPE = "cats:cuddle dogs:throw-frisbee"
TRAININGPEAKS_API_BASE_URL = "https://api.trainingpeaks.com"
TRAININGPEAKS_OAUTH_BASE_URL = "https://oauth.trainingpeaks.com"

MAPMYFITNESS_CLIENT_KEY = os.getenv("MAPMYFITNESS_CLIENT_KEY")
MAPMYFITNESS_CLIENT_SECRET = os.getenv("MAPMYFITNESS_CLIENT_SECRET")
2 changes: 1 addition & 1 deletion tapiriik/services/Endomondo/endomondo.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def UploadActivity(self, serviceRecord, activity):
serviceRecord.SetConfiguration({"DeviceRegistered": True})

activity_id = "tap-" + activity.UID + "-" + str(os.getpid())

sport = self._getSport(activity)

upload_data = {
Expand Down
1 change: 1 addition & 0 deletions tapiriik/services/MapMyFitness/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .mapmyfitness import *
Loading