1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-09-15 20:36:55 +00:00

rewrite WebCAL section

Peter Bieringer 2024-06-12 06:43:07 +02:00
parent dad9833fc1
commit 2e28fbcc0f

@ -96,16 +96,16 @@ collection: {user}(/.*)?
permissions: i permissions: i
``` ```
* extend the reverse proxy configuration by a redirect and enriching the request with credentials of user ANON1 by conditionally adding the authorization header to the request. * extend the reverse proxy configuration by catching requests in a location, map and enrich the request with credentials of user ANON1 by conditionally adding the authorization header to the request.
``` ```
## Shortcut RUL <Location /public>
RewriteRule "/publicevents1.ics" /radicale/ANON1/publicevents1/ [R,L] RewriteRule /public/(events[a-z0-9]+).ics$ /radicale/ANON1/public$1/ [PT]
</Location>
## Conditional enrich request with credentials SetEnvIf Request_URI "^/public/(events[a-z0-9]+)\.ics$" ANON_PUBLICEVENTS
# "Basic <base64 encodede USER:PASS>" example generated with 'echo -n "ANON1:ANON1" | base64' # "Basic <base64 encodede USER:PASS>" example generated with 'echo -n "ANON1:ANON1" | base64'
SetEnvIf Request_URI "^/radicale/ANON1/publicevents1/" ANON RequestHeader set Authorization "Basic QU5PTjE6QU5PTjE=" env=ANON_PUBLICEVENTS
RequestHeader setifempty Authorization "Basic QU5PTjE6QU5PTjE=" env=ANON
``` ```
### Example for a storage layout ### Example for a storage layout
@ -132,19 +132,12 @@ permissions: i
### Testing ### Testing
#### GET request to user-friendly URL shortcut #### GET request to a valid collection
(here it has 2 entries currently)
``` ```
curl -v -s http://localhost/publicevents1.ics curl -s http://localhost/public/events1.ics | grep -E '(VEVENT|VCALENDAR)'
...
< Location: http://localhost/radicale/ANON1/publicevents1/
...
```
#### GET request to redirected URL
```
curl -s http://localhost/radicale/ANON1/publicevents1/ | grep -E '(VEVENT|VCALENDAR)'
BEGIN:VCALENDAR BEGIN:VCALENDAR
BEGIN:VEVENT BEGIN:VEVENT
END:VEVENT END:VEVENT
@ -153,12 +146,20 @@ END:VEVENT
END:VCALENDAR END:VCALENDAR
``` ```
#### GET request to a non-existent collection
```
curl -s http://localhost/publicevents2.ics
The requested resource could not be found.
```
#### PROPFIND request to URL #### PROPFIND request to URL
(expected forbidden) (expected forbidden)
``` ```
curl --request PROPFIND http://localhost/radicale/ANON1/publicevents1/ curl --request PROPFIND http://localhost/public/events1.ics
Access to the requested resource forbidden. Access to the requested resource forbidden.
``` ```
#### PUT request to URL #### PUT request to URL
@ -166,13 +167,10 @@ Access to the requested resource forbidden.
(expected forbidden) (expected forbidden)
``` ```
curl --data-binary @test.ics --request PUT http://localhost/radicale/ANON1/publicevents1/test.ics curl --data-binary @test.ics --request PUT http://localhost/public/events1.ics
Access to the requested resource forbidden. Access to the requested resource forbidden.
``` ```
### Publishing ### Publishing
URL for publishing e.g. via WebCAL in case client is supporting redirect response: URL for publishing e.g. via WebCAL: `https://FQDN/public/events1.ics`
* yes: `https://FQDN/publicevents1.ics`
* no: `https://FQDN/radicale/ANON1/publicevents1/`