Improve stack_pref.py

This commit is contained in:
VirtuBox
2019-09-01 20:39:12 +02:00
parent f10bcc124d
commit d4cb9501cf
4 changed files with 121 additions and 105 deletions

View File

@@ -8,12 +8,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### v3.9.x - [Unreleased]
#### Changed
- do not terminate stack install process on errors
#### Fixed
- ufw rules for proftpd not applied
- phpredisadmin install
- netdata configuration
- extplorer installation
- add LANG='en_US.UTF-8' in install script
### v3.9.8.7 - 2019-08-31

View File

@@ -103,6 +103,8 @@ fi
# 1- Update the apt sewers with fresh info
###
export DEBIAN_FRONTEND=noninteractive
export LANG='en_US.UTF-8'
[ -z "$wo_travis" ] && {
apt-get update -qq
}

View File

@@ -184,7 +184,7 @@ def post_pref(self, apt_packages, packages, upgrade=False):
encoding='utf-8', mode='a') as wo_nginx:
wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
'\t$request_filename;\n')
try:
data = dict(php="9000", debug="9001",
php7="9070", debug7="9170")
WOTemplate.render(
@@ -200,7 +200,7 @@ def post_pref(self, apt_packages, packages, upgrade=False):
data = dict()
WOTemplate.render(self,
'{0}/webp.conf'.format(ngxcnf),
'webp.mustache', data)
'webp.mustache', data, overwrite=False)
WOTemplate.render(self,
'{0}/cloudflare.conf'.format(ngxcnf),
@@ -210,6 +210,8 @@ def post_pref(self, apt_packages, packages, upgrade=False):
'{0}/map-wp-fastcgi-cache.conf'.format(
ngxcnf),
'map-wp.mustache', data)
except CommandExecutionError as e:
Log.debug(self, "{0}".format(e))
# Setup Nginx common directory
if not os.path.exists('{0}'.format(ngxcom)):
@@ -217,6 +219,7 @@ def post_pref(self, apt_packages, packages, upgrade=False):
'/etc/nginx/common')
os.makedirs('/etc/nginx/common')
try:
data = dict()
# Common Configuration
@@ -264,7 +267,6 @@ def post_pref(self, apt_packages, packages, upgrade=False):
'{0}/wpce-php72.conf'
.format(ngxcom),
'wpce.mustache', data)
# PHP 7.3 conf
data = dict(upstream="php73")
@@ -301,6 +303,8 @@ def post_pref(self, apt_packages, packages, upgrade=False):
'{0}/wpce-php73.conf'
.format(ngxcom),
'wpce.mustache', data)
except CommandExecutionError as e:
Log.debug(self, "{0}".format(e))
with open("/etc/nginx/common/release",
"w") as release_file:
@@ -477,6 +481,7 @@ def post_pref(self, apt_packages, packages, upgrade=False):
"/var/www/22222/cert/22222.crt;\n"
"ssl_certificate_key "
"/var/www/22222/cert/22222.key;\n")
server_ip = requests.get('http://v4.wordops.eu')
if set(["nginx"]).issubset(set(apt_packages)):

View File

@@ -0,0 +1,4 @@
[WordOps]
title=WordOps(WO)
description=Command-line tool that ease WordPress site and server management
ports=22222/tcp