Commit Graph
762 Commits
Author SHA1 Message Date
RuoJi6 f9f523358c Merge pull request #182 from RuoJi6/RuoJi6/gemini
feat(llm): 支持原生 Google Gemini API 格式 (#170)
2026-11-23 18:35:37 +08:00
ji ruo 044f420c48 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	web/src/i18n/messages.ts
2026-11-23 18:35:27 +08:00
RuoJi6 1005fdc0ac Merge pull request #181 from RuoJi6/feat/issue-157-findings-one-click-cleanup
feat(findings): 发现页历史漏洞一键清理功能 (#157)
2026-11-23 18:33:10 +08:00
RuoJi6 d80bf5e801 Merge pull request #180 from RuoJi6/fix/issue-163-repeater-raw-url
fix(repeater): preserve raw request-target without URL normalization
2026-11-23 18:33:03 +08:00
RuoJi6 bc4a123c4d Merge pull request #172 from RuoJi6/RuoJi6/issue-171-hot-reload-worker-concurrency
feat: 热更新 Worker 并发与模型池绑定
2026-11-23 18:32:57 +08:00
ji ruo e65c0b09a3 test(workers): cover live pool profile switching
Cover issue #141 with unavailable and executing old-profile scenarios through the actual pinned-worker runtime.
Verify same-size profile replacement, idempotent saves, graceful completion, and no further calls to the retired provider.
Document pool binding precedence and the absence of automatic replay for historical blocked intents.

Fixes #141
2026-11-23 18:28:50 +08:00
ji ruo bdd2da919c feat(llm): 支持原生 Google Gemini API 格式
- 新增 agent/gemini.go 原生 Gemini generateContent / streamGenerateContent?alt=sse llm.Provider,支持流式/非流式、工具调用与 JSON Schema 清洗、thoughtSignature 回传、thinkingConfig(Gemini 2.5 thinkingBudget / Gemini 3+ thinkingLevel)、建连/空响应重试及限流/抓包透传。
- agent.ConfigFrom / FromEnv / Provider() 支持 gemini 格式与 BaseURL 归一化(自动补全 /v1beta 并容忍粘贴完整端点 URL),环境变量支持 GEMINI_API_KEY / GOOGLE_API_KEY。
- db/schema.sql 放开 llm_profiles.format CHECK 约束加入 gemini 并幂等迁移旧库。
- server/server_mgmt.go 模型列表接口支持 Gemini /models(剥离 models/ 前缀并过滤支持 generateContent 的模型)。
- web LLM 配置页与类型/国际化新增 Google Gemini 协议选项及占位提示。
- 补充 agent/gemini_test.go、server/gemini_models_test.go 与限流重试测试。

Fixes #170
2026-11-23 18:24:43 +08:00
ji ruo e196a06aa9 feat(findings): add one-click cleanup for historical findings
- Add DB `DeleteFindings` bulk deletion inside `WithEvidenceTx`, locking affected tasks/findings, cascading retests/cases, and removing originating `exploration_nodes` (kind='finding').
- Add `DELETE /api/exploration/findings` endpoint supporting `scope` (`all`, `filtered`, `selected`) via JSON body or query params with strict validation and 409 on archive-state conflicts.
- Add `api.cleanupFindings`, mock handler support, bilingual `findingsCleanup.*` i18n keys, and a one-click cleanup button + confirmation dialog on the Findings page refreshing all four views.
- Add Go DB/server tests (`TestDeleteFindings`, `TestDeleteFindingsValidation`, `TestDeleteFindingsEndpoint`).

Fixes #157
2026-11-23 18:20:33 +08:00
ji ruo bedc8721b4 fix(repeater): preserve raw request-target without URL normalization
- Parse only scheme and authority via WHATWG URL in frontend repeater helpers so raw path and query characters (e.g. `'`, `"`, `<`, `>`, `../`, `%2e%2e`, `\`) are not normalized or percent-encoded.
- Preserve raw request-targets in buildRawRequest, requestFromTraffic, and repeater path filtering.
- Preserve raw path and query targets in backend /api/repeater/send across HTTP/1.1 direct, HTTP proxy, and HTTP/2 while retaining scheme/authority validation and SSRF guards.
- Add frontend and backend regression tests covering raw query and path wire fidelity.

Fixes #163
2026-11-23 18:17:45 +08:00
RuoJi6 7b196bf683 Merge pull request #176 from M09Ic/docs/chainreactors-branding 2026-11-22 12:12:17 +08:00
M09IcandClaude Code 3530b583d3 docs: clarify Autumn-27/ARTEX fork lineage and use www.chainreactors.ai
Co-Authored-By: Claude Code <[email protected]>
2026-11-22 02:10:10 +08:00
M09IcandClaude Code 673c996776 docs: add ChainReactors branding and license notice
Co-Authored-By: Claude Code <[email protected]>
2026-11-22 01:54:11 +08:00
ji ruo 7d9c5699cb feat(workers): hot-reload task worker concurrency
Support live task overrides and global default/pool reconciliation.
Drain retiring workers without cancelling active intents; expose actual/target loop counts in the API and task UI.
Persist worker policy and cover resizing, API validation, settings notification, and restoration with regression tests.

Fixes #171
2026-11-19 17:26:51 +08:00
ji ruo 6997a46619 chore(release): prepare v0.3.30 release notes v0.3.30 2026-11-14 21:19:39 +08:00
ji ruo cc1d84d573 Merge pull request #155 from RuoJi6/mcp-server-implementation 2026-11-14 20:51:24 +08:00
ji ruo a4ad95d716 Merge pull request #154 from RuoJi6/codex/fix-socks5-nil-panic 2026-11-14 20:51:24 +08:00
ji ruo 900c176435 Merge pull request #152 from RuoJi6/fix/intercept-match-decoded-input 2026-11-14 20:51:24 +08:00
ji ruo 437a28cddc Merge pull request #138 from RuoJi6/agent/agent/github-10 2026-11-14 20:51:24 +08:00
ji ruo 32d8619d36 Merge pull request #122 from RuoJi6/docs/fix-readme-mistakes 2026-11-14 20:51:23 +08:00
ji ruo 0a0158a4ab feat(mcp): add a source allowlist for the MCP server endpoint
Restrict which source addresses may call /mcp with a list of IPs/CIDRs
(IPv4 and IPv6). The check runs before token authentication, so a source
that is not listed is refused with 403 even when it holds a valid token.
An empty list keeps the previous behaviour (any source).

Behind a reverse proxy the TCP peer is always the proxy, so proxies can be
registered as trusted: for requests from them the client is the rightmost
X-Forwarded-For hop that is not itself a trusted proxy. Without a trusted
proxy the header is ignored, so a caller cannot claim an allowed address.

- A stored configuration that cannot be read or parsed refuses requests
  instead of falling back to no restriction.
- The audit log records the resolved client address.
- The settings API reports the address the server sees for the caller.
- The allowlist applies to /mcp only; the web UI and admin API are
  unaffected.

Refs RuoJi6/ARTEX#144
2026-11-14 14:32:39 +08:00
RuoJi6 c9b1e240ec Update README.md 2026-11-14 14:22:43 +08:00
RuoJi6 9b8073a763 Update README.md 2026-11-14 14:22:19 +08:00
RuoJi6 faf4d4fb4a Update README.md 2026-11-14 14:22:01 +08:00
ji ruo 8cf118e34d feat(mcp): expose ARTEX as an MCP server for external agents
Add a stateless Streamable HTTP endpoint at /mcp that lets external agents
list tasks and findings, create tasks, pause/resume them and add hints.

- Access tokens (api_tokens): scopes (read, task:create, task:control),
  optional company restriction, task quotas, expiry, revocation. Only the
  SHA-256 is stored; the plaintext is returned once.
- /mcp authenticates with access tokens only. It sits outside the HTTP Basic
  Auth gate and rejects Basic credentials and the admin JWT.
- Whitelisted tools only; nothing that edits tools, skills, MCP servers,
  workspace files or settings is exposed.
- Every tools/call is audited (mcp_audit_log), refusals included.
- POST /api/tasks and the MCP spawn_task tool now share one creation path.
- Settings card for the switch, token management and the call audit.
- Off by default.

Refs RuoJi6/ARTEX#144
2026-11-14 14:08:07 +08:00
darkkid 0fed4ba3a3 fix(traffic): 升级 go-mitmproxy 修复 socks5 上游握手失败时的 nil panic
全局出口代理配置为 socks5:// 时,SOCKS5 握手失败会刷出
"http: panic serving ...: nil pointer dereference"。

根因在依赖库 go-mitmproxy v1.9.2 的 internal/helper/proxy.go:40:
x/net 的 SOCKS5 DialContext 失败时返回 (nil, err),库仍调用
conn.Close(),必然空指针。net/http 每连接 recover,进程不退出,
但每条 CONNECT 被直接掐断(客户端见到 EOF),且 panic 发生在
HTTPConnectError 回调之前,导致 reportUpstreamFailure 不触发,
代理池自愈与任务重连完全收不到失败信号。

上游已在 v1.9.4 修复(issue #110,commit 388f47a),本次升级
v1.9.2 -> v1.9.5。实测同一份 traffic 包:v1.9.2 下 CONNECT 返回
unexpected EOF 且回调不触发;v1.9.5 下返回 502 并正常触发失败回调。

连带升级 go-mitmproxy 要求的最低版本:x/net 0.61.0、x/crypto
0.58.0、x/text 0.43.0、x/sys 0.49.0、x/mod 0.41.0、x/sync 0.24.0、
x/tools 0.51.0。

验证:go build ./... 与 go vet ./... 在 -mod=readonly 下通过;
按包隔离数据库逐包对比升级前后,失败集合完全一致(db、llmrec
为本次改动前既有失败),traffic/evidence/intercept/sidequestion/
guard/notify/server 全绿。
2026-11-14 13:36:57 +08:00
ji ruo aece14df71 chore(agent): baseline — the task worktree started here 2026-11-14 13:26:06 +08:00
nftpixels 4d66a84ac5 fix(intercept): match tool_input rules against decoded values
tool_input rules were only matched against the raw JSON of the tool call.
JSON escapes newlines and tabs, so a multi-line command reaches the rules as
`cd /tmp\nrm -rf /var/www`. There is no word boundary between the `n` of `\n`
and `rm`, so the built-in `\brm\b` / `\bmkfs\b` / `\bDROP ...` rules never
fire on a dangerous command that starts a new line (heredocs, small scripts).
Quotes (`\"`) and, for Go-encoded input, & < > (`&` etc.) have the same
problem.

Decode the input once per Match and also try each string value. The raw
JSON is still checked first, so existing rules written against the JSON
form keep matching; the change can only add matches.
2026-11-14 11:16:27 +13:00
ji ruo 570dc1a14c fix: expand standard browser user agent pool to twenty samples 2026-11-11 19:21:05 +08:00
ji ruo 171db405dd fix: select random browser user agents for outbound HTTP 2026-11-11 19:13:38 +08:00
ji ruo 17c2fc5e08 fix: make HTTP user agents configurable and remove tool identifiers 2026-11-11 18:56:33 +08:00
ji ruo 40746901db chore(agent): baseline — the task worktree started here 2026-11-11 18:42:23 +08:00
ji ruo 73d5437c5a Merge pull request #135 from RuoJi6/agent/mika/github-4 2026-11-11 15:25:36 +08:00
ji ruo 5131905918 Merge pull request #134 from RuoJi6/agent/agent/github-3 2026-11-11 15:25:36 +08:00
ji ruo b9fe1cdaf6 Merge pull request #133 from RuoJi6/agent/agent/github-2-0aaf6221ae02 2026-11-11 15:25:36 +08:00
ji ruo 3306e547b2 fix(tasks): serialize no-result decisions with finding writes 2026-11-11 15:20:58 +08:00
ji ruo 8e030b1fbd Merge existing PR #133 implementation into task worktree 2026-11-11 15:09:15 +08:00
ji ruo 37544a2c63 chore(agent): baseline — the task worktree started here 2026-11-11 15:05:09 +08:00
ji ruo b16958e64b fix(sidequestion): recover incomplete summaries with bounded retries 2026-11-11 14:45:23 +08:00
ji ruo 5860bf8f25 chore(agent): baseline — the task worktree started here 2026-11-11 14:38:22 +08:00
ji ruo 62ed7db7b2 feat(tasks): add read-only task file browser (GITHUB-3) 2026-11-11 14:14:37 +08:00
ji ruo 997d2d98c0 feat(tasks): stop tasks that miss a configurable findings checkpoint 2026-11-11 14:07:39 +08:00
ji ruo 873e3a667b chore(agent): baseline — the task worktree started here 2026-11-11 13:54:13 +08:00
ji ruo 39a8f2c31a chore(agent): baseline — the task worktree started here 2026-11-11 13:49:38 +08:00
ji ruo 5c617ef70e Merge pull request #131 from RuoJi6/codex/english-i18n 2026-11-10 20:12:16 +08:00
ji ruo 151d0e4d43 Merge pull request #129 from RuoJi6/codex/auth-session-recovery 2026-11-10 20:08:49 +08:00
ji ruo 9ccaa81497 feat: add English interface localization and fix preview crashes 2026-11-10 20:03:14 +08:00
ji ruo 0ff2130f46 fix: recover expired Basic Auth sessions in the current tab 2026-11-10 16:28:23 +08:00
ji ruo a05a886d3d fix: support traffic ID copying over HTTP 2026-11-09 16:17:03 +08:00
RuoJi6 9fe993f460 Merge pull request #126 from RuoJi6/codex/issue-125-traffic-id-filter-counts
feat: 展示流量 ID 并让发现统计跟随筛选
2026-11-09 16:15:09 +08:00
ji ruo 8ee94f2215 feat: expose traffic IDs and filter finding statistics 2026-11-09 16:11:15 +08:00