Recently I migrated my site to a new server. I have been trying to get it online at 100% since. However the ActivityPub module doesn't seem to want to cooperate.

I have managed to get it visable through Fedidb.com but I can't get it to see the old accounts or for new posts to be seen.

One message I have gotten is

Outbox exception to https://social.mechanizedarmadillo.com/inbox for 777 to https://social.mechanizedarmadillo.com/inbox: Client error: `POST https://social.mechanizedarmadillo.com/inbox` resulted in a `401 Unauthorized` response: {"error":"Could not refresh public key https://hybridized-concepts.com/user/1/activitypub/CWSmith#main-key"}

When I check the backup file it seems that no keys migrated along with the files and now the old server is erased.

Could use some suggestions. Worried file permissions may be an issue as well.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

cwsmith1701 created an issue. See original summary.

swentel made their first commit to this issue’s fork.

swentel’s picture

Title: Could not refresh public key » Allow to (re)generate keys via drush or UI
Category: Support request » Task

Oh, your keys don't exist anymore then? Crap, yeah, the UI doesn't check that, I'll try to fix that.

I've committed code that adds a drush command, but that won't work if you are not on the latest dev version, so underneath is the code that should work if you add that to ActivityPubCommands.php:

  /**
   * Generates keys for a name.
   *
   * @param $name
   *
   * @command activitypub:generate-keys
   */
  public function generateKeys($name) {
    $this->logger()->notice('Generating keys for ' . $name);
    /** @var \Drupal\activitypub\Services\SignatureInterface $signature */
    $signature = \Drupal::service('activitypub.signature');
    if ($signature->generateKeys($name)) {
      $this->logger()->notice('Keys generated successfully');
    }
    else {
      $this->logger()->notice('Error generating keys, please check the logs for more details');
    }
  }

To run: drush activitypub:generate-keys {name}
name is the name of the actor you configured at user/1/activitypub/settings , without the domain. e.g. in my case, it's just 'swentel'.

  • swentel committed ad62ae90 on 1.0.x
    Issue #3584349: Allow to (re)generate keys with a drush command or via...
swentel’s picture

Status: Active » Fixed

This has been committed to dev.

It should be save to install the dev version which allows you to (re)generate the keys via the ui too (on user/x/activitypub/settings)
Or use the drush command in the previous comment.

However, do not enable the api modules, that's still in very active development!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.