Skip to content

License#225

Closed
thestumonkey wants to merge 25 commits intoSimpleOpenSoftware:devfrom
Ushadow-io:license
Closed

License#225
thestumonkey wants to merge 25 commits intoSimpleOpenSoftware:devfrom
Ushadow-io:license

Conversation

@thestumonkey
Copy link
Contributor

@thestumonkey thestumonkey commented Dec 22, 2025

There is no license in the repository currently. We can adopt another license later on, but for now a license is better than no license.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added user API key generation and management for programmatic access
    • Introduced comprehensive settings interface with multi-tab admin dashboard for configuration management
    • Added MCP server integration for enhanced conversation access and audio retrieval
    • Implemented quick-start setup script for simplified local development onboarding
  • Improvements

    • Enhanced graceful degradation when external service credentials are unavailable
    • Refactored application configuration system for better flexibility
    • Redesigned UI layout with dark mode support and improved responsiveness
    • Modernized infrastructure setup with Docker Compose modularity
  • Documentation

    • Added quick-start guide for new users
    • Included comprehensive configuration templates and examples

✏️ Tip: You can customize this high-level summary in your review settings.

AnkushMalaker and others added 25 commits December 19, 2025 00:40
Updated project title to indicate it's a fork.
# Conflicts:
#	backends/advanced/webui/src/pages/Settings.tsx
#	backends/advanced/webui/src/services/api.ts
# Conflicts:
#	README-K8S.md
#	backends/advanced/src/advanced_omi_backend/auth.py
#	backends/advanced/src/advanced_omi_backend/services/mycelia_sync.py
#	backends/advanced/webui/package-lock.json
#	backends/advanced/webui/package.json
#	quickstart.md
#	tests/infrastructure/infra_tests.robot
#	tests/integration/websocket_streaming_tests.robot

# Conflicts:
#	README.md
#	app/app.json
#	backends/advanced/src/advanced_omi_backend/app_config.py
#	backends/advanced/src/advanced_omi_backend/auth.py
#	backends/advanced/src/advanced_omi_backend/controllers/system_controller.py
#	backends/advanced/src/advanced_omi_backend/database.py
#	backends/advanced/src/advanced_omi_backend/models/job.py
#	backends/advanced/src/advanced_omi_backend/routers/modules/health_routes.py
#	backends/advanced/src/advanced_omi_backend/services/memory/config.py
#	backends/advanced/src/advanced_omi_backend/services/memory/service_factory.py
#	backends/advanced/src/advanced_omi_backend/services/mycelia_sync.py
#	backends/advanced/webui/src/pages/System.tsx
#	tests/infrastructure/infra_tests.robot
#	tests/resources/transcript_verification.robot
#	tests/setup/test_env.py
- Deleted env_writer.py (no longer needed)
- Updated system_controller to read from config.yaml
- Moved config files to config/ folder
- Added config.defaults.yaml as committed template
- Simplified config_parser.py using ruamel.yaml
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR introduces a YAML-based configuration system replacing environment-only setup, adds a comprehensive settings API with a new UI, modularizes Docker Compose architecture, implements a new MCP server for conversation access, and integrates API key management throughout the stack. Rebranding from "Chronicle" to "Friend-Lite" occurs across multiple components.

Changes

Cohort / File(s) Summary
Configuration System & Schema
backends/advanced/config/config_schema.py, backends/advanced/config/config_parser.py, backends/advanced/config/settings_adapter.py, backends/advanced/config/__init__.py, backends/advanced/config/config.defaults.yaml
Introduces YAML-based configuration with ChronicleConfig schema, ConfigParser for async load/save/update, and ConfigBasedSettingsManager adapter bridging config files to settings interface; includes default values template.
Settings Models & Manager
backends/advanced/src/advanced_omi_backend/settings_models.py, backends/advanced/src/advanced_omi_backend/settings_manager.py
Defines 10+ strongly-typed Pydantic settings models (speech detection, conversation, audio processing, diarization, LLM, providers, network, infrastructure, misc, API keys) with enums for provider selection; implements MongoDB-backed SettingsManager with per-category caching and TTL.
Settings API Routes & Endpoints
backends/advanced/src/advanced_omi_backend/routers/modules/settings_routes.py, backends/advanced/src/advanced_omi_backend/routers/modules/__init__.py, backends/advanced/src/advanced_omi_backend/routers/api_router.py
Adds 20+ FastAPI endpoints for reading/updating all settings categories, API key management, file I/O, infrastructure status checks, and cache invalidation; integrates via router inclusion into main API.
Frontend Settings UI
backends/advanced/webui/src/pages/Settings.tsx, backends/advanced/webui/src/services/api.ts
Comprehensive multi-tab Settings page with admin-only access, state management for 7+ settings domains, API key visibility toggles, file save/load workflows, and per-section fetch/update flows; expands settingsApi with 30+ endpoints.
MCP Server Module
backends/advanced/src/advanced_omi_backend/services/mcp_server.py
New MCP-backed server exposing conversation retrieval, audio access, and segment data via tools and resources; includes SSE transport, user context isolation, ownership validation, and base64 audio encoding.
API Key Management
backends/advanced/src/advanced_omi_backend/utils/api_keys_manager.py, backends/advanced/src/advanced_omi_backend/controllers/system_controller.py, backends/advanced/src/advanced_omi_backend/routers/modules/system_routes.py
Adds file-based API key read/write with masking, new get_api_key_status() controller, and admin endpoint for configuration status reporting.
User Model & API Key Lifecycle
backends/advanced/src/advanced_omi_backend/models/user.py, backends/advanced/webui/src/contexts/AuthContext.tsx, backends/advanced/webui/src/pages/System.tsx, backends/advanced/webui/src/routers/modules/user_routes.py
Extends User model with api_key and api_key_created_at fields; adds POST /me/api-key (generate) and DELETE /me/api-key (revoke) endpoints; updates System page and AuthContext.
App Factory & Config Initialization
backends/advanced/src/advanced_omi_backend/app_factory.py, backends/advanced/src/advanced_omi_backend/app_config.py
Wires config parser initialization and SettingsManager into lifespan; adds graceful API key degradation flags (allow_missing_api_keys); sets up MCP server during app creation.
Graceful API Key Degradation
backends/advanced/src/advanced_omi_backend/services/memory/config.py, backends/advanced/src/advanced_omi_backend/services/memory/service_factory.py, backends/advanced/src/advanced_omi_backend/services/transcription/__init__.py, backends/advanced/src/advanced_omi_backend/routers/modules/health_routes.py
Adds allow_missing_keys parameter to provider initialization; disables features gracefully when API keys absent instead of hard-failing; updates health routes to include service URLs and new logging.
Docker Compose Modularization
backends/advanced/docker-compose.yml, backends/advanced/compose/backend.yml, backends/advanced/compose/frontend.yml, backends/advanced/compose/overrides/dev.yml, docker-compose.yml, docker-compose.infra.yml, compose/infrastructure-shared.yml
Splits monolithic compose file into modular includes: backend/frontend/overrides in backends/advanced; root compose includes both; new infra-only compose defining shared services (mongo, redis, qdrant, neo4j, caddy).
Makefile Expansion & Rebranding
Makefile
Adds 50+ new PHONY targets for lifecycle management (up/down, build, restart, logs), quick-start workflow, infrastructure/caddy management, environment helpers, Kubernetes deployment, and Mycelia integration; updates branding from Chronicle to Friend-Lite.
Frontend UI Components & Styling
backends/advanced/webui/src/components/header/HeaderRecordButton.tsx, backends/advanced/webui/src/components/layout/Layout.tsx, backends/advanced/webui/src/pages/Chat.tsx, backends/advanced/webui/src/pages/Conversations.tsx, backends/advanced/webui/src/pages/ConversationsRouter.tsx, backends/advanced/webui/src/pages/ConversationsTimeline.tsx, backends/advanced/webui/src/pages/LiveRecord.tsx, backends/advanced/webui/src/pages/LoginPage.tsx, backends/advanced/webui/src/pages/Queue.tsx, backends/advanced/webui/src/index.css, backends/advanced/webui/tailwind.config.js
Adds HeaderRecordButton waveform visualization; refactors Layout with sticky header, user menu, search, and theme toggle; updates Chat/Conversations/Timeline/LiveRecord/LoginPage/Queue with neutral color scheme, dark mode, and new tab navigation; extends Tailwind with comprehensive design tokens.
Frontend Theme & Context
backends/advanced/webui/src/contexts/ThemeContext.tsx, backends/advanced/webui/src/contexts/AuthContext.tsx
Changes default theme initialization to dark mode (true); extends User type with API key fields.
Docker & Build Configuration
backends/advanced/webui/Dockerfile, backends/advanced/webui/package.json, backends/advanced/pyproject.toml, backends/advanced/Caddyfile.template
Upgrades Node to 22-alpine, adds VITE build args, introduces nginx production stage; downgrades sass-embedded; replaces PyYAML with ruamel.yaml; adds MCP proxy block to Caddyfile.
Documentation & Quick-Start
QUICK_START.md, README.md, .env.secrets.template, config-defaults.yml, .gitignore, LICENSE
New comprehensive quick-start guide, updated README with fork attribution, new secrets template, config defaults YAML, expanded .gitignore with environment/backup/SSL patterns, added MIT LICENSE.
Deployment & Scripts
quick-start.sh, scripts/generate-k8s-configs.py
New interactive setup script generating .env.default with admin credentials, infrastructure startup, health checks, and Tailscale provisioning; refactors k8s manifest generation to split secrets (rename namespace to friend-lite, split env credentials from API keys).
Testing & Infrastructure
tests/setup/test_env.py, tests/infrastructure/infra_tests.robot, caddy/Caddyfile
Replaces custom env loading with dotenv; adds 20+ public constants for endpoints/containers; reformats Robot teardown syntax; adds basic Caddy health endpoint config.

