radicale: Redirect to well-known URLs according to version

- Radicale 1 needs to have /radicale/.well-known/*dav to the URLs where as
  Radicale 2 needs to have /radicale to be the URLs. Hence have two separate
  apache configuration files.

- Use expr= when setting X-REMOTE-USER header to set the authenticated user name
  properly. Without this all users are using a single user '(null)' data.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-01-06 17:58:00 -05:00
1 parent 49acfa5ad1
commit 7cf279ccd0
3 files changed
+39 -15

No files matched your search

@@ -6,19 +6,8 @@ Redirect 301 /.well-known/carddav /radicale/.well-known/carddav
Redirect 301 /.well-known/caldav /radicale/.well-known/caldav
<Location /radicale>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/radicale$
RewriteRule .* /radicale/ [R=301,L]
</IfModule>
</Location>
ProxyPass http://localhost:5232
<Location /radicale/>
Include includes/freedombox-auth-ldap.conf
Require valid-user
ProxyPass http://localhost:5232/
ProxyPassReverse http://localhost:5232/
RequestHeader set X-Script-Name /radicale/
RequestHeader set X-Remote-User %{REMOTE_USER}s
</Location>
@@ -0,0 +1,24 @@
##
## On all sites, provide Radicale on a path: /radicale
## Allow all valid users.
##
Redirect 301 /.well-known/carddav /radicale/
Redirect 301 /.well-known/caldav /radicale/
<Location ~ ^/radicale$>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/radicale$
RewriteRule .* /radicale/ [R=301,L]
</IfModule>
</Location>
<Location /radicale/>
Include includes/freedombox-auth-ldap.conf
Require valid-user
ProxyPass http://localhost:5232/
ProxyPassReverse http://localhost:5232/
RequestHeader set X-Script-Name /radicale/
RequestHeader set X-Remote-User expr=%{REMOTE_USER}
</Location>