-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Milestone
Description
Summary
Generate a comprehensive config.yml file when running harp-proxy create project. The config will be dynamically generated from source code introspection, showing all available settings as commented YAML with documentation links.
Context
Currently, harp-proxy create project generates an empty config.yml ({}). New users have no visibility into available configuration options without reading documentation. Generating a complete reference config improves discoverability and reduces friction.
The config should be generated at project creation time (not static template) to stay in sync with the actual settings defined in each app's Pydantic models.
Output
Generated config.yml structure:
# =============================================================================
# HARP Proxy Configuration
# =============================================================================
# This file contains all available configuration options with their defaults.
# Uncomment and modify values as needed.
# =============================================================================
# -----------------------------------------------------------------------------
# Dashboard
# See: https://docs.harp-proxy.net/en/latest/apps/dashboard/index.html
# -----------------------------------------------------------------------------
# dashboard:
# port: 4080
# auth: null
# public_url: null
# -----------------------------------------------------------------------------
# Proxy
# See: https://docs.harp-proxy.net/en/latest/apps/proxy/index.html
# -----------------------------------------------------------------------------
# proxy:
# endpoints: []
# -----------------------------------------------------------------------------
# Storage
# See: https://docs.harp-proxy.net/en/latest/apps/storage/index.html
# -----------------------------------------------------------------------------
# storage:
# database_url: "sqlite+aiosqlite:///harp.db"
# migrate: true
# blobs: {}
# redis: null
# ... (other apps)Implementation
- Add config generation logic that introspects
ApplicationSettingsMixinsubclasses - Use Pydantic's
model_json_schema()or field iteration to extract:- Field names
- Default values
- Field descriptions
- Hook into cookiecutter post-generation to call the generator
- Format output as commented YAML with app section headers and doc URLs
Key files
harp/commandline/cookiecutters/project/hooks/post_gen_project.py- post-generation hookharp/config/- settings base classes withApplicationSettingsMixinharp_apps/*/settings*.py- app-specific settings to introspect
Testing Scenarios
- Happy path: Run
harp-proxy create project, verifyconfig.ymlcontains all app settings commented out - Format validation: Generated YAML should be valid when uncommented
- Doc URLs: Each section should have correct documentation URL