Paths of NextCloud Service discovery seem to have changed

NethServer Version: 7.9.2009
Module: NextCloud

The NextCloud module has got a setting to turn on Service discovery (“Enable CalDAV and CardDAV auto-discovery”, Nextcloud — NethServer 7 Final ). However following recent NextCloud updates, the URL seem to have changed.

In the file /etc/e-smith/templates/etc/httpd/conf.d/zz_nextcloud.conf/10base, current code is:

    if ($wellknown eq 'enabled' && $vhost eq '') {
        $OUT .= "  \n\n# Enable webdav redirect\n";
        $OUT .= "  Redirect 301 /.well-known/host-meta /nextcloud/public.php?service=host-meta\n";
        $OUT .= "  Redirect 301 /.well-known/host-meta.json /nextcloud/public.php?service=host-meta-json\n";
        $OUT .= "  Redirect 301 /.well-known/webfinger /nextcloud/public.php?service=webfinger\n";
        $OUT .= "  Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav/\n";
        $OUT .= "  Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav/\n";
   }

But according to General troubleshooting — Nextcloud latest Administration Manual latest documentation it might need to be as follow:

    if ($wellknown eq 'enabled' && $vhost eq '') {
        $OUT .= "  \n\n# Enable webdav redirect\n";
        $OUT .= "  Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav\n";
        $OUT .= "  Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav\n";
        $OUT .= "  Redirect 301 /.well-known/webfinger /nextcloud/index.php/.well-known/webfinger\n";
        $OUT .= "  Redirect 301 /.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo\n";
   }

For now, as user, I have copied the original file in a custom template and applied the change there. :slight_smile:

2 Likes

Hi and welcome to NethServer Community,

thanks for pointing that out.
I can confirm the issue and that your custom template is working.
It seems Nextcloud changed it with version 21.

I think this should be fixed.
Caldav/carddav settings are untouched so there’s no possible regression.

@giacomo I’d open an issue/PR…

1 Like

Thank you for reporting.
This is a bug, indeed.

1 Like

Issue opened, PR will follow…

6 Likes

@mrmarkuz did a great job! The package is now ready for testing.
Would you give it a try @olivier ?

2 Likes

Please can somebody test the package so we can eliminate the errors in the Nextcloud Administration overview?

yum install --enablerepo=nethserver-testing nethserver-nextcloud

There should be no errors about webfinger or nodeinfo in Nextcloud Administration overview anymore.

This is my result. Maybe because I’m running behind a reverse proxy?

1 Like

I meant to @ @mrmarkuz

Thanks for testing!

I don’t think so.

If you’re using AD and you’re asked for credentials in Nextcloud admin overview, just use one of your users but you need to add the domain like user@domain.

Did you enable caldav and carddav autodiscovery for Nextcloud?

@mrmarkuz No, I don’t have auto-discovery enabled.

OK, you need to enable it for the test to work. After enabling the webfinger and nodeinfo errors should be gone.

1 Like

I can confirm the issue has been fixed.
The issue is not even present when accessing Nextcloud using the virtual host

1 Like

Tested and working well. :slight_smile: Thanks a lot for fixing it!

As the URL are permanently redirected (with 301), I had to clear up/disable the cache of the browser when doing the tests. :slight_smile:

2 Likes

Interesting. I have several ios clients using it for their contacts, calendar and file app without that enabled.

I don’t use ios clients but maybe they don’t need/use the auto-discovery?

BTW, SOGo and Webtop support carddav/caldav too.

1 Like