Skip to content

Uploaded images have no automatic cleanup / orphan garbage collection #2

Description

@rmdevpro

Problem

Uploaded images are stored at /app/client/public/images/ (now mounted to /mnt/ssd1/workspace/henson/uploads). Files are deleted when explicitly removed via the UI, but there is no:

  • TTL / expiration on old files
  • Size limit on the uploads directory
  • Scheduled cleanup of orphaned files (files on disk with no matching record in MongoDB)

Over time this will fill the disk.

Suggested Fix

Add a cron job or scheduled task that:

  1. Queries MongoDB files collection for all referenced file paths
  2. Scans the uploads directory
  3. Deletes files on disk with no matching DB record
  4. Optionally: deletes files older than N days

Priority

Low — single-user deployment, not urgent.


Migrated from jmorrissette-RMDC/LibreChat

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions