35d70a7746
- Added a new API endpoint for managing ReconConfigs at /api/configs, including GET, POST, PUT, and a test URL feature. - Implemented a new configuration editor UI at /configs for creating and editing ReconConfigs. - Introduced a new configs list page at /configs to display existing configurations with options to edit. - Updated base HTML template to include a link to the new configs page. - Created stub configuration and authentication models for workspace development. - Added a stub configuration module to handle database configuration without a real database.
30 lines
626 B
Python
30 lines
626 B
Python
"""Stub config module for the workspace.
|
|
|
|
The production repo has a full config with database URLs and connection maps.
|
|
This stub satisfies imports without a real database.
|
|
"""
|
|
from functools import lru_cache
|
|
from os import getenv
|
|
|
|
|
|
db_config_map = {
|
|
"NETREVEAL": "netreveal",
|
|
"DATAPRODUCT": "dataproduct",
|
|
"GROUPDW": "groupdw",
|
|
"SNOWFLAKE": "snowflake",
|
|
}
|
|
|
|
|
|
class DBConfig:
|
|
def __init__(self) -> None:
|
|
self.db_url = getenv("DATABASE_URL", "sqlite+aiosqlite:///./recon_ranger.db")
|
|
|
|
|
|
@lru_cache
|
|
def get_db_config() -> DBConfig:
|
|
return DBConfig()
|
|
|
|
|
|
db_config = get_db_config()
|
|
config = db_config
|