Sequence Diagram(s)

sequenceDiagram
    participant App as FastAPI App
    participant CF as AppFactory
    participant CP as ConfigParser
    participant SM as SettingsManager
    participant DB as MongoDB
    participant Env as Environment

    App->>CF: app_factory init
    CF->>CP: init_config_parser(path)
    CP->>CP: load defaults.yaml if config missing
    CP-->>CF: ConfigParser instance
    CF->>SM: SettingsManager(db)
    SM->>DB: initialize (migrate env vars to db)
    DB-->>SM: settings stored
    SM-->>CF: SettingsManager ready
    CF->>CF: setup_mcp_server()
    CF-->>App: lifespan ready

    App->>App: Handle request
    Note over App: /settings/speech-detection GET
    App->>SM: get_speech_detection()
    SM->>DB: query (with cache TTL check)
    DB-->>SM: SpeechDetectionSettings
    SM-->>App: cached result

    App->>App: Handle request
    Note over App: /settings/speech-detection PUT (admin)
    App->>SM: update_speech_detection(new_settings)
    SM->>CP: load current config
    CP-->>SM: ChronicleConfig
    SM->>CP: apply updates, save
    CP->>CP: write to config.yaml
    SM->>DB: persist to app_settings collection
    SM->>SM: invalidate cache for category
    SM-->>App: updated settings
Loading
sequenceDiagram
    participant Browser as Frontend
    participant API as Settings API
    participant CP as ConfigParser
    participant SM as SettingsManager
    participant DB as MongoDB

    Browser->>API: GET /api/settings/all
    API->>SM: get_all_settings()
    SM->>DB: query all categories (cached)
    DB-->>SM: AllSettings object
    SM-->>API: AllSettings
    API-->>Browser: JSON response

    Browser->>Browser: User edits LLM settings
    Browser->>API: POST /api/settings/llm
    API->>SM: update_llm(new_settings, updated_by='admin')
    SM->>CP: load()
    CP-->>SM: current config
    SM->>CP: apply LLM updates
    CP->>CP: write to config.yaml
    SM->>DB: save to app_settings
    SM->>SM: invalidate_cache('llm')
    SM-->>API: LLMSettings (updated)
    API-->>Browser: success + new values
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Areas requiring extra attention:

  • ConfigParser and ConfigBasedSettingsManager (backends/advanced/src/advanced_omi_backend/config/config_parser.py, config/settings_adapter.py) — Async file I/O, defaults fallback, and state consistency; verify YAML parsing and serialization edge cases, especially with None/optional fields.
  • MCP Server security and auth (backends/advanced/src/advanced_omi_backend/services/mcp_server.py) — SSE endpoint bypasses detailed auth for development; context variable user scoping; verify ownership checks and token validation prevent data leaks.
  • Graceful API key degradation logic (app_config.py, health_routes.py, transcription/__init__.py) — Multiple branches for allow_missing_keys=True/False; ensure consistent logging and feature disabling across providers.
  • Docker Compose includes and external network (backends/advanced/docker-compose.yml, docker-compose.infra.yml) — Modular structure with external network chronicle-network assumed to exist; verify init order and network creation/cleanup.
  • Settings API route access control (settings_routes.py) — Mix of current_active_user (reads) and current_superuser (writes); verify all endpoints enforce proper authorization.
  • Frontend Settings page state management (backends/advanced/webui/src/pages/Settings.tsx) — Large component with 10+ state variables and multiple async flows; check for race conditions in refresh/save cycles and error handling consistency.
  • Admin-only UI tabs and routes — System page, Settings page, and user routes now gated by superuser; verify role checks are consistent and unauthorized access is properly rejected.

