-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from caarmen/structured-app-conf
Move some configuration out of the .env file and into a `config/app.yaml` file.
- Loading branch information
Showing
26 changed files
with
328 additions
and
179 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,30 +1,8 @@ | ||
SERVER_URL=http://localhost:8000/ | ||
DATABASE_PATH=/tmp/data/slackhealthbot.db | ||
|
||
WITHINGS_CLIENT_ID=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef | ||
WITHINGS_CLIENT_SECRET=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef | ||
WITHINGS_CALLBACK_URL=http://localhost:8000/ | ||
|
||
FITBIT_CLIENT_ID=01A2B3 | ||
FITBIT_CLIENT_SECRET=0123456789abcdef0123456789abcdef | ||
FITBIT_CLIENT_SUBSCRIBER_VERIFICATION_CODE=0123456789abcdef0123456789abcdef0123456789abcdef1023456789abcdef | ||
FITBIT_POLL_ENABLED=true | ||
FITBIT_POLL_INTERVAL_S=3600 | ||
|
||
# For FITBIT_ACTIVITY_TYPE_IDS: | ||
# See https://dev.fitbit.com/build/reference/web-api/activity/get-all-activity-types/ | ||
# for the list of all supported activity types and their ids. | ||
# Some examples: | ||
# 55001: Spinning | ||
# 90013: Walk | ||
# 90001: Bike | ||
# 90019: Treadmill | ||
# 1071: Outdoor Bike | ||
FITBIT_REALTIME_ACTIVITY_TYPE_IDS=[55001, 90013] | ||
FITBIT_DAILY_ACTIVITY_TYPE_IDS=[90019] | ||
FITBIT_DAILY_ACTIVITY_POST_TIME=23:50 | ||
FITBIT_ACTIVITY_RECORD_HISTORY_DAYS=180 | ||
|
||
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXXXX/abcdefghijklmnopqrstuvwx | ||
|
||
SQL_LOG_LEVEL=WARNING | ||
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXXXX/abcdefghijklmnopqrstuvwx |
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 |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
.coverage | ||
reports/ | ||
__pycache__/ | ||
config/app-merged.yaml | ||
config/app-custom.yaml |
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 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 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,3 @@ | ||
# Place any overrides of the default values, from app-default.yaml, into this file. | ||
logging: | ||
sql_log_level: "DEBUG" # example override: set sql logging to DEBUG |
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,52 @@ | ||
# Configuration of the slack-health-bot application | ||
server_url: "http://localhost:8000/" # The url to access the slack-health-bot server for login. | ||
database_path: "/tmp/data/slackhealthbot.db" # The location to the database file. | ||
logging: | ||
sql_log_level: "WARNING" | ||
|
||
# Withings-specific configuration: | ||
# Note that secrets like the client id and client secret are configured in the .env file. | ||
withings: | ||
callback_url: "http://localhost:8000/" # The url that withings will call at the end of SSO. | ||
|
||
# Fitbit-specific configuration: | ||
# Note that secrets like the client id and client secret are configured in the .env file. | ||
fitbit: | ||
poll: | ||
enabled: true # If your server can't receive webhook calls from fitbit, activate polling instead, to fetch data from fitbit. | ||
interval_seconds: 3600 # How often to poll fitbit for data. | ||
|
||
activities: | ||
history_days: 180 # how far to look back to report new records of best times/durations/calories/etc. | ||
daily_report_time: "23:50" # Time of day (HH:mm)to post daily reports to slack. | ||
|
||
activity_types: | ||
# Configuration specific to activity types. | ||
# | ||
# For fitbit activity type ids: | ||
# See https://dev.fitbit.com/build/reference/web-api/activity/get-all-activity-types/ | ||
# for the list of all supported activity types and their ids. | ||
# Some examples: | ||
# 55001: Spinning | ||
# 90013: Walk | ||
# 90001: Bike | ||
# 90019: Treadmill | ||
# 1071: Outdoor Bike | ||
# | ||
# supported attributes: | ||
# report_daily: whether a daily summary report should be posted to slack for this activity type | ||
# report_realtime: whether a report should be posted to slack for this activity type as soon as we receive it from fitbit | ||
- name: Treadmill | ||
id: 90019 | ||
report_daily: true | ||
report_realtime: false | ||
|
||
- name: Spinning | ||
id: 55001 | ||
report_daily: false | ||
report_realtime: true | ||
|
||
- name: Walk | ||
id: 90013 | ||
report_daily: false | ||
report_realtime: true |
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 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 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 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 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 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 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 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
Oops, something went wrong.