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

Commit

Permalink
Merge pull request #64 from neilboyd/mmr
Browse files Browse the repository at this point in the history
Implement MapMyRun
  • Loading branch information
neilboyd authored Feb 7, 2021
2 parents c7e0df1 + ed9f858 commit 1ae0455
Show file tree
Hide file tree
Showing 23 changed files with 460 additions and 12 deletions.
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

0 comments on commit 1ae0455

Please sign in to comment.