Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions lib/SelfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,22 @@ public function test(string $server, OutputInterface $output, bool $ignoreProxyE

// test if the push server can load storage mappings from the db
[$storageId, $count] = $this->getStorageIdForTest();
try {
$retrievedCount = (int)$this->client->get($server . '/test/mapping/' . $storageId, ['nextcloud' => ['allow_local_address' => true], 'verify' => false])->getBody();
} catch (\Exception $e) {
$msg = $e->getMessage();
$output->writeln("<error>🗴 can't connect to push server: $msg</error>");
return self::ERROR_OTHER;
}
// If no admin user was created during the installation, there are no oc_filecache and oc_mounts entries yet, so this check has to be skipped.
if ($storageId !== null) {
try {
$retrievedCount = (int)$this->client->get($server . '/test/mapping/' . $storageId, ['nextcloud' => ['allow_local_address' => true], 'verify' => false])->getBody();
} catch (\Exception $e) {
$msg = $e->getMessage();
$output->writeln("<error>🗴 can't connect to push server: $msg</error>");
return self::ERROR_OTHER;
}

if ((int)$count === $retrievedCount) {
$output->writeln('<info>✓ push server can load mount info from database</info>');
} else {
$output->writeln("<error>🗴 push server can't load mount info from database</error>");
return self::ERROR_OTHER;
if ((int)$count === $retrievedCount) {
$output->writeln('<info>✓ push server can load mount info from database</info>');
} else {
$output->writeln("<error>🗴 push server can't load mount info from database</error>");
return self::ERROR_OTHER;
}
}

// test if the push server can reach nextcloud by having it request the cookie
Expand Down
Loading