feat: add --host flag and AGENTMEMORY_HOST for configurable bind address#193
feat: add --host flag and AGENTMEMORY_HOST for configurable bind address#193Edison-A-N wants to merge 1 commit intorohitg00:mainfrom
Conversation
…address Add opt-in support for binding agentmemory services to non-localhost addresses (e.g. 0.0.0.0 for LAN access). Default remains 127.0.0.1 per security advisory GHSA rohitg00#3. Changes: - CLI: --host <addr> flag sets AGENTMEMORY_HOST env - Config: new host field in AgentMemoryConfig (default 127.0.0.1) - Viewer: startViewerServer accepts host param, binds accordingly - iii-engine: CLI patches iii-config.yaml at startup when host is overridden, creating a temp config with the new bind address - CORS: viewer dynamically allows origins on configured ports when bound to 0.0.0.0, avoiding need to pre-configure every hostname - CSP: connect-src relaxed to wildcard when externally bound - Security: warns if --host is non-localhost without AGENTMEMORY_SECRET Usage: npx @agentmemory/agentmemory --host 0.0.0.0 # or via env: AGENTMEMORY_HOST=0.0.0.0 in ~/.agentmemory/.env
|
Someone is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedToo many files! This PR contains 231 files, which is 81 over the limit of 150. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (69)
📒 Files selected for processing (231)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing — branch had unintended file deletions from partial clone. Will re-submit with clean branch. |
Summary
Adds opt-in support for binding agentmemory services to non-localhost addresses (e.g.
0.0.0.0for LAN access). The default remains127.0.0.1per security advisory GHSA #3.Motivation
Users deploying agentmemory on remote dev servers or shared machines need to access the Viewer (port 3113), REST API (3111), and WebSocket streams (3112) from other hosts on the network. Currently this is impossible without patching source or running a reverse proxy, since all three services hardcode
127.0.0.1.Changes
--host <addr>flag (setsAGENTMEMORY_HOSTenv var)hostfield inAgentMemoryConfig(default127.0.0.1)startViewerServer()acceptshostparam, binds accordinglyiii-config.yamlat startup when host is overridden, creating a temp config with the new bind address and wildcard CORS0.0.0.0connect-srcrelaxed to*when externally bound--hostis non-localhost withoutAGENTMEMORY_SECRETsetUsage
Security Considerations
127.0.0.1)--hostflag orAGENTMEMORY_HOSTenvAGENTMEMORY_SECRETAGENTMEMORY_HOST=0.0.0.0