Automattic / wordpress-activitypub

ActivityPub for WordPress
https://wordpress.org/plugins/activitypub/
MIT License
484 stars 73 forks source link

The plugin works *great* but fails to fully work if something else broke the /author/name path #174

Closed AlanBell closed 11 months ago

AlanBell commented 1 year ago

I had something installed called Yoast SEO (think I wanted a particular type of XML sitemap some time in the distant past) that as a byproduct of whatever it was trying to do ended up redirecting the /author/myname path on workdpress to the root of the site, which meant I wasn't discoverable on activitypub even though the webfinger bit was working fine and I could see the hits to the webfinger URL on the apache logs.

I don't know if it would be possible somehow to make diagnosis of this easier, some way to say your webfinger is fine, but your author bio is borked.

Not really the fault of this excellent plugin in any way, but it cost me some time and some folk might not get to the bottom of it if they are in a similar situation with some conflicting plugin.

The-boop-13 commented 1 year ago

Thanks a lot for that comment! This is what fixed the problems I were having.

pfefferle commented 1 year ago

Yes, this is a bit sad, because this is a natural in core implemented page, I thought I could re-use (I always prefer to re-use something instead of build a custom thing) the page, but it seems that I have to build a custom profile page that will/can not be deactivated by SEO plugins :(

Have you seen the messages in the site-health area of WordPress? I tried to check such issues to give advice like activating profile-pages or that the WebFinger endpoint might not work because of letsencrypt.

The-boop-13 commented 1 year ago

I've seen those, but only just now, after fixing the issue by deleting that naughty other plugin. Now they are all marked as passed.

Thank you a lot for this super helpful plugin! It is really important and many users rely on it, I read about it all the time. I am what others might call a noob, I am interested but have close to no knowledge in programming. That's why I am struggling a lot with some detail questions. One moment the profile view in Mastodon is up to date, the next moment it is not. No idea why. And I know it's possible to upload a profile picture, but forgot how. Maybe someone can help collecting questions and answers – I'm sure they pop up more than once. The plugin itself is absolutely great.

AlanBell commented 1 year ago

Maybe just an update to the FAQ or installation instructions would be good, pointing out that both the webfinger and /author/name page are the things to troubleshoot, at the moment you would only expect the webfinger part to be the problem.

pfefferle commented 1 year ago

Do you think that more people are reading the FAQ instead of the site-health? I really think the best idea is to have a "hidden" profile page that always works, that returns the JSON if called with Accept Header application/activity+json and that redirects to the author page if "normally" called. That would fix the problem and would be backwards compatible with the author page, that should still work if enabled.

But you are right, in a first step it would be good to have at least the information in several places!

AlanBell commented 1 year ago

ah OK, I hadn't checked site-health - there would have been a very helpful error message there if I did.

pfefferle commented 1 year ago

hmmm, @AlanBell @The-boop-13 any ideas how to propagate that a bit better?

pfefferle commented 1 year ago

because I think the site-health checks, shows where the problems are, which does not fix them, but at least helps to understand the problem, which hopefully leads to the fix.

AlanBell commented 1 year ago

so https://wordpress.org/plugins/activitypub has some troubleshooting guidance for subdirectory installations, it would be good to have a FAQ section telling people to check their site-health page. The problem isn't that it is hard to fix, but that a reasonably clueful person could spend a lot of time validating the webfinger output - the bit they just installed, when the problem is elsewhere.

The-boop-13 commented 1 year ago

I agree: An FAQ section is very helpful. That's what I meant with "gathering all the questions that pop up". You could answer all the questions that come to mind. Like, "how do I find the user in the fediverse", "known issues" (not everyone knows how to use github), "how do I change the profile picture" and whatnot.

cr0ybot commented 1 year ago

I would love if this plugin added a profile in the format that most fediverse platforms seem to use: example.com/@author

Even better if this somehow just displays the standard author page, or at least filterable in some way. Or maybe as a setting in the plugin options?

After activating this plugin, I was considering how I might change the author permalink into this style of URL but I figured it would probably break things after seeing this issue.

pfefferle commented 1 year ago

@cr0ybot I also thought about that, also because a lot of plugins are disabling/redirecting the author pages.

The-boop-13 commented 1 year ago

If you open the Weblink to your authors page on your blog and get redirected to your main page, you are affected by this. Some other plugin broke the author website which results in the activitypub-plugin no longer working correctly.

The-boop-13 commented 1 year ago

I'm helpless here as well. Maybe someone else has an idea.

pfefferle commented 1 year ago

@huckabarry can you share the author URL and the webfinger id?

AlanBell commented 1 year ago

not really the place for it, but whatever :) probably due to bouncing between inthedeltawaves.social and fxu.gkz.mybluehost.me I would imagine you are expecting one of these to work: https://fxu.gkz.mybluehost.me/.well-known/webfinger?resource=acct:bryan@fxu.gkz.mybluehost.me https://inthedeltawaves.social/.well-known/webfinger?resource=acct:bryan@inthedeltawaves.social

and neither do as far as I can tell.

pfefferle commented 1 year ago

The .well-known URL seemt to redirect to the main page.

kmccurley commented 1 year ago

I just made a clean installation on a machine today (ubuntu 22.04, php8.1, apache, self-installed wordpress that apparently works correctly, but unfortunately the installation of activitypub does not trigger anything to handle /.well-known/webfinger. The wordpress blog is at the root of sigcrap.org. I see something in the activitypub.php::add_rewrite_rules() that should be triggered if \class_exists( 'Webfinger' ) and since this is provided by class-webfinger.php, I assume it gets called. At that point I'm not sure what happens during the installation, but somehow the rewrite is not triggered. What should I do to debug this? (I have root).

pfefferle commented 1 year ago

@kmccurley you can re-create all rewrite rules, by loading the permalinks page and hit "save" (you do not have to change anything).

But it seems that you created a static file, because it returns a JSON: http://sigcrap.org/.well-known/webfinger/

If there is a static file, it will never call the rewrite rule... so to check it, you have to remove the static file!

kmccurley commented 1 year ago

the http:// URL is apparently being caught by a different virtual host, so I removed that file. I was looking for the https url to work.

Reloading the permalinks page and saving didn't seem to do anything. I don't see a rewrite rule there for .well-known/webfinger

pfefferle commented 1 year ago

It seems that you have the index.php in your rewrite setup: https://sigcrap.org/index.php/.well-known/webfinger?resource=sjdas

kmccurley commented 1 year ago

That would seem to be a conflict with the ActivityPub plugin, so I changed it to something else. Now it answers webfinger, though exactly how is something not obvious to me. When I changed my rewrite rule, it created a .htaccess file for the site.

This is actually related to why I have stopped using wordpress several times. The setup is always incredibly fragile, and any updates are likely to break any customizations. I can't imagine what it must be like to maintain a plugin for it.

janboddez commented 1 year ago

Any chance of allowing a "custom" author URL?

I know it should never change, but maybe that can be left up to the user to decide? Maybe through a filter of sorts, for tech-savvy users only? Now there's a hard check to see if the author URL has been "tampered with." It'd be nice if this could be overridden (somehow).

For instance, on one of my sites, I might choose to only federate a specific CPT, but my profile will point to the generic author archive, which would only display "regular" posts. (Just one example.)

This could be confusing (shouldn't we try to return the same content for [different representations of] the same URL?), and I might instead prefer to have my "profile" tied to a different, custom "author archive" that shows ... instances of that particular CPT.

(I know this can potentially open the door to a multitude of bugs ...)

janboddez commented 1 year ago

I really think the best idea is to have a "hidden" profile page that always works, that returns the JSON if called with Accept Header application/activity+json and that redirects to the author page if "normally" called.

Oh, wait, guess I'm going to have to try this first. (Even if I'd like to be able to change the actual URL.)

Will figure something out!

pfefferle commented 1 year ago

I am currently working on the blog-wide user ( #1 ), and this one has no author URL, so I am working on something like https://example.org/@username for all users. For real useres, these URLs will redirect to the author pages if not called with the correct Accept header.

janboddez commented 1 year ago

Ha, cool. Looks like a proper solution for most single-user blogs, too.

pfefferle commented 1 year ago

Here is the WIP: https://github.com/Automattic/wordpress-activitypub/pull/342

github-actions[bot] commented 11 months ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.