|
@ -904,145 +904,157 @@ class EEStackController(CementBaseController): |
|
|
@expose() |
|
|
@expose() |
|
|
def install(self, packages=[], apt_packages=[]): |
|
|
def install(self, packages=[], apt_packages=[]): |
|
|
self.msg = [] |
|
|
self.msg = [] |
|
|
if self.app.pargs.web: |
|
|
try: |
|
|
Log.debug(self, "Setting apt_packages variable for Nginx ,PHP" |
|
|
if self.app.pargs.web: |
|
|
" ,MySQL ") |
|
|
Log.debug(self, "Setting apt_packages variable for Nginx ,PHP" |
|
|
self.app.pargs.nginx = True |
|
|
" ,MySQL ") |
|
|
self.app.pargs.php = True |
|
|
self.app.pargs.nginx = True |
|
|
self.app.pargs.mysql = True |
|
|
self.app.pargs.php = True |
|
|
self.app.pargs.wpcli = True |
|
|
self.app.pargs.mysql = True |
|
|
self.app.pargs.postfix = True |
|
|
self.app.pargs.wpcli = True |
|
|
|
|
|
self.app.pargs.postfix = True |
|
|
if self.app.pargs.admin: |
|
|
|
|
|
self.app.pargs.nginx = True |
|
|
if self.app.pargs.admin: |
|
|
self.app.pargs.php = True |
|
|
self.app.pargs.nginx = True |
|
|
self.app.pargs.mysql = True |
|
|
self.app.pargs.php = True |
|
|
self.app.pargs.adminer = True |
|
|
self.app.pargs.mysql = True |
|
|
self.app.pargs.phpmyadmin = True |
|
|
self.app.pargs.adminer = True |
|
|
self.app.pargs.utils = True |
|
|
self.app.pargs.phpmyadmin = True |
|
|
|
|
|
self.app.pargs.utils = True |
|
|
if self.app.pargs.mail: |
|
|
|
|
|
self.app.pargs.nginx = True |
|
|
if self.app.pargs.mail: |
|
|
self.app.pargs.php = True |
|
|
self.app.pargs.nginx = True |
|
|
self.app.pargs.mysql = True |
|
|
self.app.pargs.php = True |
|
|
self.app.pargs.postfix = True |
|
|
self.app.pargs.mysql = True |
|
|
|
|
|
self.app.pargs.postfix = True |
|
|
if not EEAptGet.is_installed(self, 'dovecot-core'): |
|
|
|
|
|
Log.debug(self, "Setting apt_packages variable for mail") |
|
|
if not EEAptGet.is_installed(self, 'dovecot-core'): |
|
|
apt_packages = apt_packages + EEVariables.ee_mail |
|
|
Log.debug(self, "Setting apt_packages variable for mail") |
|
|
packages = packages + [["https://github.com/opensolutions/" |
|
|
apt_packages = apt_packages + EEVariables.ee_mail |
|
|
"ViMbAdmin/archive/3.0.10.tar.gz", |
|
|
packages = packages + [["https://github.com/opensolutions/" |
|
|
"/tmp/vimbadmin.tar.gz", "ViMbAdmin"], |
|
|
"ViMbAdmin/archive/3.0.10.tar.gz", |
|
|
["https://github.com/roundcube/" |
|
|
"/tmp/vimbadmin.tar.gz", |
|
|
"roundcubemail/releases/download/" |
|
|
"ViMbAdmin"], |
|
|
"1.0.4/roundcubemail-1.0.4.tar.gz", |
|
|
["https://github.com/roundcube/" |
|
|
"/tmp/roundcube.tar.gz", |
|
|
"roundcubemail/releases/download/" |
|
|
"Roundcube"]] |
|
|
"1.0.4/roundcubemail-1.0.4.tar.gz", |
|
|
|
|
|
"/tmp/roundcube.tar.gz", |
|
|
if EEVariables.ee_ram > 1024: |
|
|
"Roundcube"]] |
|
|
apt_packages = apt_packages + EEVariables.ee_mailscanner |
|
|
|
|
|
else: |
|
|
if EEVariables.ee_ram > 1024: |
|
|
Log.info(self, "Mail server is allready installed") |
|
|
apt_packages = (apt_packages + |
|
|
|
|
|
EEVariables.ee_mailscanner) |
|
|
if self.app.pargs.nginx: |
|
|
else: |
|
|
Log.debug(self, "Setting apt_packages variable for Nginx") |
|
|
Log.info(self, "Mail server is allready installed") |
|
|
if not EEAptGet.is_installed(self, 'nginx-common'): |
|
|
|
|
|
apt_packages = apt_packages + EEVariables.ee_nginx |
|
|
|
|
|
else: |
|
|
|
|
|
Log.info(self, "Nginx allready installed") |
|
|
|
|
|
if self.app.pargs.php: |
|
|
|
|
|
Log.debug(self, "Setting apt_packages variable for PHP") |
|
|
|
|
|
if not EEAptGet.is_installed(self, 'php5-fpm'): |
|
|
|
|
|
apt_packages = apt_packages + EEVariables.ee_php |
|
|
|
|
|
else: |
|
|
|
|
|
Log.info(self, "PHP allready installed") |
|
|
|
|
|
if self.app.pargs.mysql: |
|
|
|
|
|
Log.debug(self, "Setting apt_packages variable for MySQL") |
|
|
|
|
|
if not EEShellExec.cmd_exec(self, "mysqladmin ping"): |
|
|
|
|
|
apt_packages = apt_packages + EEVariables.ee_mysql |
|
|
|
|
|
else: |
|
|
|
|
|
Log.info(self, "MySQL connection is allready alive") |
|
|
|
|
|
if self.app.pargs.postfix: |
|
|
|
|
|
Log.debug(self, "Setting apt_packages variable for PostFix") |
|
|
|
|
|
if not EEAptGet.is_installed(self, 'postfix'): |
|
|
|
|
|
apt_packages = apt_packages + EEVariables.ee_postfix |
|
|
|
|
|
else: |
|
|
|
|
|
Log.info(self, "Postfix is allready installed") |
|
|
|
|
|
if self.app.pargs.wpcli: |
|
|
|
|
|
Log.debug(self, "Setting packages variable for WPCLI") |
|
|
|
|
|
if not EEShellExec.cmd_exec(self, "which wp"): |
|
|
|
|
|
packages = packages + [["https://github.com/wp-cli/wp-cli/" |
|
|
|
|
|
"releases/download/v0.17.1/" |
|
|
|
|
|
"wp-cli.phar", "/usr/bin/wp", |
|
|
|
|
|
"WP_CLI"]] |
|
|
|
|
|
else: |
|
|
|
|
|
Log.info(self, "WP-CLI is allready installed") |
|
|
|
|
|
if self.app.pargs.phpmyadmin: |
|
|
|
|
|
Log.debug(self, "Setting packages varible for phpMyAdmin ") |
|
|
|
|
|
packages = packages + [["https://github.com/phpmyadmin/phpmyadmin" |
|
|
|
|
|
"/archive/STABLE.tar.gz", |
|
|
|
|
|
"/tmp/pma.tar.gz", "phpMyAdmin"]] |
|
|
|
|
|
|
|
|
|
|
|
if self.app.pargs.adminer: |
|
|
|
|
|
Log.debug(self, "Setting packages variable for Adminer ") |
|
|
|
|
|
packages = packages + [["http://downloads.sourceforge.net/adminer" |
|
|
|
|
|
"/adminer-4.1.0.php", "/var/www/22222/" |
|
|
|
|
|
"htdocs/db/adminer/index.php", "Adminer"]] |
|
|
|
|
|
|
|
|
|
|
|
if self.app.pargs.utils: |
|
|
if self.app.pargs.nginx: |
|
|
Log.debug(self, "Setting packages variable for utils") |
|
|
Log.debug(self, "Setting apt_packages variable for Nginx") |
|
|
packages = packages + [["http://phpmemcacheadmin.googlecode.com/" |
|
|
if not EEAptGet.is_installed(self, 'nginx-common'): |
|
|
"files/phpMemcachedAdmin-1.2.2" |
|
|
apt_packages = apt_packages + EEVariables.ee_nginx |
|
|
"-r262.tar.gz", '/tmp/memcache.tar.gz', |
|
|
else: |
|
|
'phpMemcachedAdmin'], |
|
|
Log.info(self, "Nginx allready installed") |
|
|
["https://raw.githubusercontent.com/rtCamp/" |
|
|
if self.app.pargs.php: |
|
|
"eeadmin/master/cache/nginx/clean.php", |
|
|
Log.debug(self, "Setting apt_packages variable for PHP") |
|
|
"/var/www/22222/htdocs/cache/" |
|
|
if not EEAptGet.is_installed(self, 'php5-fpm'): |
|
|
"nginx/clean.php", "clean.php"], |
|
|
apt_packages = apt_packages + EEVariables.ee_php |
|
|
["https://raw.github.com/rlerdorf/opcache-" |
|
|
else: |
|
|
"status/master/opcache.php", |
|
|
Log.info(self, "PHP allready installed") |
|
|
"/var/www/22222/htdocs/cache/" |
|
|
if self.app.pargs.mysql: |
|
|
"opcache/opcache.php", "opcache.php"], |
|
|
Log.debug(self, "Setting apt_packages variable for MySQL") |
|
|
["https://raw.github.com/amnuts/opcache-gui" |
|
|
if not EEShellExec.cmd_exec(self, "mysqladmin ping"): |
|
|
"/master/index.php", |
|
|
apt_packages = apt_packages + EEVariables.ee_mysql |
|
|
"/var/www/22222/htdocs/" |
|
|
else: |
|
|
"cache/opcache/opgui.php", "index.php"], |
|
|
Log.info(self, "MySQL connection is allready alive") |
|
|
["https://gist.github.com/ck-on/4959032/raw" |
|
|
if self.app.pargs.postfix: |
|
|
"/0b871b345fd6cfcd6d2be030c1f33d1ad6a475cb" |
|
|
Log.debug(self, "Setting apt_packages variable for PostFix") |
|
|
"/ocp.php", |
|
|
if not EEAptGet.is_installed(self, 'postfix'): |
|
|
"/var/www/22222/htdocs/cache/" |
|
|
apt_packages = apt_packages + EEVariables.ee_postfix |
|
|
"opcache/ocp.php", "ocp.php"], |
|
|
else: |
|
|
["https://github.com/jokkedk/webgrind/" |
|
|
Log.info(self, "Postfix is allready installed") |
|
|
"archive/master.tar.gz", |
|
|
if self.app.pargs.wpcli: |
|
|
'/tmp/webgrind.tar.gz', 'Webgrind'], |
|
|
Log.debug(self, "Setting packages variable for WPCLI") |
|
|
["http://bazaar.launchpad.net/~percona-too" |
|
|
if not EEShellExec.cmd_exec(self, "which wp"): |
|
|
"lkit-dev/percona-toolkit/2.1/download/he" |
|
|
packages = packages + [["https://github.com/wp-cli/wp-cli/" |
|
|
"ad:/ptquerydigest-20110624220137-or26tn4" |
|
|
"releases/download/v0.17.1/" |
|
|
"expb9ul2a-16/pt-query-digest", |
|
|
"wp-cli.phar", "/usr/bin/wp", |
|
|
"/usr/bin/pt-query-advisor", |
|
|
"WP_CLI"]] |
|
|
"pt-query-digest"], |
|
|
else: |
|
|
["https://github.com/box/Anemometer/archive" |
|
|
Log.info(self, "WP-CLI is allready installed") |
|
|
"/master.tar.gz", |
|
|
if self.app.pargs.phpmyadmin: |
|
|
'/tmp/anemometer.tar.gz', 'Anemometer'] |
|
|
Log.debug(self, "Setting packages varible for phpMyAdmin ") |
|
|
] |
|
|
packages = packages + [["https://github.com/phpmyadmin/" |
|
|
Log.debug(self, "Calling pre_pref ") |
|
|
"phpmyadmin/archive/STABLE.tar.gz", |
|
|
self.pre_pref(apt_packages) |
|
|
"/tmp/pma.tar.gz", "phpMyAdmin"]] |
|
|
if len(apt_packages): |
|
|
|
|
|
EESwap.add(self) |
|
|
if self.app.pargs.adminer: |
|
|
Log.debug(self, "Updating apt-cache") |
|
|
Log.debug(self, "Setting packages variable for Adminer ") |
|
|
EEAptGet.update(self) |
|
|
packages = packages + [["http://downloads.sourceforge.net/" |
|
|
Log.debug(self, "Installing all apt_packages") |
|
|
"adminer/adminer-4.1.0.php", |
|
|
print(apt_packages) |
|
|
"/var/www/22222/" |
|
|
EEAptGet.install(self, apt_packages) |
|
|
"htdocs/db/adminer/index.php", |
|
|
if len(packages): |
|
|
"Adminer"]] |
|
|
Log.debug(self, "Downloading all packages") |
|
|
|
|
|
EEDownload.download(self, packages) |
|
|
if self.app.pargs.utils: |
|
|
Log.debug(self, "Calling post_pref") |
|
|
Log.debug(self, "Setting packages variable for utils") |
|
|
self.post_pref(apt_packages, packages) |
|
|
packages = packages + [["http://phpmemcacheadmin.googlecode" |
|
|
if len(self.msg): |
|
|
".com/files/phpMemcachedAdmin-1.2.2" |
|
|
for msg in self.msg: |
|
|
"-r262.tar.gz", '/tmp/memcache.tar.gz', |
|
|
Log.info(self, msg) |
|
|
'phpMemcachedAdmin'], |
|
|
Log.info(self, "Successfully installed packages") |
|
|
["https://raw.githubusercontent.com" |
|
|
|
|
|
"/rtCamp/eeadmin/master/cache/nginx/" |
|
|
|
|
|
"clean.php", |
|
|
|
|
|
"/var/www/22222/htdocs/cache/" |
|
|
|
|
|
"nginx/clean.php", "clean.php"], |
|
|
|
|
|
["https://raw.github.com/rlerdorf/" |
|
|
|
|
|
"opcache-status/master/opcache.php", |
|
|
|
|
|
"/var/www/22222/htdocs/cache/" |
|
|
|
|
|
"opcache/opcache.php", "opcache.php"], |
|
|
|
|
|
["https://raw.github.com/amnuts/" |
|
|
|
|
|
"opcache-gui/master/index.php", |
|
|
|
|
|
"/var/www/22222/htdocs/" |
|
|
|
|
|
"cache/opcache/opgui.php", |
|
|
|
|
|
"index.php"], |
|
|
|
|
|
["https://gist.github.com/ck-on/4959032" |
|
|
|
|
|
"/raw/0b871b345fd6cfcd6d2be030c1f33d1" |
|
|
|
|
|
"ad6a475cb/ocp.php", |
|
|
|
|
|
"/var/www/22222/htdocs/cache/" |
|
|
|
|
|
"opcache/ocp.php", "ocp.php"], |
|
|
|
|
|
["https://github.com/jokkedk/webgrind/" |
|
|
|
|
|
"archive/master.tar.gz", |
|
|
|
|
|
'/tmp/webgrind.tar.gz', 'Webgrind'], |
|
|
|
|
|
["http://bazaar.launchpad.net/~" |
|
|
|
|
|
"percona-toolkit-dev/percona-toolkit/" |
|
|
|
|
|
"2.1/download/head:/ptquerydigest-" |
|
|
|
|
|
"20110624220137-or26tn4" |
|
|
|
|
|
"expb9ul2a-16/pt-query-digest", |
|
|
|
|
|
"/usr/bin/pt-query-advisor", |
|
|
|
|
|
"pt-query-digest"], |
|
|
|
|
|
["https://github.com/box/Anemometer/" |
|
|
|
|
|
"archive/master.tar.gz", |
|
|
|
|
|
'/tmp/anemometer.tar.gz', 'Anemometer'] |
|
|
|
|
|
] |
|
|
|
|
|
except Exception as e: |
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
if len(apt_packages) or len(packages): |
|
|
|
|
|
Log.debug(self, "Calling pre_pref ") |
|
|
|
|
|
self.pre_pref(apt_packages) |
|
|
|
|
|
if len(apt_packages): |
|
|
|
|
|
EESwap.add(self) |
|
|
|
|
|
Log.debug(self, "Updating apt-cache") |
|
|
|
|
|
EEAptGet.update(self) |
|
|
|
|
|
Log.debug(self, "Installing all apt_packages") |
|
|
|
|
|
print(apt_packages) |
|
|
|
|
|
EEAptGet.install(self, apt_packages) |
|
|
|
|
|
if len(packages): |
|
|
|
|
|
Log.debug(self, "Downloading all packages") |
|
|
|
|
|
EEDownload.download(self, packages) |
|
|
|
|
|
Log.debug(self, "Calling post_pref") |
|
|
|
|
|
self.post_pref(apt_packages, packages) |
|
|
|
|
|
if len(self.msg): |
|
|
|
|
|
for msg in self.msg: |
|
|
|
|
|
Log.info(self, msg) |
|
|
|
|
|
Log.info(self, "Successfully installed packages") |
|
|
|
|
|
|
|
|
@expose() |
|
|
@expose() |
|
|
def remove(self): |
|
|
def remove(self): |
|
|