Initial pfsense-mcp: REST API v2 based MCP server (72 tools)
This commit is contained in:
28
src/pfsense_mcp/config.py
Normal file
28
src/pfsense_mcp/config.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Configuration loaded from environment variables."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_prefix="PFSENSE_", extra="ignore")
|
||||
|
||||
url: str = "https://192.168.1.1"
|
||||
# REST API v2 key (preferred). Generate in pfSense: System → REST API → Keys.
|
||||
api_key: str = ""
|
||||
# Fallback: local user basic auth (requires auth_methods to include BasicAuth).
|
||||
username: str = ""
|
||||
password: str = ""
|
||||
verify_ssl: bool = False
|
||||
timeout: float = 60.0
|
||||
|
||||
# Safety controls
|
||||
allow_writes: bool = False
|
||||
dry_run: bool = False
|
||||
require_description_prefix: str = "mcp:"
|
||||
block_wan_inbound_any: bool = True
|
||||
audit_log_path: str = "/root/.hermes/logs/pfsense-mcp-audit.jsonl"
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user