Add Debian deployment, MariaDB storage and randomized proxy routing

This commit is contained in:
Codex
2026-10-11 19:07:27 +08:00
parent 2e3439dbb9
commit 915241a2fd
27 changed files with 896 additions and 32 deletions
+8
View File
@@ -137,6 +137,10 @@ def _pool_entry(arguments, project, service):
class PoolService:
def __init__(self, settings):
self.settings = settings
self.linux = None
if os.name != "nt":
from studio.linux_pool import LinuxPoolService
self.linux = LinuxPoolService(settings)
self.session = requests.Session()
self.session.trust_env = False
self.lock = threading.Lock()
@@ -154,6 +158,8 @@ class PoolService:
return json.loads(result.stdout.decode("utf-8-sig"))
def status(self, config=None):
if self.linux:
return self.linux.status(config)
if config is None:
config = self.settings.read()
project = Path(config["pool_project"])
@@ -233,6 +239,8 @@ class PoolService:
return "\n".join(lines)
def manage(self, action):
if self.linux:
return self.linux.manage(action)
if action not in ("start", "stop", "status"):
raise ValueError("代理池操作无效")
with self.lock: