/[smecontribs]/rpms/smeserver-cacti/contribs10/smeserver-cacti-1.1.19-sme10.patch
ViewVC logotype

Annotation of /rpms/smeserver-cacti/contribs10/smeserver-cacti-1.1.19-sme10.patch

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


Revision 1.1 - (hide annotations) (download)
Tue Jul 26 04:09:02 2022 UTC (2 years, 3 months ago) by jpp
Branch: MAIN
* Mon Jul 25 2022 Jean-Philippe Pialasse <tests@pialasse.com> 1.1.19-2.sme
- update httpd 2.4 to syntax [SME: 12039]
- initial import to SME10 [SME: 11307]
  cacti-1.2.21
  dedicated php-fpm pool 74
  update event

* Wed Dec 11 2019 Jean-Philipe Pialasse <tests@pialasse.com> 1.1.19-1.sme
- update to cacti-1.1.19 [SME: 8434]

1 jpp 1.1 diff -Nur --no-dereference smeserver-cacti-1.1.19.old/createlinks smeserver-cacti-1.1.19/createlinks
2     --- smeserver-cacti-1.1.19.old/createlinks 2014-06-16 11:53:01.000000000 -0400
3     +++ smeserver-cacti-1.1.19/createlinks 2022-07-26 00:03:16.700000000 -0400
4     @@ -5,6 +5,7 @@
5     for my $event (qw(
6     post-upgrade
7     bootstrap-console-save
8     + console-save
9     ))
10     {
11     templates2events("/etc/cacti/db.php", $event);
12     @@ -22,3 +23,26 @@
13     }
14    
15     templates2events("/etc/e-smith/sql/init/80cacti", "post-upgrade");
16     +
17     +my $event="smeserver-cacti-update";
18     +event_templates($event, qw(
19     + /etc/cacti/db.php
20     + /etc/httpd/conf/httpd.conf
21     + /etc/crontab
22     + /etc/opt/remi/php74/php-fpm.d/www.conf
23     + /etc/e-smith/sql/init/80cacti
24     +));
25     +
26     +event_services($event, qw(
27     + crond restart
28     +  mysql.init restart
29     + httpd-e-smith sigusr1
30     + php74-php-fpm reload-or-restart
31     +));
32     +
33     +#backup ?
34     +#use esmith::Build::Backup qw(:all);
35     +#backup_includes("smeserver-cacti", qw(
36     +#
37     +#));
38     +
39     diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86Cacti smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86Cacti
40     --- smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86Cacti 2014-06-16 11:53:00.000000000 -0400
41     +++ smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86Cacti 2022-07-26 00:04:03.542000000 -0400
42     @@ -5,32 +5,19 @@
43     SSLRequireSSL
44     Options -Indexes
45     AllowOverride None
46     - order deny,allow
47     - deny from all
48     -
49     -{
50     - my $cactiaxs = $cacti{'access'} || "private";
51     - if ($cactiaxs eq "private")
52     - {
53     - $OUT .= " allow from $localAccess $externalSSLAccess";
54     - } else {
55     - $OUT .= " allow from all";
56     - }
57     -}
58     - Satisfy all
59     - AddType application/x-httpd-php .php .php3
60     - php_flag magic_quotes_gpc on
61     - php_flag track_vars on
62     + Require { (($cacti{'access'} ||"private") eq "public") ? "all granted" : "ip $localAccess $externalSSLAccess"; }
63     + AddType application/x-httpd-php .php
64     + <FilesMatch \.php$\>
65     + SetHandler "proxy:unix:/var/run/php-fpm/php74-cacti.sock|fcgi://localhost"
66     + </FilesMatch>
67     </Directory>
68    
69    
70    
71     <Directory /usr/share/cacti/log>
72     - Order deny,allow
73     - Deny from all
74     + Require all denied
75     </Directory>
76     <Directory /usr/share/cacti/rra>
77     - Order deny,allow
78     - Deny from all
79     + Require all denied
80     </Directory>
81    
82     diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15cacti smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15cacti
83     --- smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15cacti 1969-12-31 19:00:00.000000000 -0500
84     +++ smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15cacti 2022-07-26 00:03:45.335000000 -0400
85     @@ -0,0 +1,68 @@
86     +{
87     +
88     +if ($PHP_VERSION eq '74'){
89     + if (($cacti{'status'} || 'disabled') eq 'enabled'){
90     + my $max_upload_size = ($cacti{MaxUploadSize} || '4096');
91     + $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/);
92     + my $memory_limit = ($cacti{MemoryLimit} || '512M');
93     + $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/);
94     + my $open_basedir= $cacti{PHPBaseDir} || '';
95     + $open_basedir = "/usr/share/cacti:/var/lib/cacti:/var/log/cacti.log:/var/lib/php/cacti:/home/e-smith/files/cacti:/dev/urandom:/proc/meminfo:$open_basedir";
96     + my $id = 'cacti';
97     + my $max_children = $cacti{'PHPmaxChildren'} || 20;
98     + my $min_spare_servers = $cacti{'PHPminServers'} || 4;
99     + my $start_servers = $cacti{'PHPstartServers'} || 6;
100     + my $max_spare_servers = $cacti{'PHPmaxServers'} || 8;
101     + my $max_requests = $cacti{'PHPmaxRequests'} || 1000;
102     + $min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ? printf("%.0f",$max_spare_servers/2) : $min_spare_servers;
103     + $start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f", $max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers;
104     +
105     + $OUT .=<<_EOF;
106     +
107     +[php$PHP_VERSION-$id]
108     +user = www
109     +group = www
110     +listen.owner = root
111     +listen.group = www
112     +listen.mode = 0660
113     +listen = /var/run/php-fpm/php$PHP_VERSION-$id.sock
114     +pm = dynamic
115     +pm.max_children = $max_children
116     +pm.start_servers = $start_servers
117     +pm.min_spare_servers = $min_spare_servers
118     +pm.max_spare_servers = $max_spare_servers
119     +pm.max_requests = $max_requests
120     +php_admin_value[session.save_path] = /var/lib/php/$id/session
121     +php_admin_value[session.gc_maxlifetime] = 86400
122     +php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache
123     +php_admin_value[upload_tmp_dir] = /var/lib/php/$id/tmp
124     +php_admin_value[error_log] = /var/log/php/$id/error.log
125     +slowlog = /var/log/php/cacti/slow.log
126     +php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName }
127     +php_admin_flag[display_errors] = off
128     +php_admin_flag[log_errors] = on
129     +php_admin_value[error_log] = syslog
130     +php_admin_value[memory_limit] = $memory_limit
131     +php_admin_value[max_execution_time] = 3600
132     +php_admin_value[post_max_size] = $max_upload_size
133     +php_admin_value[upload_max_filesize] = $max_upload_size
134     +php_admin_value[disable_functions] = system, show_source, symlink, exec, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd
135     +php_admin_value[open_basedir] = $open_basedir
136     +php_admin_flag[allow_url_fopen] = on
137     +php_admin_flag[file_upload] = on
138     +php_admin_flag[session.cookie_httponly] = on
139     +php_admin_flag[allow_url_include] = off
140     +php_admin_value[session.save_handler] = files
141     +php_admin_flag[output_buffering] = off
142     +
143     +_EOF
144     +
145     + }
146     + else{
147     + $OUT .= '; Nextcloud is disabled';
148     + }
149     +}
150     +}
151     +
152     +
153     +

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