|
|
|
|
@ -287,25 +287,16 @@ class UserAccountDelete extends Command
|
|
|
|
|
$httpFailed = [];
|
|
|
|
|
$retryable = collect();
|
|
|
|
|
|
|
|
|
|
$version = config('pixelfed.version');
|
|
|
|
|
$appUrl = config('app.url');
|
|
|
|
|
$userAgent = "(Pixelfed/{$version}; +{$appUrl})";
|
|
|
|
|
|
|
|
|
|
$requests = function () use ($client, $urls, $digest, $payload, $userAgent) {
|
|
|
|
|
$requests = function () use ($client, $urls, $digest, $payload) {
|
|
|
|
|
foreach ($urls as $url) {
|
|
|
|
|
$headers = HttpSignature::instanceActorSignWithDigest($url, $digest, [
|
|
|
|
|
'Content-Type' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$headers['User-Agent'] = $userAgent;
|
|
|
|
|
|
|
|
|
|
yield function () use ($client, $url, $headers, $payload) {
|
|
|
|
|
return $client->postAsync($url, [
|
|
|
|
|
'curl' => [
|
|
|
|
|
CURLOPT_HTTPHEADER => $headers,
|
|
|
|
|
CURLOPT_POSTFIELDS => $payload,
|
|
|
|
|
CURLOPT_HEADER => true,
|
|
|
|
|
],
|
|
|
|
|
'headers' => $headers,
|
|
|
|
|
'body' => $payload,
|
|
|
|
|
]);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
@ -353,16 +344,10 @@ class UserAccountDelete extends Command
|
|
|
|
|
|
|
|
|
|
protected function sendDebug(string $url, string $payload, string $digest): int
|
|
|
|
|
{
|
|
|
|
|
$version = config('pixelfed.version');
|
|
|
|
|
$appUrl = config('app.url');
|
|
|
|
|
$userAgent = "(Pixelfed/{$version}; +{$appUrl})";
|
|
|
|
|
|
|
|
|
|
$headers = HttpSignature::instanceActorSignWithDigest($url, $digest, [
|
|
|
|
|
'Content-Type' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$headers['User-Agent'] = $userAgent;
|
|
|
|
|
|
|
|
|
|
$this->info('Target: '.$url);
|
|
|
|
|
$this->newLine();
|
|
|
|
|
|
|
|
|
|
@ -385,11 +370,8 @@ class UserAccountDelete extends Command
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$response = $client->post($url, [
|
|
|
|
|
'curl' => [
|
|
|
|
|
CURLOPT_HTTPHEADER => $headers,
|
|
|
|
|
CURLOPT_POSTFIELDS => $payload,
|
|
|
|
|
CURLOPT_HEADER => true,
|
|
|
|
|
],
|
|
|
|
|
'headers' => $headers,
|
|
|
|
|
'body' => $payload,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$status = $response->getStatusCode();
|
|
|
|
|
|