/[smecontribs]/rpms/smeserver-freepbx/contribs10/smeserver-freepbx-14-go15.patch
ViewVC logotype

Contents of /rpms/smeserver-freepbx/contribs10/smeserver-freepbx-14-go15.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.8 - (show annotations) (download)
Sun Feb 5 16:43:04 2023 UTC (21 months, 2 weeks ago) by jpp
Branch: MAIN
CVS Tags: smeserver-freepbx-14-13_el7_sme, smeserver-freepbx-14-14_el7_sme, HEAD
Changes since 1.7: +1 -1 lines
* Wed Jan 04 2023 Jean-Philippe Pialasse <tests@pialasse.com> 14-12.sme
- fix permission denied on /usr/local/sbin/fwconsole from cron

1 diff -Nur --no-dereference smeserver-freepbx-14.old/createlinks smeserver-freepbx-14/createlinks
2 --- smeserver-freepbx-14.old/createlinks 2022-12-14 23:37:45.763000000 -0500
3 +++ smeserver-freepbx-14/createlinks 2022-12-15 02:36:42.248000000 -0500
4 @@ -3,8 +3,8 @@
5 use esmith::Build::CreateLinks qw(:all);
6
7 # force default php to php56
8 -safe_symlink("/usr/bin/php56", "root/usr/sbin/php");
9 -safe_symlink("/usr/bin/php56", "root/usr/local/sbin/php");
10 +safe_symlink("/usr/bin/php74", "root/usr/sbin/php");
11 +safe_symlink("/usr/bin/php74", "root/usr/local/sbin/php");
12
13 #safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/httpd-fpbx');
14 #safe_symlink("/var/service/httpd-fpbx" , 'root/service/httpd-fpbx');
15 @@ -21,10 +21,11 @@
16 templates2events("/etc/asterisk/cdr_mysql.conf", qw(freepbx-update bootstrap-console-save));
17 templates2events("/etc/asterisk/manager.conf", qw(freepbx-update bootstrap-console-save));
18 templates2events("/etc/logrotate.d/asterisk", qw(freepbx-update bootstrap-console-save));
19 +templates2events("/etc/odbc.ini", qw(freepbx-update bootstrap-console-save));
20 templates2events("/etc/httpd/conf/httpd.conf", $event);
21 templates2events("/etc/httpd/fpbx-conf/httpd.conf", qw(freepbx-update bootstrap-console-save conf-userpanel));
22 templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", qw(freepbx-update bootstrap-console-save));
23 -#templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event);
24 +templates2events("/etc/opt/remi/php74/php-fpm.d/www.conf", $event);
25 templates2events("/opt/remi/php56/root/etc/php-fpm.d/www.conf", $event);
26
27 event_link("freepbx-checkinstall", $event, "10");
28 @@ -40,6 +41,7 @@
29 safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
30 safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-fpbx");
31 safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php56-php-fpm");
32 +safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php74-php-fpm");
33
34 safe_symlink("sigusr1", "root/etc/e-smith/events/logrotate/services2adjust/httpd-fpbx");
35
36 @@ -62,12 +64,13 @@
37 templates2events("/etc/asterisk/cdr_mysql.conf", $event);
38 templates2events("/etc/asterisk/manager.conf", $event);
39 templates2events("/etc/logrotate.d/asterisk", $event);
40 +templates2events("/etc/logrotate.d/vsftpd", $event);
41 templates2events("/etc/httpd/conf/httpd.conf", $event);
42 templates2events("/etc/httpd/fpbx-conf/httpd.conf", $event);
43 templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", $event);
44 -#templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event);
45 +templates2events("/etc/opt/remi/php74/php-fpm.d/www.conf", $event);
46 templates2events("/opt/remi/php56/root/etc/php-fpm.d/www.conf", $event);
47 -
48 +templates2events("/etc/odbc.ini", $event);
49
50 event_link("freepbx-checkinstall", $event, "10");
51 event_link("freepbx-checkinstall-backup", $event, "11");
52 @@ -79,6 +82,7 @@
53 safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
54 safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-fpbx");
55 safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php56-php-fpm");
56 +safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php74-php-fpm");
57 #action needed in case we have a systemd unit
58 event_link("systemd-default", $event, "88");
59 event_link("systemd-reload", $event, "89");
60 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
61 --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-03-27 23:45:44.000000000 -0400
62 +++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-12-15 03:13:57.868000000 -0500
63 @@ -1,5 +1,20 @@
64 #!/bin/bash
65
66 +version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1)
67 +if [[ $version -ge 15 ]] ; then
68 +fwconsole="/sbin/e-smith/fwconsole"
69 +$fwconsole setting DISABLE_CSS_AUTOGEN 1
70 +$fwconsole setting CHECKREFERER 0
71 +$fwconsole setting AUTHTYPE none
72 +$fwconsole setting AMPWEBROOT /opt/freepbx
73 +$fwconsole setting MODULEADMINWGET 1
74 +$fwconsole setting DYNAMICHINTS 1
75 +$fwconsole setting ARI_ADMIN_PASSWORD $(/sbin/e-smith/db configuration getprop freepbx AriPassword) 2>/dev/null 1>&2
76 +$fwconsole setting AMPMGRPASS $(/sbin/e-smith/db configuration getprop freepbx ManagerPassword)
77 +$fwconsole setting RSSFEEDS 'http://www.freepbx.org/rss.xml'
78 +$fwconsole setting BRAND_FREEPBX_ALT_FOOT FreePBX
79 +
80 +else
81 # Change FreePBX database settings that should have come from /etc/amportal.conf,
82 # this is a dynamic template for FreePBX > 1.9 as it update the file on the fly, and also the db
83 FPBX_SETTING_PATH="/var/lib/asterisk/bin/freepbx_setting"
84 @@ -13,6 +28,6 @@
85 $FPBX_SETTING_PATH AMPMGRPASS $(/sbin/e-smith/db configuration getprop freepbx ManagerPassword)
86 $FPBX_SETTING_PATH RSSFEEDS 'http://www.freepbx.org/rss.xml'
87 $FPBX_SETTING_PATH BRAND_FREEPBX_ALT_FOOT FreePBX
88 -
89 +fi
90 # now regenrate the amportal.conf from mysql
91 -/var/lib/asterisk/bin/fwconsole r
92 +/sbin/e-smith/fwconsole r
93 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
94 --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-14 23:37:45.781000000 -0500
95 +++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-15 03:13:57.660000000 -0500
96 @@ -53,19 +53,32 @@
97 # Upgrades have to be done through freePBX and the online repository
98 if [ ! -d /opt/freepbx/admin ]; then
99 mkdir -p /opt/freepbx
100 + # we need the right php version available
101 + version=$(/usr/bin/rpm -q freepbx-src --qf "%{version}"|cut -d. -f1)
102 + php="/usr/bin/php56"
103 + if [[ $version -ge 16 ]]
104 + then
105 + php="/usr/bin/php74"
106 + elif [[ $version -le 15 ]]
107 + then
108 + php="/usr/bin/php56"
109 + fi
110 + ln -sf $php /usr/sbin/php
111 + ln -sf $php /usr/local/sbin/php
112 +
113 if [ -e /usr/share/freepbx/sources/freepbx/ ]; then
114 cd /usr/share/freepbx/sources/freepbx/
115 echo "Starting Asterisk..." > /root/freepbx_install.log
116 ./start_asterisk start >> /root/freepbx_install.log 2>&1
117 echo "" >> /root/freepbx_install.log
118 echo "Installing FreePBX..." >> /root/freepbx_install.log
119 - echo "a" | ./install --webroot="/opt/freepbx" \
120 + echo "a" |$php --define sys_temp_dir=/var/spool/asterisk/tmp/ --define allow_url_fopen=1 --define memory_limit=256M /usr/share/freepbx/sources/freepbx/install --webroot="/opt/freepbx" \
121 --dbengine="mysql" --dbname="freepbxdb" --dbuser="freepbxuser" --dbpass="$DBPASS" -n \
122 --cdrdbname="$CDRDBNAME" --astmoddir=/usr/lib64/asterisk/modules/ \
123 --astagidir=/usr/share/asterisk/agi-bin/ --ampsbin=/usr/sbin --ampcgibin=/opt/freepbx/cgi-bin \
124 >> /root/freepbx_install.log 2>&1
125 else
126 - echo "error: /usr/share/freepbx/sources/freepbx/ doesn't exists"
127 + echo "error: /usr/share/freepbx/sources/freepbx/ doesn't exists"
128 exit 1
129 fi
130 else
131 @@ -92,22 +105,26 @@
132 ln -sf /usr/sbin/e-smith/fwconsole /usr/sbin/fwconsole
133 ln -sf /usr/sbin/e-smith/fwconsole /usr/local/sbin/fwconsole
134 version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1)
135 -php="/usr/bin/php74"
136 +php="56"
137 if [[ $version -ge 16 ]]
138 then
139 - php="/usr/bin/php80"
140 -elif [[ $version -lt 15 ]]
141 + #version we have is not fully compatible, need newer source
142 + php="74"
143 +elif [[ $version -le 15 ]]
144 then
145 - php="/usr/bin/php56"
146 + php="56"
147 fi
148 -ln -sf $php /usr/sbin/php
149 -
150 +forcephp=$(/sbin/e-smith/db configuration getprop freepbx PHPVersion 2>/dev/null || echo $php )
151 +php=$forcephp
152 +ln -sf /usr/bin/php$php /usr/sbin/php
153 +ln -sf /usr/bin/php$php /usr/local/sbin/php
154
155 # update modules
156 -/usr/sbin/e-smith/fwconsole ma upgrade framework
157 -/usr/sbin/e-smith/fwconsole ma upgradeall -R standard -R extended
158 -/usr/sbin/e-smith/fwconsole ma refreshsignatures
159 -/usr/sbin/e-smith/fwconsole ma downloadinstall userman certman
160 +/usr/sbin/e-smith/fwconsole ma upgrade framework 2>/dev/null
161 +/usr/sbin/e-smith/fwconsole ma upgrade core 2>/dev/null
162 +/usr/sbin/e-smith/fwconsole ma upgradeall -R standard -R extended 2>/dev/null
163 +/usr/sbin/e-smith/fwconsole ma refreshsignatures 2>/dev/null
164 +/usr/sbin/e-smith/fwconsole ma downloadinstall userman certman arimanager 2>/dev/null
165 /usr/sbin/e-smith/fwconsole ma downloadinstall ucp 2>/dev/null
166
167 exit 0
168 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
169 --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-12-14 23:37:45.782000000 -0500
170 +++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-12-15 03:13:58.104000000 -0500
171 @@ -56,6 +56,16 @@
172 if [ -z $backupid ] ; then
173 backupid=$(/usr/bin/uuidgen)
174 echo "creating new backup id $backupid"
175 +
176 + mysql -e "use $DBNAME; CREATE TABLE IF NOT EXISTS \`kvstore_FreePBX_modules_Backup\` (
177 + \`key\` char(255) NOT NULL,
178 + \`val\` varchar(4096) DEFAULT NULL,
179 + \`type\` char(16) DEFAULT NULL,
180 + \`id\` char(255) DEFAULT NULL,
181 + UNIQUE KEY \`uniqueindex\` (\`key\`(190),\`id\`(190)),
182 + KEY \`keyindex\` (\`key\`(190)),
183 + KEY \`idindex\` (\`id\`(190))
184 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
185
186 ##TODO SELECT * FROM `kvblobstore` WHERE `uuid` LIKE 'a9fe727b-fc4c-40c4-ad45-bcabd075302a'
187 ### TODO : list modules enabled and populate
188 @@ -155,7 +165,7 @@
189 #('backup_items', 'a9fe727b-fc4c-40c4-ad45-bcabd075302a', 'blob', '$backupid')
190 #ON DUPLICATE KEY UPDATE val=VALUES(val);"
191
192 -else
193 +elif [[ $version -lt 15 ]] ; then
194 # set first backup as the one for SME way
195 # set destination
196 mysql -e "use $DBNAME;UPDATE backup_server_details set value = '/home/e-smith/files/freepbx' WHERE server_id = 1;"
197 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
198 --- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root 2022-12-14 23:37:45.768000000 -0500
199 +++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root 2022-12-15 03:14:11.029000000 -0500
200 @@ -4,7 +4,7 @@
201 {
202 my $key = "freepbx";
203 my $pool_name = lc $key;
204 - my $version = 56;
205 + my $version = ( $freepbx{PHPVersion} eq '74' )? '74' : '56';
206 $OUT .="
207 <FilesMatch .php\$>
208 SetHandler \"proxy:unix:/var/run/php-fpm/php${version}-${pool_name}.sock|fcgi://localhost\"
209 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
210 --- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info 1969-12-31 19:00:00.000000000 -0500
211 +++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info 2022-12-15 01:53:26.738000000 -0500
212 @@ -0,0 +1 @@
213 +# /var/log/xferlog already handled in /etc/logrotate.d/proftpd
214 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
215 --- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/odbc.ini/10freepbx 1969-12-31 19:00:00.000000000 -0500
216 +++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/odbc.ini/10freepbx 2022-12-15 00:06:39.445000000 -0500
217 @@ -0,0 +1,12 @@
218 +[MySQL-{ ${freepbx}{CdrDbName} || 'asteriskcdrdb' }]
219 +Description=MySQL connection to '{ ${freepbx}{CdrDbName} || 'asteriskcdrdb' }' database
220 +driver=MySQL
221 +server=localhost
222 +database={ ${freepbx}{CdrDbName} || 'asteriskcdrdb' }
223 +Port=3306
224 +Socket=/var/lib/mysql/mysql.sock
225 +option=3
226 +Charset=utf8
227 +User = { ${freepbx}{DbUser} || 'freepbxuser'}
228 +Password = { ${freepbx}{DbPassword} || 'freepbxuser'}
229 +
230 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
231 --- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx 2022-03-27 23:45:44.000000000 -0400
232 +++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx 2022-12-15 03:14:15.561000000 -0500
233 @@ -1,6 +1,7 @@
234 {
235
236 -if ($PHP_VERSION eq '56'){
237 +my $PHPVersion = ( $freepbx{PHPVersion} eq '74' )? '74' : '56';
238 +if ($PHP_VERSION eq $PHPVersion){
239 if (($freepbx{'status'} || 'disabled') eq 'enabled'){
240 my $max_upload_size = ($freepbx{MaxUploadSize} || '100M');
241 $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/);
242 diff -Nur --no-dereference smeserver-freepbx-14.old/root/sbin/e-smith/fwconsole smeserver-freepbx-14/root/sbin/e-smith/fwconsole
243 --- smeserver-freepbx-14.old/root/sbin/e-smith/fwconsole 2022-12-14 23:37:45.782000000 -0500
244 +++ smeserver-freepbx-14/root/sbin/e-smith/fwconsole 2022-12-15 03:14:02.205000000 -0500
245 @@ -1,12 +1,14 @@
246 #!/bin/bash
247 version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1)
248 -php="/usr/bin/php74"
249 +php="56"
250 if [[ $version -ge 16 ]]
251 then
252 - php="/usr/bin/php80"
253 -elif [[ $version -lt 15 ]]
254 + php="74"
255 +elif [[ $version -le 15 ]]
256 then
257 - php="/usr/bin/php56"
258 + php="56"
259 fi
260 +forcephp=$(/sbin/e-smith/db configuration getprop freepbx PHPVersion 2>/dev/null || echo $php )
261 +php=$forcephp
262
263 -$php --define sys_temp_dir=/var/spool/asterisk/tmp/ --define allow_url_fopen=1 /var/lib/asterisk/bin/fwconsole $@
264 +/usr/bin/php$php --define sys_temp_dir=/var/spool/asterisk/tmp/ --define allow_url_fopen=1 /var/lib/asterisk/bin/fwconsole $@

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed