pastafari2/libraries/configtask.py
Antonio de la Rosa 802fccc162 Added fix in api
2025-05-23 01:36:31 +02:00

89 lines
1.6 KiB
Python

#!/usr/bin/env python3
import os
class ConfigTask:
def __init__(self):
#Local paths
# Scheme: code task: {description task, module task}
self.libraries={}
self.base_path=os.path.dirname(os.path.dirname(__file__))
self.tasks_path=['tasks', 'modules/pastafari2/tasks']
self.scripts_path=['scripts', 'modules/pastafari2/scripts']
self.logs_path='logs'
#Remote paths
self.remote_path='/home/spanel'
#Relative to remote_path
self.tmp_sftp_path='tmp'
self.remote_user='spanel'
self.remote_password=None
#Local home
self.home=''
#SSH configuration
self.user_key=''
self.public_key=''
self.private_key=''
self.password_key=None
self.port=22
self.deny_missing_host_key=True
#Internal tasks
self.num_of_forks=10
self.stop_if_error=False
self.num_errors=0
self.num_success=0
self.num_total=0
self.num_servers=0
self.file_resume=None
#Used if in next versions, pastafari try use others tasks servers.
self.server_task='http://127.0.0.1:1337'
self.url_host=''
self.url_monit=''
self.api_key=''
self.ssh_directory=os.path.expanduser('~')+'/.ssh'
self.ssh_private_key=self.ssh_directory+'/id_rsa'
self.ssh_private_key_password=''
self.ssh_public_key=self.ssh_private_key+'.pub'
# Class for global configuration
config_task=ConfigTask()