/[smecontribs]/rpms/smeserver-shared-folders/contribs10/smeserver-shared-folders-0.3-bz11523-php-fpm.patch
ViewVC logotype

Contents of /rpms/smeserver-shared-folders/contribs10/smeserver-shared-folders-0.3-bz11523-php-fpm.patch

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


Revision 1.2 - (show annotations) (download)
Mon Jul 25 06:01:51 2022 UTC (2 years, 4 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-shared-folders-0_3-18_el7_sme, smeserver-shared-folders-0_3-16_el7_sme, smeserver-shared-folders-0_3-17_el7_sme, smeserver-shared-folders-0_3-20_el7_sme, smeserver-shared-folders-0_3-22_el7_sme, smeserver-shared-folders-0_3-21_el7_sme, smeserver-shared-folders-0_3-23_el7_sme, smeserver-shared-folders-0_3-19_el7_sme, HEAD
Changes since 1.1: +14 -2 lines
* Mon Jul 25 2022 Jean-Philippe Pialasse <tests@pialasse.com> 0.3-16.sme
- merge php-fpm code [SME: 11523]

1 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/createlinks smeserver-shared-folders-0.3/createlinks
2 --- smeserver-shared-folders-0.3.old/createlinks 2022-07-25 01:14:56.328000000 -0400
3 +++ smeserver-shared-folders-0.3/createlinks 2022-07-25 01:33:17.069000000 -0400
4 @@ -84,3 +84,32 @@
5 templates2events("/etc/rsyncd.conf", "bootstrap-console-save");
6 templates2events("/etc/rsyncd.conf", "remoteaccess-update");
7
8 +# for php-fpm
9 +foreach my $service (qw(php-fpm php55-php-fpm php56-php-fpm php70-php-fpm php71-php-fpm php72-php-fpm php73-php-fpm php74-php-fpm php80-php-fpm php81-php-fpm)){
10 + foreach my $event qw(share-create share-modify share-modify-server share-delete smeserver-shared-update){
11 + safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/$service");
12 + }
13 +}
14 +
15 +
16 +
17 +foreach my $file qw( /etc/php-fpm.d/shares.conf
18 + /opt/remi/php55/root/etc/php-fpm.d/shares.conf
19 + /opt/remi/php56/root/etc/php-fpm.d/shares.conf
20 + /etc/opt/remi/php70/php-fpm.d/shares.conf
21 + /etc/opt/remi/php71/php-fpm.d/shares.conf
22 + /etc/opt/remi/php72/php-fpm.d/shares.conf
23 + /etc/opt/remi/php73/php-fpm.d/shares.conf
24 + /etc/opt/remi/php74/php-fpm.d/shares.conf
25 + /etc/opt/remi/php80/php-fpm.d/shares.conf
26 + /etc/opt/remi/php81/php-fpm.d/shares.conf ){
27 + templates2events($file, qw(webapps-update bootstrap-console-save share-create share-modify share-modify-server share-delete smeserver-shared-update smeserver-php-update));
28 + safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates$file/template-begin");
29 +}
30 +
31 +
32 +event_link("php-pool-dirs", "share-create", "90");
33 +event_link("php-pool-dirs", "share-modify", "90");
34 +event_link("php-pool-dirs", "share-modify-server", "90");
35 +event_link("php-pool-dirs", "share-delete", "90");
36 +
37 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess50shares smeserver-shared-folders-0.3/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess50shares
38 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess50shares 2022-07-25 01:14:56.310000000 -0400
39 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess50shares 2022-07-25 02:00:18.927000000 -0400
40 @@ -124,7 +124,7 @@
41 $OUT .= ' AddHandler php' . $key . '-fastcgi .php' . "\n";
42 }
43 elsif ($fastcgi_mod eq 'mod_proxy_fcgi'){
44 - my $version = $properties{'PHPVersion'} || '';
45 + my $version = $properties{'PHPVersion'} || '74';
46 $OUT .=<<"_EOF";
47 <FilesMatch \.php\$>
48 SetHandler "proxy:unix:/var/run/php-fpm/php$version-$key.sock|fcgi://localhost"
49 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates/etc/php-fpm.d/shares.conf/10Shares smeserver-shared-folders-0.3/root/etc/e-smith/templates/etc/php-fpm.d/shares.conf/10Shares
50 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates/etc/php-fpm.d/shares.conf/10Shares 1969-12-31 19:00:00.000000000 -0500
51 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates/etc/php-fpm.d/shares.conf/10Shares 2022-07-25 01:59:49.751000000 -0400
52 @@ -0,0 +1,72 @@
53 +{
54 +
55 +use esmith::AccountsDB;
56 +my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database";
57 +
58 +foreach my $share ($a->get_all_by_prop(type => 'share')){
59 + my $version = $share->prop('PHPVersion') || '74';
60 + my $dynamic = $share->prop('DynamicContent') || 'disabled';
61 + my $custom = $share->prop('PHPCustomPool') || undef;
62 + next unless ($dynamic eq 'enabled' && $version eq $PHP_VERSION && !$custom);
63 + my $key = $share->key;
64 + my $pool_name = 'php' . $version . '-' . $key;
65 + my $memory_limit = $share->prop('PHPMemoryLimit') || '128M';
66 + my $max_execution_time = $share->prop('PHPMaxExecutionTime') || '30';
67 + my $max_input_time = $share->prop('PHPMaxInputTime') || '60';
68 + my $allow_url_fopen = $share->prop('PHPAllowUrlFopen') || 'disabled';
69 + my $post_max_size = $share->prop('PHPPostMaxSize') || '10M';
70 + my $upload_max_filesize = $share->prop('PHPUploadMaxFilesize') || '10M';
71 + my $file_upload = $share->prop('PHPFileUpload') || 'enabled';
72 + my $open_basedir = $share->prop('PHPBaseDir') || '/home/e-smith/files/shares/' . $key .
73 + ':/var/lib/php/' . $key;
74 + my $disabled_functions = $share->prop('PHPDisabledFunctions') || 'system,show_source,' .
75 + 'symlink,exec,dl,shell_exec,' .
76 + 'passthru,phpinfo,' .
77 + 'escapeshellarg,escapeshellcmd';
78 + # Format vars
79 + $file_upload = ($file_upload =~ m/^1|yes|on|enabled$/) ? 'on' : 'off';
80 + $allow_url_fopen = ($allow_url_fopen =~ m/^1|yes|on|enabled$/) ? 'on' : 'off';
81 + $disabled_functions = join(', ', split /[,;:]/, $disabled_functions);
82 + $open_basedir = join(':', split(/[,;:]/, $open_basedir));
83 +
84 + $OUT .=<<"_EOF" if ($version eq $PHP_VERSION);
85 +
86 +[$pool_name]
87 +user = www
88 +group = www
89 +listen.owner = root
90 +listen.group = www
91 +listen.mode = 0660
92 +listen = /var/run/php-fpm/$pool_name.sock
93 +pm = dynamic
94 +pm.max_children = 15
95 +pm.start_servers = 3
96 +pm.min_spare_servers = 3
97 +pm.max_spare_servers = 4
98 +pm.max_requests = 1000
99 +slowlog = /var/log/php/$key/slow.log
100 +php_admin_value[session.save_path] = /var/lib/php/$key/session
101 +php_admin_value[opcache.file_cache] = /var/lib/php/$key/opcache
102 +php_admin_value[upload_tmp_dir] = /var/lib/php/$key/tmp
103 +php_admin_value[error_log] = /var/log/php/$key/error.log
104 +php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName }
105 +php_admin_flag[display_errors] = off
106 +php_admin_flag[log_errors] = on
107 +php_admin_value[error_log] = syslog
108 +php_admin_value[memory_limit] = $memory_limit
109 +php_admin_value[max_execution_time] = $max_execution_time
110 +php_admin_value[post_max_size] = $post_max_size
111 +php_admin_value[upload_max_filesize] = $upload_max_filesize
112 +php_admin_value[max_input_time] = $max_input_time
113 +php_admin_value[disable_functions] = $disabled_functions
114 +php_admin_flag[allow_url_fopen] = $allow_url_fopen
115 +php_admin_flag[file_upload] = $file_upload
116 +php_admin_flag[session.cookie_httponly] = on
117 +php_admin_flag[allow_url_include] = off
118 +php_admin_value[session.save_handler] = files
119 +php_admin_value[open_basedir] = $open_basedir
120 +
121 +_EOF
122 +}
123 +
124 +}
125 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/shares.conf smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/shares.conf
126 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/shares.conf 1969-12-31 19:00:00.000000000 -0500
127 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php70/php-fpm.d/shares.conf 2017-07-27 12:05:00.000000000 -0400
128 @@ -0,0 +1,2 @@
129 +TEMPLATE_PATH="/etc/php-fpm.d/shares.conf"
130 +MORE_DATA={ PHP_VERSION => 70 }
131 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/shares.conf smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/shares.conf
132 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/shares.conf 1969-12-31 19:00:00.000000000 -0500
133 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php71/php-fpm.d/shares.conf 2017-07-27 12:05:00.000000000 -0400
134 @@ -0,0 +1,2 @@
135 +TEMPLATE_PATH="/etc/php-fpm.d/shares.conf"
136 +MORE_DATA={ PHP_VERSION => 71 }
137 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php72/php-fpm.d/shares.conf smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php72/php-fpm.d/shares.conf
138 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php72/php-fpm.d/shares.conf 1969-12-31 19:00:00.000000000 -0500
139 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php72/php-fpm.d/shares.conf 2020-01-27 13:27:12.000000000 -0500
140 @@ -0,0 +1,2 @@
141 +TEMPLATE_PATH="/etc/php-fpm.d/shares.conf"
142 +MORE_DATA={ PHP_VERSION => 72 }
143 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php73/php-fpm.d/shares.conf smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php73/php-fpm.d/shares.conf
144 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php73/php-fpm.d/shares.conf 1969-12-31 19:00:00.000000000 -0500
145 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php73/php-fpm.d/shares.conf 2020-01-27 13:27:12.000000000 -0500
146 @@ -0,0 +1,2 @@
147 +TEMPLATE_PATH="/etc/php-fpm.d/shares.conf"
148 +MORE_DATA={ PHP_VERSION => 73 }
149 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php74/php-fpm.d/shares.conf smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php74/php-fpm.d/shares.conf
150 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php74/php-fpm.d/shares.conf 1969-12-31 19:00:00.000000000 -0500
151 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php74/php-fpm.d/shares.conf 2022-07-25 01:20:02.519000000 -0400
152 @@ -0,0 +1,2 @@
153 +TEMPLATE_PATH="/etc/php-fpm.d/shares.conf"
154 +MORE_DATA={ PHP_VERSION => 74 }
155 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php80/php-fpm.d/shares.conf smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php80/php-fpm.d/shares.conf
156 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php80/php-fpm.d/shares.conf 1969-12-31 19:00:00.000000000 -0500
157 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php80/php-fpm.d/shares.conf 2022-07-25 01:20:16.726000000 -0400
158 @@ -0,0 +1,2 @@
159 +TEMPLATE_PATH="/etc/php-fpm.d/shares.conf"
160 +MORE_DATA={ PHP_VERSION => 80 }
161 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php81/php-fpm.d/shares.conf smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php81/php-fpm.d/shares.conf
162 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/opt/remi/php81/php-fpm.d/shares.conf 1969-12-31 19:00:00.000000000 -0500
163 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/opt/remi/php81/php-fpm.d/shares.conf 2022-07-25 01:20:29.574000000 -0400
164 @@ -0,0 +1,2 @@
165 +TEMPLATE_PATH="/etc/php-fpm.d/shares.conf"
166 +MORE_DATA={ PHP_VERSION => 80 }
167 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/php-fpm.d/shares.conf smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/php-fpm.d/shares.conf
168 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/etc/php-fpm.d/shares.conf 1969-12-31 19:00:00.000000000 -0500
169 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/etc/php-fpm.d/shares.conf 2017-07-27 12:05:00.000000000 -0400
170 @@ -0,0 +1,2 @@
171 +TEMPLATE_PATH="/etc/php-fpm.d/shares.conf"
172 +MORE_DATA={ PHP_VERSION => '' }
173 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/opt/remi/php55/root/etc/php-fpm.d/shares.conf smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/opt/remi/php55/root/etc/php-fpm.d/shares.conf
174 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/opt/remi/php55/root/etc/php-fpm.d/shares.conf 1969-12-31 19:00:00.000000000 -0500
175 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/opt/remi/php55/root/etc/php-fpm.d/shares.conf 2022-07-25 01:22:17.066000000 -0400
176 @@ -0,0 +1,2 @@
177 +TEMPLATE_PATH="/etc/php-fpm.d/shares.conf"
178 +MORE_DATA={ PHP_VERSION => 55 }
179 diff -Nur --no-dereference smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/shares.conf smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/shares.conf
180 --- smeserver-shared-folders-0.3.old/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/shares.conf 1969-12-31 19:00:00.000000000 -0500
181 +++ smeserver-shared-folders-0.3/root/etc/e-smith/templates.metadata/opt/remi/php56/root/etc/php-fpm.d/shares.conf 2017-07-27 12:05:00.000000000 -0400
182 @@ -0,0 +1,2 @@
183 +TEMPLATE_PATH="/etc/php-fpm.d/shares.conf"
184 +MORE_DATA={ PHP_VERSION => 56 }

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