Merge pull request #588 from WordOps/updating-configuration

Add PHP 8.3 support
This commit is contained in:
VirtuBox
2023-11-30 08:11:54 +01:00
committed by GitHub
11 changed files with 117 additions and 87 deletions

View File

@@ -27,7 +27,7 @@ if os.geteuid() == 0:
os.makedirs('/var/lib/wo/tmp/') os.makedirs('/var/lib/wo/tmp/')
setup(name='wordops', setup(name='wordops',
version='3.18.1', version='3.19.0',
description='An essential toolset that eases server administration', description='An essential toolset that eases server administration',
long_description=LONG, long_description=LONG,
long_description_content_type='text/markdown', long_description_content_type='text/markdown',

View File

@@ -32,7 +32,7 @@ echo -e "${CGREEN}#############################################${CEND}"
echo -e ' stack install ' echo -e ' stack install '
echo -e "${CGREEN}#############################################${CEND}" echo -e "${CGREEN}#############################################${CEND}"
stack_list='nginx php php73 php74 php80 php81 php82 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer redis phpredisadmin mysqltuner utils ufw cheat nanorc' stack_list='nginx php php73 php74 php80 php81 php82 php83 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer redis phpredisadmin mysqltuner utils ufw cheat nanorc'
for stack in $stack_list; do for stack in $stack_list; do
echo -ne " Installing $stack [..]\r" echo -ne " Installing $stack [..]\r"
@@ -52,7 +52,7 @@ done
echo -e "${CGREEN}#############################################${CEND}" echo -e "${CGREEN}#############################################${CEND}"
echo -e ' Simple site create ' echo -e ' Simple site create '
echo -e "${CGREEN}#############################################${CEND}" echo -e "${CGREEN}#############################################${CEND}"
site_types='html php php72 php73 php74 php80 php81 php82 mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker' site_types='html php php72 php73 php74 php80 php81 php82 php83 mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker'
for site in $site_types; do for site in $site_types; do
echo -ne " Creating $site [..]\r" echo -ne " Creating $site [..]\r"
if { if {
@@ -116,7 +116,7 @@ echo
echo -e "${CGREEN}#############################################${CEND}" echo -e "${CGREEN}#############################################${CEND}"
echo -e ' wo site update --php74 ' echo -e ' wo site update --php74 '
echo -e "${CGREEN}#############################################${CEND}" echo -e "${CGREEN}#############################################${CEND}"
other_site_types='mysql php72 php73 wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' other_site_types='mysql php72 php73 php83 wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir'
for site in $other_site_types; do for site in $other_site_types; do
echo -ne " Updating site to $site php74 [..]\r" echo -ne " Updating site to $site php74 [..]\r"
if { if {
@@ -460,7 +460,7 @@ wo info
echo -e "${CGREEN}#############################################${CEND}" echo -e "${CGREEN}#############################################${CEND}"
echo -e ' wo stack purge ' echo -e ' wo stack purge '
echo -e "${CGREEN}#############################################${CEND}" echo -e "${CGREEN}#############################################${CEND}"
stack_purge='nginx php php73 php74 php80 php81 php82 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer adminer redis ufw ngxblocker cheat nanorc' stack_purge='nginx php php73 php74 php80 php81 php82 php83 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer adminer redis ufw ngxblocker cheat nanorc'
for stack in $stack_purge; do for stack in $stack_purge; do
echo -ne " purging $stack [..]\r" echo -ne " purging $stack [..]\r"
if { if {

View File

@@ -629,7 +629,7 @@ class WOInfoController(CementBaseController):
if (not pargs.nginx and not pargs.php and if (not pargs.nginx and not pargs.php and
not pargs.mysql and not pargs.php73 and not pargs.mysql and not pargs.php73 and
not pargs.php74 and not pargs.php80 and not pargs.php74 and not pargs.php80 and
not pargs.php81 and not pargs.php82): not pargs.php81 and not pargs.php82) and not (pargs.php83):
pargs.nginx = True pargs.nginx = True
pargs.php = True pargs.php = True
pargs.mysql = True pargs.mysql = True
@@ -643,6 +643,8 @@ class WOInfoController(CementBaseController):
pargs.php81 = True pargs.php81 = True
if WOAptGet.is_installed(self, 'php8.2-fpm'): if WOAptGet.is_installed(self, 'php8.2-fpm'):
pargs.php82 = True pargs.php82 = True
if WOAptGet.is_installed(self, 'php8.3-fpm'):
pargs.php83 = True
if pargs.nginx: if pargs.nginx:
if ((not WOAptGet.is_installed(self, 'nginx-custom')) and if ((not WOAptGet.is_installed(self, 'nginx-custom')) and

View File

@@ -186,7 +186,7 @@ class WOSiteCreateController(CementBaseController):
data['basic'] = True data['basic'] = True
if (pargs.php72 or pargs.php73 or pargs.php74 or if (pargs.php72 or pargs.php73 or pargs.php74 or
pargs.php80 or pargs.php81 or pargs.php82): pargs.php80 or pargs.php81 or pargs.php82 or pargs.php83):
data = dict( data = dict(
site_name=wo_domain, www_domain=wo_www_domain, site_name=wo_domain, www_domain=wo_www_domain,
static=False, basic=False, static=False, basic=False,

View File

@@ -775,7 +775,7 @@ def sitebackup(self, data):
.format(data['site_name']), backup_path) .format(data['site_name']), backup_path)
if data['currsitetype'] in ['html', 'php', 'php72', 'php74', if data['currsitetype'] in ['html', 'php', 'php72', 'php74',
'php73', 'php80', 'php81', 'php82', 'php73', 'php80', 'php81', 'php82', 'php83'
'proxy', 'mysql']: 'proxy', 'mysql']:
if not data['wp']: if not data['wp']:
Log.info(self, "Backing up Webroot \t\t", end='') Log.info(self, "Backing up Webroot \t\t", end='')
@@ -836,7 +836,7 @@ def site_package_check(self, stype):
stack.app = self.app stack.app = self.app
pargs = self.app.pargs pargs = self.app.pargs
if stype in ['html', 'proxy', 'php', 'php72', 'mysql', 'wp', 'wpsubdir', if stype in ['html', 'proxy', 'php', 'php72', 'mysql', 'wp', 'wpsubdir',
'wpsubdomain', 'php73', 'php74', 'php80', 'php81', 'php82', 'alias']: 'wpsubdomain', 'php73', 'php74', 'php80', 'php81', 'php82', 'php83', 'alias']:
Log.debug(self, "Setting apt_packages variable for Nginx") Log.debug(self, "Setting apt_packages variable for Nginx")
# Check if server has nginx-custom package # Check if server has nginx-custom package
@@ -872,7 +872,7 @@ def site_package_check(self, stype):
wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME ' wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
'\t$request_filename;\n') '\t$request_filename;\n')
php_versions = ['php72', 'php73', 'php74', 'php80', 'php81', 'php82'] php_versions = ['php72', 'php73', 'php74', 'php80', 'php81', 'php82', 'php83']
selected_versions = [version for version in php_versions if getattr(pargs, version)] selected_versions = [version for version in php_versions if getattr(pargs, version)]
if len(selected_versions) > 1: if len(selected_versions) > 1:
@@ -881,6 +881,7 @@ def site_package_check(self, stype):
if ((not pargs.php72) and (not pargs.php73) and (not pargs.php74) and if ((not pargs.php72) and (not pargs.php73) and (not pargs.php74) and
(not pargs.php80) and (not pargs.php81) and (not pargs.php82) and (not pargs.php80) and (not pargs.php81) and (not pargs.php82) and
(not pargs.php83) and
stype in ['php', 'mysql', 'wp', 'wpsubdir', stype in ['php', 'mysql', 'wp', 'wpsubdir',
'wpsubdomain']): 'wpsubdomain']):
Log.debug(self, "Setting apt_packages variable for PHP") Log.debug(self, "Setting apt_packages variable for PHP")
@@ -1082,7 +1083,7 @@ def detSitePar(opts):
for key, val in opts.items(): for key, val in opts.items():
if val and key in ['html', 'php', 'mysql', 'wp', if val and key in ['html', 'php', 'mysql', 'wp',
'wpsubdir', 'wpsubdomain', 'php72', 'wpsubdir', 'wpsubdomain', 'php72',
'php73', 'php74', 'php80', 'php81', 'php82', ]: 'php73', 'php74', 'php80', 'php81', 'php82', 'php83']:
typelist.append(key) typelist.append(key)
elif val and key in ['wpfc', 'wpsc', 'wpredis', 'wprocket', 'wpce']: elif val and key in ['wpfc', 'wpsc', 'wpredis', 'wprocket', 'wpce']:
cachelist.append(key) cachelist.append(key)
@@ -1134,6 +1135,12 @@ def detSitePar(opts):
cachetype = 'basic' cachetype = 'basic'
else: else:
cachetype = cachelist[0] cachetype = cachelist[0]
elif False not in [x in ('php83', 'mysql', 'html') for x in typelist]:
sitetype = 'mysql'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('php', 'mysql') for x in typelist]: elif False not in [x in ('php', 'mysql') for x in typelist]:
sitetype = 'mysql' sitetype = 'mysql'
if not cachelist: if not cachelist:
@@ -1176,6 +1183,12 @@ def detSitePar(opts):
cachetype = 'basic' cachetype = 'basic'
else: else:
cachetype = cachelist[0] cachetype = cachelist[0]
elif False not in [x in ('php83', 'mysql') for x in typelist]:
sitetype = 'mysql'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('html', 'mysql') for x in typelist]: elif False not in [x in ('html', 'mysql') for x in typelist]:
sitetype = 'mysql' sitetype = 'mysql'
if not cachelist: if not cachelist:
@@ -1236,6 +1249,12 @@ def detSitePar(opts):
cachetype = 'basic' cachetype = 'basic'
else: else:
cachetype = cachelist[0] cachetype = cachelist[0]
elif False not in [x in ('wp', 'php83') for x in typelist]:
sitetype = 'wp'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('wpsubdir', 'php72') for x in typelist]: elif False not in [x in ('wpsubdir', 'php72') for x in typelist]:
sitetype = 'wpsubdir' sitetype = 'wpsubdir'
if not cachelist: if not cachelist:
@@ -1272,6 +1291,12 @@ def detSitePar(opts):
cachetype = 'basic' cachetype = 'basic'
else: else:
cachetype = cachelist[0] cachetype = cachelist[0]
elif False not in [x in ('wpsubdir', 'php83') for x in typelist]:
sitetype = 'wpsubdir'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('wpsubdomain', 'php72') for x in typelist]: elif False not in [x in ('wpsubdomain', 'php72') for x in typelist]:
sitetype = 'wpsubdomain' sitetype = 'wpsubdomain'
if not cachelist: if not cachelist:
@@ -1308,6 +1333,12 @@ def detSitePar(opts):
cachetype = 'basic' cachetype = 'basic'
else: else:
cachetype = cachelist[0] cachetype = cachelist[0]
elif False not in [x in ('wpsubdomain', 'php83') for x in typelist]:
sitetype = 'wpsubdomain'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
else: else:
raise RuntimeError("could not determine site and cache type") raise RuntimeError("could not determine site and cache type")
else: else:
@@ -1332,6 +1363,9 @@ def detSitePar(opts):
elif (not typelist or "php82" in typelist) and cachelist: elif (not typelist or "php82" in typelist) and cachelist:
sitetype = 'wp' sitetype = 'wp'
cachetype = cachelist[0] cachetype = cachelist[0]
elif (not typelist or "php83" in typelist) and cachelist:
sitetype = 'wp'
cachetype = cachelist[0]
elif typelist and (not cachelist): elif typelist and (not cachelist):
sitetype = typelist[0] sitetype = typelist[0]
cachetype = 'basic' cachetype = 'basic'

View File

@@ -188,7 +188,7 @@ class WOSiteUpdateController(CementBaseController):
pargs.ngxblocker or pargs.letsencrypt == 'renew') and not ( pargs.ngxblocker or pargs.letsencrypt == 'renew') and not (
pargs.html or pargs.php or pargs.php72 or pargs.php73 or pargs.html or pargs.php or pargs.php72 or pargs.php73 or
pargs.php74 or pargs.php80 or pargs.php81 or pargs.php82 or pargs.php74 or pargs.php80 or pargs.php81 or pargs.php82 or
pargs.mysql or pargs.wp or pargs.wpfc or pargs.wpsc or pargs.php83 or pargs.mysql or pargs.wp or pargs.wpfc or pargs.wpsc or
pargs.wprocket or pargs.wpce or pargs.wprocket or pargs.wpce or
pargs.wpsubdir or pargs.wpsubdomain)): pargs.wpsubdir or pargs.wpsubdomain)):
@@ -256,20 +256,20 @@ class WOSiteUpdateController(CementBaseController):
if (((stype == 'php' and if (((stype == 'php' and
oldsitetype not in ['html', 'proxy', 'php', 'php72', oldsitetype not in ['html', 'proxy', 'php', 'php72',
'php73', 'php74', 'php80', 'php73', 'php74', 'php80',
'php81', 'php82']) or 'php81', 'php82', 'php83']) or
(stype == 'mysql' and oldsitetype not in [ (stype == 'mysql' and oldsitetype not in [
'html', 'php', 'php72', 'php73', 'php74', 'php80', 'php81', 'html', 'php', 'php72', 'php73', 'php74', 'php80', 'php81',
'php82', 'proxy']) or 'php82', 'php83', 'proxy']) or
(stype == 'wp' and oldsitetype not in [ (stype == 'wp' and oldsitetype not in [
'html', 'php', 'php72', 'php73', 'php74', 'php80', 'php81', 'html', 'php', 'php72', 'php73', 'php74', 'php80', 'php81',
'php82', 'mysql', 'proxy', 'wp']) or 'php82', 'php83', 'mysql', 'proxy', 'wp']) or
(stype == 'wpsubdir' and oldsitetype in ['wpsubdomain']) or (stype == 'wpsubdir' and oldsitetype in ['wpsubdomain']) or
(stype == 'wpsubdomain' and oldsitetype in ['wpsubdir']) or (stype == 'wpsubdomain' and oldsitetype in ['wpsubdir']) or
(stype == oldsitetype and cache == oldcachetype)) and (stype == oldsitetype and cache == oldcachetype)) and
not (pargs.php72 or pargs.php73 or not (pargs.php72 or pargs.php73 or
pargs.php74 or pargs.php80 or pargs.php74 or pargs.php80 or
pargs.php81 or pargs.php82 or pargs.php81 or pargs.php82 or
pargs.alias)): pargs.php83 or pargs.alias)):
Log.info(self, Log.FAIL + "can not update {0} {1} to {2} {3}". Log.info(self, Log.FAIL + "can not update {0} {1} to {2} {3}".
format(oldsitetype, oldcachetype, stype, cache)) format(oldsitetype, oldcachetype, stype, cache))
return 1 return 1
@@ -298,7 +298,7 @@ class WOSiteUpdateController(CementBaseController):
site_name=wo_domain, www_domain=wo_www_domain, site_name=wo_domain, www_domain=wo_www_domain,
static=False, basic=True, wp=False, wpfc=False, static=False, basic=True, wp=False, wpfc=False,
php72=False, php73=False, php74=False, php72=False, php73=False, php74=False,
php80=False, php81=False, php82=False, php80=False, php81=False, php82=False, php83=False,
wpsc=False, wpredis=False, wprocket=False, wpce=False, wpsc=False, wpredis=False, wprocket=False, wpce=False,
multisite=False, wpsubdir=False, webroot=wo_site_webroot, multisite=False, wpsubdir=False, webroot=wo_site_webroot,
currsitetype=oldsitetype, currcachetype=oldcachetype) currsitetype=oldsitetype, currcachetype=oldcachetype)
@@ -323,11 +323,11 @@ class WOSiteUpdateController(CementBaseController):
data['wpsubdir'] = True data['wpsubdir'] = True
if ((pargs.php72 or pargs.php73 or pargs.php74 or if ((pargs.php72 or pargs.php73 or pargs.php74 or
pargs.php80 or pargs.php81 or pargs.php82) and pargs.php80 or pargs.php81 or pargs.php82 or pargs.php83) and
(not data)): (not data)):
Log.debug( Log.debug(
self, "pargs php72, or php73, or php74, " self, "pargs php72, or php73, or php74, "
"or php80, or php81 or php82 enabled") "or php80, or php81 or php82 or php83 enabled")
data = dict( data = dict(
site_name=wo_domain, site_name=wo_domain,
www_domain=wo_www_domain, www_domain=wo_www_domain,
@@ -344,7 +344,7 @@ class WOSiteUpdateController(CementBaseController):
elif (oldsitetype == 'php' or oldsitetype == 'mysql' or elif (oldsitetype == 'php' or oldsitetype == 'mysql' or
oldsitetype == 'php73' or oldsitetype == 'php74' or oldsitetype == 'php73' or oldsitetype == 'php74' or
oldsitetype == 'php80' or oldsitetype == 'php81' or oldsitetype == 'php80' or oldsitetype == 'php81' or
oldsitetype == 'php82'): oldsitetype == 'php82' or oldsitetype == 'php83'):
data['static'] = False data['static'] = False
data['wp'] = False data['wp'] = False
data['multisite'] = False data['multisite'] = False
@@ -396,7 +396,8 @@ class WOSiteUpdateController(CementBaseController):
if (data and (not pargs.php73) and if (data and (not pargs.php73) and
(not pargs.php74) and (not pargs.php72) and (not pargs.php74) and (not pargs.php72) and
(not pargs.php80) and (not pargs.php81) and (not pargs.php82)): (not pargs.php80) and (not pargs.php81) and (not pargs.php82)
and (not pargs.php83)):
data[pargs_version] = bool(old_version_var is True) data[pargs_version] = bool(old_version_var is True)
Log.debug( Log.debug(
self, f"data {pargs_version} = {data[pargs_version]}") self, f"data {pargs_version} = {data[pargs_version]}")
@@ -492,7 +493,7 @@ class WOSiteUpdateController(CementBaseController):
data['wo_php'] = pargs_version data['wo_php'] = pargs_version
Log.debug(self, f"data wo_php set to {pargs_version}") Log.debug(self, f"data wo_php set to {pargs_version}")
check_php_version = version check_php_version = version
Log.debug(self, f"check_php_versions et to {version}") Log.debug(self, f"check_php_versions set to {version}")
break break
if pargs.hsts: if pargs.hsts:
@@ -522,9 +523,6 @@ class WOSiteUpdateController(CementBaseController):
sitebackup(self, data) sitebackup(self, data)
except Exception as e: except Exception as e:
Log.debug(self, str(e)) Log.debug(self, str(e))
Log.info(self, Log.FAIL + "Check the log for details: "
"`tail /var/log/wo/wordops.log` and please try again")
return 1
# setup NGINX configuration, and webroot # setup NGINX configuration, and webroot
try: try:
@@ -799,7 +797,7 @@ class WOSiteUpdateController(CementBaseController):
# Setup WordPress if old sites are html/php/mysql sites # Setup WordPress if old sites are html/php/mysql sites
if data['wp'] and oldsitetype in ['html', 'proxy', 'php', 'php72', if data['wp'] and oldsitetype in ['html', 'proxy', 'php', 'php72',
'mysql', 'php73', 'php74', 'php80', 'mysql', 'php73', 'php74', 'php80',
'php81', 'php82']: 'php81', 'php82', 'php83']:
try: try:
wo_wp_creds = setupwordpress(self, data) wo_wp_creds = setupwordpress(self, data)
except SiteError as e: except SiteError as e:

View File

@@ -130,6 +130,7 @@ class WOStackController(CementBaseController):
pargs.php80 = True pargs.php80 = True
pargs.php81 = True pargs.php81 = True
pargs.php82 = True pargs.php82 = True
pargs.php83 = True
pargs.redis = True pargs.redis = True
pargs.proftpd = True pargs.proftpd = True
@@ -188,6 +189,7 @@ class WOStackController(CementBaseController):
'php80': WOVar.wo_php80, 'php80': WOVar.wo_php80,
'php81': WOVar.wo_php81, 'php81': WOVar.wo_php81,
'php82': WOVar.wo_php82, 'php82': WOVar.wo_php82,
'php83': WOVar.wo_php83,
} }
for parg_version, version in WOVar.wo_php_versions.items(): for parg_version, version in WOVar.wo_php_versions.items():
@@ -455,7 +457,8 @@ class WOStackController(CementBaseController):
WOAptGet.is_installed(self, 'php7.4-fpm') or WOAptGet.is_installed(self, 'php7.4-fpm') or
WOAptGet.is_installed(self, 'php8.0-fpm') or WOAptGet.is_installed(self, 'php8.0-fpm') or
WOAptGet.is_installed(self, 'php8.1-fpm') or WOAptGet.is_installed(self, 'php8.1-fpm') or
WOAptGet.is_installed(self, 'php8.2-fpm')): WOAptGet.is_installed(self, 'php8.2-fpm') or
WOAptGet.is_installed(self, 'php8.3-fpm')):
pargs.php = True pargs.php = True
Log.debug(self, "Setting packages variable for utils") Log.debug(self, "Setting packages variable for utils")
packages = packages + [[ packages = packages + [[
@@ -554,6 +557,7 @@ class WOStackController(CementBaseController):
pargs.php80 = True pargs.php80 = True
pargs.php81 = True pargs.php81 = True
pargs.php82 = True pargs.php82 = True
pargs.php83 = True
pargs.fail2ban = True pargs.fail2ban = True
pargs.proftpd = True pargs.proftpd = True
pargs.utils = True pargs.utils = True
@@ -596,6 +600,7 @@ class WOStackController(CementBaseController):
'php80': WOVar.wo_php80, 'php80': WOVar.wo_php80,
'php81': WOVar.wo_php81, 'php81': WOVar.wo_php81,
'php82': WOVar.wo_php82, 'php82': WOVar.wo_php82,
'php83': WOVar.wo_php83,
} }
# Loop through all versions. # Loop through all versions.
@@ -856,6 +861,7 @@ class WOStackController(CementBaseController):
pargs.php80 = True pargs.php80 = True
pargs.php81 = True pargs.php81 = True
pargs.php82 = True pargs.php82 = True
pargs.php83 = True
pargs.fail2ban = True pargs.fail2ban = True
pargs.proftpd = True pargs.proftpd = True
pargs.utils = True pargs.utils = True
@@ -891,63 +897,24 @@ class WOStackController(CementBaseController):
else: else:
Log.info(self, "Nginx is not installed") Log.info(self, "Nginx is not installed")
# PHP 7.2 wo_vars = {
if pargs.php72: 'php72': WOVar.wo_php72,
Log.debug(self, "Setting apt_packages variable for PHP 7.2") 'php73': WOVar.wo_php73,
if (WOAptGet.is_installed(self, 'php7.2-fpm')): 'php74': WOVar.wo_php74,
apt_packages = apt_packages + WOVar.wo_php72 'php80': WOVar.wo_php80,
else: 'php81': WOVar.wo_php81,
Log.debug(self, "PHP 7.2 is not installed") 'php82': WOVar.wo_php82,
Log.info(self, "PHP 7.2 is not installed") 'php83': WOVar.wo_php83,
}
# PHP 7.3 for parg_version, version in WOVar.wo_php_versions.items():
if pargs.php73: if getattr(pargs, parg_version, False):
Log.debug(self, "Setting apt_packages variable for PHP 7.3") Log.debug(self, f"Setting apt_packages variable for PHP {version}")
if WOAptGet.is_installed(self, 'php7.3-fpm'): if not WOAptGet.is_installed(self, f'php{version}-fpm'):
apt_packages = apt_packages + WOVar.wo_php73 apt_packages = apt_packages + wo_vars[parg_version]
else: else:
Log.debug(self, "PHP 7.3 is not installed") Log.debug(self, f"PHP {version} already purged")
Log.info(self, "PHP 7.3 is not installed") Log.info(self, f"PHP {version} already purged")
# PHP 7.4
if pargs.php74:
Log.debug(self, "Setting apt_packages variable for PHP 7.4")
if WOAptGet.is_installed(self, 'php7.4-fpm'):
apt_packages = apt_packages + WOVar.wo_php74
else:
Log.debug(self, "PHP 7.4 is not installed")
Log.info(self, "PHP 7.4 is not installed")
# PHP 8.0
if pargs.php80:
Log.debug(self, "Setting apt_packages variable for PHP 8.0")
if WOAptGet.is_installed(self, 'php8.0-fpm'):
apt_packages = apt_packages + WOVar.wo_php80
else:
Log.debug(self, "PHP 8.0 is not installed")
Log.info(self, "PHP 8.0 is not installed")
# PHP 8.1
if pargs.php81:
Log.debug(self, "Setting apt_packages variable for PHP 8.1")
if WOAptGet.is_installed(self, 'php8.1-fpm'):
apt_packages = apt_packages + WOVar.wo_php81
else:
Log.debug(self, "PHP 8.1 is not installed")
Log.info(self, "PHP 8.1 is not installed")
Log.info(self, "PHP 8.1 is not installed")
# PHP 8.2
if pargs.php82:
Log.debug(self, "Setting apt_packages variable for PHP 8.2")
if WOAptGet.is_installed(self, 'php8.2-fpm'):
apt_packages = apt_packages + WOVar.wo_php82
else:
Log.debug(self, "PHP 8.2 is not installed")
Log.info(self, "PHP 8.2 is not installed")
Log.info(self, "PHP 8.2 is not installed")
# REDIS # REDIS
if pargs.redis: if pargs.redis:

View File

@@ -98,7 +98,8 @@ def pre_pref(self, apt_packages):
('php7.4-fpm' in apt_packages) or ('php7.4-fpm' in apt_packages) or
('php8.0-fpm' in apt_packages) or ('php8.0-fpm' in apt_packages) or
('php8.1-fpm' in apt_packages) or ('php8.1-fpm' in apt_packages) or
('php8.2-fpm' in apt_packages)): ('php8.2-fpm' in apt_packages) or
('php8.3-fpm' in apt_packages)):
if (WOVar.wo_distro == 'ubuntu'): if (WOVar.wo_distro == 'ubuntu'):
Log.debug(self, 'Adding ppa for PHP') Log.debug(self, 'Adding ppa for PHP')
Log.info(self, "Adding repository for PHP, please wait...") Log.info(self, "Adding repository for PHP, please wait...")

