mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
add an AIO outdated notification
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
bdcd4fc240
commit
de137f70ae
5 changed files with 92 additions and 2 deletions
26
php/src/Cron/OutdatedNotification.php
Normal file
26
php/src/Cron/OutdatedNotification.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
// increase memory limit to 2GB
|
||||
ini_set('memory_limit', '2048M');
|
||||
|
||||
use DI\Container;
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$container = \AIO\DependencyInjection::GetContainer();
|
||||
|
||||
/** @var \AIO\Docker\DockerActionManager $dockerActionManger */
|
||||
$dockerActionManger = $container->get(\AIO\Docker\DockerActionManager::class);
|
||||
/** @var \AIO\ContainerDefinitionFetcher $containerDefinitionFetcher */
|
||||
$containerDefinitionFetcher = $container->get(\AIO\ContainerDefinitionFetcher::class);
|
||||
|
||||
$id = 'nextcloud-aio-nextcloud';
|
||||
$nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id);
|
||||
|
||||
$isNextcloudImageOutdated = $dockerActionManger->isNextcloudImageOutdated();
|
||||
|
||||
if ($isNextcloudImageOutdated === true) {
|
||||
$dockerActionManger->sendNotification($nextcloudContainer, 'AIO is outdated!', 'Please open the AIO interface or ask an administrator to update it. If you do not want to do it manually each time, you can enable the daily backup feature from the AIO interface which automatically updates all containers.', '/notify-all.sh');
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue