Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with redirects breaking Social app for Nextcloud in subdirectories #1808

Open
riparise opened this issue Jul 4, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@riparise
Copy link

riparise commented Jul 4, 2023

I cannot follow users or see any post in the social app. I manage to narrow down the issue, but I fail to find a solution. Any help is much appreciated.

My nextcloud was installed via Softaculos in cpanel. I have no root access. The Nextcloud is running in a directory under the root of my website, which is served via Apache.

Here are some parts of the error log generated when I try to follow someone in the Social app:

[social] Info: Error while managing request: {
  "protocols":["https"],
  "used_protocol":"https",
  "port":0,
  "host":"lemmy.ml",
  "url":"/u/SOMELEMMYUSER/inbox",
  ...
  "Signature":"keyId="https://MYDOMAIN.COM/nextcloud/nextcloud/apps/social/@USERNAME#main-key",
  ...
  "id":"https://MYDOMAIN.COM/nextcloud/10c43d04-5927-4ba5-b39c-26e722753670",
  "type":"Follow",
  "actor":"https://MYDOMAIN.COM/nextcloud/nextcloud/apps/social/@USERNAME",
  ...
}

As you can see, sometimes the URL is correctly formed (MYDOMAIN.COM/nextcloud/whatever) and sometimes it is wrong (MYDOMAIN.COM/nextcloud/nextcloud/whatever), which I assume is the cause of the issue.

The .htaccess file inside the root of the website looks like this:

RewriteEngine On
RewriteRule ^$ /nextcloud [L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^MYDOMAIN\.COM$ [OR]
RewriteCond %{HTTP_HOST} ^www\.MYDOMAIN\.COM$
RewriteRule ^(.*)$ "https\:\/\/MYDOMAIN\.COM\/$1" [R=301,L]
RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav [R=301,L]
RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav [R=301,L]
RewriteRule ^/.well-known/webfinger /nextcloud/index.php/.well-known/webfinger [R=301,L]
RewriteRule ^\.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo [R=301,L]

It is weird because all the redirects seem to work fine:

If I go to MYDOMAIN.COM/nextcloud/index.php/.well-known/webfinger I get the following message:
{"message":"webfinger not supported"}

If I go to MYDOMAIN.COM/nextcloud/index.php/.well-known/nodeinfo I get the following message:
{"links": {"rel":"http:\/\/nodeinfo.diaspora.software\/ns\/schema\/2.0","href":"https:\/\/MYDOMAIN>COM\/nextcloud\/apps\/social\/.well-known\/nodeinfo\/2.0"}]}

In the MYDOMAIN.COM/nextcloud/apps/social/.well-known/nodeinfo/2.0 I can see:
{"version":"2.0","software":{"name":"My Nextcloud","version":"0.6.1"},"protocols":["activitypub"],"rootUrl":"https:\/\/MYDOMAIN.COM\/nextcloud\/apps\/social","usage":[],"openRegistrations":false}

I am not sure if this is a general bug on configuration issue on my side. If latter is the case, please feel free to close the issue

@riparise riparise added the bug Something isn't working label Jul 4, 2023
@Thatoo
Copy link

Thatoo commented Dec 17, 2023

I managed to be able to be followed.
For that, I changed the redirect nginx rule
location = /.well-known/webfinger { return 301 /nuage-nextcloud/index.php$uri; }
to
location = /.well-known/webfinger { return 301 /nuage-nextcloud/index.php$request_uri; }

However, I still can't follow, I face the same issue as here : #1813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants