mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-23 03:40:19 +00:00
Compare commits
1 Commits
aio-depend
...
copilot/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
121e60491d |
@@ -1,6 +1,6 @@
|
||||
# syntax=docker/dockerfile:latest
|
||||
# Docker CLI is a requirement
|
||||
FROM docker:29.5.2-cli AS docker
|
||||
FROM docker:29.5.1-cli AS docker
|
||||
|
||||
ARG CADDY_REMOTE_HOST_HASH=e80a9931765a8dbcbb47db415863387f0df0e1b3
|
||||
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
$CONFIG = array (
|
||||
'one-click-instance' => true,
|
||||
'one-click-instance.user-limit' => 100,
|
||||
'update_channel' => 'stable',
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
$CONFIG = array (
|
||||
'serverid' => hexdec(hash('xxh32', gethostname())) & 0x1FF,
|
||||
'serverid' => crc32(gethostname()) % 512,
|
||||
);
|
||||
|
||||
@@ -419,41 +419,12 @@ EOF
|
||||
|
||||
# AIO update to latest start # Do not remove or change this line!
|
||||
if [ "$INSTALL_LATEST_MAJOR" = yes ]; then
|
||||
php /var/www/html/occ config:system:set updatedirectory --value="/nc-updater"
|
||||
INSTALLED_AT="$(php /var/www/html/occ config:app:get core installedat)"
|
||||
if [ -n "${INSTALLED_AT}" ]; then
|
||||
# Set the installdat to 00 which will allow to skip staging and install the next major directly
|
||||
# shellcheck disable=SC2001
|
||||
INSTALLED_AT="$(echo "${INSTALLED_AT}" | sed "s|[0-9][0-9]$|00|")"
|
||||
php /var/www/html/occ config:app:set core installedat --value="${INSTALLED_AT}"
|
||||
fi
|
||||
php /var/www/html/updater/updater.phar --no-interaction --no-backup
|
||||
if ! php /var/www/html/occ -V || php /var/www/html/occ status | grep maintenance | grep -q 'true'; then
|
||||
echo "Installation of Nextcloud failed!"
|
||||
touch "$NEXTCLOUD_DATA_DIR/install.failed"
|
||||
if ! bash /upgrade-latest-major.sh; then
|
||||
echo "Upgrade to latest major version failed! Check the output above for details."
|
||||
exit 1
|
||||
fi
|
||||
# shellcheck disable=SC2016
|
||||
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
||||
INSTALLED_MAJOR="${installed_version%%.*}"
|
||||
IMAGE_MAJOR="${image_version%%.*}"
|
||||
# If a valid upgrade path, trigger the Nextcloud built-in Updater
|
||||
if ! [ "$INSTALLED_MAJOR" -gt "$IMAGE_MAJOR" ]; then
|
||||
php /var/www/html/updater/updater.phar --no-interaction --no-backup
|
||||
if ! php /var/www/html/occ -V || php /var/www/html/occ status | grep maintenance | grep -q 'true'; then
|
||||
echo "Installation of Nextcloud failed!"
|
||||
# TODO: Add a hint here about what to do / where to look / updater.log?
|
||||
touch "$NEXTCLOUD_DATA_DIR/install.failed"
|
||||
exit 1
|
||||
fi
|
||||
# shellcheck disable=SC2016
|
||||
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
||||
fi
|
||||
php /var/www/html/occ config:system:set updatechecker --type=bool --value=true
|
||||
php /var/www/html/occ app:enable nextcloud-aio --force
|
||||
php /var/www/html/occ db:add-missing-columns
|
||||
php /var/www/html/occ db:add-missing-primary-keys
|
||||
yes | php /var/www/html/occ db:convert-filecache-bigint
|
||||
fi
|
||||
# AIO update to latest end # Do not remove or change this line!
|
||||
|
||||
|
||||
38
Containers/nextcloud/upgrade-latest-major.sh
Normal file
38
Containers/nextcloud/upgrade-latest-major.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
||||
IMAGE_MAJOR="${image_version%%.*}"
|
||||
|
||||
php /var/www/html/occ config:system:set updatedirectory --value="/nc-updater"
|
||||
INSTALLED_AT="$(php /var/www/html/occ config:app:get core installedat)"
|
||||
if [ -n "${INSTALLED_AT}" ]; then
|
||||
# Set the installedat to 00 which will allow to skip staging and install the next major directly
|
||||
# shellcheck disable=SC2001
|
||||
INSTALLED_AT="$(echo "${INSTALLED_AT}" | sed "s|[0-9][0-9]$|00|")"
|
||||
php /var/www/html/occ config:app:set core installedat --value="${INSTALLED_AT}"
|
||||
fi
|
||||
php /var/www/html/updater/updater.phar --no-interaction --no-backup
|
||||
if ! php /var/www/html/occ -V || php /var/www/html/occ status | grep maintenance | grep -q 'true'; then
|
||||
echo "Installation of Nextcloud failed!"
|
||||
touch "$NEXTCLOUD_DATA_DIR/install.failed"
|
||||
exit 1
|
||||
fi
|
||||
# shellcheck disable=SC2016
|
||||
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
||||
INSTALLED_MAJOR="${installed_version%%.*}"
|
||||
# If a valid upgrade path, trigger the Nextcloud built-in Updater
|
||||
if ! [ "$INSTALLED_MAJOR" -gt "$IMAGE_MAJOR" ]; then
|
||||
php /var/www/html/updater/updater.phar --no-interaction --no-backup
|
||||
if ! php /var/www/html/occ -V || php /var/www/html/occ status | grep maintenance | grep -q 'true'; then
|
||||
echo "Installation of Nextcloud failed!"
|
||||
# TODO: Add a hint here about what to do / where to look / updater.log?
|
||||
touch "$NEXTCLOUD_DATA_DIR/install.failed"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
php /var/www/html/occ config:system:set updatechecker --type=bool --value=true
|
||||
php /var/www/html/occ app:enable nextcloud-aio --force
|
||||
php /var/www/html/occ db:add-missing-columns
|
||||
php /var/www/html/occ db:add-missing-primary-keys
|
||||
yes | php /var/www/html/occ db:convert-filecache-bigint
|
||||
@@ -42,15 +42,6 @@ if ! [ -f /var/www/html/custom_apps/notify_push/bin/"$CPU_ARCH"/notify_push ] &&
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Logic for ipv6 disabled servers
|
||||
BIND="::"
|
||||
if grep -q "1" /sys/module/ipv6/parameters/disable \
|
||||
|| grep -q "1" /proc/sys/net/ipv6/conf/all/disable_ipv6 \
|
||||
|| grep -q "1" /proc/sys/net/ipv6/conf/default/disable_ipv6; then
|
||||
BIND="0.0.0.0"
|
||||
fi
|
||||
export BIND
|
||||
|
||||
echo "notify-push was started"
|
||||
|
||||
|
||||
|
||||
34
php/composer.lock
generated
34
php/composer.lock
generated
@@ -64,16 +64,16 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "7.10.3",
|
||||
"version": "7.10.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle.git",
|
||||
"reference": "47ba23c7a55247e2e1b7407aca90e9bbed0d9d86"
|
||||
"reference": "aed36fd5fb4844f284252a999d9abf35d3a9a1ae"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/47ba23c7a55247e2e1b7407aca90e9bbed0d9d86",
|
||||
"reference": "47ba23c7a55247e2e1b7407aca90e9bbed0d9d86",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/aed36fd5fb4844f284252a999d9abf35d3a9a1ae",
|
||||
"reference": "aed36fd5fb4844f284252a999d9abf35d3a9a1ae",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -171,7 +171,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/guzzle/issues",
|
||||
"source": "https://github.com/guzzle/guzzle/tree/7.10.3"
|
||||
"source": "https://github.com/guzzle/guzzle/tree/7.10.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -187,20 +187,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-05-20T22:59:19+00:00"
|
||||
"time": "2026-05-20T11:58:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
"version": "2.4.1",
|
||||
"version": "2.3.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/promises.git",
|
||||
"reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2"
|
||||
"reference": "d2d8dfae4757f384d630fdffc2d8d6618d8f4c5e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/09e8a212562fb1fb6a512c4156ed71525969d6c2",
|
||||
"reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/d2d8dfae4757f384d630fdffc2d8d6618d8f4c5e",
|
||||
"reference": "d2d8dfae4757f384d630fdffc2d8d6618d8f4c5e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -254,7 +254,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/promises/issues",
|
||||
"source": "https://github.com/guzzle/promises/tree/2.4.1"
|
||||
"source": "https://github.com/guzzle/promises/tree/2.3.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -270,7 +270,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-05-20T22:57:30+00:00"
|
||||
"time": "2026-05-19T18:30:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
@@ -1285,16 +1285,16 @@
|
||||
},
|
||||
{
|
||||
"name": "slim/slim",
|
||||
"version": "4.15.2",
|
||||
"version": "4.15.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/slimphp/Slim.git",
|
||||
"reference": "e12cb05ca2a14e8f459d019e87a31dc915b80470"
|
||||
"reference": "887893516557506f254d950425ce7f5387a26970"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/slimphp/Slim/zipball/e12cb05ca2a14e8f459d019e87a31dc915b80470",
|
||||
"reference": "e12cb05ca2a14e8f459d019e87a31dc915b80470",
|
||||
"url": "https://api.github.com/repos/slimphp/Slim/zipball/887893516557506f254d950425ce7f5387a26970",
|
||||
"reference": "887893516557506f254d950425ce7f5387a26970",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1397,7 +1397,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-05-22T08:00:12+00:00"
|
||||
"time": "2025-11-21T12:23:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "slim/twig-view",
|
||||
|
||||
@@ -104,6 +104,7 @@ $app->post('/api/docker/backup-test', AIO\Controller\DockerController::class . '
|
||||
$app->post('/api/docker/restore', AIO\Controller\DockerController::class . ':StartBackupContainerRestore');
|
||||
$app->post('/api/docker/stop', AIO\Controller\DockerController::class . ':StopContainer');
|
||||
$app->post('/api/docker/backup-reset-location', AIO\Controller\DockerController::class . ':DeleteBorgBackupConfig');
|
||||
$app->post('/api/docker/nextcloud-upgrade-to-latest-major', AIO\Controller\DockerController::class . ':RunNextcloudUpgradeToLatestMajor');
|
||||
$app->post('/api/docker/prune', AIO\Controller\DockerController::class . ':SystemPrune');
|
||||
$app->get('/api/docker/logs', AIO\Controller\DockerController::class . ':GetLogs');
|
||||
$app->post('/api/auth/login', AIO\Controller\LoginController::class . ':TryLogin');
|
||||
@@ -181,10 +182,8 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
||||
'community_containers' => $configurationManager->listAvailableCommunityContainers(),
|
||||
'community_containers_enabled' => $configurationManager->aioCommunityContainers,
|
||||
'bypass_container_update' => $bypass_container_update,
|
||||
// Do not cache the page as it shows credentials
|
||||
])->withHeader('Cache-Control', 'no-store');
|
||||
]);
|
||||
})->setName('profile');
|
||||
|
||||
$app->get('/login', function (Request $request, Response $response, array $args) use ($container) {
|
||||
$view = Twig::fromRequest($request);
|
||||
/** @var \AIO\Docker\DockerActionManager $dockerActionManager */
|
||||
@@ -193,7 +192,6 @@ $app->get('/login', function (Request $request, Response $response, array $args)
|
||||
'is_login_allowed' => $dockerActionManager->isLoginAllowed(),
|
||||
]);
|
||||
});
|
||||
|
||||
$app->get('/setup', function (Request $request, Response $response, array $args) use ($container) {
|
||||
$view = Twig::fromRequest($request);
|
||||
/** @var \AIO\Data\Setup $setup */
|
||||
@@ -212,10 +210,8 @@ $app->get('/setup', function (Request $request, Response $response, array $args)
|
||||
[
|
||||
'password' => $setup->Setup(),
|
||||
]
|
||||
// Do not cache the page as it shows credentials
|
||||
)->withHeader('Cache-Control', 'no-store');
|
||||
);
|
||||
});
|
||||
|
||||
$app->get('/log', function (Request $request, Response $response, array $args) use ($container) {
|
||||
$params = $request->getQueryParams();
|
||||
$id = $params['id'] ?? '';
|
||||
@@ -223,13 +219,7 @@ $app->get('/log', function (Request $request, Response $response, array $args) u
|
||||
throw new DI\NotFoundException();
|
||||
}
|
||||
$view = Twig::fromRequest($request);
|
||||
return $view->render(
|
||||
$response, 'log.twig',
|
||||
[
|
||||
'id' => $id
|
||||
]
|
||||
// Do not cache the page as it might shows credentials
|
||||
)->withHeader('Cache-Control', 'no-store');
|
||||
return $view->render($response, 'log.twig', ['id' => $id]);
|
||||
});
|
||||
|
||||
// Auth Redirector
|
||||
|
||||
@@ -52,18 +52,14 @@ readonly class ContainerDefinitionFetcher {
|
||||
$standardContainerNames = array_column($data['aio_services_v1'], 'container_name');
|
||||
|
||||
$additionalContainerNames = [];
|
||||
$additionalTopLevelContainerNames = [];
|
||||
foreach ($this->configurationManager->aioCommunityContainers as $communityContainer) {
|
||||
if ($communityContainer !== '') {
|
||||
$path = DataConst::GetCommunityContainersDirectory() . '/' . $communityContainer . '/' . $communityContainer . '.json';
|
||||
$additionalData = json_decode((string)file_get_contents($path), true, 512, JSON_THROW_ON_ERROR);
|
||||
$data = array_merge_recursive($data, $additionalData);
|
||||
foreach ($additionalData['aio_services_v1'] as $additionalEntry) {
|
||||
$additionalContainerNames[] = $additionalEntry['container_name'];
|
||||
}
|
||||
if (isset($additionalData['aio_services_v1'][0]['display_name']) && $additionalData['aio_services_v1'][0]['display_name'] !== '') {
|
||||
// Store main container_name of community containers in variable for later
|
||||
$additionalTopLevelContainerNames[] = $additionalData['aio_services_v1'][0]['container_name'];
|
||||
// Store container_name of community containers in variable for later
|
||||
$additionalContainerNames[] = $additionalData['aio_services_v1'][0]['container_name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,7 +176,7 @@ readonly class ContainerDefinitionFetcher {
|
||||
if ($entry['container_name'] === 'nextcloud-aio-apache') {
|
||||
// Add community containers first and default ones last so that aio_variables works correctly
|
||||
$valueDependsOnTemp = [];
|
||||
foreach ($additionalTopLevelContainerNames as $containerName) {
|
||||
foreach ($additionalContainerNames as $containerName) {
|
||||
$valueDependsOnTemp[] = $containerName;
|
||||
}
|
||||
$valueDependsOn = array_merge_recursive($valueDependsOnTemp, $valueDependsOn);
|
||||
|
||||
@@ -14,6 +14,7 @@ use Slim\Psr7\NonBufferedBody;
|
||||
|
||||
readonly class DockerController {
|
||||
private const string TOP_CONTAINER = 'nextcloud-aio-apache';
|
||||
private const string LATEST_MAJOR_VERSION = '33';
|
||||
|
||||
public function __construct(
|
||||
private DockerActionManager $dockerActionManager,
|
||||
@@ -221,7 +222,7 @@ readonly class DockerController {
|
||||
}
|
||||
|
||||
if (isset($request->getParsedBody()['install_latest_major'])) {
|
||||
$installLatestMajor = '33';
|
||||
$installLatestMajor = self::LATEST_MAJOR_VERSION;
|
||||
} else {
|
||||
$installLatestMajor = '';
|
||||
}
|
||||
@@ -333,6 +334,20 @@ readonly class DockerController {
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
}
|
||||
|
||||
public function RunNextcloudUpgradeToLatestMajor(Request $request, Response $response, array $args) : Response {
|
||||
$this->configurationManager->installLatestMajor = self::LATEST_MAJOR_VERSION;
|
||||
|
||||
// Get streaming response start and closure
|
||||
$nonbufResp = $this->startStreamingResponse($response);
|
||||
$addToStreamingResponseBody = $this->getPlainStreamingCallback($nonbufResp);
|
||||
|
||||
$this->dockerActionManager->RunNextcloudUpgradeToLatestMajor($addToStreamingResponseBody);
|
||||
|
||||
// End streaming response
|
||||
$this->finalizeStreamingResponse($nonbufResp);
|
||||
return $nonbufResp;
|
||||
}
|
||||
|
||||
public function SystemPrune(Request $request, Response $response, array $args) : Response {
|
||||
// Get streaming response start and closure
|
||||
$nonbufResp = $this->startStreamingResponse($response);
|
||||
@@ -430,12 +445,18 @@ readonly class DockerController {
|
||||
// if it'll actually pull an image), but which should not need to know anything about the
|
||||
// wanted markup or formatting.
|
||||
$addToStreamingResponseBody = function (Container $container, string $message) use ($nonbufResp) : void {
|
||||
$nonbufResp->getBody()->write("<div>{$container->displayName}: {$message}</div>");
|
||||
$nonbufResp->getBody()->write("<div>" . htmlspecialchars("{$container->displayName}: {$message}", ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . "</div>");
|
||||
};
|
||||
|
||||
return $addToStreamingResponseBody;
|
||||
}
|
||||
|
||||
private function getPlainStreamingCallback(Response $nonbufResp) : \Closure {
|
||||
return function (string $message) use ($nonbufResp) : void {
|
||||
$nonbufResp->getBody()->write("<div>" . htmlspecialchars($message, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . "</div>");
|
||||
};
|
||||
}
|
||||
|
||||
private function finalizeStreamingResponse(Response $nonbufResp) : void {
|
||||
$nonbufResp->getBody()->write($this->getStreamingResponseHtmlEnd());
|
||||
}
|
||||
|
||||
@@ -761,48 +761,79 @@ readonly class DockerActionManager {
|
||||
}
|
||||
|
||||
public function sendNotification(Container $container, string $subject, string $message, string $file = '/notify.sh'): void {
|
||||
if ($this->GetContainerStartingState($container) === ContainerState::Running) {
|
||||
$this->execCommandInContainer($container, ['bash', $file, $subject, $message]);
|
||||
}
|
||||
|
||||
$containerName = $container->identifier;
|
||||
public function execCommandInContainer(Container $container, array $cmd, ?\Closure $outputCallback = null): void {
|
||||
if ($cmd === []) {
|
||||
throw new \InvalidArgumentException('$cmd must not be empty.');
|
||||
}
|
||||
foreach ($cmd as $arg) {
|
||||
if (!is_string($arg) || $arg === '') {
|
||||
throw new \InvalidArgumentException('Every element of $cmd must be a non-empty string.');
|
||||
}
|
||||
}
|
||||
|
||||
// schedule the exec
|
||||
$url = $this->BuildApiUrl(sprintf('containers/%s/exec', urlencode($containerName)));
|
||||
$response = json_decode(
|
||||
$this->guzzleClient->request(
|
||||
'POST',
|
||||
$url,
|
||||
[
|
||||
'json' => [
|
||||
'AttachStdout' => true,
|
||||
'Tty' => true,
|
||||
'Cmd' => [
|
||||
'bash',
|
||||
$file,
|
||||
$subject,
|
||||
$message
|
||||
],
|
||||
],
|
||||
]
|
||||
)->getBody()->getContents(),
|
||||
true,
|
||||
512,
|
||||
JSON_THROW_ON_ERROR,
|
||||
);
|
||||
if ($this->GetContainerStartingState($container) !== ContainerState::Running) {
|
||||
return;
|
||||
}
|
||||
|
||||
$id = $response['Id'];
|
||||
$containerName = $container->identifier;
|
||||
|
||||
// start the exec
|
||||
$url = $this->BuildApiUrl(sprintf('exec/%s/start', $id));
|
||||
// Create exec instance
|
||||
$url = $this->BuildApiUrl(sprintf('containers/%s/exec', urlencode($containerName)));
|
||||
$response = json_decode(
|
||||
$this->guzzleClient->request(
|
||||
'POST',
|
||||
$url,
|
||||
[
|
||||
'json' => [
|
||||
'Detach' => false,
|
||||
'AttachStdout' => true,
|
||||
'AttachStderr' => true,
|
||||
'Tty' => true,
|
||||
'Cmd' => $cmd,
|
||||
],
|
||||
]
|
||||
);
|
||||
)->getBody()->getContents(),
|
||||
true,
|
||||
512,
|
||||
JSON_THROW_ON_ERROR,
|
||||
);
|
||||
|
||||
$execId = $response['Id'];
|
||||
|
||||
// Start exec
|
||||
$url = $this->BuildApiUrl(sprintf('exec/%s/start', $execId));
|
||||
$requestOptions = [
|
||||
'json' => [
|
||||
'Detach' => false,
|
||||
'Tty' => true,
|
||||
],
|
||||
];
|
||||
if ($outputCallback !== null) {
|
||||
$requestOptions['stream'] = true;
|
||||
}
|
||||
|
||||
$startResponse = $this->guzzleClient->request('POST', $url, $requestOptions);
|
||||
|
||||
if ($outputCallback !== null) {
|
||||
$body = $startResponse->getBody();
|
||||
$buffer = '';
|
||||
while (!$body->eof()) {
|
||||
$chunk = $body->read(1024);
|
||||
$buffer .= $chunk;
|
||||
while (($pos = strpos($buffer, "\n")) !== false) {
|
||||
$line = substr($buffer, 0, $pos);
|
||||
$buffer = substr($buffer, $pos + 1);
|
||||
$line = rtrim($line, "\r");
|
||||
if ($line !== '') {
|
||||
$outputCallback($line);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (trim($buffer) !== '') {
|
||||
$outputCallback(trim($buffer));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1027,6 +1058,11 @@ readonly class DockerActionManager {
|
||||
}
|
||||
}
|
||||
|
||||
public function RunNextcloudUpgradeToLatestMajor(\Closure $addToStreamingResponseBody): void {
|
||||
$container = $this->containerDefinitionFetcher->GetContainerById('nextcloud-aio-nextcloud');
|
||||
$this->execCommandInContainer($container, ['bash', '/upgrade-latest-major.sh'], $addToStreamingResponseBody);
|
||||
}
|
||||
|
||||
public function SystemPrune(?\Closure $addToStreamingResponseBody = null): void {
|
||||
$endpoints = [
|
||||
// Remove stopped containers
|
||||
|
||||
@@ -3,6 +3,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace AIO\Docker;
|
||||
|
||||
use AIO\ContainerDefinitionFetcher;
|
||||
use AIO\Data\ConfigurationManager;
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
readonly class DockerHubManager {
|
||||
@@ -13,16 +15,6 @@ readonly class DockerHubManager {
|
||||
$this->guzzleClient = new Client();
|
||||
}
|
||||
|
||||
|
||||
// Official Docker Hub images need the library/ prefix when using the registry API directly.
|
||||
private function normalizeImageName(string $name): string {
|
||||
if (!str_contains($name, '/')) {
|
||||
return 'library/' . $name;
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
|
||||
|
||||
public function GetLatestDigestOfTag(string $name, string $tag) : ?string {
|
||||
$cacheKey = 'dockerhub-manifest-' . $name . $tag;
|
||||
|
||||
@@ -32,7 +24,6 @@ readonly class DockerHubManager {
|
||||
}
|
||||
|
||||
// If one of the links below should ever become outdated, we can still upgrade the mastercontainer via the webinterface manually by opening '/api/docker/getwatchtower'
|
||||
$name = $this->normalizeImageName($name);
|
||||
|
||||
try {
|
||||
$authTokenRequest = $this->guzzleClient->request(
|
||||
|
||||
@@ -298,7 +298,12 @@
|
||||
{% if newMajorVersionString != '' and isAnyRunning == true and isApacheStarting != true %}
|
||||
<details>
|
||||
<summary>Note about <strong>Nextcloud Hub {{ newMajorVersionString }}</strong></summary>
|
||||
<p>If you haven't upgraded to Nextcloud Hub {{ newMajorVersionString }} yet and want to do that now, feel free to follow <strong><a target="_blank" href="https://github.com/nextcloud/all-in-one/discussions/7523">this documentation</a></strong></p>
|
||||
<p>If you haven't upgraded to Nextcloud Hub {{ newMajorVersionString }} yet and want to do that now, feel free to click the button below. ⚠️ Warning: make sure to create a backup before clicking the button as the update can go wrong and will leave your instance in a broken state!</p>
|
||||
<form method="POST" action="api/docker/nextcloud-upgrade-to-latest-major" target="overlay-log">
|
||||
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
|
||||
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
||||
<input type="submit" value="Upgrade to Nextcloud Hub {{ newMajorVersionString }}" data-confirm="Upgrade to Nextcloud Hub {{ newMajorVersionString }}? You should consider creating a backup first." />
|
||||
</form>
|
||||
</details>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1 +1 @@
|
||||
13.1.0
|
||||
13.0.4
|
||||
|
||||
Reference in New Issue
Block a user