chiark / gitweb /
Make stats retrieval more configurable
authorCiaran Gultnieks <ciaran@ciarang.com>
Tue, 2 Sep 2014 17:53:22 +0000 (18:53 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Tue, 2 Sep 2014 17:53:36 +0000 (18:53 +0100)
examples/config.py
fdroidserver/common.py
fdroidserver/stats.py

index 5f8dfdcfd919a90445c9b0917095d9c904f4b4f3..a2cc50fc925b39178c97a72fde4c37bf87a57b76 100644 (file)
@@ -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'
index 6e9cf1ec1b8070f85c89725340f61da1c8528b2d..1d262a257ddcafbbcfd4147c92f8c56f4ba685b3 100644 (file)
@@ -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,
index 4c2a5effb396741c7d5969edfe001dec74349a32..05c44d3fdad62ebbb486c9e49cbfe4d029882e8f 100644 (file)
@@ -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")