YunoHost-Apps / nextcloud_ynh

Nextcloud package for YunoHost
https://nextcloud.com/
GNU Affero General Public License v3.0
144 stars 62 forks source link

.well-known URLs, failed on: /.well-known/caldav #701

Open rodinux opened 3 days ago

rodinux commented 3 days ago

Describe the bug

After upgrade I have a message .well-known URLs, failed on: /.well-known/caldav

Context

Steps to reproduce

Expected behavior

Keep the /.well-known/caldav working after an update

This issue is related there :

https://github.com/nextcloud/server/issues/45033

After trying a lot of things to debug, like editing the nginx nextcloud.conf, I have understood my problem is because for subfolder installations because this will be checking for /subfolder/.well-known/carddav instead of /.well-known/carddav whereas applications using WebDAV will be querying for /.well-known/carddav without the subfolder.

So this issue comes with a nextcloud installed on a subpath URL like https://mydomain.tld/nextcloud/

This post help me resolve the issue: https://github.com/nextcloud/server/issues/45033#issuecomment-2095742325

So editing the file /var/www/nextcloud/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php and change the line 64

 60         protected function getTestUrls(string $url): array {
 61                 $hosts = $this->config->getSystemValue('trusted_domains', []);
 62                 $cliUrl = $this->config->getSystemValue('overwrite.cli.url', '');
 63                 if ($cliUrl !== '') {
 64                         $hosts[] =  $cliUrl;
 65                 }

with :

 60         protected function getTestUrls(string $url): array {
 61                 $hosts = $this->config->getSystemValue('trusted_domains', []);
 62                 $cliUrl = $this->config->getSystemValue('overwrite.cli.url', '');
 63                 if ($cliUrl !== '') {
 64                         $hosts[] = rtrim(str_replace($this->urlGenerator->getWebroot(), '', $cliUrl), '/');
 65                 }
rodinux commented 2 days ago

Be careful, it seems not been a good idea to try this patch !

The issue will be fixed in version 29.0.4 While browsing the discussion, MichaIng reports that carddav and caldav work perfectly but it is the verification mechanism that bug, that is why the fix is not considered urgent and that it must be checked that it will not break something else. In short, modify by hand php files of such a complex application, I will avoid until the developer has not asked.