View File

@@ -107,6 +107,7 @@ class WOStackUpgradeController(CementBaseController):
pargs.php80 = True pargs.php80 = True
pargs.php81 = True pargs.php81 = True
pargs.php82 = True pargs.php82 = True
pargs.php83 = True
pargs.mysql = True pargs.mysql = True
pargs.wpcli = True pargs.wpcli = True
@@ -141,6 +142,7 @@ class WOStackUpgradeController(CementBaseController):
'php80': WOVar.wo_php80, 'php80': WOVar.wo_php80,
'php81': WOVar.wo_php81, 'php81': WOVar.wo_php81,
'php82': WOVar.wo_php82, 'php82': WOVar.wo_php82,
'php83': WOVar.wo_php83,
} }
for parg_version, version in WOVar.wo_php_versions.items(): for parg_version, version in WOVar.wo_php_versions.items():
@@ -282,6 +284,7 @@ class WOStackUpgradeController(CementBaseController):
"php8.0-fpm" in apt_packages or "php8.0-fpm" in apt_packages or
"php8.1-fpm" in apt_packages or "php8.1-fpm" in apt_packages or
"php8.2-fpm" in apt_packages or "php8.2-fpm" in apt_packages or
"php8.3-fpm" in apt_packages or
"redis-server" in apt_packages or "redis-server" in apt_packages or
"nginx-custom" in apt_packages or "nginx-custom" in apt_packages or
"mariadb-server" in apt_packages): "mariadb-server" in apt_packages):

