refactor: Externalize host configuration to hosts.json
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
18
main.py
18
main.py
@@ -8,20 +8,16 @@ import asyncio
|
||||
import aiohttp
|
||||
import aiomqtt
|
||||
import ssl
|
||||
import json
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
||||
HOSTS = {
|
||||
'http': [
|
||||
'tanner.vc',
|
||||
'forum.protospace.ca',
|
||||
'protospace.ca',
|
||||
'my.protospace.ca',
|
||||
],
|
||||
'mqtt': [
|
||||
'webhost.protospace.ca',
|
||||
],
|
||||
}
|
||||
try:
|
||||
with open('hosts.json', 'r') as f:
|
||||
HOSTS = json.load(f)
|
||||
except FileNotFoundError:
|
||||
logging.error("hosts.json not found. Please copy hosts.json.example to hosts.json and configure it.")
|
||||
exit(1)
|
||||
|
||||
|
||||
def alert_tanner(msg):
|
||||
|
||||
Reference in New Issue
Block a user