From c2da42df3bcbfc885f257128e60769254f54900b Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Thu, 2 May 2019 10:07:37 +0200 Subject: [PATCH] testing open_basedir --- CHANGELOG.md | 6 ++++-- install | 10 +--------- wo/cli/plugins/stack.py | 19 ++++++++++++++++--- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 932df22..51c1dde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,9 +37,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Extplorer filemanager - Enable OSCP Stapling with Let's Encrypt - Compress database backup with pigz before updating sites -- Add support for Ubuntu 19.04 disco -- Add support for Raspbian +- Support for Ubuntu 19.04 (disco) - few php extensions missing +- Support for Raspbian 9 (stretch) - tested on Raspberry Pi 3b+ - backup letsencrypt certificate before upgrade +- directives emergency_restart_threshold & emergency_restart_interval to restart php-fpm in case of failure #### Changed @@ -73,6 +74,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - --hsts flag with basic html site - hsts flag on site not secure with letsencrypt - fix import of previous acme.sh certificate +- fix proxy webroot folder creation ### v3.9.4 - 2019-03-15 diff --git a/install b/install index 99e976e..7d875b8 100755 --- a/install +++ b/install @@ -357,15 +357,7 @@ wo_install_acme_sh() { fi cd /opt/acme.sh || exit 1 # create conf directories - [ ! -d /etc/letsencrypt/config ] && { - mkdir -p /etc/letsencrypt/config - } - [ ! -d /etc/letsencrypt/live ] && { - mkdir -p /etc/letsencrypt/live - } - [ ! -d /etc/letsencrypt/renewal ] && { - mkdir -p /etc/letsencrypt/renewal - } + mkdir -p /etc/letsencrypt/{config,live,renewal} # install acme.sh ./acme.sh --install \ --home /etc/letsencrypt \ diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index 8d5bac5..7f7901b 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -787,6 +787,11 @@ class WOStackController(CementBaseController): "/etc/php/7.2/fpm/pool.d/www.conf") config.write(configfile) + with open("/etc/php/7.2/fpm/pool.d/www.conf", + encoding='utf-8', mode='a') as myfile: + myfile.write("\nphp_admin_value[open_basedir] " + "= \"/var/www:/tmp/:/var/run/nginx-cache\"\n") + # Generate /etc/php/7.2/fpm/pool.d/www-two.conf WOFileUtils.copyfile(self, "/etc/php/7.2/fpm/pool.d/www.conf", "/etc/php/7.2/fpm/pool.d/www-two.conf") @@ -942,6 +947,11 @@ class WOStackController(CementBaseController): "/etc/php/7.3/fpm/pool.d/www.conf") config.write(configfile) + with open("/etc/php/7.3/fpm/pool.d/www.conf", + encoding='utf-8', mode='a') as myfile: + myfile.write("\nphp_admin_value[open_basedir] " + "= \"/var/www:/tmp/:/var/run/nginx-cache\"\n") + # Generate /etc/php/7.3/fpm/pool.d/www-two.conf WOFileUtils.copyfile(self, "/etc/php/7.3/fpm/pool.d/www.conf", "/etc/php/7.3/fpm/pool.d/www-two.conf") @@ -1081,7 +1091,8 @@ class WOStackController(CementBaseController): if any('/var/lib/wo/tmp/pma.tar.gz' == x[1] for x in packages): - WOExtract.extract(self, '/var/lib/wo/tmp/pma.tar.gz', '/var/lib/wo/tmp/') + WOExtract.extract( + self, '/var/lib/wo/tmp/pma.tar.gz', '/var/lib/wo/tmp/') Log.debug(self, 'Extracting file /var/lib/wo/tmp/pma.tar.gz to ' 'location /var/lib/wo/tmp/') if not os.path.exists('{0}22222/htdocs/db' @@ -1252,7 +1263,8 @@ class WOStackController(CementBaseController): for x in packages): Log.debug(self, "Extracting file webgrind.tar.gz to " "location /var/lib/wo/tmp/ ") - WOExtract.extract(self, '/var/lib/wo/tmp/webgrind.tar.gz', '/var/lib/wo/tmp/') + WOExtract.extract( + self, '/var/lib/wo/tmp/webgrind.tar.gz', '/var/lib/wo/tmp/') if not os.path.exists('{0}22222/htdocs/php' .format(WOVariables.wo_webroot)): Log.debug(self, "Creating directroy " @@ -1294,7 +1306,8 @@ class WOStackController(CementBaseController): for x in packages): Log.debug(self, "Extracting file anemometer.tar.gz to " "location /var/lib/wo/tmp/ ") - WOExtract.extract(self, '/var/lib/wo/tmp/anemometer.tar.gz', '/var/lib/wo/tmp/') + WOExtract.extract( + self, '/var/lib/wo/tmp/anemometer.tar.gz', '/var/lib/wo/tmp/') if not os.path.exists('{0}22222/htdocs/db/' .format(WOVariables.wo_webroot)): Log.debug(self, "Creating directory")