Mailing List Archive

hiding /caldav.php
Hello,

I've inherited a DAViCal installation, and due to some completely
braindead "enterprise" clients still in use, I am tasked with
simplifying the URLs. Don't ask. Anyway, point is that user A's
resource Foo needs to be a accessible as
`https://caldav.example.org/A/Foo`.

This works, using nothing other than

```
Alias / /usr/share/davical/htdocs
FallbackResource /davical/caldav.php
```

but there is a remaining problem, namely that when DAViCal returns
URLs to itself, it forces /caldav.php/ back into the path, e.g.

```
/.well-known/caldav ? /caldav.php/A/Foo
```

and this is because the [well-known handler sets `$force_script =
true` when calling
`ConstructURL`](https://gitlab.com/davical-project/davical/-/blob/master/inc/well-known.php#L18).

I am sure there are other places, where this happens, and reading
the source suggests to me that there is no way around this, despite
[advice to set
`$c->base_url`](https://bugzilla.mozilla.org/show_bug.cgi?id=605201#c4)
(which does not work).

I've even tried to hide http://localhost/davical/caldav.php behind a
transparent proxy, but that doesn't work either.

Has anyone managed to actually expose DAViCal without exposing
`caldav.php` in the URL?

--
@martinkrafft | https://riot.im/app/#/room/#madduck:madduck.net

"vulgarity is simply the conduct of other people."
-- oscar wilde

spamtraps: madduck.bogus@madduck.net
Re: hiding /caldav.php [ In reply to ]
Hello,

On 2020-05-14 06:51, martin f krafft wrote:
> Untitled but there is a remaining problem, namely that when DAViCal
> returns URLs to itself, it forces /caldav.php/ back into the path, e.g.
> |/.well-known/caldav ? /caldav.php/A/Foo |
>
> and this is because the well-known handler sets |$force_script = true|
> when calling |ConstructURL|
> <https://gitlab.com/davical-project/davical/-/blob/master/inc/well-known.php#L18>.
>
> I am sure there are other places, where this happens, and reading the
> source suggests to me that there is no way around this, despite advice
> to set |$c->base_url|
> <https://bugzilla.mozilla.org/show_bug.cgi?id=605201#c4> (which does
> not work).
>
> I've even tried to hide http://localhost/davical/caldav.php behind a
> transparent proxy, but that doesn't work either.
>
> Has anyone managed to actually expose DAViCal without exposing
> |caldav.php| in the URL?
>

I have used quite a bit of time by trying to find regular ways to
get rid of this, but failed to find them. In the end, I modified
ConstructURL (commented the lines that would append caldav.php).

This caused another problem to surface - Thunderbird is "improving"
the URLs provided by the DAV server, so you might need to use some
mod_rewrite magic to unimprove them.

Specifically, it converts /user/calendar/0123.ics to
/user/calendar/calendar/0123.ics, which doesn't work so well.

https://bugzilla.mozilla.org/show_bug.cgi?id=605201


Adalbert


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: hiding /caldav.php [ In reply to ]
Regarding the following, written by "Adalbert Michelic" on 2020-05-14 at 08:42 Uhr +0200:
>I have used quite a bit of time by trying to find regular ways to
>get rid of this, but failed to find them. In the end, I modified
>ConstructURL (commented the lines that would append caldav.php).

Ouch. I am surprised why this isn't configurable.

>Specifically, it converts /user/calendar/0123.ics to
>/user/calendar/calendar/0123.ics, which doesn't work so well.
>
>https://bugzilla.mozilla.org/show_bug.cgi?id=605201

Oh yeah, I've been bitten by that. But thanks for pointing it out
anyway!

--
@martinkrafft | https://riot.im/app/#/room/#madduck:madduck.net

"'this must be a thursday,' said arthur to himself, sinking low over
his beer. 'i never could get the hang of thursdays.'"
-- hitchhiker's guide to the galaxy

spamtraps: madduck.bogus@madduck.net
Re: hiding /caldav.php [ In reply to ]
Adalbert Michelic wrote on 14/5/20 02:42:
>
> Specifically, it converts /user/calendar/0123.ics to
> /user/calendar/calendar/0123.ics, which doesn't work so well.
can't u just use a logical?   ln -s /user/calendar/calendar
/user/calendar/


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: hiding /caldav.php [ In reply to ]
On May 30, 2020, at 10:40 AM, tom wible <tomwible@cardinalglen.org> wrote:
>
> ln -s /user/calendar/calendar /user/calendar/

oops wrong order

> ln -s /user/calendar /user/calendar/calendar




_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: hiding /caldav.php [ In reply to ]
On Thu, 2020-05-14 at 19:57 +1200, martin f krafft wrote:
> Regarding the following, written by "Adalbert Michelic" on 2020-05-14
> at 08:42 Uhr +0200:
> > I have used quite a bit of time by trying to find regular ways to
> > get rid of this, but failed to find them. In the end, I modified
> > ConstructURL (commented the lines that would append caldav.php).
> >
>
> Ouch. I am surprised why this isn't configurable.

If this approach works, then maybe we should make it configurable?

> > Specifically, it converts /user/calendar/0123.ics to
> > /user/calendar/calendar/0123.ics, which doesn't work so well.
> >
> > https://bugzilla.mozilla.org/show_bug.cgi?id=605201
> >
>
> Oh yeah, I've been bitten by that. But thanks for pointing it out
> anyway!

Gosh. What a saga.

--
Andrew Ruthven, Wellington, New Zealand
andrew@etc.gen.nz |
Catalyst Cloud: | This space intentionally left blank
https://catalystcloud.nz |



_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general