`stripHopByHop` copies headers with `out.set(key, value)`, which overwrites.
Correct for every header except the one that legitimately repeats: a NextAuth
sign-in sends several Set-Cookie - csrf-token, callback-url, session-token - and
collapsing them to one drops the rest.
Measured: two Set-Cookie headers direct from Linkwarden, one through the door,
and the survivor was callback-url. So the csrf cookie never reached the browser,
the sign-in posted, failed its CSRF check and bounced back to the form. A
redirect loop with nothing in any log saying why - and the owner predicted this
exact symptom from the other side before it was found.
`getSetCookie()` returns them unjoined, which is the reason to use it rather than
splitting a combined value: `Expires` contains a comma, so naive splitting
corrupts the date and the cookie is discarded.
Both hops use this one function, so both are fixed by it.
The owner installed it, landed on the configuration form, and could not get off
it. Not a bug in the form: there was nothing behind it. One panel was registered
and it was the settings.
That is the wrong shape for a plugin regardless of how much is finished. A screen
whose only content is its own configuration reads as broken rather than
unfinished, because the first thing anybody does after installing is look for the
way forward.
So: collections on the left, links on the right, and the settings behind the gear
in the collections panel - reachable when something is wrong and out of the way
when it is not. Selection is `?collection=` in the URL rather than a channel, so
which collection you are looking at survives a reload and can be linked to.
Search is Linkwarden's own `searchQueryString`, which searches names,
descriptions, tags AND the archived page text - the thing a bookmark bar cannot
do, and the reason this is worth more than a list of addresses. Doing it here
would mean pulling every link to the browser and would still only see the fields
we happened to fetch. Verified against the instance: 50 unfiltered, 8 for "arch",
0 for a string matching nothing.
The panel holds no credential and could not send one. Every request goes through
the authenticated door, which finds the caller's mapped account and puts their
token on. `no Linkwarden account is mapped to you` is the state every user starts
in, so it is said as an instruction rather than rendered as an outage.
One Linkwarden per Officer install, pointed at by the owner, with every Officer
user mapped onto an account of their own. Officer stores no bookmarks; it owns
the credential and the door.
The model is Vault's, and the parts that are the same are the same on purpose:
a one-row config table rather than an env var, because a plugin cannot ask the
owner to edit a file and restart a process; a sidecar that is the only thing
knowing where the upstream is; and two doors, one authenticated for our own UI
and one unauthenticated for a client that carries its own credential.
`linkwarden_accounts` is the part Vault does not have. Its schema says so in as
many words - "mapping Officer accounts onto them is not a column here" - so this
is new work rather than a copy, and it follows plugins/USER_PROVISIONING.md,
written from the photos plugin against Immich.
── The difference that matters ──
Vaultwarden speaks a host-agnostic bearer protocol. Linkwarden is a Next.js app
using NextAuth, which issues host-scoped cookies, checks CSRF against the host,
and hands clients absolute URLs built from NEXTAUTH_URL. Measured rather than
inferred: a sign-in posted to the tailnet address answers with an absolute URL
to a hostname that does not answer at all.
So serving the extension through Officer needs NEXTAUTH_URL to name the address
Officer serves it at. That is a change to the container rather than to this
plugin, and it is a prerequisite, not a preference. The API half is unaffected -
/api/v1/* takes a bearer token and never touches NextAuth - so the panel and
anything an agent does work either way.
Verified against Linkwarden v2.16.2 on 2026-09-05: every route 401 without a
token and 200 with one, including /api/v1/users, which is the admin surface
provisioning needs. Links carry textContent and readable, which is what makes a
saved page searchable rather than merely re-openable.
Foundation only. No sidecar, routers, provisioning or panel yet.