config: unify configuration with multi-site support

- Remove mock_content setting (working database loop makes it unnecessary)
- Change server.dev_mode to global dev_mode setting for consistency
- Update CLI to use cli.site_id and cli.output for scoped configuration
- Implement database client for CLI enhance command (complete static site loop)
- Update justfile to use INSERTR_DATABASE_PATH environment variable
- Enable multi-site architecture: server is site-agnostic, CLI is site-specific
- Unified insertr.yaml now supports both server and CLI with minimal config
This commit is contained in:
2025-09-10 19:28:59 +02:00
parent 8a709a5250
commit c572428e45
6 changed files with 216 additions and 45 deletions

View File

@@ -1,25 +1,23 @@
# Insertr Configuration File
# This file provides default configuration for the unified insertr binary
# Database configuration
database:
path: "./insertr.db" # SQLite file path or PostgreSQL connection string
# API configuration (for remote content API)
api:
url: "" # Content API URL (leave empty to use local database)
key: "" # API authentication key
# Server configuration
server:
port: 8080 # HTTP server port
dev_mode: false # Enable development mode features
# Build configuration
build:
input: "./src" # Default input directory for enhancement
output: "./dist" # Default output directory for enhanced files
# Insertr Unified Configuration
# Server and CLI configuration - library manages its own config
# Global settings
site_id: "demo" # Default site ID for content lookup
mock_content: false # Use mock content instead of real data
dev_mode: false # Development mode (affects server CORS, CLI verbosity)
# Database configuration
database:
path: "./insertr.db" # SQLite file or PostgreSQL connection string
# Server configuration (multi-site ready)
server:
port: 8080 # HTTP API server port
# CLI enhancement configuration
cli:
site_id: "demo" # Default site ID for CLI operations
output: "./dist" # Default output directory for enhanced files
# API client configuration (for CLI remote mode)
api:
url: "" # Content API URL (empty = use local database)
key: "" # API authentication key