Implementation:24kchengYe MemoMind dashboard server
| Knowledge Sources | |
|---|---|
| Domains | Web_UI, Deployment |
| Last Updated | 2026-10-28 00:00 GMT |
Overview
Concrete tool for running a password-protected web dashboard for browsing memories, viewing chat history, and managing documents in MemoMind production.
Description
The dashboard_server.py script runs a web dashboard on port 9999. It provides:
- Password authentication: PBKDF2-SHA256 password verification with session cookies (HMAC-signed)
- Chat index: loads an AI chat index from JSON, finds corresponding markdown files
- Document viewer: browses documents stored in MemoMind
- Memory browsing: proxies requests to the MemoMind API backend (MEMOMIND_API_URL)
Key functions:
- _verify_password: PBKDF2-SHA256 hash comparison using hmac.compare_digest
- _create_session: base64-encoded JSON payload with HMAC-SHA256 signature, TTL-based expiry
- _valid_session: validates session cookie signature and expiry
- DashboardHandler: BaseHTTPRequestHandler serving HTML pages and proxying API requests
Auth can be disabled via AUTH_ENABLED flag for local development. Sessions use a SESSION_SECRET for signing.
Usage
Run this script as the Docker container command for the dashboard service. It requires MEMOMIND_API_URL and MEMOMIND_AUTH_* environment variables.
Code Reference
Source Location
- Repository: MemoMind
- File: deploy/server/dashboard_server.py
- Lines: L110+ (_verify_password at L110, _create_session at L131, _valid_session at L141, DashboardHandler at L189+)
Signature
def _verify_password(password: str, stored_hash: str) -> bool:
...
def _create_session(username: str) -> str:
...
def _valid_session(cookie_header: str) -> bool:
...
class DashboardHandler(http.server.BaseHTTPRequestHandler):
...
Import
# Run as a script: python dashboard_server.py
# Or as Docker command: ["python", "/app/dashboard_server.py"]
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| MEMOMIND_API_URL | str (env) | Yes | Backend API URL (default http://memomind-api:19999) |
| MEMOMIND_AUTH_* | str (env) | No | Login authentication config (password hash, session secret) |
Outputs
| Name | Type | Description |
|---|---|---|
| server | HTTPServer | Running web dashboard on port 9999 |
Usage Examples
Docker Compose Configuration
# docker-compose.yml (simplified)
services:
dashboard:
build: .
env_file: .env
environment:
MEMOMIND_API_URL: http://memomind-api:19999
command: ["python", "/app/dashboard_server.py"]
ports:
- "${BIND_IP:-127.0.0.1}:9999:9999"
depends_on:
- memomind-api