Skip to content

Add Libravatar Avatars plugin#3

Open
shukiv wants to merge 1 commit into
bulwarkmail:mainfrom
shukiv:add-libravatar-plugin
Open

Add Libravatar Avatars plugin#3
shukiv wants to merge 1 commit into
bulwarkmail:mainfrom
shukiv:add-libravatar-plugin

Conversation

@shukiv

@shukiv shukiv commented Jun 19, 2026

Copy link
Copy Markdown

Adds a Libravatar Avatars plugin — Libravatar is a federated, privacy-friendly Gravatar alternative.

Modelled directly on the bundled gravatar plugin (same onAvatarResolve transform hook, same esbuild build, same cache/coalescing pattern), with the Libravatar-specific differences:

  • Endpoint is seccdn.libravatar.org (the public delegation CDN).
  • No content-rating parameter — Libravatar has no rating system — so settingsSchema is size + defaultStyle only.
  • SHA-256 email hash, HEAD existence check with d=404 so it defers to the host's initials/favicon when an address has no avatar.
  • Persistent hit/miss cache (7d/1d) with in-flight coalescing; defers to higher-priority avatar plugins.

Caveat: a browser-sandboxed plugin can't do Libravatar's DNS-SRV delegation lookup, so this targets the central CDN (which still serves avatars for domains that delegate to it). Self-hosted Libravatar servers that don't delegate to the CDN aren't reached client-side.

Built with the documented flow (npm run builddist/index.js → zipped with manifest.json as libravatar.zip). Authored against the current plugin types; I don't have a live instance to load-test it on — a sanity check from a maintainer with one would be appreciated.

Context: this replaces a core PR I'd opened on the webmail repo (bulwarkmail/webmail#447) before the onAvatarResolve hook existed; that's now closed in favour of this plugin form.

A hook-type plugin that resolves Libravatar profile pictures via the
onAvatarResolve transform hook — a federated, privacy-friendly Gravatar
alternative. Modelled on the bundled Gravatar plugin: SHA-256 email hash,
seccdn.libravatar.org endpoint, HEAD existence check with d=404 fallthrough,
persistent hit/miss cache with in-flight coalescing, configurable size +
fallback style, defers to higher-priority avatar plugins.

Differs from Gravatar: no content-rating param (Libravatar has none), and
no DNS-SRV delegation (client sandbox) so it targets the central CDN.
shukiv added a commit to shukiv/jabali-panel that referenced this pull request Jun 19, 2026
The plugin's real home is Bulwark's plugins marketplace repo, submitted as
bulwarkmail/plugins#3 (modelled on the official gravatar plugin). Replace
the earlier thin scaffold (which had a defer bug + empty permissions) with
a pointer to the PR + fork source.
@rathlinus

Copy link
Copy Markdown
Member

You can also publish it yourself it you want to submit it yourself

shukiv added a commit to shukiv/jabali-panel that referenced this pull request Jun 19, 2026
Ships the first-party Libravatar avatar plugin into jabali's Bulwark
webmail so sender/recipient avatars resolve from Libravatar out of the box
(the plugin form of the parked #214 mailbox-avatar work; built version of
bulwarkmail/plugins#3).

Bulwark 1.7.x gates dev-folder plugin bundles behind host Ed25519 signing +
an admin approval before they load, and relocating the admin config dir is
required because ProtectSystem=strict makes /opt/jabali-webmail/data
read-only. install_bulwark now sets PLUGIN_DEV_DIR + ADMIN_CONFIG_DIR
(writable state volume) in bulwark.env, ships the vendored built plugin to
PLUGIN_DEV_DIR/libravatar, and pre-seeds plugin-approvals.json with an
approved entry keyed by the bundle sha256 (re-stamped every run; other
plugins' approvals preserved). Signing key auto-generates once the config
dir is writable.

Validated end-to-end on a live host: function recreates plugin dir +
approval from scratch, webmail restarts clean (0 EROFS), /api/plugins lists
libravatar, signing pubkey returns an ed25519 key. Visual avatar render
needs a logged-in mailbox to confirm.
@shukiv

shukiv commented Jun 19, 2026

Copy link
Copy Markdown
Author

Thanks! Found the self-publish route — extensions.bulwarkmail.org. I'll look at publishing it there. Happy to leave this PR up too in case it's useful in the examples collection. Running against Bulwark 1.7.1 here.

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.

2 participants