wip
This commit is contained in:
parent
eac9d2f510
commit
105c18ba14
4 changed files with 17 additions and 22 deletions
16
agent.py
16
agent.py
|
@ -8,21 +8,21 @@ import requests
|
|||
import socket
|
||||
import re
|
||||
import logging
|
||||
import sys
|
||||
from datetime import datetime, timedelta
|
||||
from watchdog.observers import Observer
|
||||
from watchdog.events import FileSystemEventHandler
|
||||
from dotenv import load_dotenv
|
||||
import sys
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
||||
# Configuration
|
||||
CADDYFILE_PATH = os.getenv('CADDYFILE_PATH')
|
||||
# Fixed configuration
|
||||
CADDYFILE_PATH = "/app/Caddyfile" # Fixed internal path
|
||||
DASHBOARD_URL = os.getenv('DASHBOARD_URL')
|
||||
SERVER_NAME = os.getenv('SERVER_NAME', socket.gethostname()) # Hostname is a reasonable default
|
||||
API_KEY = os.getenv('API_KEY')
|
||||
CHECK_INTERVAL = int(os.getenv('CHECK_INTERVAL', '60')) # Default check interval is reasonable
|
||||
SERVER_NAME = os.getenv('SERVER_NAME', socket.gethostname())
|
||||
API_KEY = os.getenv('API_KEY')
|
||||
CHECK_INTERVAL = int(os.getenv('CHECK_INTERVAL', '60'))
|
||||
|
||||
# Setup logging
|
||||
logging.basicConfig(
|
||||
|
@ -32,10 +32,6 @@ logging.basicConfig(
|
|||
logger = logging.getLogger('caddy-agent')
|
||||
|
||||
# Validate required configuration
|
||||
if not CADDYFILE_PATH:
|
||||
logger.error("CADDYFILE_PATH environment variable not set - cannot monitor Caddyfile")
|
||||
sys.exit(1)
|
||||
|
||||
if not os.path.exists(CADDYFILE_PATH):
|
||||
logger.error(f"Caddyfile not found at {CADDYFILE_PATH}")
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue