mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-28 06:20:14 +00:00
Rewrite all AIO interface paths to be relative
Signed-off-by: Lorenzo Moscati <lorenzo@moscati.page>
This commit is contained in:
@@ -85,7 +85,7 @@ readonly class DockerController {
|
||||
public function StartBackupContainerBackup(Request $request, Response $response, array $args) : Response {
|
||||
$forceStopNextcloud = true;
|
||||
$this->startBackup($forceStopNextcloud);
|
||||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
}
|
||||
|
||||
public function startBackup(bool $forceStopNextcloud = false) : void {
|
||||
@@ -102,7 +102,7 @@ readonly class DockerController {
|
||||
|
||||
public function StartBackupContainerCheck(Request $request, Response $response, array $args) : Response {
|
||||
$this->checkBackup();
|
||||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
}
|
||||
|
||||
public function checkBackup() : void {
|
||||
@@ -132,7 +132,7 @@ readonly class DockerController {
|
||||
$id = 'nextcloud-aio-borgbackup';
|
||||
$this->PerformRecursiveContainerStart($id);
|
||||
|
||||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
}
|
||||
|
||||
public function StartBackupContainerCheckRepair(Request $request, Response $response, array $args) : Response {
|
||||
@@ -148,7 +148,7 @@ readonly class DockerController {
|
||||
$config['backup-mode'] = 'check';
|
||||
$this->configurationManager->WriteConfig($config);
|
||||
|
||||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
}
|
||||
|
||||
public function StartBackupContainerTest(Request $request, Response $response, array $args) : Response {
|
||||
@@ -163,7 +163,7 @@ readonly class DockerController {
|
||||
$id = 'nextcloud-aio-borgbackup';
|
||||
$this->PerformRecursiveContainerStart($id);
|
||||
|
||||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
}
|
||||
|
||||
public function StartContainer(Request $request, Response $response, array $args) : Response
|
||||
@@ -171,6 +171,7 @@ readonly class DockerController {
|
||||
$uri = $request->getUri();
|
||||
$host = $uri->getHost();
|
||||
$port = $uri->getPort();
|
||||
$path = $request->getParsedBody()['base_path'];
|
||||
if ($port === 8000) {
|
||||
error_log('The AIO_URL-port was discovered to be 8000 which is not expected. It is now set to 443.');
|
||||
$port = 443;
|
||||
@@ -184,7 +185,7 @@ readonly class DockerController {
|
||||
|
||||
$config = $this->configurationManager->GetConfig();
|
||||
// set AIO_URL
|
||||
$config['AIO_URL'] = $host . ':' . $port;
|
||||
$config['AIO_URL'] = $host . ':' . $port . $path;
|
||||
// set wasStartButtonClicked
|
||||
$config['wasStartButtonClicked'] = 1;
|
||||
// set install_latest_major
|
||||
@@ -204,7 +205,7 @@ readonly class DockerController {
|
||||
// Temporarily disabled as it leads much faster to docker rate limits
|
||||
// apcu_clear_cache();
|
||||
|
||||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
}
|
||||
|
||||
public function startTopContainer(bool $pullImage) : void {
|
||||
@@ -223,7 +224,7 @@ readonly class DockerController {
|
||||
|
||||
public function StartWatchtowerContainer(Request $request, Response $response, array $args) : Response {
|
||||
$this->startWatchtower();
|
||||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
}
|
||||
|
||||
public function startWatchtower() : void {
|
||||
@@ -261,7 +262,7 @@ readonly class DockerController {
|
||||
$forceStopNextcloud = true;
|
||||
$this->PerformRecursiveContainerStop($id, $forceStopNextcloud);
|
||||
|
||||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
}
|
||||
|
||||
public function stopTopContainer() : void {
|
||||
|
||||
Reference in New Issue
Block a user