Skip to content

v0.18.0

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Nov 13:23
· 1 commit to main since this release

Features

Reach a server behind Cloudflare Access or another gateway. An access gateway in front of a self-hosted ZenNotes server turns away every request without its credentials. zn, zn tui and zn mcp now send them as extra headers on every request, live updates included, from ZENNOTES_REMOTE_HEADERS: one Name: value per line. For a Cloudflare Access service token:

export ZENNOTES_REMOTE_HEADERS=$'CF-Access-Client-Id: <client id>.access\nCF-Access-Client-Secret: <client secret>'
zn list --server https://notes.example.com

In an MCP client's JSON config, write the line break as \n inside the env value. Keep the server's own token in --token, ZENNOTES_REMOTE_TOKEN or zn connect. A value that does not parse stops the command with its line number before anything is sent, and a gateway that still refuses is named as one instead of showing its page. The headers are never written to credentials.toml. ZenNotes 2.89.0 takes the same lines in its connect dialog (ZenNotes/zennotes#1091, #54).

How to test locally

python3 - <<'PY' &
import http.server
class Gate(http.server.BaseHTTPRequestHandler):
    def do_GET(self):
        ok = self.headers.get('CF-Access-Client-Id') == 'id.access'
        self.send_response(200 if ok else 403)
        self.send_header('Content-Type', 'application/json' if ok else 'text/html')
        self.end_headers()
        self.wfile.write(b'null' if ok else b'<h1>denied</h1>')
http.server.HTTPServer(('127.0.0.1', 7980), Gate).serve_forever()
PY
zn vault info --server http://127.0.0.1:7980
ZENNOTES_REMOTE_HEADERS='CF-Access-Client-Id: id.access' zn vault info --server http://127.0.0.1:7980
kill %1
  • Before: both commands fail with an HTML error from the gateway.
  • After: the first names the gateway and ZENNOTES_REMOTE_HEADERS; the second gets past it.