-
-
Notifications
You must be signed in to change notification settings - Fork 936
Remove unnecessary pictrs purge calls #5565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8b62dc9 to
988638d
Compare
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 29, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
MrKaplan-lw
pushed a commit
to Fedihosting-Foundation-Forks/lemmy
that referenced
this pull request
Mar 29, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 29, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 29, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 29, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 29, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 29, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 29, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 29, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
flamingos-cant
pushed a commit
to flamingos-cant/lemmy
that referenced
this pull request
Mar 30, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
flamingos-cant
added a commit
to flamingos-cant/lemmy
that referenced
this pull request
Mar 30, 2025
Also add the changes to from LemmyNet#5565 related to handling NSFW posts from federation.
988638d to
e2565cf
Compare
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 31, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
e2565cf to
cf9ddd5
Compare
Nutomic
reviewed
Mar 31, 2025
Nutomic
reviewed
Mar 31, 2025
Nutomic
reviewed
Mar 31, 2025
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 31, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as banning a user with content removal setting their avatar and profile banner to `NULL` in the db, which prevents them from being displayed on their profile. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging users will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
dessalines
reviewed
Mar 31, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Banning a user with content removal now deletes all media they uploaded. 7. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. 8. On an NSFW-disabled instance, receiving a post update via federation, which changes the post from not NSFW to NSFW no longer purges post URL and thumbnail from pict-rs. Some of the mentioned actions will still remove references to image URLs from the database, such as purging a community will still set its icon and banner to `NULL` in the db, but the associated images will no longer be purged from pict-rs. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging and banning users with content removal will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. fixes LemmyNet#5560
cf9ddd5 to
6e82f97
Compare
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Mar 31, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Banning a user with content removal now deletes all media they uploaded. 7. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as purging a community will still set its icon and banner to `NULL` in the db, but the associated images will no longer be purged from pict-rs. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging and banning users with content removal will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
dessalines
approved these changes
Apr 1, 2025
Member
dessalines
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx!
| purge_post_images(url, thumbnail_url, context).await; | ||
| // TODO: Remove locally generated thumbnail if one exists, depends on | ||
| // https://github.com/LemmyNet/lemmy/issues/5564 to be implemented to be able to | ||
| // safely do this. |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll comment in the linked issue.
Nutomic
approved these changes
Apr 1, 2025
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Apr 1, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Banning a user with content removal now deletes all media they uploaded. 7. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as purging a community will still set its icon and banner to `NULL` in the db, but the associated images will no longer be purged from pict-rs. As this stops erasure of thumbnails, LemmyNet#5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging and banning users with content removal will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@988638d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Apr 1, 2025
This change was implemented after the original PR was created to restore functionality to delete user media on bans with content removal. Unlike the original implementation, this now only deletes user media rather than purging their images from pict-rs, and it applies to all uploads associated with the user rather than iterating over media references in user avatar, user banner, as well as post URLs and post thumbnails for all posts created by the banned user. backports remaining part of LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@b892f3d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Apr 1, 2025
This change was implemented after the original PR was created to restore functionality to delete user media on bans with content removal. Unlike the original implementation, this now only deletes user media rather than purging their images from pict-rs, and it applies to all uploads associated with the user rather than iterating over media references in user avatar, user banner, as well as post URLs and post thumbnails for all posts created by the banned user. backports remaining part of LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@b892f3d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Apr 1, 2025
This change was implemented after the original PR was created to restore functionality to delete user media on bans with content removal. Unlike the original implementation, this now only deletes user media rather than purging their images from pict-rs, and it applies to all uploads associated with the user rather than iterating over media references in user avatar, user banner, as well as post URLs and post thumbnails for all posts created by the banned user. backports remaining part of LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@b892f3d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Apr 1, 2025
This change was implemented after the original PR was created to restore functionality to delete user media on bans with content removal. Unlike the original implementation, this now only deletes user media rather than purging their images from pict-rs, and it applies to all uploads associated with the user rather than iterating over media references in user avatar, user banner, as well as post URLs and post thumbnails for all posts created by the banned user. backports remaining part of LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@b892f3d
Nothing4You
added a commit
to Nothing4You/lemmy
that referenced
this pull request
Apr 1, 2025
This change was implemented after the original PR was created to restore functionality to delete user media on bans with content removal. Unlike the original implementation, this now only deletes user media rather than purging their images from pict-rs, and it applies to all uploads associated with the user rather than iterating over media references in user avatar, user banner, as well as post URLs and post thumbnails for all posts created by the banned user. backports remaining part of LemmyNet#5565 to 0.19 LemmyNet#5565 LemmyNet@b892f3d
Nutomic
pushed a commit
that referenced
this pull request
Apr 2, 2025
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended. pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads. As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well. Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with. This implements the following changes: 1. Purging a community no longer purges the community banner or icon from pict-rs. 2. Purging a community no longer purges all images referenced in post URLs and post thumbnails within the community from pict-rs. 3. Banning a user with content removal no longer purges their profile avatar or banner from pict-rs. 4. Banning a user with content removal no longer purges images referenced in post URLs and post thumbnails for all posts they created from pict-rs. 5. Banning a user with content removal no longer purges the community banners or icons for all communities they're the top mod of from pict-rs. 6. Banning a user with content removal now deletes all media they uploaded. 7. Purging a user no longer purges their profile avatar, banner, or images referenced in post URLs and post thumbnails for all posts they created from pict-rs. All media linked to their user account will still get deleted, which was already explicitly the case in the past. Some of the mentioned actions will still remove references to image URLs from the database, such as purging a community will still set its icon and banner to `NULL` in the db, but the associated images will no longer be purged from pict-rs. As this stops erasure of thumbnails, #5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images. The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging and banning users with content removal will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining. backports #5565 to 0.19 #5565 988638d
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit removes various cases in which Lemmy would purge images from pictrs, which would in many cases not be what admins intended.
pict-rs provides aliases on upload, which allows deduplicating multiple uploads of the same file in the backend, while still providing unique URLs for uploads.
As Lemmy used pictrs' purge API, this meant that not only the image alias referring to removed content was deleted, all other aliases were invalidated as well.
Additionally, even alias deletion would not appropriate in many of these cases, as they were lacking validation that they were exclusively used by the content they were supposed to get removed with.
This implements the following changes:
Some of the mentioned actions will still remove references to image URLs from the database, such as purging a community will still set its icon and banner to
NULLin the db, but the associated images will no longer be purged from pict-rs.As this stops erasure of thumbnails, #5564 has been created to ensure tracking the person that triggered the creation of thumbnails, which will allow removing them like other images.
The only remaining option to purge images attached to a post is now purging an individual post, which still erases the post URL and thumbnail from pict-rs entirely, including any other aliases. Purging and banning users with content removal will remove all aliases associated with them, which will end up deleting those images entirely when there are no other alias remaining.
fixes #5560