Allow opt-in privileged API access for explicitly trusted hosts (remote settings/credentials management) #2689
Arekejoker
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Scenario
Running
dsh webon a headless home server and managing it remotely over a private tailnet (Tailscale HTTPS serve →dsh web --trusted-host <host>.ts.net).Chat/session APIs work fine from the trusted host, but the settings page is unusable remotely: every privileged method returns 403 Forbidden. First-time setup (adding model providers/keys, choosing a workspace directory) therefore requires physical console access or an SSH tunnel, which defeats the purpose of
--trusted-hostfor home-server deployments.Current behavior
In
@deepseek-ai/dsh-client-connection,PRIVILEGED_METHODS(settings.describe/update/replace/mutate/openDocument, credentials.describe/set/unset, llm.discoverModels, agentPreset.read/copy/openDocument/remove, host.pickDirectory/openPath) are checked with an empty trust list:So
--trusted-hostgrants access to regular APIs but never to privileged ones. I understand this is a deliberate defense (e.g. DNS rebinding), and the default should stay loopback-only.Proposal
An opt-in way to extend trust to privileged methods for explicitly configured hosts, e.g.:
or a dedicated flag such as
--trusted-host-privileged <host>.Requirements I'd expect (and that my local test kept intact):
Verification
I locally patched the privileged check to pass
trustedHostsinstead of[]and verified:So the fence logic itself already supports this; it's only the hardcoded empty list that blocks it. Happy to provide more details or test a PR.
All reactions