3 * @file src/Module/Inbox.php
5 namespace Friendica\Module;
7 use Friendica\BaseModule;
8 use Friendica\Protocol\ActivityPub;
9 use Friendica\Core\System;
14 class Inbox extends BaseModule
16 public static function init()
20 $postdata = file_get_contents('php://input');
22 if (empty($postdata)) {
23 System::httpExit(400);
26 if (ActivityPub::verifySignature($postdata, $_SERVER)) {
27 $filename = 'signed-activitypub';
29 $filename = 'failed-activitypub';
32 $tempfile = tempnam(get_temppath(), $filename);
33 file_put_contents($tempfile, json_encode(['header' => $_SERVER, 'body' => $postdata]));
35 System::httpExit(200);