Skip to content

Fixing Issue #80: "Images in messages affected by Discord's new Signed Attachment CDN URLs". Adding attachment archiver.#94

Open
ncjsvr wants to merge 4 commits intomodmail-dev:masterfrom
ncjsvr:master
Open

Fixing Issue #80: "Images in messages affected by Discord's new Signed Attachment CDN URLs". Adding attachment archiver.#94
ncjsvr wants to merge 4 commits intomodmail-dev:masterfrom
ncjsvr:master

Conversation

@ncjsvr
Copy link

@ncjsvr ncjsvr commented Feb 12, 2026

What this does

Discord CDN links expire after about 24 hours so any images/attachments in old logs just break. This adds an optional background archiver that downloads them before they expire and stores them in Mongodb GridFS so they always load.

Fixes #80 - #80

Changes

  • Added a new archiver module that runs in the background, scans logs for discord cdn urls, downloads them and stores in gridfs. Compresses images to jpeg to save space. Has configurable interval, retention, quality etc
  • Updated models so when viewing a log, it checks if attachments have been archived and swaps in the server url instead of the discord one
  • Added an /attachments/ route to serve the archived files
  • Updated env example, app config, and readme with the new config options
  • Updated dockerfile, pipfile, and requirements to add aiohttp and pillow
  • Added logging so you can see this process in console.

Config

Off by default, set SAVE_ATTACHMENTS=yes to enable. All the options are in the env example file.

Edit

Just wanted to say I have 72 archived attachments in my mongo database and it uses 3mb currently.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Images in messages affected by Discord's new Signed Attachment CDN URLs

2 participants