summaryrefslogtreecommitdiff
path: root/sample/src/passwd_protect
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2012-12-31 20:08:30 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2012-12-31 20:08:30 +0100
commit95b85be502f639fb2080ae92d4d33c013b18aa94 (patch)
tree7ca15af789198da9021937269eda023946b69221 /sample/src/passwd_protect
parent571790ba31a48c108e42c4ae10f8e63ae734c376 (diff)
downloadcataract-95b85be502f639fb2080ae92d4d33c013b18aa94.tar.xz
Add support for password protected albums
This adds support for simple password protected areas (albums and all subalbums) through webserver HTTP authentication. CGG simply generates .htaccess and password files and it's up to the user to set up the rest on server side. No UI changes at this point. Limited to one user per album for the moment.
Diffstat (limited to 'sample/src/passwd_protect')
-rw-r--r--sample/src/passwd_protect/index.xml27
1 files changed, 27 insertions, 0 deletions
diff --git a/sample/src/passwd_protect/index.xml b/sample/src/passwd_protect/index.xml
new file mode 100644
index 0000000..10225fa
--- /dev/null
+++ b/sample/src/passwd_protect/index.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<gallery type="album">
+ <general>
+ <ID>Restricted area</ID>
+ <title>Restricted area</title>
+ <description><![CDATA[Welcome to restricted area! You should have been presented a standard HTTP authentication dialog. If that didn't happen, your web server configuration is probably incorrect. Note that this natually doesn't work when opened locally (<code>file://</code> URL).
+ <br/><br/>
+ This feature requires web server user htaccess override enabled as well as the particular authentication modules loaded. All subdirectories (including the current album images) should be protected the same way through automatic parenting. It's usually sufficient to only set password for top-level path you want to protect. Please note this implementation is not bulletproof in any way, a simple configuration error or missing file will bypass any protection. See <a href="http://httpd.apache.org/docs/2.2/howto/auth.html">httpd.apache.org/docs/2.2/howto/auth.html</a> for more information.
+ <br/><br/>
+ CGG will automatically create new password file and will add necessary lines in <code>.htaccess</code> file (appending if it exists). By default, MD5 hash is used. The <code>htpasswd</code> tool needs to be installed as Apache uses it's own MD5 hash modification. Check e.g. <code>apache-tools</code> package.
+ <br/><br/>
+ All of this has a culprit however. For security reasons, the webserver (Apache) disallows relative pathnames to the password file and requires either absolute path or relative path to ServerRoot (basically document root for the domain). Also, storing the password file within the document tree is discouraged though it's fully satisfactory for our needs. A new &lt;location&gt; section in <code>setup.xml</code> file has been introduced. Having a correct path in the &lt;local_path&gt; tag is the key to success.
+ ]]></description>
+
+ <auth>
+ <!-- ID of the area, the message will also be presented to user -->
+ <realm>Secret pictures</realm>
+ <username>test</username>
+ <!-- plain text password please, will be encrypted during processing -->
+ <password>test</password>
+ <!-- we only support mod_auth_basic, adding support for mod_auth_digest would be nice -->
+ <type>Basic</type>
+ </auth>
+ </general>
+
+</gallery>
+