New config options

It would be great to add a few envs to manage the retention of icon-cache and attachment.

At the moment, after creating a new container, all data disappears (if it is not saved), I would like to be able to save these files inside the database as a BLOB, and use the date directory as a cache.

Is such a format possible from the point of view of the application architecture?

All icon cache is stored to disk already. Using the database will make it slower in my opinion.

Also, the data should not disappear if you created a volume because that should be persistent.

I suggest to read the following wiki Starting a Container · dani-garcia/vaultwarden Wiki · GitHub

Yes, this will slow down the process, but I’m going to store blobs no more than 100kb, so it’s not critical for me.

I read the WIKI about the /data directory, and in my case I can’t throw the data anywhere, since I run it in the cloud with rather limited functionality.

Then i suggest to use something else then the internal icon fetcher. It will not cache them locally but it could be a solution.

It is available in the latest testing tagged docker image.
See: vaultwarden/.env.template at main · dani-garcia/vaultwarden · GitHub

Also, i think it would be best that you disable attachments, since those are stored on disk too.

I understand that this is stored on disk.

This is the point that when adding or removing attachments, they will be saved to the database, for storage and in the data folder, for faster access. On request, get files from the data directory, and if there are none, get them from the database. Or remove the saving in the folder and save only in the database, for example, with the variable STORE_ATTACHMENT_IN_DB=true.