fix: unify backend port to 18080 and make validator targets configurable

- Set default API port to 18080 in config.py
- Add configurable validation_targets to SettingsSchema and DEFAULT_SETTINGS
- Update ValidatorService to support runtime test URL updates
- Hot-reload validation_targets from DB on startup and on settings save
- Add domestic fallback URLs (baidu.com, qq.com) to reduce foreign dependency risk
- Update Settings.vue to allow adding/removing validator target URLs in UI
This commit is contained in:
祀梦
2026-04-04 22:47:54 +08:00
parent b972b64616
commit 49e440cb41
7 changed files with 107 additions and 10 deletions

View File

@@ -16,7 +16,7 @@ class Settings(BaseSettings):
# API 服务配置
host: str = "127.0.0.1"
port: int = 9949
port: int = 18080
# 验证器配置
validator_timeout: int = 5
@@ -40,6 +40,16 @@ class Settings(BaseSettings):
score_min: int = 0
score_max: int = 100
# 验证目标配置
validator_test_urls: List[str] = [
"http://httpbin.org/ip",
"https://httpbin.org/ip",
"http://api.ipify.org",
"https://api.ipify.org",
"http://www.baidu.com",
"http://www.qq.com",
]
# 插件配置
plugins_dir: str = "plugins"