Skip to content

fix(self-host): Memory tab 401 when opening the dash via LAN IP - #1637

Open
Souravrajvi0 wants to merge 1 commit into
supermemoryai:mainfrom
Souravrajvi0:feat/lan-dash-auth-7ac6
Open

fix(self-host): Memory tab 401 when opening the dash via LAN IP#1637
Souravrajvi0 wants to merge 1 commit into
supermemoryai:mainfrom
Souravrajvi0:feat/lan-dash-auth-7ac6

Conversation

@Souravrajvi0

Copy link
Copy Markdown

Fixes #1538

Problem

On supermemory-server v0.0.8, the local dash at / loads when you browse via a LAN/public IP, but the Memory tab returns 401 Unauthorized for documents and stats.

Local auto-auth only applies when the request Host is localhost, 127.0.0.1, or ::1. /local-console.js calls POST /v3/documents/documents and GET /v3/container-tags/list with no Authorization header, so those requests 401 off-loopback. Sending the banner key as Authorization: Bearer sm_… succeeds on the same IP (the workaround the reporter already uses).

Reproduced on this VM against the official server-v0.0.8 linux-x64 binary:

Call Result
POST /v3/documents/documents127.0.0.1:6767 (no auth) 200
Same path → LAN IP :6767 (no auth) 401 {"error":"Unauthorized"}
LAN IP :6767 + Authorization: Bearer <banner key> 200

The self-hosted binary is not built from this public tree, so this PR cannot change that Host check in-process.

This PR

  • Documents the Host-based auth gap, SSH-tunnel recommendation, and the header workaround.
  • Adds scripts/lan-dashboard-proxy.mjs, which forwards to supermemory-server and injects the api-key file when the Memory tab omits it. Opening http://<lan-ip>:6768 then loads documents/stats.

Verified: same LAN IP that 401s on :6767 returns 200 for POST /v3/documents/documents and GET /v3/container-tags/list through the proxy.

node --test scripts/lan-dashboard-proxy.test.mjs

A first-class fix still belongs in supermemory-server (send the key from the dash, or an explicit SUPERMEMORY_TRUSTED_HOSTS allowlist). Until a server-v* release includes that, the tunnel or this proxy unblocks LAN browsing.

supermemory-server only auto-applies the local API key when Host is
localhost/127.0.0.1/::1. The dash Memory tab never sends Authorization,
so documents and stats 401 on a LAN hostname (supermemoryai#1538).

Document the Host-based auth gap and add a small proxy that injects the
banner API key so the UI works at http://<lan-ip>:6768.
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.

Supermemory v0.0.8 |Cannot load documents and stats that's NOT from localhost

1 participant