Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:24kchengYe MemoMind dashboard server

From Leeroopedia
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:

  1. Password authentication: PBKDF2-SHA256 password verification with session cookies (HMAC-signed)
  2. Chat index: loads an AI chat index from JSON, finds corresponding markdown files
  3. Document viewer: browses documents stored in MemoMind
  4. 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

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment