From e6bc57d7b68b4d43498913fad42fcfc776419ba7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 3 Feb 2023 20:20:51 -0700 Subject: [PATCH 1/2] Update Media model, use cloud filesystem url if enabled instead of cdn_url to easily update S3 media urls --- app/Media.php | 2 +- config/filesystems.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Media.php b/app/Media.php index 3e9afe1ed..8f9f3a5a7 100644 --- a/app/Media.php +++ b/app/Media.php @@ -38,7 +38,7 @@ class Media extends Model public function url() { if($this->cdn_url) { - return $this->cdn_url; + return Storage::disk(config('filesystems.cloud'))->url($this->media_path); } if($this->remote_media && $this->remote_url) { diff --git a/config/filesystems.php b/config/filesystems.php index 43c2732e0..38feb2173 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -82,6 +82,7 @@ return [ ], 'root' => env('DO_SPACES_ROOT',''), 'throw' => true, + 'url' => env('AWS_URL'), ], 'backup' => [ From c62ac0259da28b880371579e08746677c2698729 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 3 Feb 2023 20:21:59 -0700 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ce043ad6..5b1f87622 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,6 +93,7 @@ - Update ComposeController, fix validation issue ([80e6a5a9](https://github.com/pixelfed/pixelfed/commit/80e6a5a9)) - Update reply view, fix visibility filtering ([d419af4b](https://github.com/pixelfed/pixelfed/commit/d419af4b)) - Update AP helpers, ingest attachments in replies ([c504e643](https://github.com/pixelfed/pixelfed/commit/c504e643)) +- Update Media model, use cloud filesystem url if enabled instead of cdn_url to easily update S3 media urls ([e6bc57d7](https://github.com/pixelfed/pixelfed/commit/e6bc57d7)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)