mirror of https://github.com/sualko/cloud_bbb
feat: add command to clear avatar cache
parent
dd87506f22
commit
862cda79c3
|
@ -111,6 +111,10 @@ and `avatar.url = https://avatar-cache.your-nextcloud.com/`:
|
||||||
For additional security, we recommend to disable directory listing, symlinks and
|
For additional security, we recommend to disable directory listing, symlinks and
|
||||||
any language interpreter such as php for the cache directory.
|
any language interpreter such as php for the cache directory.
|
||||||
|
|
||||||
|
Cached avatars are usually deleted as soon as the meeting ends. In cases the BBB
|
||||||
|
server shuts down unexpected, we provide the `bbb:clear-avatar-cache` occ
|
||||||
|
command (example use: `./occ bbb:clear-avatar-cache`).
|
||||||
|
|
||||||
|
|
||||||
## :bowtie: User guide
|
## :bowtie: User guide
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,9 @@ Developer wanted! If you have time it would be awesome if you could help to enha
|
||||||
<lib>SimpleXML</lib>
|
<lib>SimpleXML</lib>
|
||||||
<nextcloud min-version="20" max-version="23"/>
|
<nextcloud min-version="20" max-version="23"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
<commands>
|
||||||
|
<command>OCA\BigBlueButton\Command\ClearAvatarCache</command>
|
||||||
|
</commands>
|
||||||
<settings>
|
<settings>
|
||||||
<admin>OCA\BigBlueButton\Settings\Admin</admin>
|
<admin>OCA\BigBlueButton\Settings\Admin</admin>
|
||||||
<personal-section>OCA\BigBlueButton\Settings\Section</personal-section>
|
<personal-section>OCA\BigBlueButton\Settings\Section</personal-section>
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace OCA\BigBlueButton\Command;
|
||||||
|
|
||||||
|
use OCA\BigBlueButton\AvatarRepository;
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
|
class ClearAvatarCache extends Command {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var AvatarRepository
|
||||||
|
*/
|
||||||
|
private $avatarRepository;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
AvatarRepository $avatarRepository
|
||||||
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
$this->avatarRepository = $avatarRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function configure() {
|
||||||
|
$this->setName('bbb:clear-avatar-cache');
|
||||||
|
$this->setDescription('Clear all avatars in cache');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||||
|
$stats = $this->avatarRepository->clearAllRooms();
|
||||||
|
|
||||||
|
$output->writeln("Removed " . $stats["files"] . " avatars in " . $stats["rooms"] . " rooms");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue