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
```
* 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
RewriteRule "/publicevents1.ics" /radicale/ANON1/publicevents1/ [R,L]
<Location /public>
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'
SetEnvIf Request_URI "^/radicale/ANON1/publicevents1/" ANON
RequestHeader setifempty Authorization "Basic QU5PTjE6QU5PTjE=" env=ANON
RequestHeader set Authorization "Basic QU5PTjE6QU5PTjE=" env=ANON_PUBLICEVENTS
```
### Example for a storage layout
@ -132,19 +132,12 @@ permissions: i
### 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
...
< Location: http://localhost/radicale/ANON1/publicevents1/
...
```
#### GET request to redirected URL
```
curl -s http://localhost/radicale/ANON1/publicevents1/ | grep -E '(VEVENT|VCALENDAR)'
curl -s http://localhost/public/events1.ics | grep -E '(VEVENT|VCALENDAR)'
BEGIN:VCALENDAR
BEGIN:VEVENT
END:VEVENT
@ -153,12 +146,20 @@ END:VEVENT
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
(expected forbidden)
```
curl --request PROPFIND http://localhost/radicale/ANON1/publicevents1/
curl --request PROPFIND http://localhost/public/events1.ics
Access to the requested resource forbidden.
```
#### PUT request to URL
@ -166,13 +167,10 @@ Access to the requested resource 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.
```
### Publishing
URL for publishing e.g. via WebCAL in case client is supporting redirect response:
* yes: `https://FQDN/publicevents1.ics`
* no: `https://FQDN/radicale/ANON1/publicevents1/`
URL for publishing e.g. via WebCAL: `https://FQDN/public/events1.ics`