Commit b454ea3c authored by Ciaran Gultnieks's avatar Ciaran Gultnieks

Make stats retrieval more configurable

parent 27edbd56
......@@ -169,6 +169,12 @@ update_stats = False
# calculation purposes.
stats_ignore = []
# Server stats logs are retrieved from. Required when update_stats is True.
stats_server = "example.com"
# User stats logs are retrieved from. Required when update_stats is True.
stats_user = "bob"
# Use the following to push stats to a Carbon instance:
stats_to_carbon = False
carbon_host = '0.0.0.0'
......
......@@ -50,6 +50,8 @@ def get_default_config():
'sync_from_local_copy_dir': False,
'update_stats': False,
'stats_ignore': [],
'stats_server': None,
'stats_user': None,
'stats_to_carbon': False,
'repo_maxage': 0,
'build_server_always': False,
......
......@@ -91,8 +91,8 @@ def main():
logging.info('Retrieving logs')
ssh = paramiko.SSHClient()
ssh.load_system_host_keys()
ssh.connect('f-droid.org', username='fdroid', timeout=10,
key_filename=config['webserver_keyfile'])
ssh.connect(config['stats_server'], username=config['stats_user'],
timeout=10, key_filename=config['webserver_keyfile'])
ftp = ssh.open_sftp()
ftp.get_channel().settimeout(60)
logging.info("...connected")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment