mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 15:02:51 +03:00
Make stats retrieval more configurable
This commit is contained in:
parent
27edbd56a7
commit
b454ea3c6f
3 changed files with 10 additions and 2 deletions
|
@ -169,6 +169,12 @@ update_stats = False
|
||||||
# calculation purposes.
|
# calculation purposes.
|
||||||
stats_ignore = []
|
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:
|
# Use the following to push stats to a Carbon instance:
|
||||||
stats_to_carbon = False
|
stats_to_carbon = False
|
||||||
carbon_host = '0.0.0.0'
|
carbon_host = '0.0.0.0'
|
||||||
|
|
|
@ -50,6 +50,8 @@ def get_default_config():
|
||||||
'sync_from_local_copy_dir': False,
|
'sync_from_local_copy_dir': False,
|
||||||
'update_stats': False,
|
'update_stats': False,
|
||||||
'stats_ignore': [],
|
'stats_ignore': [],
|
||||||
|
'stats_server': None,
|
||||||
|
'stats_user': None,
|
||||||
'stats_to_carbon': False,
|
'stats_to_carbon': False,
|
||||||
'repo_maxage': 0,
|
'repo_maxage': 0,
|
||||||
'build_server_always': False,
|
'build_server_always': False,
|
||||||
|
|
|
@ -91,8 +91,8 @@ def main():
|
||||||
logging.info('Retrieving logs')
|
logging.info('Retrieving logs')
|
||||||
ssh = paramiko.SSHClient()
|
ssh = paramiko.SSHClient()
|
||||||
ssh.load_system_host_keys()
|
ssh.load_system_host_keys()
|
||||||
ssh.connect('f-droid.org', username='fdroid', timeout=10,
|
ssh.connect(config['stats_server'], username=config['stats_user'],
|
||||||
key_filename=config['webserver_keyfile'])
|
timeout=10, key_filename=config['webserver_keyfile'])
|
||||||
ftp = ssh.open_sftp()
|
ftp = ssh.open_sftp()
|
||||||
ftp.get_channel().settimeout(60)
|
ftp.get_channel().settimeout(60)
|
||||||
logging.info("...connected")
|
logging.info("...connected")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue