[packages/owncloud] use webserver config not .htaccess to deny access

glen glen at pld-linux.org
Tue Jan 22 23:29:41 CET 2013


commit bfd5f0754a86b8c97beeb0298423d842c8b4091c
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed Jan 23 00:18:46 2013 +0200

    use webserver config not .htaccess to deny access

 apache.conf   |  4 ++++
 lighttpd.conf |  5 +++++
 owncloud.spec | 10 ++++++----
 3 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/owncloud.spec b/owncloud.spec
index 09a92a4..2bdc76d 100644
--- a/owncloud.spec
+++ b/owncloud.spec
@@ -23,6 +23,7 @@ Source1:	config.php
 Source2:	apache.conf
 Source3:	lighttpd.conf
 Patch0:		system-pear.patch
+Patch1:		system-config.patch
 URL:		http://owncloud.org
 BuildRequires:	rpmbuild(macros) >= 1.268
 Requires:	getid3
@@ -76,6 +77,7 @@ ownCloud server on their devices.
 %prep
 %setup -q -n %{name}
 %patch0 -p1
+%patch1 -p1
 
 # remove bundled 3rdparty libs
 %{__rm} -r 3rdparty/{class.phpmailer.php,class.smtp.php,getid3,Archive,Console,Crypt_Blowfish,MDB2,MDB2.php,XML}
@@ -86,7 +88,7 @@ ownCloud server on their devices.
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/config,%{_appdir}}
 
-cp -pdR *.php db_structure.xml 3rdparty apps core files l10n lib ocs search settings themes $RPM_BUILD_ROOT/%{_appdir}
+cp -pdR *.php db_structure.xml 3rdparty apps core files l10n lib ocs search settings themes $RPM_BUILD_ROOT%{_appdir}
 ln -s %{_sysconfdir}/config $RPM_BUILD_ROOT%{_appdir}/config
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/config/config.php
 
@@ -96,6 +98,9 @@ cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
 
 install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
 
+%clean
+rm -rf $RPM_BUILD_ROOT
+
 %triggerin -- apache1 < 1.3.37-3, apache1-base
 %webapp_register apache %{_webapp}
 
@@ -114,9 +119,6 @@ install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
 %triggerun -- lighttpd
 %webapp_unregister lighttpd %{_webapp}
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS COPYING-AGPL COPYING-README README
diff --git a/apache.conf b/apache.conf
index 9ee80c0..a52450e 100644
--- a/apache.conf
+++ b/apache.conf
@@ -19,3 +19,7 @@ Alias /owncloud /usr/share/owncloud
 	Options -Indexes
 	Allow from all
 </Directory>
+
+<Directory /usr/share/owncloud/data>
+	Deny from all
+</Directory>
diff --git a/lighttpd.conf b/lighttpd.conf
index d421ad4..f1eb4a0 100644
--- a/lighttpd.conf
+++ b/lighttpd.conf
@@ -6,3 +6,8 @@ $HTTP["url"] =~ "^/owncloud($|/)" {
 	dir-listing.activate = "disable"
 	server.error-handler-404 = "/owncloud/core/templates/404.php"
 }
+
+# deny from all to /data
+$HTTP["url"] =~ "^/owncloud/data" {
+	url.access-deny = ("")
+}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/owncloud.git/commitdiff/9f6bf6cea6c9b2a91eaefdf264fa2cb0199b7118



More information about the pld-cvs-commit mailing list