--- rpms/smeserver-freepbx/contribs10/smeserver-freepbx-14-go15.patch 2022/12/15 05:18:58 1.2 +++ rpms/smeserver-freepbx/contribs10/smeserver-freepbx-14-go15.patch 2023/01/04 05:25:17 1.7 @@ -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 00:17:45.820000000 -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,29 +20,90 @@ 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)); -@@ -67,7 +68,7 @@ +-#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); ++templates2events("/etc/logrotate.d/vsftpd", $event); + 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 03:13:57.868000000 -0500 +@@ -1,5 +1,20 @@ + #!/bin/bash + ++version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1) ++if [[ $version -ge 15 ]] ; then ++fwconsole="/sbin/e-smith/fwconsole" ++$fwconsole setting DISABLE_CSS_AUTOGEN 1 ++$fwconsole setting CHECKREFERER 0 ++$fwconsole setting AUTHTYPE none ++$fwconsole setting AMPWEBROOT /opt/freepbx ++$fwconsole setting MODULEADMINWGET 1 ++$fwconsole setting DYNAMICHINTS 1 ++$fwconsole setting ARI_ADMIN_PASSWORD $(/sbin/e-smith/db configuration getprop freepbx AriPassword) 2>/dev/null 1>&2 ++$fwconsole setting AMPMGRPASS $(/sbin/e-smith/db configuration getprop freepbx ManagerPassword) ++$fwconsole setting RSSFEEDS 'http://www.freepbx.org/rss.xml' ++$fwconsole setting BRAND_FREEPBX_ALT_FOOT FreePBX ++ ++else + # Change FreePBX database settings that should have come from /etc/amportal.conf, + # this is a dynamic template for FreePBX > 1.9 as it update the file on the fly, and also the db + FPBX_SETTING_PATH="/var/lib/asterisk/bin/freepbx_setting" +@@ -13,6 +28,6 @@ + $FPBX_SETTING_PATH AMPMGRPASS $(/sbin/e-smith/db configuration getprop freepbx ManagerPassword) + $FPBX_SETTING_PATH RSSFEEDS 'http://www.freepbx.org/rss.xml' + $FPBX_SETTING_PATH BRAND_FREEPBX_ALT_FOOT FreePBX +- ++fi + # now regenrate the amportal.conf from mysql +-/var/lib/asterisk/bin/fwconsole r ++/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 00:17:35.927000000 -0500 ++++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-15 03:13:57.660000000 -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 @@ -67,23 +128,89 @@ diff -Nur --no-dereference smeserver-fre exit 1 fi else -@@ -95,13 +108,14 @@ - 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 2>/dev/null || 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 +-/usr/sbin/e-smith/fwconsole ma upgrade framework +-/usr/sbin/e-smith/fwconsole ma upgradeall -R standard -R extended +-/usr/sbin/e-smith/fwconsole ma refreshsignatures +-/usr/sbin/e-smith/fwconsole ma downloadinstall userman certman ++/usr/sbin/e-smith/fwconsole ma upgrade framework 2>/dev/null ++/usr/sbin/e-smith/fwconsole ma upgrade core 2>/dev/null ++/usr/sbin/e-smith/fwconsole ma upgradeall -R standard -R extended 2>/dev/null ++/usr/sbin/e-smith/fwconsole ma refreshsignatures 2>/dev/null ++/usr/sbin/e-smith/fwconsole ma downloadinstall userman certman arimanager 2>/dev/null + /usr/sbin/e-smith/fwconsole ma downloadinstall ucp 2>/dev/null + + 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 03:13:58.104000000 -0500 +@@ -56,6 +56,16 @@ + if [ -z $backupid ] ; then + backupid=$(/usr/bin/uuidgen) + echo "creating new backup id $backupid" ++ ++ mysql -e "use $DBNAME; CREATE TABLE IF NOT EXISTS \`kvstore_FreePBX_modules_Backup\` ( ++ \`key\` char(255) NOT NULL, ++ \`val\` varchar(4096) DEFAULT NULL, ++ \`type\` char(16) DEFAULT NULL, ++ \`id\` char(255) DEFAULT NULL, ++ UNIQUE KEY \`uniqueindex\` (\`key\`(190),\`id\`(190)), ++ KEY \`keyindex\` (\`key\`(190)), ++ KEY \`idindex\` (\`id\`(190)) ++) ENGINE=InnoDB DEFAULT CHARSET=utf8;" + + ##TODO SELECT * FROM `kvblobstore` WHERE `uuid` LIKE 'a9fe727b-fc4c-40c4-ad45-bcabd075302a' + ### TODO : list modules enabled and populate +@@ -155,7 +165,7 @@ + #('backup_items', 'a9fe727b-fc4c-40c4-ad45-bcabd075302a', 'blob', '$backupid') + #ON DUPLICATE KEY UPDATE val=VALUES(val);" + +-else ++elif [[ $version -lt 15 ]] ; then + # 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 03:14:11.029000000 -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 +@@ -0,0 +1 @@ ++# /var/log/xferlog already handled in /etc/logrotate.d/proftpd diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/odbc.ini/10freepbx smeserver-freepbx-14/root/etc/e-smith/templates/etc/odbc.ini/10freepbx --- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/odbc.ini/10freepbx 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/odbc.ini/10freepbx 2022-12-15 00:06:39.445000000 -0500 @@ -100,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 03:14:15.561000000 -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 03:14:02.205000000 -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 $@