Local Blossom Cache
Almond can run as a Local Blossom Cache: a local proxy on 127.0.0.1:24242 that caches blobs from remote Blossom servers. Uploads and mirrors are off; the cache fills only through proxying.
dotenv
ALMOND_BIND_ADDR=127.0.0.1:24242
ALMOND_PUBLIC_URL=http://127.0.0.1:24242
ALMOND_UPLOAD_ACCESS=off
ALMOND_MIRROR_ACCESS=off
ALMOND_LIST_ENABLED=true
ALMOND_HOMEPAGE_ENABLED=true
ALMOND_CUSTOM_ORIGIN_ACCESS=public
ALMOND_UPSTREAM_MODE=proxy
ALMOND_STORAGE_MAX_SIZE=5000MiB
ALMOND_UPSTREAM_CACHE_TTL=30dWith Docker:
bash
docker run -p 24242:24242 \
-v /path/to/cache:/app/files \
-e ALMOND_BIND_ADDR=0.0.0.0:24242 \
-e ALMOND_PUBLIC_URL=http://127.0.0.1:24242 \
-e ALMOND_UPLOAD_ACCESS=off \
-e ALMOND_MIRROR_ACCESS=off \
-e ALMOND_CUSTOM_ORIGIN_ACCESS=public \
-e ALMOND_UPSTREAM_MODE=proxy \
-e ALMOND_STORAGE_MAX_SIZE=5000MiB \
-e ALMOND_UPSTREAM_CACHE_TTL=30d \
ghcr.io/flox1an/almondA request flows like this:
- Client requests
GET /abc123...def.jpg?xs=cdn.example.com&as=<pubkey>. - A cached blob is returned immediately.
- Otherwise Almond tries the
xshints, then theasauthor's BUD-03 server list (kind10063), caches the blob and returns it. - If no hinted server has it, the answer is
404.
Expired entries are removed after ALMOND_UPSTREAM_CACHE_TTL; under capacity pressure the oldest entries go first.
