feat(server): LAN deployment enhancements — health endpoint, retry, CORS, configurable URLs#5379
Open
jxufesoft wants to merge 3 commits into
Open
feat(server): LAN deployment enhancements — health endpoint, retry, CORS, configurable URLs#5379jxufesoft wants to merge 3 commits into
jxufesoft wants to merge 3 commits into
Conversation
- Upgrade Dashboard base image from node:20 to node:22 (pnpm 11 requires Node 22+) - Use npm-installed pnpm@9 to avoid pnpm 11 build script approval errors - Fix cookie secure flag: use COOKIE_SECURE env var instead of NODE_ENV (NODE_ENV=production caused secure=true, breaking HTTP LAN access) - Configure LAN-accessible URLs in docker-compose.yaml Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code changes: - mem0/memory/main.py: drop mandatory filter requirement from Memory.search/get_all and async versions; empty filters now search across all users (supports LAN-wide global search) - server/main.py: add _retry_upstream decorator with linear backoff on POST /memories and POST /search for transient upstream errors; smart CORS (allow * when AUTH_DISABLED=true); EXTRA_CORS_ORIGINS env var; 404 handling for DELETE on invalid/not-found memory IDs - server/docker-compose.yaml: configurable URLs via env vars with defaults; PostgreSQL bound to 127.0.0.1 only; install mem0 from local source via /opt/mem0-src volume mount; EXTRA_CORS_ORIGINS support; dashboard healthcheck uses 127.0.0.1 Documentation: - DEPLOY_MANUAL.md: new sections for CORS/network config (3.5), transient error retry (9.5); updated .env example with all new env vars; refreshed modified-files changelog (Section 8); added global search example (no filters) - server/README.md: new sections for LAN/Network Deployment, Transient Error Retry, and API Notes Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add GET /health endpoint with DB liveness probe (SELECT 1) - Add healthcheck to mem0 service in docker-compose - Update SKIPPED_REQUEST_LOG_PATHS to include /health Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
user seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked Issue
N/A — addresses self-hosted deployment gaps identified during LAN setup.
Description
This PR improves the self-hosted
server/deployment experience for LAN and network-accessible environments:Core Changes
/healthendpoint (server/main.py)GET /health— lightweight liveness & readiness probe with DB check (SELECT 1){"status": "ok"|"degraded", "db": true|false}SKIPPED_REQUEST_LOG_PATHSto avoid log noiseTransient error retry (
server/main.py)_retry_upstream()decorator with linear backoff onPOST /memoriesandPOST /searchprovider_timeout,provider_rate_limited,provider_unavailable,datastore_unavailable,vector_store_unavailableSmart CORS (
server/main.py)EXTRA_CORS_ORIGINSenv var for explicit origin listAUTH_DISABLED=true, allows*origin so any LAN client can use the APIBetter error handling (
server/main.py)DELETE /memories/{id}returns 404 for invalid/not-found IDs instead of generic 500Configurable docker-compose (
server/docker-compose.yaml)DASHBOARD_URL,NEXT_PUBLIC_API_URL,INSTANCE_NAMEconfigurable via env vars127.0.0.1:8432only..:/opt/mem0-srcfor dev-mode installs/healthendpointGlobal search support (
mem0/memory/main.py)Memory.search()andMemory.get_all()Dashboard fixes (
server/dashboard/)Type of Change
Breaking Changes
None — all new behavior is additive and backward-compatible.
Test Coverage
AUTH_DISABLED=trueChecklist