Skip to content

Commit e1b8e9a

Browse files
committed
fix(SetupChecks): Detect CLI mode in HTTPS / URL generator check
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
1 parent f6d4af8 commit e1b8e9a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/settings/lib/SetupChecks/HttpsUrlGeneration.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,17 @@ public function run(): SetupResult {
6363
}
6464
}
6565
$generatedUrl = $this->urlGenerator->getAbsoluteURL('index.php');
66-
if (!str_starts_with($generatedUrl, 'https://')) {
66+
if (!\OC::$CLI && !str_starts_with($generatedUrl, 'https://')) {
6767
return SetupResult::warning(
6868
$this->l10n->t('You are accessing your instance over a secure connection, however your instance is generating insecure URLs. This most likely means that you are behind a reverse proxy and the overwrite config variables are not set correctly.'),
6969
$this->urlGenerator->linkToDocs('admin-reverse-proxy')
7070
);
7171
}
72-
73-
return SetupResult::success($this->l10n->t('You are accessing your instance over a secure connection, and your instance is generating secure URLs.'));
72+
if (\OC::$CLI) {
73+
/* We were called from CLI so we can't check this */
74+
return SetupResult::info($this->l10n->t('Your URL generation could not be checked from CLI mode.'));
75+
} else {
76+
return SetupResult::success($this->l10n->t('You are accessing your instance over a secure connection, and your instance is generating secure URLs.'));
77+
}
7478
}
7579
}

0 commit comments

Comments
 (0)