Metadata-Version: 2.4
Name: pumice-plugin-immich
Version: 0.1.0
Summary: pumice-server publish plugin: resolves harang-immich embeds on published pages by fetching the photo from Immich and inlining it as base64.
Requires-Python: >=3.13
Requires-Dist: requests>=2.32
Description-Content-Type: text/markdown

# pumice-plugin-immich

A [pumice-server](https://github.com/search5/pumice-server) publish plugin that resolves
[harang-immich](../harang-immich)'s `![immich:profileId/assetId|altText]` embed syntax on
published pages: fetches the photo from Immich and inlines it as a base64 `data:` URI, so a
published page is fully self-contained (no separate request back to Immich needed to see it).

See pumice-server's [`docs/PLUGIN_DEVELOPMENT.md`](../pumice-server/docs/PLUGIN_DEVELOPMENT.md)
for the plugin contract this implements.

## Why a separate credential

harang-immich (the Obsidian plugin) authenticates to Immich using a pre-issued API key that
lives only in Obsidian's local `secretStorage` — it's never synced, so pumice-server has no way
to use it. This plugin is instead configured with its own, separately-issued Immich API key
entered directly on the server (via pumice-server's Publish tab → plugin settings), independent
of whatever the Obsidian client is doing.

## Config

Declares `CONFIG_FIELDS` for pumice-server's generic per-vault plugin config store — one entry
per Immich profile, keyed by the same `profileId` harang-immich's own `data.json` uses. This is
a general mechanism: any plugin can declare whatever config keys/types it needs this way, and
pumice-server's Publish tab renders a real labeled form from that schema without knowing
anything about what the fields mean. pumice-plugin-immich declares just two:

- `server_url` — the Immich server's base URL
- `token` — an Immich API key (Immich has no login endpoint for this; API keys are issued
  directly in Immich's own account settings and sent as the `x-api-key` header, same as the
  Obsidian client does)

## Autofill

`server_url` and a stable per-profile id aren't secrets, and harang-immich's own
`.obsidian/plugins/harang-immich/data.json` already has both (only the real API key lives in
`secretStorage`, out of reach). Declares `AUTOFILL_PATHS`/`suggest_autofill` so pumice-server's
settings modal can read that already-synced file and offer each profile found there as a
one-click fill-in — the vault owner still has to type the `token` themselves.

## Installing into pumice-server

```toml
# pumice-server's pyproject.toml
[tool.uv.sources]
pumice-plugin-immich = { path = "../obsidian-plugin/pumice-plugin-immich", editable = true }
```

```
uv add pumice-plugin-immich
```

## Development

```
uv sync
uv run pytest
```
