Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/02-admin/04-running-mbin/05-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,23 @@ php bin/console mbin:user:unsub <username>
Arguments:
- `username`: the user from which to remove all local followers.

### Fix user duplicates

This command allows you to fix duplicate usernames. There is a unique index on the usernames, but it is case-sensitive.
This command will go through all the users with duplicate case-insensitive usernames,
where the username is not part of the public id (meaning the original URL) and update them from the remote server.
After that it will go through the rest of the duplicates and ask you whether you want to merge matching pairs.

Usage:

```bash
php bin/console mbin:users:fix-duplicates [--dry-run]
```

Options:
- `--dry-run`: don't change anything in the DB


## Magazine Management

### Magazine-Create
Expand Down
7 changes: 4 additions & 3 deletions src/Command/ActorUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Messenger\Stamp\TransportNamesStamp;

#[AsCommand(
name: 'mbin:actor:update',
Expand Down Expand Up @@ -45,15 +46,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$force = (bool) $input->getOption('force');

if ($userArg) {
$this->bus->dispatch(new UpdateActorMessage($userArg, $force));
$this->bus->dispatch(new UpdateActorMessage($userArg, $force), [new TransportNamesStamp('sync')]);
} elseif ($input->getOption('users')) {
foreach ($this->repository->findRemoteForUpdate() as $u) {
$this->bus->dispatch(new UpdateActorMessage($u->apProfileId, $force));
$this->bus->dispatch(new UpdateActorMessage($u->apProfileId, $force), [new TransportNamesStamp('sync')]);
$io->info($u->username);
}
} elseif ($input->getOption('magazines')) {
foreach ($this->magazineRepository->findRemoteForUpdate() as $u) {
$this->bus->dispatch(new UpdateActorMessage($u->apProfileId, $force));
$this->bus->dispatch(new UpdateActorMessage($u->apProfileId, $force), [new TransportNamesStamp('sync')]);
$io->info($u->name);
}
}
Expand Down
Loading
Loading