Possibly related PRs

  • Release v0.0.1 #214 — Modifies transcription provider selection logic and get_transcription_provider parameter handling, directly related to graceful degradation changes in this PR.
  • Memory config from UI #90 — Adds editable memory/diarization configuration endpoints and UI, overlaps with settings model definitions and config loading paths.
  • Robot2 #167 — Introduces MCP/WebSocket functionality and backend initialization surfaces; directly related to new MCP server module and app factory changes.

Suggested reviewers

  • AnkushMalaker
  • 0xrushi

🐰 A config revolution hops into view,
YAML files and settings anew!
MCP conversations flow,
APIs steal the show,
Friend-Lite shines brightly through!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e79b70 and 6a567a3.

⛔ Files ignored due to path filters (1)
  • backends/advanced/webui/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (64)
  • .env.secrets.template
  • .gitignore
  • LICENSE
  • Makefile
  • QUICK_START.md
  • README.md
  • backends/advanced/Caddyfile.template
  • backends/advanced/compose/backend.yml
  • backends/advanced/compose/frontend.yml
  • backends/advanced/compose/overrides/dev.yml
  • backends/advanced/config/config.defaults.yaml
  • backends/advanced/docker-compose.yml
  • backends/advanced/pyproject.toml
  • backends/advanced/src/advanced_omi_backend/app_config.py
  • backends/advanced/src/advanced_omi_backend/app_factory.py
  • backends/advanced/src/advanced_omi_backend/config/__init__.py
  • backends/advanced/src/advanced_omi_backend/config/config_parser.py
  • backends/advanced/src/advanced_omi_backend/config/config_schema.py
  • backends/advanced/src/advanced_omi_backend/config/settings_adapter.py
  • backends/advanced/src/advanced_omi_backend/controllers/system_controller.py
  • backends/advanced/src/advanced_omi_backend/legacy_config.py
  • backends/advanced/src/advanced_omi_backend/models/user.py
  • backends/advanced/src/advanced_omi_backend/routers/api_router.py
  • backends/advanced/src/advanced_omi_backend/routers/modules/__init__.py
  • backends/advanced/src/advanced_omi_backend/routers/modules/health_routes.py
  • backends/advanced/src/advanced_omi_backend/routers/modules/settings_routes.py
  • backends/advanced/src/advanced_omi_backend/routers/modules/system_routes.py
  • backends/advanced/src/advanced_omi_backend/routers/modules/user_routes.py
  • backends/advanced/src/advanced_omi_backend/services/mcp_server.py
  • backends/advanced/src/advanced_omi_backend/services/memory/config.py
  • backends/advanced/src/advanced_omi_backend/services/memory/service_factory.py
  • backends/advanced/src/advanced_omi_backend/services/transcription/__init__.py
  • backends/advanced/src/advanced_omi_backend/settings_manager.py
  • backends/advanced/src/advanced_omi_backend/settings_models.py
  • backends/advanced/src/advanced_omi_backend/utils/api_keys_manager.py
  • backends/advanced/webui/Dockerfile
  • backends/advanced/webui/package.json
  • backends/advanced/webui/src/App.tsx
  • backends/advanced/webui/src/components/header/HeaderRecordButton.tsx
  • backends/advanced/webui/src/components/layout/Layout.tsx
  • backends/advanced/webui/src/contexts/AuthContext.tsx
  • backends/advanced/webui/src/contexts/ThemeContext.tsx
  • backends/advanced/webui/src/index.css
  • backends/advanced/webui/src/pages/Chat.tsx
  • backends/advanced/webui/src/pages/Conversations.tsx
  • backends/advanced/webui/src/pages/ConversationsRouter.tsx
  • backends/advanced/webui/src/pages/ConversationsTimeline.tsx
  • backends/advanced/webui/src/pages/LiveRecord.tsx
  • backends/advanced/webui/src/pages/LoginPage.tsx
  • backends/advanced/webui/src/pages/Queue.tsx
  • backends/advanced/webui/src/pages/Settings.tsx
  • backends/advanced/webui/src/pages/System.tsx
  • backends/advanced/webui/src/services/api.ts
  • backends/advanced/webui/tailwind.config.js
  • caddy/Caddyfile
  • compose/infrastructure-shared.yml
  • config-defaults.yml
  • docker-compose.infra.yml
  • docker-compose.yml
  • quick-start.sh
  • quickstart.md
  • scripts/generate-k8s-configs.py
  • tests/infrastructure/infra_tests.robot
  • tests/setup/test_env.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thestumonkey thestumonkey deleted the license branch December 22, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants