mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
Add support for bypass_container_update param for easier local build and testing (#6702)
Signed-off-by: Alan Savage <3028205+asavageiv@users.noreply.github.com> Signed-off-by: Simon L. <szaimen@e.mail.de> Signed-off-by: Alan Savage <asavageiv@users.noreply.github.com> Co-authored-by: Alan Savage <asavage@ifrit.internal> Co-authored-by: Alan Savage <3028205+asavageiv@users.noreply.github.com> Co-authored-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
49aa732ec5
commit
dd495d76a1
6 changed files with 46 additions and 31 deletions
|
|
@ -86,6 +86,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
|||
// Check if bypass_mastercontainer_update is provided on the URL, a special developer mode to bypass a mastercontainer update and use local image.
|
||||
$params = $request->getQueryParams();
|
||||
$bypass_mastercontainer_update = isset($params['bypass_mastercontainer_update']);
|
||||
$bypass_container_update = isset($params['bypass_container_update']);
|
||||
|
||||
return $view->render($response, 'containers.twig', [
|
||||
'domain' => $configurationManager->GetDomain(),
|
||||
|
|
@ -136,6 +137,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
|||
'is_whiteboard_enabled' => $configurationManager->isWhiteboardEnabled(),
|
||||
'community_containers' => $configurationManager->listAvailableCommunityContainers(),
|
||||
'community_containers_enabled' => $configurationManager->GetEnabledCommunityContainers(),
|
||||
'bypass_container_update' => $bypass_container_update,
|
||||
]);
|
||||
})->setName('profile');
|
||||
$app->get('/login', function (Request $request, Response $response, array $args) use ($container) {
|
||||
|
|
|
|||
|
|
@ -191,8 +191,14 @@ readonly class DockerController {
|
|||
$config['install_latest_major'] = $installLatestMajor;
|
||||
$this->configurationManager->WriteConfig($config);
|
||||
|
||||
// Do not pull container images in case 'bypass_container_update' is set via url params
|
||||
// Needed for local testing
|
||||
$pullImage = !isset($request->getParsedBody()['bypass_container_update']);
|
||||
if ($pullImage === false) {
|
||||
error_log('WARNING: Not pulling container images. Instead, using local ones.');
|
||||
}
|
||||
// Start container
|
||||
$this->startTopContainer(true);
|
||||
$this->startTopContainer($pullImage);
|
||||
|
||||
// Clear apcu cache in order to check if container updates are available
|
||||
// Temporarily disabled as it leads much faster to docker rate limits
|
||||
|
|
|
|||
|
|
@ -352,6 +352,7 @@
|
|||
<form method="POST" action="/api/docker/start" class="xhr">
|
||||
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
|
||||
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
||||
<input type="hidden" name="bypass_container_update" value="{{bypass_container_update}}">
|
||||
<input class="button " type="submit" value="Start and update containers" onclick="return confirm('Start and update containers? You should consider creating a backup first.')" />
|
||||
</form>
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue