Skip to content

Commit

Permalink
better default config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ksanislo committed Dec 27, 2018
1 parent 17a0bce commit e8932a5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
42 changes: 33 additions & 9 deletions persistent/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
log.level: INFO
---
# This controls the logging verbosity, avaliable choices are:
# CRITICAL, ERROR, WARNING, INFO, or DEBUG
# Log entries for all previous levels are also included.
#log.level: INFO

# These are the username and password used to login to your
# mytotalconnectcomfort.com account to collect your stats.
tcc.username: [email protected]
tcc.password: your-password
tcc.timeout: 10
exporter.host: 0.0.0.0
exporter.port: 9101
exporter.cookiejar: persistent/cookies.txt
exporter.sync_interval: 300

# This makes legacy TCC_* env variables override values from this config file.
legacy.override: True

# This controls adjusts the timeouts used by the exporter.
# Length is specified in seconds. It's generally best to keep
# this set shorter than your prometheus collection interval.
#tcc.timeout: 10

# The local interface to which tcc-exporter will bind for it's service
#exporter.host: 0.0.0.0

# The TCP port number to listen on.
#exporter.port: 9101

# This controls the path where login cookies are stored. If you're using
# the standard docker container, this should be somewhere mounted via
# persistent storage. While not critical, if you don't maintain cookies
# through restarts, it's easy to trigger the too-many-logins message.
#exporter.cookiejar: persistent/cookies.txt

# This controls the minimum age of the exporter.cookiejar file before it
# is overwritten during normal operations. A successful login() doesn't
# check this, so fresh cookies will always be saved immediately.
#exporter.sync_interval: 300

# This allows TCC_* env variables override values from this config file.
#config.override: True
8 changes: 4 additions & 4 deletions tcc-exporter
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from http.cookiejar import LWPCookieJar
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.error import HTTPError

VERSION = '0.9.7'
VERSION = '0.9.8'
CONFIG_FILE = os.environ.get('TCC_CONFIG_FILE', 'persistent/config.yml')
PREFIX = 'https://mytotalconnectcomfort.com/'

Expand Down Expand Up @@ -258,10 +258,10 @@ def load_config():
config['exporter.cookiejar'] = 'persistent/cookies.txt'
if not 'exporter.sync_interval' in config:
config['exporter.sync_interval'] = 300
if not 'legacy.override' in config:
config['legacy.override'] = True
if not 'config.override' in config:
config['config.override'] = True
# Override if allowed.
if 'legacy.override' in config and config['legacy.override']:
if 'config.override' in config and config['config.override']:
# Load environment settings
if os.environ.get('TCC_USERNAME'):
config['tcc.username'] = os.environ.get('TCC_USERNAME')
Expand Down

0 comments on commit e8932a5

Please sign in to comment.