/[smeserver]/rpms/e-smith-ibays/sme10/e-smith-ibays-2.6.0-bz11407-force-https-on-DAV-and-httpauth.patch
ViewVC logotype

Annotation of /rpms/e-smith-ibays/sme10/e-smith-ibays-2.6.0-bz11407-force-https-on-DAV-and-httpauth.patch

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


Revision 1.1 - (hide annotations) (download)
Wed Mar 10 05:11:29 2021 UTC (3 years, 8 months ago) by jpp
Branch: MAIN
CVS Tags: e-smith-ibays-2_6_0-17_el7_sme, e-smith-ibays-2_6_0-16_el7_sme, e-smith-ibays-2_6_0-20_el7_sme, e-smith-ibays-2_6_0-18_el7_sme, e-smith-ibays-2_6_0-19_el7_sme, HEAD
* Tue Mar 09 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-16.sme
- force https if auth or dav are enabled  [SME: 11407]

1 jpp 1.1 diff -Nur --no-dereference e-smith-ibays-2.6.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays e-smith-ibays-2.6.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays
2     --- e-smith-ibays-2.6.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays 2021-03-09 18:37:10.651000000 -0500
3     +++ e-smith-ibays-2.6.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays 2021-03-10 00:09:29.017000000 -0500
4     @@ -93,6 +93,9 @@
5     my $followSymLinks = $properties{'FollowSymLinks'} || "disabled";
6     my $indexes = $properties{'Indexes'} || "enabled";
7     my $sslRequireSSL = $properties{'SSLRequireSSL'} || "disabled";
8     + # here we force SSL if either a password is asked or DAV is enabled
9     + $sslRequireSSL = "enabled" if ($pass == 1);
10     + $sslRequireSSL = "enabled" if ( ($properties{'ModDav'}||'disabled') eq 'enabled');
11    
12     $OUT .= "\n";
13     $OUT .= "#------------------------------------------------------------\n";
14     @@ -103,7 +106,7 @@
15     $OUT .= "<Directory /home/e-smith/files/ibays/$key/html>\n";
16     if ($sslRequireSSL eq 'enabled')
17     {
18     - $OUT .=" SSLRequireSSL\n";
19     + $OUT .= " SSLRequireSSL\n";
20     }
21     $OUT .= " Options None\n";
22     $OUT .= " Options +Indexes\n" if ($indexes eq 'enabled');
23     @@ -139,6 +142,10 @@
24    
25     $OUT .= "\n";
26     $OUT .= "<Directory /home/e-smith/files/ibays/$key/cgi-bin>\n";
27     + if ($sslRequireSSL eq 'enabled')
28     + {
29     + $OUT .= " SSLRequireSSL\n";
30     + }
31     if ($dynamicContent eq 'enabled')
32     {
33     $OUT .= " Options ExecCGI\n";
34     @@ -160,6 +167,10 @@
35    
36     $OUT .= "\n";
37     $OUT .= "<Directory /home/e-smith/files/ibays/$key/files>\n";
38     + if ($sslRequireSSL eq 'enabled')
39     + {
40     + $OUT .= " SSLRequireSSL\n";
41     + }
42     $OUT .= " AllowOverride None\n";
43     $OUT .= " order deny,allow\n";
44     $OUT .= " deny from all\n";
45     diff -Nur --no-dereference e-smith-ibays-2.6.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent e-smith-ibays-2.6.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent
46     --- e-smith-ibays-2.6.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent 2021-03-09 18:37:10.651000000 -0500
47     +++ e-smith-ibays-2.6.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent 2021-03-10 00:09:29.266000000 -0500
48     @@ -11,6 +11,10 @@
49     my $basedir = "/home/e-smith/files/ibays/$ibay";
50     my $cgiBin = $accounts->get_prop($ibay, "CgiBin") || "";
51     my $ssl_domain = $accounts->get_prop($ibay, "SSLRequireSSL") || "disabled";
52     + my $access = $accounts->get_prop($ibay,'PublicAccess') || 'none';
53     + my $pass = $access =~ /-pw/;
54     + $ssl_domain = "enabled" if $pass;
55     + $ssl_domain = "enabled" if (($accounts->get_prop($ibay, 'ModDav')||'disabled') eq 'enabled');
56    
57     $OUT .= " DocumentRoot $basedir/html\n";
58    
59     @@ -51,7 +55,13 @@
60     $OUT .= " # $key ibay ($name)\n";
61     $OUT .= "\n";
62    
63     - if (( $port ne $httpsPort ) && (($ibay->prop('SSLRequireSSL') || 'disabled') eq 'enabled')){
64     + my $ssl_bay = $ibay->prop('SSLRequireSSL') || 'disabled';
65     + my $access_bay = $ibay->prop('PublicAccess') || 'none';
66     + my $pass_bay = $access_bay =~ /-pw/;
67     + $ssl_bay = "enabled" if $pass_bay ;
68     + $ssl_bay = "enabled" if (($ibay->prop('ModDav')||'disabled') eq 'enabled');
69     +
70     + if (( $port ne $httpsPort ) && ($ssl_bay eq 'enabled')){
71     my $portspec = ($httpsPort eq 443) ? "" : ":$httpsPort";
72     $OUT .= " RewriteEngine on\n";
73     $OUT .= " RewriteRule ^/$key(/.*|\$) https://%{HTTP_HOST}${portspec}/$key\$1 \[L,R\]\n";

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