View File

@@ -145,6 +145,26 @@ upstream debug82 {
server 127.0.0.1:9177; server 127.0.0.1:9177;
} }
#-------------------------------
# PHP 8.3
#-------------------------------
# PHP 8.3 upstream with load-balancing on two unix sockets
upstream php83 {
least_conn;
server unix:/var/run/php/php83-fpm.sock;
server unix:/var/run/php/php83-two-fpm.sock;
keepalive 5;
}
# PHP 8.3 debug
upstream debug83 {
# Debug Pool
server 127.0.0.1:9178;
}
#------------------------------- #-------------------------------
# Netdata # Netdata
#------------------------------- #-------------------------------
@@ -177,4 +197,5 @@ upstream multiphp {
server unix:/var/run/php/php80-fpm.sock; server unix:/var/run/php/php80-fpm.sock;
server unix:/var/run/php/php81-fpm.sock; server unix:/var/run/php/php81-fpm.sock;
server unix:/var/run/php/php82-fpm.sock; server unix:/var/run/php/php82-fpm.sock;
server unix:/var/run/php/php83-fpm.sock;
} }

View File

@@ -15,9 +15,9 @@ class WOVar():
"""Intialization of core variables""" """Intialization of core variables"""
# WordOps version # WordOps version
wo_version = "3.18.1" wo_version = "3.19.0"
# WordOps packages versions # WordOps packages versions
wo_wp_cli = "2.8.1" wo_wp_cli = "2.9.0"
wo_adminer = "4.8.1" wo_adminer = "4.8.1"
wo_phpmyadmin = "5.2.0" wo_phpmyadmin = "5.2.0"
wo_extplorer = "2.1.15" wo_extplorer = "2.1.15"
@@ -157,12 +157,13 @@ class WOVar():
'php80': '8.0', 'php80': '8.0',
'php81': '8.1', 'php81': '8.1',
'php82': '8.2', 'php82': '8.2',
'php83': '8.3',
} }
def generate_php_modules(version_prefix, version_number): def generate_php_modules(version_prefix, version_number):
wo_module = ["bcmath", "cli", "common", "curl", "fpm", "gd", "igbinary", wo_module = ["bcmath", "cli", "common", "curl", "fpm", "gd", "igbinary",
"imagick", "imap", "intl", "mbstring", "memcached", "msgpack", "imagick", "imap", "intl", "mbstring", "memcached", "msgpack",
"mysql", "opcache", "readline", "redis", "soap", "xdebug", "mysql", "opcache", "readline", "redis", "soap",
"xml", "zip"] "xml", "zip"]
php_modules = ["php{0}-{1}".format(version_number, module) for module in wo_module] php_modules = ["php{0}-{1}".format(version_number, module) for module in wo_module]
@@ -170,6 +171,8 @@ class WOVar():
php_modules.append("php{0}-recode".format(version_number)) php_modules.append("php{0}-recode".format(version_number))
elif version_prefix == 'php74': elif version_prefix == 'php74':
php_modules.extend(["php{0}-geoip".format(version_number), "php{0}-json".format(version_number)]) php_modules.extend(["php{0}-geoip".format(version_number), "php{0}-json".format(version_number)])
elif version_prefix != 'php83':
php_modules.append("php{0}-xdebug".format(version_number))
return php_modules return php_modules
@@ -179,6 +182,7 @@ class WOVar():
wo_php80 = generate_php_modules('php80', '8.0') wo_php80 = generate_php_modules('php80', '8.0')
wo_php81 = generate_php_modules('php81', '8.1') wo_php81 = generate_php_modules('php81', '8.1')
wo_php82 = generate_php_modules('php82', '8.2') wo_php82 = generate_php_modules('php82', '8.2')
wo_php83 = generate_php_modules('php83', '8.3')
wo_php_extra = ["graphviz"] wo_php_extra = ["graphviz"]