Improve stack_pref.py
This commit is contained in:
@@ -8,12 +8,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
|
|
||||||
### v3.9.x - [Unreleased]
|
### v3.9.x - [Unreleased]
|
||||||
|
|
||||||
|
#### Changed
|
||||||
|
|
||||||
|
- do not terminate stack install process on errors
|
||||||
|
|
||||||
#### Fixed
|
#### Fixed
|
||||||
|
|
||||||
- ufw rules for proftpd not applied
|
- ufw rules for proftpd not applied
|
||||||
- phpredisadmin install
|
- phpredisadmin install
|
||||||
- netdata configuration
|
- netdata configuration
|
||||||
|
- extplorer installation
|
||||||
|
- add LANG='en_US.UTF-8' in install script
|
||||||
|
|
||||||
### v3.9.8.7 - 2019-08-31
|
### v3.9.8.7 - 2019-08-31
|
||||||
|
|
||||||
|
|||||||
2
install
2
install
@@ -103,6 +103,8 @@ fi
|
|||||||
# 1- Update the apt sewers with fresh info
|
# 1- Update the apt sewers with fresh info
|
||||||
###
|
###
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
export LANG='en_US.UTF-8'
|
||||||
|
|
||||||
[ -z "$wo_travis" ] && {
|
[ -z "$wo_travis" ] && {
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,32 +184,34 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
encoding='utf-8', mode='a') as wo_nginx:
|
encoding='utf-8', mode='a') as wo_nginx:
|
||||||
wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
|
wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
|
||||||
'\t$request_filename;\n')
|
'\t$request_filename;\n')
|
||||||
|
try:
|
||||||
|
data = dict(php="9000", debug="9001",
|
||||||
|
php7="9070", debug7="9170")
|
||||||
|
WOTemplate.render(
|
||||||
|
self, '{0}/upstream.conf'.format(ngxcnf),
|
||||||
|
'upstream.mustache', data, overwrite=True)
|
||||||
|
|
||||||
data = dict(php="9000", debug="9001",
|
data = dict(phpconf=True if
|
||||||
php7="9070", debug7="9170")
|
WOAptGet.is_installed(self, 'php7.2-fpm')
|
||||||
WOTemplate.render(
|
else False)
|
||||||
self, '{0}/upstream.conf'.format(ngxcnf),
|
WOTemplate.render(self,
|
||||||
'upstream.mustache', data, overwrite=True)
|
'{0}/stub_status.conf'.format(ngxcnf),
|
||||||
|
'stub_status.mustache', data)
|
||||||
|
data = dict()
|
||||||
|
WOTemplate.render(self,
|
||||||
|
'{0}/webp.conf'.format(ngxcnf),
|
||||||
|
'webp.mustache', data, overwrite=False)
|
||||||
|
|
||||||
data = dict(phpconf=True if
|
WOTemplate.render(self,
|
||||||
WOAptGet.is_installed(self, 'php7.2-fpm')
|
'{0}/cloudflare.conf'.format(ngxcnf),
|
||||||
else False)
|
'cloudflare.mustache', data)
|
||||||
WOTemplate.render(self,
|
|
||||||
'{0}/stub_status.conf'.format(ngxcnf),
|
|
||||||
'stub_status.mustache', data)
|
|
||||||
data = dict()
|
|
||||||
WOTemplate.render(self,
|
|
||||||
'{0}/webp.conf'.format(ngxcnf),
|
|
||||||
'webp.mustache', data)
|
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/cloudflare.conf'.format(ngxcnf),
|
'{0}/map-wp-fastcgi-cache.conf'.format(
|
||||||
'cloudflare.mustache', data)
|
ngxcnf),
|
||||||
|
'map-wp.mustache', data)
|
||||||
WOTemplate.render(self,
|
except CommandExecutionError as e:
|
||||||
'{0}/map-wp-fastcgi-cache.conf'.format(
|
Log.debug(self, "{0}".format(e))
|
||||||
ngxcnf),
|
|
||||||
'map-wp.mustache', data)
|
|
||||||
|
|
||||||
# Setup Nginx common directory
|
# Setup Nginx common directory
|
||||||
if not os.path.exists('{0}'.format(ngxcom)):
|
if not os.path.exists('{0}'.format(ngxcom)):
|
||||||
@@ -217,90 +219,92 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
'/etc/nginx/common')
|
'/etc/nginx/common')
|
||||||
os.makedirs('/etc/nginx/common')
|
os.makedirs('/etc/nginx/common')
|
||||||
|
|
||||||
data = dict()
|
try:
|
||||||
|
data = dict()
|
||||||
|
|
||||||
# Common Configuration
|
# Common Configuration
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/locations-wo.conf'
|
'{0}/locations-wo.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'locations.mustache', data)
|
'locations.mustache', data)
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/wpsubdir.conf'
|
'{0}/wpsubdir.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'wpsubdir.mustache', data)
|
'wpsubdir.mustache', data)
|
||||||
data = dict(upstream="php72")
|
data = dict(upstream="php72")
|
||||||
# PHP 7.2 conf
|
# PHP 7.2 conf
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/php72.conf'
|
'{0}/php72.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'php.mustache', data)
|
'php.mustache', data)
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/redis-php72.conf'
|
'{0}/redis-php72.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'redis.mustache', data)
|
'redis.mustache', data)
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/wpcommon-php72.conf'
|
'{0}/wpcommon-php72.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'wpcommon.mustache', data)
|
'wpcommon.mustache', data)
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/wpfc-php72.conf'
|
'{0}/wpfc-php72.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'wpfc.mustache', data)
|
'wpfc.mustache', data)
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/wpsc-php72.conf'
|
'{0}/wpsc-php72.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'wpsc.mustache', data)
|
'wpsc.mustache', data)
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/wprocket-php72.conf'
|
'{0}/wprocket-php72.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'wprocket.mustache', data)
|
'wprocket.mustache', data)
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/wpce-php72.conf'
|
'{0}/wpce-php72.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'wpce.mustache', data)
|
'wpce.mustache', data)
|
||||||
|
# PHP 7.3 conf
|
||||||
|
data = dict(upstream="php73")
|
||||||
|
|
||||||
# PHP 7.3 conf
|
WOTemplate.render(self,
|
||||||
data = dict(upstream="php73")
|
'{0}/php73.conf'
|
||||||
|
.format(ngxcom),
|
||||||
|
'php.mustache', data)
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/php73.conf'
|
'{0}/redis-php73.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'php.mustache', data)
|
'redis.mustache', data)
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/redis-php73.conf'
|
'{0}/wpcommon-php73.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'redis.mustache', data)
|
'wpcommon.mustache', data)
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/wpcommon-php73.conf'
|
'{0}/wpfc-php73.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'wpcommon.mustache', data)
|
'wpfc.mustache', data)
|
||||||
|
WOTemplate.render(self,
|
||||||
|
'{0}/wpsc-php73.conf'
|
||||||
|
.format(ngxcom),
|
||||||
|
'wpsc.mustache', data)
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/wpfc-php73.conf'
|
'{0}/wprocket-php73.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'wpfc.mustache', data)
|
'wprocket.mustache', data)
|
||||||
WOTemplate.render(self,
|
|
||||||
'{0}/wpsc-php73.conf'
|
|
||||||
.format(ngxcom),
|
|
||||||
'wpsc.mustache', data)
|
|
||||||
|
|
||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'{0}/wprocket-php73.conf'
|
'{0}/wpce-php73.conf'
|
||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'wprocket.mustache', data)
|
'wpce.mustache', data)
|
||||||
|
except CommandExecutionError as e:
|
||||||
WOTemplate.render(self,
|
Log.debug(self, "{0}".format(e))
|
||||||
'{0}/wpce-php73.conf'
|
|
||||||
.format(ngxcom),
|
|
||||||
'wpce.mustache', data)
|
|
||||||
|
|
||||||
with open("/etc/nginx/common/release",
|
with open("/etc/nginx/common/release",
|
||||||
"w") as release_file:
|
"w") as release_file:
|
||||||
@@ -477,6 +481,7 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
"/var/www/22222/cert/22222.crt;\n"
|
"/var/www/22222/cert/22222.crt;\n"
|
||||||
"ssl_certificate_key "
|
"ssl_certificate_key "
|
||||||
"/var/www/22222/cert/22222.key;\n")
|
"/var/www/22222/cert/22222.key;\n")
|
||||||
|
|
||||||
server_ip = requests.get('http://v4.wordops.eu')
|
server_ip = requests.get('http://v4.wordops.eu')
|
||||||
|
|
||||||
if set(["nginx"]).issubset(set(apt_packages)):
|
if set(["nginx"]).issubset(set(apt_packages)):
|
||||||
@@ -665,12 +670,12 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
.format(ngxroot))
|
.format(ngxroot))
|
||||||
os.makedirs('{0}22222/htdocs/fpm/status/'
|
os.makedirs('{0}22222/htdocs/fpm/status/'
|
||||||
.format(ngxroot))
|
.format(ngxroot))
|
||||||
open('{0}22222/htdocs/fpm/status/debug72'
|
open('{0}22222/htdocs/fpm/status/debug72'
|
||||||
.format(ngxroot),
|
.format(ngxroot),
|
||||||
encoding='utf-8', mode='a').close()
|
encoding='utf-8', mode='a').close()
|
||||||
open('{0}22222/htdocs/fpm/status/php72'
|
open('{0}22222/htdocs/fpm/status/php72'
|
||||||
.format(ngxroot),
|
.format(ngxroot),
|
||||||
encoding='utf-8', mode='a').close()
|
encoding='utf-8', mode='a').close()
|
||||||
|
|
||||||
# Write info.php
|
# Write info.php
|
||||||
if not os.path.exists('{0}22222/htdocs/php/'
|
if not os.path.exists('{0}22222/htdocs/php/'
|
||||||
@@ -681,10 +686,10 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
os.makedirs('{0}22222/htdocs/php'
|
os.makedirs('{0}22222/htdocs/php'
|
||||||
.format(ngxroot))
|
.format(ngxroot))
|
||||||
|
|
||||||
with open("{0}22222/htdocs/php/info.php"
|
with open("{0}22222/htdocs/php/info.php"
|
||||||
.format(ngxroot),
|
.format(ngxroot),
|
||||||
encoding='utf-8', mode='w') as myfile:
|
encoding='utf-8', mode='w') as myfile:
|
||||||
myfile.write("<?php\nphpinfo();\n?>")
|
myfile.write("<?php\nphpinfo();\n?>")
|
||||||
|
|
||||||
WOFileUtils.chown(self, "{0}22222/htdocs"
|
WOFileUtils.chown(self, "{0}22222/htdocs"
|
||||||
.format(ngxroot),
|
.format(ngxroot),
|
||||||
|
|||||||
4
wo/cli/templates/wo-ufw.mustache
Normal file
4
wo/cli/templates/wo-ufw.mustache
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[WordOps]
|
||||||
|
title=WordOps(WO)
|
||||||
|
description=Command-line tool that ease WordPress site and server management
|
||||||
|
ports=22222/tcp
|
||||||
Reference in New Issue
Block a user