Skip to content

Commit

Permalink
allow local ips on globalscale
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed May 4, 2023
1 parent d052ade commit 243c204
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Command/CirclesRemote.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,11 @@ private function outgoingTest(string $remote, array $payload): NCSignedRequest {

$app = $this->remoteStreamService->getAppSignatory();
$signedRequest = $this->remoteStreamService->signOutgoingRequest($request, $app);
$this->doRequest($signedRequest->getOutgoingRequest());
$outgoingRequest = $signedRequest->getOutgoingRequest();
$outgoingRequest->setLocalAddressAllowed(true);
$outgoingRequest->setFollowLocation(true);

$this->doRequest($outgoingRequest);

return $signedRequest;
}
Expand Down Expand Up @@ -446,11 +450,12 @@ function (RemoteInstance $instance): string {
* @param string $instance
*/
private function syncGSInstance(string $instance): void {
$this->output->write('Adding <comment>' . $instance . '</comment>: ');
if ($this->configService->isLocalInstance($instance)) {
$this->output->writeln('<comment>instance is local</comment>');
return;
}

$this->output->write('Adding <comment>' . $instance . '</comment>: ');
try {
$this->remoteStreamService->addRemoteInstance(
$instance,
Expand Down
2 changes: 2 additions & 0 deletions lib/Controller/RemoteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ public function test(): DataResponse {

return new DataResponse($this->serialize($test));
} catch (Exception $e) {
$this->e($e);

return $this->exceptionResponse($e, Http::STATUS_UNAUTHORIZED);
}
}
Expand Down

0 comments on commit 243c204

Please sign in to comment.