From 6544271d3be643a4489aafbeac635061d49273a9 Mon Sep 17 00:00:00 2001 From: Andrey Borysenko Date: Wed, 24 Jan 2024 12:54:05 +0200 Subject: [PATCH] WIP: minor fixes, force host if https enabled in UI Signed-off-by: Andrey Borysenko --- lib/DeployActions/DockerActions.php | 10 +++--- .../RegisterDaemonConfigModal.vue | 32 ++++++++++++++++--- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/lib/DeployActions/DockerActions.php b/lib/DeployActions/DockerActions.php index aa3da9cc..002068d3 100644 --- a/lib/DeployActions/DockerActions.php +++ b/lib/DeployActions/DockerActions.php @@ -514,12 +514,15 @@ public function initGuzzleClient(DaemonConfig $daemonConfig): void { ], ]; } elseif ($daemonConfig->getProtocol() === 'https') { - $guzzleParams = $this->setupCerts($guzzleParams, $daemonConfig->getDeployConfig()); + $guzzleParams = $this->setupCerts($guzzleParams); + } + if (!empty($daemonConfig->getDeployConfig()['haproxy_password'])) { + $guzzleParams['auth'] = [self::APP_API_HAPROXY_USER, $daemonConfig->getDeployConfig()['haproxy_password']]; } $this->guzzleClient = new Client($guzzleParams); } - private function setupCerts(array $guzzleParams, array $deployConfig): array { + private function setupCerts(array $guzzleParams): array { if (!$this->config->getSystemValueBool('installed', false)) { $certs = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; } else { @@ -527,9 +530,6 @@ private function setupCerts(array $guzzleParams, array $deployConfig): array { } $guzzleParams['verify'] = $certs; - if (!empty($deployConfig['haproxy_password'])) { - $guzzleParams['auth'] = [self::APP_API_HAPROXY_USER, $deployConfig['haproxy_password']]; - } return $guzzleParams; } diff --git a/src/components/DaemonConfig/RegisterDaemonConfigModal.vue b/src/components/DaemonConfig/RegisterDaemonConfigModal.vue index df1ce014..2ac17051 100644 --- a/src/components/DaemonConfig/RegisterDaemonConfigModal.vue +++ b/src/components/DaemonConfig/RegisterDaemonConfigModal.vue @@ -86,16 +86,20 @@
-
+
+ :helper-text="networkHelperText" />
-
+
{{ t('app_api', 'Register') }}