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/php-fpm.d/shares.conf/10Shares smeserver-shared-folders-0.3/root/etc/e-smith/templates/etc/php-fpm.d/shares.conf/10Shares |
38 |
--- 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 |
39 |
+++ smeserver-shared-folders-0.3/root/etc/e-smith/templates/etc/php-fpm.d/shares.conf/10Shares 2017-07-27 12:05:00.000000000 -0400 |
40 |
@@ -0,0 +1,72 @@ |
41 |
+{ |
42 |
+ |
43 |
+use esmith::AccountsDB; |
44 |
+my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database"; |
45 |
+ |
46 |
+foreach my $share ($a->get_all_by_prop(type => 'share')){ |
47 |
+ my $version = $share->prop('PHPVersion') || ''; |
48 |
+ my $dynamic = $share->prop('DynamicContent') || 'disabled'; |
49 |
+ my $custom = $share->prop('PHPCustomPool') || undef; |
50 |
+ next unless ($dynamic eq 'enabled' && $version eq $PHP_VERSION && !$custom); |
51 |
+ my $key = $share->key; |
52 |
+ my $pool_name = 'php' . $version . '-' . $key; |
53 |
+ my $memory_limit = $share->prop('PHPMemoryLimit') || '128M'; |
54 |
+ my $max_execution_time = $share->prop('PHPMaxExecutionTime') || '30'; |
55 |
+ my $max_input_time = $share->prop('PHPMaxInputTime') || '60'; |
56 |
+ my $allow_url_fopen = $share->prop('PHPAllowUrlFopen') || 'disabled'; |
57 |
+ my $post_max_size = $share->prop('PHPPostMaxSize') || '10M'; |
58 |
+ my $upload_max_filesize = $share->prop('PHPUploadMaxFilesize') || '10M'; |
59 |
+ my $file_upload = $share->prop('PHPFileUpload') || 'enabled'; |
60 |
+ my $open_basedir = $share->prop('PHPBaseDir') || '/home/e-smith/files/shares/' . $key . |
61 |
+ ':/var/lib/php/' . $key; |
62 |
+ my $disabled_functions = $share->prop('PHPDisabledFunctions') || 'system,show_source,' . |
63 |
+ 'symlink,exec,dl,shell_exec,' . |
64 |
+ 'passthru,phpinfo,' . |
65 |
+ 'escapeshellarg,escapeshellcmd'; |
66 |
+ # Format vars |
67 |
+ $file_upload = ($file_upload =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; |
68 |
+ $allow_url_fopen = ($allow_url_fopen =~ m/^1|yes|on|enabled$/) ? 'on' : 'off'; |
69 |
+ $disabled_functions = join(', ', split /[,;:]/, $disabled_functions); |
70 |
+ $open_basedir = join(':', split(/[,;:]/, $open_basedir)); |
71 |
+ |
72 |
+ $OUT .=<<"_EOF" if ($version eq $PHP_VERSION); |
73 |
+ |
74 |
+[$pool_name] |
75 |
+user = www |
76 |
+group = www |
77 |
+listen.owner = root |
78 |
+listen.group = www |
79 |
+listen.mode = 0660 |
80 |
+listen = /var/run/php-fpm/$pool_name.sock |
81 |
+pm = dynamic |
82 |
+pm.max_children = 15 |
83 |
+pm.start_servers = 3 |
84 |
+pm.min_spare_servers = 3 |
85 |
+pm.max_spare_servers = 4 |
86 |
+pm.max_requests = 1000 |
87 |
+slowlog = /var/log/php/$key/slow.log |
88 |
+php_admin_value[session.save_path] = /var/lib/php/$key/session |
89 |
+php_admin_value[opcache.file_cache] = /var/lib/php/$key/opcache |
90 |
+php_admin_value[upload_tmp_dir] = /var/lib/php/$key/tmp |
91 |
+php_admin_value[error_log] = /var/log/php/$key/error.log |
92 |
+php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName } |
93 |
+php_admin_flag[display_errors] = off |
94 |
+php_admin_flag[log_errors] = on |
95 |
+php_admin_value[error_log] = syslog |
96 |
+php_admin_value[memory_limit] = $memory_limit |
97 |
+php_admin_value[max_execution_time] = $max_execution_time |
98 |
+php_admin_value[post_max_size] = $post_max_size |
99 |
+php_admin_value[upload_max_filesize] = $upload_max_filesize |
100 |
+php_admin_value[max_input_time] = $max_input_time |
101 |
+php_admin_value[disable_functions] = $disabled_functions |
102 |
+php_admin_flag[allow_url_fopen] = $allow_url_fopen |
103 |
+php_admin_flag[file_upload] = $file_upload |
104 |
+php_admin_flag[session.cookie_httponly] = on |
105 |
+php_admin_flag[allow_url_include] = off |
106 |
+php_admin_value[session.save_handler] = files |
107 |
+php_admin_value[open_basedir] = $open_basedir |
108 |
+ |
109 |
+_EOF |
110 |
+} |
111 |
+ |
112 |
+} |
113 |
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 |
114 |
--- 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 |
115 |
+++ 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 |
116 |
@@ -0,0 +1,2 @@ |
117 |
+TEMPLATE_PATH="/etc/php-fpm.d/shares.conf" |
118 |
+MORE_DATA={ PHP_VERSION => 70 } |
119 |
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 |
120 |
--- 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 |
121 |
+++ 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 |
122 |
@@ -0,0 +1,2 @@ |
123 |
+TEMPLATE_PATH="/etc/php-fpm.d/shares.conf" |
124 |
+MORE_DATA={ PHP_VERSION => 71 } |
125 |
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 |
126 |
--- 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 |
127 |
+++ 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 |
128 |
@@ -0,0 +1,2 @@ |
129 |
+TEMPLATE_PATH="/etc/php-fpm.d/shares.conf" |
130 |
+MORE_DATA={ PHP_VERSION => 72 } |
131 |
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 |
132 |
--- 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 |
133 |
+++ 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 |
134 |
@@ -0,0 +1,2 @@ |
135 |
+TEMPLATE_PATH="/etc/php-fpm.d/shares.conf" |
136 |
+MORE_DATA={ PHP_VERSION => 73 } |
137 |
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 |
138 |
--- 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 |
139 |
+++ 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 |
140 |
@@ -0,0 +1,2 @@ |
141 |
+TEMPLATE_PATH="/etc/php-fpm.d/shares.conf" |
142 |
+MORE_DATA={ PHP_VERSION => 74 } |
143 |
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 |
144 |
--- 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 |
145 |
+++ 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 |
146 |
@@ -0,0 +1,2 @@ |
147 |
+TEMPLATE_PATH="/etc/php-fpm.d/shares.conf" |
148 |
+MORE_DATA={ PHP_VERSION => 80 } |
149 |
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 |
150 |
--- 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 |
151 |
+++ 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 |
152 |
@@ -0,0 +1,2 @@ |
153 |
+TEMPLATE_PATH="/etc/php-fpm.d/shares.conf" |
154 |
+MORE_DATA={ PHP_VERSION => 80 } |
155 |
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 |
156 |
--- 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 |
157 |
+++ 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 |
158 |
@@ -0,0 +1,2 @@ |
159 |
+TEMPLATE_PATH="/etc/php-fpm.d/shares.conf" |
160 |
+MORE_DATA={ PHP_VERSION => '' } |
161 |
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 |
162 |
--- 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 |
163 |
+++ 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 |
164 |
@@ -0,0 +1,2 @@ |
165 |
+TEMPLATE_PATH="/etc/php-fpm.d/shares.conf" |
166 |
+MORE_DATA={ PHP_VERSION => 55 } |
167 |
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 |
168 |
--- 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 |
169 |
+++ 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 |
170 |
@@ -0,0 +1,2 @@ |
171 |
+TEMPLATE_PATH="/etc/php-fpm.d/shares.conf" |
172 |
+MORE_DATA={ PHP_VERSION => 56 } |