summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-05-30 12:42:44 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-05-30 12:42:44 -0100
commit3afc2e9bfd02eea084413eacdafa06e0ce57f674 (patch)
tree5ec7d08b32bdae7909433dab901ea6693c05b080 /lib
parent4a4dc5ea6da55485babd8b46a251ab0c0970ed15 (diff)
disable webfinger on full lock
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/webfinger.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/webfinger.php b/lib/webfinger.php
index 2cf5a78a..432b2c0b 100644
--- a/lib/webfinger.php
+++ b/lib/webfinger.php
@@ -33,6 +33,7 @@ use Exception;
use OC;
use OCA\Social\Service\CacheActorService;
use OCA\Social\Service\ConfigService;
+use OCA\Social\Service\FediverseService;
require_once(__DIR__ . '/../appinfo/autoload.php');
@@ -56,15 +57,21 @@ if ($type !== 'acct') {
list($username, $instance) = explode('@', $account);
try {
$cacheActorService = OC::$server->query(CacheActorService::class);
+ $fediverseService = OC::$server->query(FediverseService::class);
$configService = OC::$server->query(ConfigService::class);
+ $fediverseService->jailed();
+
if ($configService->getCloudAddress(true) !== $instance) {
- throw new Exception('instance is ' . $instance . ', expected ' . $configService->getCloudAddress(true));
+ throw new Exception(
+ 'instance is ' . $instance . ', expected ' . $configService->getCloudAddress(true)
+ );
}
$cacheActorService->getFromLocalAccount($username);
} catch (Exception $e) {
- OC::$server->getLogger()->log(1, 'Exception on webfinger - ' . $e->getMessage());
+ OC::$server->getLogger()
+ ->log(1, 'Exception on webfinger - ' . $e->getMessage());
http_response_code(404);
exit;
}
@@ -81,14 +88,17 @@ $finger = [
'subject' => $subject,
'links' => [
[
- 'rel' => 'self',
+ 'rel' => 'self',
'type' => 'application/activity+json',
'href' => $href
],
[
'rel' => 'http://ostatus.org/schema/1.0/subscribe',
'template' => urldecode(
- $href = $urlGenerator->linkToRouteAbsolute('social.OStatus.subscribe', ['uri' => '{uri}']))
+ $href = $urlGenerator->linkToRouteAbsolute(
+ 'social.OStatus.subscribe', ['uri' => '{uri}']
+ )
+ )
]
]
];