From 7e8653f0bbb19639b315947364e8acf02a1f536c Mon Sep 17 00:00:00 2001 From: Shlee Date: Sat, 15 Nov 2025 12:12:23 +1030 Subject: [PATCH 1/8] Update .dockerignore --- .dockerignore | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 58091cf56..03460ed31 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,9 +1,14 @@ # Folders .git/ -storage/app/public/ +# Laravel +## local storage of media excluided from image +!storage/app/public/m/ +storage/app/public/m/* +tests/ +# Docker mariadb-11-data/ redis-data/ -tests/ +# Packages node_modules/ vendor/ .ddev/ From a9b69e3d839ebbd8ce82772e73ee29392b25ee73 Mon Sep 17 00:00:00 2001 From: Shlee Date: Sat, 15 Nov 2025 12:43:38 +1030 Subject: [PATCH 2/8] Update .dockerignore --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.dockerignore b/.dockerignore index 03460ed31..00867dd7e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,6 +4,8 @@ ## local storage of media excluided from image !storage/app/public/m/ storage/app/public/m/* +!bootstrap/cache/ +bootstrap/cache/* tests/ # Docker mariadb-11-data/ From 06eedfba00bd518a0f949d67604fd695256aad5f Mon Sep 17 00:00:00 2001 From: Shlee Date: Sat, 15 Nov 2025 14:49:24 +1030 Subject: [PATCH 3/8] Update docker-compose.yml --- docker-compose.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f482b9038..c7dc47bcb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,18 @@ services: ## MariaDB and Redis (optional) db: - image: mariadb:11 + image: mysql:9 container_name: pixelfed-db restart: unless-stopped env_file: - .env environment: - MARIADB_DATABASE: ${DB_DATABASE} - MARIADB_USER: ${DB_USERNAME} - MARIADB_PASSWORD: ${DB_PASSWORD} - MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} + MYSQL_DATABASE: ${DB_DATABASE} + MYSQL_USER: ${DB_USERNAME} + MYSQL_PASSWORD: ${DB_PASSWORD} + MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} volumes: - - ./mariadb-11-data:/var/lib/mysql + - ./mysql-9-data:/var/lib/mysql healthcheck: test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] interval: 10s From 787e5719a6e95c1853a7023da84d9372a7a2f10e Mon Sep 17 00:00:00 2001 From: Shlee Date: Sat, 15 Nov 2025 14:55:48 +1030 Subject: [PATCH 4/8] Update Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index c68332c31..342a9d916 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,7 @@ RUN install-php-extensions \ bcmath \ curl \ gd \ + imagick \ intl \ mbstring \ xml \ From 63a3c63cbafb93f2a9dfdb135796569e0ee3771c Mon Sep 17 00:00:00 2001 From: Shlee Date: Sat, 15 Nov 2025 18:36:19 +1030 Subject: [PATCH 5/8] Update docker-compose.yml --- docker-compose.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f482b9038..489c8f964 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -86,12 +86,16 @@ services: command: ["php", "artisan", "horizon"] env_file: - .env + environment: environment: # Laravel Auto-run Configuration + AUTORUN_ENABLED: "false" + AUTORUN_LARAVEL_MIGRATION: "false" + AUTORUN_LARAVEL_MIGRATION_ISOLATION: "false" AUTORUN_LARAVEL_STORAGE_LINK: "true" - AUTORUN_LARAVEL_EVENT_CACHE: "true" - AUTORUN_LARAVEL_ROUTE_CACHE: "true" - AUTORUN_LARAVEL_VIEW_CACHE: "true" + AUTORUN_LARAVEL_EVENT_CACHE: "false" + AUTORUN_LARAVEL_ROUTE_CACHE: "false" + AUTORUN_LARAVEL_VIEW_CACHE: "false" AUTORUN_LARAVEL_CONFIG_CACHE: "true" PHP_POST_MAX_SIZE: "500M" PHP_UPLOAD_MAX_FILE_SIZE: "500M" @@ -120,12 +124,16 @@ services: stop_signal: SIGTERM env_file: - .env + environment: environment: # Laravel Auto-run Configuration + AUTORUN_ENABLED: "false" + AUTORUN_LARAVEL_MIGRATION: "false" + AUTORUN_LARAVEL_MIGRATION_ISOLATION: "false" AUTORUN_LARAVEL_STORAGE_LINK: "true" - AUTORUN_LARAVEL_EVENT_CACHE: "true" - AUTORUN_LARAVEL_ROUTE_CACHE: "true" - AUTORUN_LARAVEL_VIEW_CACHE: "true" + AUTORUN_LARAVEL_EVENT_CACHE: "false" + AUTORUN_LARAVEL_ROUTE_CACHE: "false" + AUTORUN_LARAVEL_VIEW_CACHE: "false" AUTORUN_LARAVEL_CONFIG_CACHE: "true" PHP_POST_MAX_SIZE: "500M" PHP_UPLOAD_MAX_FILE_SIZE: "500M" From 6cf1e8fb9c190ef88e156c62ffe99dc3388b909a Mon Sep 17 00:00:00 2001 From: Shlee Date: Sat, 15 Nov 2025 18:36:56 +1030 Subject: [PATCH 6/8] Update docker-compose.yml --- docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 489c8f964..551a4c49f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -86,7 +86,6 @@ services: command: ["php", "artisan", "horizon"] env_file: - .env - environment: environment: # Laravel Auto-run Configuration AUTORUN_ENABLED: "false" @@ -124,7 +123,6 @@ services: stop_signal: SIGTERM env_file: - .env - environment: environment: # Laravel Auto-run Configuration AUTORUN_ENABLED: "false" From 7f4e9164753f1f150e222aff6cdc72a419627d98 Mon Sep 17 00:00:00 2001 From: Shlee Date: Sun, 16 Nov 2025 20:53:54 +1030 Subject: [PATCH 7/8] Update .dockerignore --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index 58091cf56..b5c2844c6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,7 @@ # Folders .git/ storage/app/public/ +mysql-9-data/ mariadb-11-data/ redis-data/ tests/ From 6197a8296f42253fbc5985774ade3ef56ca964d5 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 20 Nov 2025 04:54:36 -0700 Subject: [PATCH 8/8] Update UserAccountDelete command --- app/Console/Commands/UserAccountDelete.php | 86 ++++++++++++---------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/app/Console/Commands/UserAccountDelete.php b/app/Console/Commands/UserAccountDelete.php index 3af4bb1f2..77123a89f 100644 --- a/app/Console/Commands/UserAccountDelete.php +++ b/app/Console/Commands/UserAccountDelete.php @@ -68,56 +68,68 @@ class UserAccountDelete extends Command $profile = Profile::withTrashed()->find($user->profile_id); - $fractal = new Fractal\Manager(); - $fractal->setSerializer(new ArraySerializer()); - $resource = new Fractal\Resource\Item($profile, new DeleteActor()); + $fractal = new Fractal\Manager; + $fractal->setSerializer(new ArraySerializer); + $resource = new Fractal\Resource\Item($profile, new DeleteActor); $activity = $fractal->createData($resource)->toArray(); - - $audience = Instance::whereNotNull(['shared_inbox', 'nodeinfo_last_fetched']) - ->where('nodeinfo_last_fetched', '>', now()->subDays(14)) - ->distinct() - ->pluck('shared_inbox'); - $payload = json_encode($activity); $client = new Client([ 'timeout' => 5, + 'connect_timeout' => 2, ]); $version = config('pixelfed.version'); $appUrl = config('app.url'); $userAgent = "(Pixelfed/{$version}; +{$appUrl})"; - $requests = function ($audience) use ($client, $activity, $profile, $payload, $userAgent) { - foreach ($audience as $url) { - $headers = HttpSignature::sign($profile, $url, $activity, [ - 'Content-Type' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', - 'User-Agent' => $userAgent, - ]); - yield function () use ($client, $url, $headers, $payload) { - return $client->postAsync($url, [ - 'curl' => [ - CURLOPT_HTTPHEADER => $headers, - CURLOPT_POSTFIELDS => $payload, - CURLOPT_HEADER => true, - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_SSL_VERIFYHOST => false, - ], - ]); + $totalSent = 0; + $bar = $this->output->createProgressBar(); + $bar->start(); + + Instance::whereNotNull('shared_inbox') + ->whereNotNull('nodeinfo_last_fetched') + ->where('nodeinfo_last_fetched', '>', now()->subDays(14)) + ->select(['shared_inbox']) + ->distinct() + ->chunk(500, function ($instances) use ($client, $activity, $profile, $payload, $userAgent, &$totalSent, $bar) { + $audience = $instances->pluck('shared_inbox')->unique(); + + $requests = function ($audience) use ($client, $activity, $profile, $payload, $userAgent) { + foreach ($audience as $url) { + $headers = HttpSignature::sign($profile, $url, $activity, [ + 'Content-Type' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', + 'User-Agent' => $userAgent, + ]); + yield function () use ($client, $url, $headers, $payload) { + return $client->postAsync($url, [ + 'curl' => [ + CURLOPT_HTTPHEADER => $headers, + CURLOPT_POSTFIELDS => $payload, + CURLOPT_HEADER => true, + ], + ]); + }; + } }; - } - }; - - $pool = new Pool($client, $requests($audience), [ - 'concurrency' => 50, - 'fulfilled' => function ($response, $index) { - }, - 'rejected' => function ($reason, $index) { - }, - ]); - $promise = $pool->promise(); + $pool = new Pool($client, $requests($audience), [ + 'concurrency' => 100, + 'fulfilled' => function ($response, $index) use (&$totalSent, $bar) { + $totalSent++; + $bar->advance(); + }, + 'rejected' => function ($reason, $index) use ($bar) { + $bar->advance(); + }, + ]); + + $promise = $pool->promise(); + $promise->wait(); + }); - $promise->wait(); + $bar->finish(); + $this->newLine(); + $this->info("Successfully sent Delete activity to {$totalSent} instances."); } }