-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
major rewrite and update for Python 3
- Loading branch information
Showing
25 changed files
with
840 additions
and
1,103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
runme.sh | ||
*.pyc | ||
runme2.sh | ||
weight.fit | ||
.DS_Store | ||
config/withings_user.json | ||
*.egg-info/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM python:3.8-alpine | ||
|
||
RUN apk add --update --no-cache libxml2-dev libxslt-dev gcc musl-dev | ||
|
||
# Profit from Docker build cache buy building python lxml here.. | ||
RUN pip3 install lxml requests | ||
|
||
RUN mkdir -p /src | ||
COPY . /src | ||
|
||
RUN cd /src && \ | ||
python3 ./setup.py install | ||
|
||
ENTRYPOINT ["withings-sync"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include withings_sync/config/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
apiVersion: "v1 | ||
kind: Namespace | ||
metadata: | ||
name: withings | ||
--- | ||
# Secret for Garmin and TrainerRoad credentials | ||
# PLEASE CHANGE! | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: credentials | ||
namespace: withings | ||
type: Opaque | ||
data: | ||
# Base64 encoded!!! | ||
GARMIN_PASSWORD: "" | ||
GARMIN_USERNAME: "" | ||
TRAINERROAD_PASSWORD: "" | ||
TRAINERROAD_USERNAME: "" | ||
--- | ||
# PVC for storing Withings OAuth tokens | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
finalizers: | ||
- kubernetes.io/pvc-protection | ||
name: withings-oauth-cache | ||
namespace: withings | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Mi | ||
volumeMode: Filesystem | ||
--- | ||
apiVersion: batch/v1beta1 | ||
kind: CronJob | ||
metadata: | ||
name: withings-garmin-sync | ||
namespace: withings | ||
spec: | ||
concurrencyPolicy: Allow | ||
failedJobsHistoryLimit: 1 | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- args: | ||
- -v | ||
env: | ||
- name: HOME | ||
value: /root | ||
envFrom: | ||
- secretRef: | ||
name: credentials | ||
image: stv0g/withings-sync | ||
imagePullPolicy: Always | ||
name: withings-garmin-sync | ||
volumeMounts: | ||
- mountPath: /root/ | ||
name: oauth-cache | ||
restartPolicy: Never | ||
volumes: | ||
- name: oauth-cache | ||
persistentVolumeClaim: | ||
claimName: withings-oauth-cache | ||
schedule: '*/15 * * * *' | ||
successfulJobsHistoryLimit: 3 | ||
Oops, something went wrong.