Пример #1
0
 def __init__(self, ssh_api, ssh_status):
     self.ssh_api = ssh_api
     self.ssh_status = ssh_status
     self.logger = Logger()
     self.config_manager = ConfigManager()
     self.jabberd_template_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../conf/ejabberd.yml')
     self.jabberd_out_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../dist/ejabberd.yml')
     self.cmd_ejabberd_install = "sudo apt-get install -y ejabberd=19.09.1-0"
     self.jabberd_des_path = "/tmp"
     self.jabberd_conf_path = "/opt/ejabberd"
     self.cmd_cp_conf = "sudo cp {0}/ejabberd.yml {1}/conf"
     self.cmd_chown_ejabberd = "sudo chown -R ejabberd=ejabberd {0}/conf"
     self.cmd_bin_ejabberd_path = "/opt/ejabberd-19.09.1"
     self.cmd_register = "sudo {0}/bin/ejabberdctl register {1} {2} {3}"
     self.cmd_jabberd_start = "sudo {0}/bin/ejabberdctl start"
     self.cmd_jabberd_restart = "sudo {0}/bin/ejabberdctl restart"
     self.cmd_jabberd_status = "sudo {0}/bin/ejabberdctl status"
     self.cmd_srg_create = "sudo {0}/bin/ejabberdctl srg-create everyone {1} /'everyone/' this_is_everyone everyone"
     self.cmd_srg_user_add = "sudo {0}/bin/ejabberdctl srg-user-add @all@ {1} everyone {1}"
     self.cmd_hold_ejabberd = "sudo apt-mark hold ejabberd"
     self.cmd_copy_ejabberd_service = "sudo cp {0}/bin/ejabberd.service /etc/systemd/system/"
     self.cmd_system_reload = "sudo systemctl daemon-reload"
     self.cmd_enable_ejabberd_service = "sudo systemctl enable ejabberd.service"
Пример #2
0
 def __init__(self):
     super(InstallManager, self).__init__()
     self.util = Util()
     self.ssh_status = ""
     self.logger = Logger()
     self.config_maneger = ConfigManager()
     self.liderahenk_data_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)), 'dist/liderahenk.json')
     self.liderldap_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../dist/lider_ldap.json')
Пример #3
0
 def __init__(self, ssh_api, ssh_status):
     self.ssh_api = ssh_api
     self.ssh_status = ssh_status
     self.logger = Logger()
     self.config_manager = ConfigManager()
     self.jabberd_template_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../conf/ejabberd_temp.yml')
     self.jabberd_out_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../dist/ejabberd.yml')
 def __init__(self):
     self.yaml = YAML()
     self.yaml.indent(mapping=4)
     self.logger = Logger()
     self.installer_config_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../conf/installer_config.yml')
     if not os.path.exists(
             os.path.join(os.path.dirname(os.path.abspath(__file__)),
                          '../../dist')):
         os.makedirs(
             os.path.join(os.path.dirname(os.path.abspath(__file__)),
                          '../../dist'))
Пример #5
0
 def __init__(self):
     self.logger = Logger()
     self.config = configparser.ConfigParser()
     self.installer_config_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../conf/installer_config.yml')
     self.installer_config_path2 = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../conf/installer.conf')
     if not os.path.exists(
             os.path.join(os.path.dirname(os.path.abspath(__file__)),
                          '../../dist')):
         os.makedirs(
             os.path.join(os.path.dirname(os.path.abspath(__file__)),
                          '../../dist'))
Пример #6
0
 def __init__(self, ssh_api, ssh_status):
     self.ssh_api = ssh_api
     self.ssh_status = ssh_status
     self.logger = Logger()
     self.util = Util()
     self.config_manager = ConfigManager()
     self.lider_conf_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../conf/tr.org.liderahenk.cfg')
     self.db_conf_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../conf/tr.org.liderahenk.datasource.cfg')
     self.lider_conf_out_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../dist/tr.org.liderahenk.cfg')
     self.db_conf_out_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../dist/tr.org.liderahenk.datasource.cfg')
Пример #7
0
 def __init__(self, ssh_api, ssh_status):
     self.ssh_api = ssh_api
     self.ssh_status = ssh_status
     self.logger = Logger()
     self.ldap_config_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../conf/ldapconfig_temp')
     self.update_ldap_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../conf/update_ldap_temp')
     self.liderahenk_ldif_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../conf/liderahenk.ldif')
     self.sudo_ldif_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)), '../../conf/sudo.ldif')
     self.ldap_config_out_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../dist/ldapconfig')
     self.update_ldap_out_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../dist/update_ldap')
