Merge branch 'feat/optional-backend' of https://github.com/AstrBotDevs/AstrBot into feat/optional-backend

This commit is contained in:
LIghtJUNction
2026-02-06 12:37:58 +08:00
4 changed files with 15 additions and 6 deletions
+4 -2
View File
@@ -52,8 +52,10 @@ def run(reload: bool, host: str, port: str, backend_only: bool) -> None:
os.environ["ASTRBOT_ROOT"] = str(astrbot_root)
sys.path.insert(0, str(astrbot_root))
os.environ["DASHBOARD_PORT"] = port or "6185"
os.environ["DASHBOARD_HOST"] = host or "::"
if port is not None:
os.environ["DASHBOARD_PORT"] = port
if host is not None:
os.environ["DASHBOARD_HOST"] = host
os.environ["DASHBOARD_ENABLE"] = str(not backend_only)
if reload:
+4 -2
View File
@@ -254,8 +254,10 @@ async def get_public_ip_address() -> list[IPv4Address | IPv6Address]:
ip = ip_address(raw_ip)
if ip.version not in found_ips:
found_ips[ip.version] = ip
except Exception:
pass
except Exception as e:
# Ignore errors from individual services so that a single failing
# endpoint does not prevent discovering the public IP from others.
logger.debug("Failed to fetch public IP from %s: %s", url, e)
async with aiohttp.ClientSession() as session:
tasks = [fetch(session, url) for url in urls]
+2 -1
View File
@@ -59,4 +59,5 @@ class Response:
return self
def to_json(self):
return jsonify(asdict(self))
# Return a plain dict so callers can safely wrap with jsonify()
return asdict(self)
+5 -1
View File
@@ -1,5 +1,4 @@
import asyncio
import ipaddress
import logging
import os
import platform
@@ -33,6 +32,11 @@ from .routes.session_management import SessionManagementRoute
from .routes.subagent import SubAgentRoute
from .routes.t2i import T2iRoute
class _AddrWithPort(Protocol):
port: int
APP: Quart