forked from Hithomelabs/Gitea_Event_Bridge
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
"""Configuration settings for Gitea Event Bridge."""
|
|
|
|
import os
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
# OpenCode Server Configuration
|
|
OPENCODE_URL = os.getenv("OPENCODE_URL", "http://localhost:8080")
|
|
|
|
# Flask Configuration
|
|
HOST = os.getenv("HOST", "0.0.0.0")
|
|
PORT = int(os.getenv("PORT", "5000"))
|
|
DEBUG = os.getenv("DEBUG", "false").lower() == "true"
|
|
|
|
# Activity Log Configuration (JSON Lines format)
|
|
LOG_FILE = os.getenv("LOG_FILE", "activity.json")
|
|
|
|
# Ensure LOG_FILE is absolute path if set via environment
|
|
if LOG_FILE and not LOG_FILE.startswith('/'):
|
|
import os
|
|
LOG_FILE = os.path.abspath(LOG_FILE)
|
|
|
|
# Gitea Webhook Configuration
|
|
GITEA_WEBHOOK_SECRET = os.getenv("GITEA_WEBHOOK_SECRET", "")
|
|
|
|
# Auto-Trigger Configuration
|
|
AUTO_TRIGGER_PIPELINE = os.getenv("AUTO_TRIGGER_PIPELINE", "true").lower() == "true"
|
|
AUTO_TRIGGER_REVIEW = os.getenv("AUTO_TRIGGER_REVIEW", "true").lower() == "true"
|
|
|
|
# Supported Gitea Events
|
|
GITEA_EVENT_TYPES = [
|
|
"issue",
|
|
"issue.label",
|
|
"pull_request",
|
|
"pull_request.label",
|
|
"pull_request.review",
|
|
"comment",
|
|
"repository",
|
|
"organization"
|
|
]
|
|
|
|
# SSE Configuration
|
|
SSE_RECONNECT_TIME = 5
|
|
SSE_HEARTBEAT_INTERVAL = 30 |