Пример #8
0
    def __init__(self, ssh_api, ssh_status):
        self.ssh_api = ssh_api
        self.ssh_status = ssh_status
        self.logger = Logger()
        self.util = Util()
        self.config_manager = ConfigManager()
        self.lider_conf_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            '../../conf/tr.org.liderahenk.cfg')
        self.db_conf_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            '../../conf/tr.org.liderahenk.datasource.cfg')
        self.lider_conf_out_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            '../../dist/tr.org.liderahenk.cfg')
        self.db_conf_out_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            '../../dist/tr.org.liderahenk.datasource.cfg')
        self.tomcat_service_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            '../../conf/tomcat.service')
        self.application_properties_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            '../../conf/lider.properties')
        self.application_properties_out_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            '../../dist/lider.properties')
        self.lider_web_url = "http://liderahenk.org/downloads/ROOT.war"
        self.tomcat_tar_url = "http://liderahenk.org/downloads/apache-tomcat-9.0.36.tar.gz"
        self.dist_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)), '../../dist')
        self.liderv2_app_properties_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            '../../dist/liderv2/src/main/resources/lider.properties')

        self.lider_war_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)), '../../conf/ROOT.war')
        self.tomcat_path = os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            '../../conf/apache-tomcat-9.0.36.tar.gz')
    def __init__(self, ssh_api, ssh_status):
        self.ssh_api = ssh_api
        self.ssh_status = ssh_status
        self.logger = Logger()
        self.data = None
        self.liderdb = None

        # Database configuration
        self.cmd_deb_frontend = "export DEBIAN_FRONTEND = \"noninteractive\""
        self.db_debconf_pwd = "echo \'mariadb-server mysql-server/root_password password {0}\' | sudo debconf -set -selections"
        self.db_debconf_pwd_again = "echo \'mariadb-server mysql-server/root_password_again password {0}\' | sudo debconf -set -selections"
        self.cmd_db_install = "sudo apt-get install -y mariadb-server"
        self.cmd_db_dep = "sudo apt-get -f install"
        self.cmd_db_set_password = "******"SET PASSWORD FOR 'root'@'localhost' = PASSWORD('{0}')\";"
        # self.cmd_create_db = "sudo mysql -uroot -p{0} -e \'CREATE DATABASE {1} DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci\'"
        self.cmd_create_db = "CREATE DATABASE {0} DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci"
        # self.cmd_db_replace_bind_addr = "sudo sed -i \'s/^bind-address/#&/\' /etc/mysql/my.cnf"
        self.cmd_db_replace_bind_addr = "sudo sed -i \'s/^bind-address/#&/\' /etc/mysql/mariadb.conf.d/50-server.cnf"
        self.cmd_db_service = "sudo systemctl restart mysql.service"
        self.cmd_db_grant_privileges = "mysql -uroot -p{0} -e \"GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '{1}' WITH GRANT OPTION;\""
        # self.cmd_create_config_table = "mysql -uroot -p{0} -e \"CREATE TABLE {1}.c_config (config_id INT NOT NULL, create_date VARCHAR(45) NOT NULL, modify_date VARCHAR(45) NULL, name VARCHAR(45) NOT NULL, value VARCHAR(45) NULL, PRIMARY KEY (config_id));\""
        self.cmd_create_config_table = "CREATE TABLE c_config (config_id INT NOT NULL, create_date VARCHAR(45) NOT NULL, modify_date VARCHAR(45) NULL, name VARCHAR(45) NOT NULL, value LONGTEXT NULL, PRIMARY KEY (config_id));"
Пример #10
0
 def __init__(self, ssh_api, ssh_status):
     self.ssh_api = ssh_api
     self.ssh_status = ssh_status
     self.logger = Logger()
Пример #11
0
 def __init__(self):
     self.ssh = None
     self.ip = {}
     self.password = None
     self.location = None
     self.logger = Logger()
Пример #12
0
    def __init__(self, ssh_api, ssh_status):
        self.ssh_api = ssh_api
        self.ssh_status = ssh_status
        self.logger = Logger()

        self.cmd_db_grant_privileges = "mysql -uroot -p{0} -e \"GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '{1}' WITH GRANT OPTION;\""