--- rpms/smeserver-freepbx/contribs10/smeserver-freepbx-14-go15.patch 2022/12/15 07:06:15 1.4 +++ rpms/smeserver-freepbx/contribs10/smeserver-freepbx-14-go15.patch 2022/12/15 07:51:28 1.5 @@ -1,6 +1,6 @@ diff -Nur --no-dereference smeserver-freepbx-14.old/createlinks smeserver-freepbx-14/createlinks --- smeserver-freepbx-14.old/createlinks 2022-12-14 23:37:45.763000000 -0500 -+++ smeserver-freepbx-14/createlinks 2022-12-15 01:54:26.822000000 -0500 ++++ smeserver-freepbx-14/createlinks 2022-12-15 02:36:42.248000000 -0500 @@ -3,8 +3,8 @@ use esmith::Build::CreateLinks qw(:all); @@ -12,7 +12,7 @@ diff -Nur --no-dereference smeserver-fre #safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/httpd-fpbx'); #safe_symlink("/var/service/httpd-fpbx" , 'root/service/httpd-fpbx'); -@@ -21,6 +21,7 @@ +@@ -21,10 +21,11 @@ templates2events("/etc/asterisk/cdr_mysql.conf", qw(freepbx-update bootstrap-console-save)); templates2events("/etc/asterisk/manager.conf", qw(freepbx-update bootstrap-console-save)); templates2events("/etc/logrotate.d/asterisk", qw(freepbx-update bootstrap-console-save)); @@ -20,7 +20,20 @@ diff -Nur --no-dereference smeserver-fre templates2events("/etc/httpd/conf/httpd.conf", $event); templates2events("/etc/httpd/fpbx-conf/httpd.conf", qw(freepbx-update bootstrap-console-save conf-userpanel)); templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", qw(freepbx-update bootstrap-console-save)); -@@ -62,12 +63,13 @@ +-#templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event); ++templates2events("/etc/opt/remi/php74/php-fpm.d/www.conf", $event); + templates2events("/opt/remi/php56/root/etc/php-fpm.d/www.conf", $event); + + event_link("freepbx-checkinstall", $event, "10"); +@@ -40,6 +41,7 @@ + safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); + safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-fpbx"); + safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php56-php-fpm"); ++safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php74-php-fpm"); + + safe_symlink("sigusr1", "root/etc/e-smith/events/logrotate/services2adjust/httpd-fpbx"); + +@@ -62,12 +64,13 @@ templates2events("/etc/asterisk/cdr_mysql.conf", $event); templates2events("/etc/asterisk/manager.conf", $event); templates2events("/etc/logrotate.d/asterisk", $event); @@ -28,16 +41,25 @@ diff -Nur --no-dereference smeserver-fre templates2events("/etc/httpd/conf/httpd.conf", $event); templates2events("/etc/httpd/fpbx-conf/httpd.conf", $event); templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", $event); - #templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event); +-#templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event); ++templates2events("/etc/opt/remi/php74/php-fpm.d/www.conf", $event); templates2events("/opt/remi/php56/root/etc/php-fpm.d/www.conf", $event); - +templates2events("/etc/odbc.ini", $event); event_link("freepbx-checkinstall", $event, "10"); event_link("freepbx-checkinstall-backup", $event, "11"); +@@ -79,6 +82,7 @@ + safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); + safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-fpbx"); + safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php56-php-fpm"); ++safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php74-php-fpm"); + #action needed in case we have a systemd unit + event_link("systemd-default", $event, "88"); + event_link("systemd-reload", $event, "89"); diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-amportal.conf smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-amportal.conf --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-03-27 23:45:44.000000000 -0400 -+++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-12-15 01:50:09.007000000 -0500 ++++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-12-15 02:50:16.040000000 -0500 @@ -1,5 +1,20 @@ #!/bin/bash @@ -70,18 +92,18 @@ diff -Nur --no-dereference smeserver-fre +/sbin/e-smith/fwconsole r diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-14 23:37:45.781000000 -0500 -+++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-15 01:50:08.759000000 -0500 ++++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-15 02:50:15.841000000 -0500 @@ -53,19 +53,32 @@ # Upgrades have to be done through freePBX and the online repository if [ ! -d /opt/freepbx/admin ]; then mkdir -p /opt/freepbx + # we need the right php version available + version=$(/usr/bin/rpm -q freepbx-src --qf "%{version}"|cut -d. -f1) -+ php="/usr/bin/php74" ++ php="/usr/bin/php56" + if [[ $version -ge 16 ]] + then + php="/usr/bin/php74" -+ elif [[ $version -lt 15 ]] ++ elif [[ $version -le 15 ]] + then + php="/usr/bin/php56" + fi @@ -106,20 +128,29 @@ diff -Nur --no-dereference smeserver-fre exit 1 fi else -@@ -95,19 +108,21 @@ - php="/usr/bin/php74" +@@ -92,22 +105,26 @@ + ln -sf /usr/sbin/e-smith/fwconsole /usr/sbin/fwconsole + ln -sf /usr/sbin/e-smith/fwconsole /usr/local/sbin/fwconsole + version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1) +-php="/usr/bin/php74" ++php="56" if [[ $version -ge 16 ]] then - php="/usr/bin/php80" +-elif [[ $version -lt 15 ]] + #version we have is not fully compatible, need newer source -+ php="/usr/bin/php74" - elif [[ $version -lt 15 ]] ++ php="74" ++elif [[ $version -le 15 ]] then - php="/usr/bin/php56" +- php="/usr/bin/php56" ++ php="56" fi - ln -sf $php /usr/sbin/php +-ln -sf $php /usr/sbin/php - -+ln -sf $php /usr/local/sbin/php ++forcephp=$(/sbin/e-smith/db configuration getprop freepbx PHPVersion || echo $php ) ++php=$forcephp ++ln -sf /usr/bin/php$php /usr/sbin/php ++ln -sf /usr/bin/php$php /usr/local/sbin/php # update modules -/usr/sbin/e-smith/fwconsole ma upgrade framework @@ -136,7 +167,7 @@ diff -Nur --no-dereference smeserver-fre exit 0 diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall-backup smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall-backup --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-12-14 23:37:45.782000000 -0500 -+++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-12-15 02:05:02.315000000 -0500 ++++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-12-15 02:28:47.994000000 -0500 @@ -56,6 +56,16 @@ if [ -z $backupid ] ; then backupid=$(/usr/bin/uuidgen) @@ -163,6 +194,18 @@ diff -Nur --no-dereference smeserver-fre # set first backup as the one for SME way # set destination mysql -e "use $DBNAME;UPDATE backup_server_details set value = '/home/e-smith/files/freepbx' WHERE server_id = 1;" +diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root smeserver-freepbx-14/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root +--- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root 2022-12-14 23:37:45.768000000 -0500 ++++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root 2022-12-15 02:45:28.605000000 -0500 +@@ -4,7 +4,7 @@ + { + my $key = "freepbx"; + my $pool_name = lc $key; +- my $version = 56; ++ my $version = ( $freepbx{PHPVersion} eq '74' )? '74' : '56'; + $OUT .=" + + SetHandler \"proxy:unix:/var/run/php-fpm/php${version}-${pool_name}.sock|fcgi://localhost\" diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info smeserver-freepbx-14/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info --- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info 2022-12-15 01:53:26.738000000 -0500 @@ -184,3 +227,38 @@ diff -Nur --no-dereference smeserver-fre +User = { ${freepbx}{DbUser} || 'freepbxuser'} +Password = { ${freepbx}{DbPassword} || 'freepbxuser'} + +diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx smeserver-freepbx-14/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx +--- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx 2022-03-27 23:45:44.000000000 -0400 ++++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx 2022-12-15 02:37:25.534000000 -0500 +@@ -1,6 +1,7 @@ + { + +-if ($PHP_VERSION eq '56'){ ++my $PHPVersion = ( $freepbx{PHPVersion} eq '74' )? '74' : '56'; ++if ($PHP_VERSION eq $PHPVersion){ + if (($freepbx{'status'} || 'disabled') eq 'enabled'){ + my $max_upload_size = ($freepbx{MaxUploadSize} || '100M'); + $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/); +diff -Nur --no-dereference smeserver-freepbx-14.old/root/sbin/e-smith/fwconsole smeserver-freepbx-14/root/sbin/e-smith/fwconsole +--- smeserver-freepbx-14.old/root/sbin/e-smith/fwconsole 2022-12-14 23:37:45.782000000 -0500 ++++ smeserver-freepbx-14/root/sbin/e-smith/fwconsole 2022-12-15 02:50:09.489000000 -0500 +@@ -1,12 +1,14 @@ + #!/bin/bash + version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1) +-php="/usr/bin/php74" ++php="56" + if [[ $version -ge 16 ]] + then +- php="/usr/bin/php80" +-elif [[ $version -lt 15 ]] ++ php="74" ++elif [[ $version -le 15 ]] + then +- php="/usr/bin/php56" ++ php="56" + fi ++forcephp=$(/sbin/e-smith/db configuration getprop freepbx PHPVersion || echo $php ) ++php=$forcephp + +-$php --define sys_temp_dir=/var/spool/asterisk/tmp/ --define allow_url_fopen=1 /var/lib/asterisk/bin/fwconsole $@ ++/usr/bin/php$php --define sys_temp_dir=/var/spool/asterisk/tmp/ --define allow_url_fopen=1 /var/lib/asterisk/bin/fwconsole $@