Repository navigation
Releases: udarent/obsidian-plugins-attachment-cloud-cache
Release list
1.2.0
Your own file is the offline copy now, and a few settings changed shape.
Changed
-
The plugin no longer keeps a folder of its own. A copy used to be moved into a hidden cache
folder; now the file you pasted or added simply stays where it is and is used as the offline
copy. Nothing is moved, nothing is duplicated, and there is no cache folder to explain to your
sync tool. "Delete the local file after uploading" still turns caching off, as before. -
Object keys always carry the file name —
<name>-<full hash>[.<extension>]. The shape is no
longer configurable: a template without the hash can make two different files collapse onto one
key and silently overwrite each other. This applies to everyone, and on first run the plugin
clears the old template setting and says so. Note that the name is part of the key, so file
names are visible in your storage provider's logs. -
Off-site files are now one switch plus a site list. "Handle files from other sites like
ordinary files" replaces the old pair of controls, with an optional list of hosts to include or
exclude. Picking files by hand is never restricted by it. -
"When an attachment is no longer linked" is a new setting: ask (default), just show a notice,
or do nothing. Cleaning up always needs your confirmation — this only decides whether you are told. -
"Free up local space" (shown only when "delete the local file" is selected) clears the copies
of attachments that were uploaded earlier and are still linked from a note. They are deleted for
good, not trashed, so the space comes back at once — and each one is only deleted after confirming
the object is still in your storage. -
The local-copy index repairs itself shortly after startup, and periodically afterwards. It
only ever edits the index, never a file. -
The "Attachments folder override" setting is gone. It existed to send uploads somewhere other
than Obsidian's own attachment folder — a leftover from the cache folder. With no cache folder
there is nothing left to override: files land in Obsidian's attachment folder (or the vault root).
Only people who had filled that box in will notice, and only for files added from now on.
Fixed
- The orphan prompt no longer goes missing in the "keep no local copy" setting. Whether an
object was uploaded by this plugin is now tracked in its own ledger, instead of being inferred
from the cache index — the index records where a copy is, and that setting has no copy, so the
prompt could never appear there.
Upgrading
Nothing to do. Your files, links and settings keep working. Two settings change shape on first run
(the off-site pair, and the removed attachment-folder override), and the object key of newly
uploaded files now includes the name — objects already in your storage are untouched, so
re-uploading the same file stores it once more under the new key.
1.1.2
Adding an attachment from your phone now uploads it, and so does any other way a file lands in your vault.
Fixed
-
On Android, adding an image from the toolbar's paperclip did not upload it. It was not a
regression: the plugin only ever listened for pasting and dropping, which is how you add files on a
desktop. The paperclip runs Obsidian's own "Insert attachment" command instead, and that command
saves the file into your vault before it writes the link into the note, emitting neither event.
The plugin now also watches for files that appear in the vault, so the paperclip — gallery, camera,
sharing into Obsidian, or copying files in from elsewhere — all upload and rewrite the note's link.Adoption deliberately waits for the file to be referenced by a note (a few seconds at most) before
uploading: uploading moves the original into the cache folder, and rewriting the reference is what
keeps that from leaving a dead link behind. A file you copy into the vault that no note references
is left alone, exactly like the "upload existing attachments" command already did.
Changed
- The upload setting now covers every way a file can land in your vault, so its wording changed
from "Upload on paste and drop" to "Upload new attachments automatically". It is still on by
default; turning it off leaves all of it to Obsidian and keeps files local, as before.
Upgrading
Nothing to do. Same files, same settings. Cached copies still render offline, and notes keep the same
links unless an attachment you just added gets uploaded and its link rewritten to the remote URL —
which is what the plugin has always done for pasted files.
1.1.1
A one-line fix with a visible effect: the button that deletes files now looks like one.
Fixed
- The "clean up unused cache" confirmation no longer looks harmless. The confirm dialog accepted a
destructiveflag that nothing ever applied, so the button that actually deletes files rendered
exactly like "Cancel" — measured on a real install they differed in nothing: same class, same
background, same text colour, same border. That dialog is the only safety signal a user reads before
an irreversible delete. The confirm button now carries the host's destructive style (red text and
border), the same way the cloud-delete dialog already did it.
Also in this release's repository (no behaviour change): the README and its demo GIF were rewritten
around what 1.1.0 actually does — pasting an image, a PDF and an audio clip, and all three still
rendering after the storage is stopped.
Upgrading
Nothing to do. Same files, same settings, same behaviour — only one button's appearance changes.
1.1.0
Any attachment type, canvases, offline previews for audio/video/PDF, and cloud cleanup.
Added
- Every kind of attachment, not just images. Audio, video, PDF, archives, documents, files
without an extension — paste or drag any of them and they upload. Types Obsidian can preview
(images, audio, video, PDF) are inserted as embeds; everything else becomes an ordinary link
you can click open. The old "participating file types" setting is gone: it asked you to keep a
list of file extensions up to date, which is exactly the kind of thing nobody maintains. - Canvases count the same as notes. A file only referenced from a canvas is now uploaded and
rewritten too.filenodes (the ones you drop directly onto a canvas) end up pointing at the
cached copy, and links written inside a canvas text card are rewritten to your storage just like
they would be in a note. - Audio, video and PDF render offline. Obsidian renders a remote
as an image
element, which can never show a PDF — so the element is rebuilt into a real embed pointing at
your local copy. Reading view and Live Preview both work with no network. - Reclaim cloud space. Two ways to get storage back:
- when you delete an uploaded attachment, the plugin asks whether the copy in your storage
should go too (the default, and the button you get by pressing Enter, is "local only"); - a "clean up unused objects in the cloud" command lists what no note in this vault refers to,
with the total size, before deleting anything.
Both spell out the risk: the same content is stored once, so one object can be shared by other
notes — and by other devices, which a single vault cannot see. Deleting cannot be undone.
- when you delete an uploaded attachment, the plugin asks whether the copy in your storage
- Import credentials from a file. Pick the credentials file downloaded from the MinIO console
and the fields are filled in for you. The secret key still only ever goes to the system keychain.
Changed
- "Upload existing attachments" only touches files notes actually reference, and now moves
them into the cache folder (renaming them by content), rewriting the links in the same run.
Files sitting in your attachments folder that no note links to are left completely alone. tiff,heicandiconow become plain links instead of embeds. Obsidian cannot preview
those inside an embed, so a remote![]()for one of them rendered as a broken image. Your
files are untouched — only the link shape changed.- Caching files from other sites is no longer limited to images, and it still refuses to
"cache" a web page: if an address returnstext/htmlor plain text instead of a file, you get
a message saying so rather than a downloaded web page in your notes.
Upgrading
Nothing to do. Notes keep working as they are. Links written by 1.0.x stay exactly as written —
the plugin does not rewrite existing links to a different form (add a ! yourself if you want an
image that is currently a plain link to be an embed).
If you cached images from other sites with 1.0.0, the copies cached back then are not marked as
such, so the new cleanup command may list them. Re-caching them once marks them properly, and the
command shows you the list before deleting anything either way.
Verified on a real install (Obsidian 1.14.4, self-hosted MinIO): pasting eight different file
types and checking the link shape, the uploaded bytes, the Content-Type and the local copy for
each; canvas rewriting with a canvas that mixes both node kinds; audio/video/PDF rendering offline
in both view modes, asserting that the remote address is never written into an element; and both
cloud-cleanup entry points, including the case where the cloud copy is refused because another note
still links the file.
1.0.1
Bug fixes, plus a change to how off-site images are handled.
Fixed
- The temporary copy written during an upload now lands in the folder Obsidian's own
"attachment folder" setting points at. It previously always landed in the vault root,
so uploads looked like stray image files piling up at the top of the vault. - The "upload existing attachments" command no longer leaves a duplicate copy of files
that are already in your vault. - Caching off-site images now works in Live Preview, not only in reading view.
The render hook Obsidian exposes only fires in reading view, so while editing — where
most people spend their time — nothing happened at all. - A cached copy now gets a real file extension (.png) instead of a fragment of the
URL. Some image hosts put a dot in the last URL segment, so the "extension" used to
become a long token; Obsidian does not display files whose extension it does not
recognise, so the cache folder looked empty even though the files were there. - Pasting an image no longer inserts the same picture two or three times.
Changed - Off-site images are no longer governed by a per-site prompt. There is now a default
behaviour in the settings (skip, or cache) plus a way to choose per image: a command
and a settings button open a picker and cache exactly the ones you tick. The old
.site-decisions.json file is no longer read or written. - The "upload existing attachments" command can also pick up images that notes link to
somewhere else, not only files sitting in the vault.
If you cached off-site images with 1.0.0
Those copies were written with the token-style name described above. Re-caching them with
1.0.1 produces properly named .png copies, which leaves the old ones unreferenced.
Run Repair the local-copy index, then Clean up unused cache files, to tidy up.
How far this has been verified
Signing, key and path derivation, the upload chain, the caching chain and the cleanup
commands are covered by tests, and every rule is mutation-checked (deliberately broken,
with the suite required to fail for that rule's own reason). The real build is then driven
in a real Obsidian, and the full upload and download round trip is proven against a real
MinIO instance — the object key is recomputed independently from the bytes and matches,
the link opens anonymously, the bytes read back are identical, and the rendered
points at the local copy rather than the remote URL.
Not verified: iOS has never been run, and Android has not been run on a real device.
MIT licensed. See the repository README for setup details.
1.0.0
Upload attachments to your own S3-compatible storage, and keep a local copy in a cache folder —
so images still render with no network.
What this release can do
- Upload on paste or drag-and-drop, rewriting the link in your note to point at your storage
- Images render from the local copy, with zero remote requests while offline
- Content-addressed by default ({hash}.{ext}): the same image is stored once, pasting it twice
uploads nothing - A failed upload never loses the file — it stays in your attachment folder with a working local link
and the reason is shown - Optional third-party image caching (off by default) and an optional cache size limit
- Four maintenance commands: show cache usage, repair the local-copy index, clean up unused cache
files, upload existing attachments
Before you start - Requires Obsidian 1.13.0 or newer (desktop and mobile). The floor is set by the declarative
settings API, which makes the settings searchable in Obsidian's global search. - You need an S3-compatible endpoint, a bucket, and an access key. Cloudflare R2, AWS S3, MinIO and
Backblaze B2 all work; anything S3-compatible should too. - If you serve images through a CDN or a custom domain, put that prefix in Public URL base.
Leaving it empty uses the object address, which requires the bucket to allow anonymous reads.
How far this has been verified
Signing, key and path derivation, the upload chain and the cleanup commands are covered by tests,
and every rule is mutation-checked (deliberately broken, with the suite required to fail for that
rule's own reason). The real build is then driven in a real Obsidian, and the full upload and
download round trip is proven against a real MinIO instance — the object key is recomputed
independently from the bytes and matches, the link opens anonymously, the bytes read back are
identical, and the renderedpoints at the local copy rather than the remote URL.
Not verified: iOS has never been run, and Android has not been run on a real device.
MIT licensed. See the repository README for setup details.