mirror of
https://github.com/taylanbakircioglu/haproxy-openmanager.git
synced 2026-09-20 17:43:29 +00:00
b8326cc4d4
Changed ENTITY_SNAPSHOT_ENABLED default from false to true. Reasoning: - Code is tested and deployed to production - Backward compatibility verified - No need for gradual rollout with feature flag - Entity rollback should work by default - Users expect reject to rollback entities (not just status change) Feature flag still exists for emergency disable if needed: - Set ENTITY_SNAPSHOT_ENABLED=false to disable - Useful for troubleshooting or rollback scenarios Default behavior (ENTITY_SNAPSHOT_ENABLED=true): - Entity update creates snapshot in metadata - Reject operation rolls back entities to old values - Bulk import reject deletes new entities, restores updated ones - Restore reject returns to pre-restore state
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
import os
|
|
from typing import Optional
|
|
|
|
# Database connection settings
|
|
DATABASE_URL = os.getenv("DATABASE_URL", "postgresql://haproxy_user:haproxy_password@postgres:5432/haproxy_openmanager")
|
|
|
|
# Redis connection
|
|
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379")
|
|
|
|
# CORS settings
|
|
CORS_ORIGINS = ["http://localhost:3000"]
|
|
|
|
# Security settings
|
|
SECRET_KEY = os.getenv("SECRET_KEY", "your-secret-key-here")
|
|
JWT_SECRET_KEY = SECRET_KEY # Alias for JWT middleware
|
|
ALGORITHM = "HS256"
|
|
JWT_ALGORITHM = ALGORITHM # Alias for JWT middleware
|
|
ACCESS_TOKEN_EXPIRE_MINUTES = 30
|
|
|
|
# Logging level
|
|
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
|
|
|
|
# Public URL configuration (for agent installation scripts)
|
|
PUBLIC_URL = os.getenv("PUBLIC_URL", "http://localhost:8000")
|
|
MANAGEMENT_BASE_URL = os.getenv("MANAGEMENT_BASE_URL", PUBLIC_URL) # Backward compatibility
|
|
|
|
# Agent settings
|
|
AGENT_HEARTBEAT_TIMEOUT_SECONDS = 15
|
|
AGENT_CONFIG_SYNC_INTERVAL_SECONDS = 30
|
|
|
|
# Entity snapshot enabled by default (rollback functionality)
|
|
# Set to "false" only if you need to disable snapshot temporarily
|
|
ENTITY_SNAPSHOT_ENABLED = os.getenv("ENTITY_SNAPSHOT_ENABLED", "true").lower() == "true" |