mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-07 05:11:51 +08:00
feat(traffic,sandbox): add TUN/netstack transparent gateway, egress controls, CAP_NET_RAW hardening, and i18n fixes
- Implement full-traffic transparent gateway (cmd/artex-gateway, traffic/netstack.go, traffic/transparent.go) using Linux TUN + gVisor netstack deferred TCP handshakes (eliminating nmap/nc false-positive open ports), real ICMPv4 Echo proxying, UDP/DNS interception, and per-container upstream proxy overrides. - Add egress blacklist + asset-intercept sync, non-HTTP flow/DNS SQLite persistence and APIs, and /system/proxy & /function/traffic TCP/UDP/DNS UI panels. - Fix sandbox Playwright MCP browser loopback --proxy-server rewrite and NODE_EXTRA_CA_CERTS override in server/mcpstdio.go. - Strip all SUID/SGID binaries in Dockerfile.sandbox, grant minimal cap_net_raw+ep to nmap/nping/ping with ARTEX_SANDBOX_ALLOW_NET_RAW toggle, and enforce IPv4/IPv6 anti-spoofing in iptables and netstack. - Remove hardcoded Chinese "(全局)" from GET /api/proxy/routes, localize ContainerRoutesTab / NonHTTPTrafficPanel labels, and expose reactive locale/isEn from useLiveTranslation for React Compiler compatibility.
This commit is contained in:
1 parent
9c43e694a3
commit
d786de90af
69 files changed
+13082
-1433
No files matched your search
@@ -212,6 +212,26 @@ type dockerContainerInspect struct {
|
||||
NetworkMode string `json:"NetworkMode"`
|
||||
Memory int64 `json:"Memory"`
|
||||
} `json:"HostConfig"`
|
||||
NetworkSettings struct {
|
||||
Networks map[string]struct {
|
||||
IPAddress string `json:"IPAddress"`
|
||||
} `json:"Networks"`
|
||||
} `json:"NetworkSettings"`
|
||||
}
|
||||
|
||||
func (i *dockerContainerInspect) IPOnNetwork(network string) string {
|
||||
if i == nil {
|
||||
return ""
|
||||
}
|
||||
if nw, ok := i.NetworkSettings.Networks[network]; ok && strings.TrimSpace(nw.IPAddress) != "" {
|
||||
return strings.TrimSpace(nw.IPAddress)
|
||||
}
|
||||
for _, nw := range i.NetworkSettings.Networks {
|
||||
if strings.TrimSpace(nw.IPAddress) != "" {
|
||||
return strings.TrimSpace(nw.IPAddress)
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (c *dockerClient) InspectContainer(ctx context.Context, idOrName string) (*dockerContainerInspect, error) {
|
||||
@@ -224,15 +244,34 @@ func (c *dockerClient) InspectContainer(ctx context.Context, idOrName string) (*
|
||||
}
|
||||
|
||||
type dockerContainerListItem struct {
|
||||
ID string `json:"Id"`
|
||||
Names []string `json:"Names"`
|
||||
Image string `json:"Image"`
|
||||
State string `json:"State"`
|
||||
Status string `json:"Status"`
|
||||
Created int64 `json:"Created"`
|
||||
Labels map[string]string `json:"Labels"`
|
||||
ID string `json:"Id"`
|
||||
Names []string `json:"Names"`
|
||||
Image string `json:"Image"`
|
||||
State string `json:"State"`
|
||||
Status string `json:"Status"`
|
||||
Created int64 `json:"Created"`
|
||||
Labels map[string]string `json:"Labels"`
|
||||
NetworkSettings struct {
|
||||
Networks map[string]struct {
|
||||
IPAddress string `json:"IPAddress"`
|
||||
} `json:"Networks"`
|
||||
} `json:"NetworkSettings"`
|
||||
}
|
||||
|
||||
func (i *dockerContainerListItem) IPOnNetwork(network string) string {
|
||||
if i == nil {
|
||||
return ""
|
||||
}
|
||||
if nw, ok := i.NetworkSettings.Networks[network]; ok && strings.TrimSpace(nw.IPAddress) != "" {
|
||||
return strings.TrimSpace(nw.IPAddress)
|
||||
}
|
||||
for _, nw := range i.NetworkSettings.Networks {
|
||||
if strings.TrimSpace(nw.IPAddress) != "" {
|
||||
return strings.TrimSpace(nw.IPAddress)
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (c *dockerClient) ListContainersByLabel(ctx context.Context, labels map[string]string) ([]dockerContainerListItem, error) {
|
||||
labelList := make([]string, 0, len(labels))
|
||||
for k, v := range labels {
|
||||
|
||||
Reference in new issue
Block a user