Skip to content

Custom Headers for remote vault #1091

Closed

Description

@medzsikmisi

Hi,
I really like the app but I'd like to host a self-hosted version for remote vault. I want to secure it with Cloudflare so no one can even try to connect to it. There are two options to do that.

  1. mTLS certificate
    More time to implement
  2. Service credentials
    Only the Auth token page should be modified when adding a remote vault. I'd need two custom headers for it to work.

Is there any way you could add that sometime?

Let me know if you need anything else.

Activity

  1. adibhanna commented on Nov 20, 2026

    @adibhanna
    Contributor

    Ill look into it tomorrow!

  2. self-assigned this
    on Nov 20, 2026
  3. medzsikmisi commented on Nov 20, 2026

    @medzsikmisi
    Author

    You're the best🫶

  4. adibhanna commented on Nov 20, 2026

    @adibhanna
    Contributor

    Thanks for the request! This is built and comes in ZenNotes 2.89.0.

    The desktop app can now send extra headers with every request to a remote vault, live updates included, so a server behind Cloudflare Access (or any gateway that checks headers) works.

    Setting it up with a Cloudflare service token

    1. In Cloudflare Zero Trust, create a token under Access controls → Service credentials → Service Tokens, and give your server's Access application a policy with the action Service Auth that includes it.
    2. In ZenNotes, run Connect to Remote Vault, enter the server URL, and on the Auth Token step choose Add extra headers. Write one header per line:
      CF-Access-Client-Id: <client id>.access
      CF-Access-Client-Secret: <client secret>
      
      Keep your ZenNotes auth token in its own field above. Cmd/Ctrl+Enter connects.
    3. For a remote you already saved, the same box is under Settings → Vault → Saved Remote Workspaces → Edit.

    The headers are stored in the system keychain with the token, never in config.toml, and Settings only shows their names. If the gateway still refuses, ZenNotes now says so instead of showing a confusing error.

    zn and the MCP server read the same lines from ZENNOTES_REMOTE_HEADERS. In an MCP client's JSON config, write the line break as \n:

    "ZENNOTES_REMOTE_HEADERS": "CF-Access-Client-Id: <client id>.access\nCF-Access-Client-Secret: <client secret>"

    The phone apps don't send extra headers yet. mTLS isn't included in this change. Let me know how it goes once 2.89.0 is out.

  5. medzsikmisi commented on Nov 22, 2026

    @medzsikmisi
    Author

    I've tested it and it works really great. I only tested the simple windows client, I didn't use MCP. I've discovered a bug tho, but I'll open a separate issue for it. Thanks a lot for the quick implementation. I didn't need the docs to set it up but I've checked it anyhow and it's also cool. I'm really looking forward to test it further as using it on a daily basis and use it on iOS as well in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions