mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-13 01:06:03 +00:00
feat(platform): show deployment outbound IPs on adapter config forms
Cloud/NAT deployments couldn't complete WeCom-family / Official Account / QQ Official setup because the trusted-IP (IP whitelist) value — the server's egress IPs — was nowhere visible in LangBot. - config.yaml: new system.outbound_ips list (env: SYSTEM__OUTBOUND_IPS, comma-separated), exposed via GET /api/v1/system/info - dynamic form: generic __system.*-named display-only fields resolved from systemContext (same namespace as show_if), one read-only row per value with a copy button, excluded from form state and emitted values; hidden entirely when the deployment provides no IPs - manifests: trusted-IP display field for wecom, wecomcs, wecombot, officialaccount, qqofficial Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,18 @@ class SystemRouterGroup(group.RouterGroup):
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# ``system.outbound_ips`` may be a comma-separated string instead of
|
||||
# a list when injected via the SYSTEM__OUTBOUND_IPS env var into a
|
||||
# pre-existing data/config.yaml that lacks the key (env overrides
|
||||
# only coerce to list when the key already holds one).
|
||||
outbound_ips = self.ap.instance_config.data.get('system', {}).get('outbound_ips', [])
|
||||
if isinstance(outbound_ips, str):
|
||||
outbound_ips = [ip.strip() for ip in outbound_ips.split(',') if ip.strip()]
|
||||
elif isinstance(outbound_ips, list):
|
||||
outbound_ips = [str(ip).strip() for ip in outbound_ips if str(ip).strip()]
|
||||
else:
|
||||
outbound_ips = []
|
||||
|
||||
return self.success(
|
||||
data={
|
||||
'version': constants.semantic_version,
|
||||
@@ -49,6 +61,7 @@ class SystemRouterGroup(group.RouterGroup):
|
||||
'disable_models_service', False
|
||||
),
|
||||
'limitation': self.ap.instance_config.data.get('system', {}).get('limitation', {}),
|
||||
'outbound_ips': outbound_ips,
|
||||
'wizard_status': wizard_status,
|
||||
'wizard_progress': wizard_progress,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user