Activitypub and changed domains

I just realized I am faced with this as well, after changing my site’s url to digitallysovereign.org.

Looks like there is actually no way around removing and reinstalling the plugin, and recreating all the actors, because existing followers on Mastodon or wherever else won’t automatically know about your domain change. Their servers cached your old actor URL.

I only had two followers so far so removing and reinstalling is a no brainer.

Edit: forgot that removing and reinstalling doesn’t remove plugin data. This rails command did the trick.

tables = [
  "discourse_activity_pub_actors",
  "discourse_activity_pub_follows",
  "discourse_activity_pub_activities",
  "discourse_activity_pub_attachments",
  "discourse_activity_pub_authorizations",
  "discourse_activity_pub_clients",
  "discourse_activity_pub_collections",
  "discourse_activity_pub_logs",
  "discourse_activity_pub_objects"
]

ActiveRecord::Base.connection.execute("TRUNCATE #{tables.join(', ')} CASCADE")
puts "All ActivityPub tables cleared!"

Edit 2: I can confirm that doing the above rails command and recreating the actor worked - I did not have to remove and reinstall the plugin.