You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/app/Http/Controllers/InstanceActorController.php

92 lines
3.4 KiB
PHTML

<?php
namespace App\Http\Controllers;
use App\Models\InstanceActor;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Cache;
class InstanceActorController extends Controller
{
public function profile(): Response
9 months ago
{
$res = Cache::rememberForever(InstanceActor::PROFILE_KEY, function () {
$res = (new InstanceActor)->first()->getActor();
9 months ago
return json_encode($res, JSON_UNESCAPED_SLASHES);
});
9 months ago
return response($res)->header('Content-Type', 'application/activity+json');
}
public function inbox(): void {}
9 months ago
public function outbox(): Response
9 months ago
{
$res = json_encode([
'@context' => [
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1',
[
9 months ago
'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
'toot' => 'http://joinmastodon.org/ns#',
'featured' => [
'@id' => 'toot:featured',
'@type' => '@id',
],
9 months ago
'featuredTags' => [
'@id' => 'toot:featuredTags',
'@type' => '@id',
],
9 months ago
'alsoKnownAs' => [
'@id' => 'as:alsoKnownAs',
'@type' => '@id',
],
9 months ago
'movedTo' => [
'@id' => 'as:movedTo',
'@type' => '@id',
],
9 months ago
'schema' => 'http://schema.org#',
'PropertyValue' => 'schema:PropertyValue',
'value' => 'schema:value',
'discoverable' => 'toot:discoverable',
'Device' => 'toot:Device',
'Ed25519Signature' => 'toot:Ed25519Signature',
'Ed25519Key' => 'toot:Ed25519Key',
'Curve25519Key' => 'toot:Curve25519Key',
'EncryptedMessage' => 'toot:EncryptedMessage',
'publicKeyBase64' => 'toot:publicKeyBase64',
'deviceId' => 'toot:deviceId',
'claim' => [
'@type' => '@id',
'@id' => 'toot:claim',
],
9 months ago
'fingerprintKey' => [
'@type' => '@id',
'@id' => 'toot:fingerprintKey',
],
9 months ago
'identityKey' => [
'@type' => '@id',
'@id' => 'toot:identityKey',
],
9 months ago
'devices' => [
'@type' => '@id',
'@id' => 'toot:devices',
],
9 months ago
'messageFranking' => 'toot:messageFranking',
'messageType' => 'toot:messageType',
'cipherText' => 'toot:cipherText',
'suspended' => 'toot:suspended',
],
],
9 months ago
'id' => config('app.url').'/i/actor/outbox',
'type' => 'OrderedCollection',
'totalItems' => 0,
'first' => config('app.url').'/i/actor/outbox?page=true',
'last' => config('app.url').'/i/actor/outbox?min_id=0page=true',
], JSON_UNESCAPED_SLASHES);
return response($res)->header('Content-Type', 'application/activity+json');
}
}