Commit Graph
793 Commits
Author SHA1 Message Date
ji ruo 8568c41528 feat(schedules,chat): redesign schedules as interactive calendar with server clock and chat tools
- Expose top-level server_time, server_timezone, and server_utc_offset_minutes on GET /api/schedules
- Add list_task_schedules, create_task_schedule, update_task_schedule, and delete_task_schedule chat agent tools
- Redesign /function/schedules into a calendar workspace (mini month, status filters, Up next, Day/Week/Month/Agenda views, server-time red indicator, TZ/date switcher, drag-move/resize, rich detail popover)
- Add schedule-calendar math unit tests and Postgres integration tests for chat schedule tools
2026-12-03 00:28:01 +08:00
ji ruo 778e49317d feat(proxy,chat): add per-task/schedule/chat proxy pool routing and @task mentions
- Support pool auto-rotation mode alongside inherit/direct/node/custom proxy routes across gateway and MITM proxy
- Add GET /api/proxy/routes/{scope}/{owner_id}, task create/DTO proxy_route, and schedule proxy persistence + propagation
- Add list_proxy_pool and set_task_proxy chat agent tools and @task mention search/context injection
- Wire shared proxy/pool selectors into tasks, schedules, chat sandbox popover, and container routes UI
2026-12-03 00:10:50 +08:00
ji ruo b18cf89b77 fix(chat): show the sandbox container a conversation actually uses
A reporter chat bound to one task ran commands in that task's sandbox, while the chat page kept querying the empty session container. Save the task or session target on the conversation and point the badge, uploads, and later turns at it.
2026-12-02 17:45:28 +08:00
ji ruo 8bac4960e7 fix(sandbox,traffic): keep sandbox command output and free scan dial slots
Docker exec no longer wraps commands in setsid, which exited immediately and cut stdout after about two seconds. Netstack releases the pending-dial slot once the handshake finishes, raises the in-flight limits, and treats local file-descriptor exhaustion as a silent drop. The gateway container gets a higher open-file limit.
2026-12-02 17:45:28 +08:00
ji ruo ee5ac6e6dd refactor(web): reorganize ARTEX settings page into modular category cards
- Split monolithic settings page into focused card modules with shared SettingsSectionCard/SettingRow primitives.
- Group settings into 6 categories with URL hash persistence, quick status overview bar, and enhanced cross-category search.
- Clean up legacy masonry utility classes and add bilingual i18n labels for new settings groups.
2026-12-02 15:17:42 +08:00
ji ruo d5926d6420 fix(traffic,server,sandbox): fix TCP/53 false positives, add error-traffic storage toggle, and fix spawn_task/sandbox polling
- Route external TCP/53 through netstack deferred handshake and real-target DNS inspection (RFC 7766 single-write framing) instead of hijacking to host DNS.
- Preserve explicit targetServer in ProcessDNSQueryToTarget under upstream proxy so external UDP/53 probes never fall back to host DNSUpstream.
- Default error traffic storage (net_flows/dns_queries action=error) to off with hot-toggle controls synced across gateway, Proxy & Egress, and Traffic pages.
- Restore json.Unmarshal in spawn_task orchestration tool and poll live sandbox container state in chat/task controls.
2026-12-02 15:17:42 +08:00
ji ruo 07309e4530 feat(deploy,gateway): add dual-edition deployment/migration/rollback and TUN route reconciliation
- Add standalone edition (`Dockerfile.standalone`, `docker-compose.standalone.yml`) alongside sandbox edition and publish both in `.github/workflows/release.yml`.
- Implement `scripts/deploy-lib.sh`, `install.sh`, `update.sh`, and `scripts/artex-sandbox-firewall.sh --cleanup` with edition detection, legacy standalone -> sandbox migration (symlink-safe workspace permissions), automatic snapshots with pinned `artex-rollback/*` images + PG dump, auto/manual cross-edition rollback, and post-rollback upstream unpinning.
- Update `ensureWritableDir` in `internal/sandbox/manager.go` to safely migrate nested root-owned workspace files without following symlinks.
- Expose `deploy_edition` in `/api/update/check` and update `UpdateCard` UI/i18n warnings for sandbox vs standalone in-app update/rollback.
- Reconcile `artex-gateway` TUN policy routing (`priority 218`, `raw PREROUTING`, `nat POSTROUTING`, `DOCKER-USER`) every 15s to self-heal after host network rule flushes or bridge changes.
- Add unit and shell tests (`scripts/deploy_test.sh`, `cmd/artex-gateway/tun_linux_test.go`, `internal/sandbox/sandbox_test.go`, `server/update_test.go`) and update `README.md` / `.env.example`.
2026-12-02 13:31:05 +08:00
ji ruo d786de90af 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.
2026-12-02 02:51:36 +08:00
ji ruo 9c43e694a3 feat(sandbox): isolate worker/chat execution in Docker containers with lifecycle UI
- Add Docker sandbox manager, non-root sandbox image, compose isolation, and host firewall script (#217)
- Route Bash, custom commands/scripts, stdio MCP, chat sessions, MainAgent chat, and task-scoped reporter screenshots into sandbox containers with per-task browser concurrency gate
- Enforce proxy SSRF guard against loopback, metadata, internal services, and admin port
- Add dedicated /system/sandbox management page, /chat session sandbox control, and task detail sandbox popover with progressive stats loading
2026-12-01 21:13:21 +08:00
ji ruo 6bbeac588d chore(release): prepare v0.3.32 release notes v0.3.32 2026-11-27 15:59:54 +08:00
ji ruo f8c9728698 Merge pull request #204 from RuoJi6/RuoJi6/fix/issue-196-mainagent-reopen-task
feat(agent): support reopening and steering closed/paused tasks (#196)

# Conflicts:
#	server/orchestration.go
2026-11-27 15:58:05 +08:00
ji ruo 9ce996ef46 Merge pull request #203 from RuoJi6/RuoJi6/feat/issue-194-memory-limit
fix: limit ARTEX container and tool memory use

# Conflicts:
#	agent/chat.go
#	agent/mainagent.go
#	agent/planner.go
2026-11-27 15:57:17 +08:00
ji ruo 99994413bf Merge pull request #202 from RuoJi6/RuoJi6/feat/issue-198-finding-remark-edit
feat(findings): add manual remark and finding edit support (#198)

# Conflicts:
#	web/src/app/(main)/function/tasks/detail/_tabs/findings-tab.tsx
2026-11-27 15:56:10 +08:00
ji ruo dc6d0d0ee5 Merge pull request #201 from RuoJi6/RuoJi6/fix/issue-184-opencode-go-quota-failover
fix(llm): 支持识别 OpenCode Go 用量窗口耗尽并触发多账户轮换 (#184)
2026-11-27 15:55:28 +08:00
ji ruo cf2d72a852 Merge pull request #200 from RuoJi6/RuoJi6/fix/issue-199-archive-skip-unix-socket
fix(archive): skip unix sockets and other non-regular files during packaging
2026-11-27 15:55:28 +08:00
ji ruo 10be95ac44 Merge pull request #193 from RuoJi6/RuoJi6/fix/issue-186-intercept-polling-count
fix(intercept): avoid full-history polling and full-table counts (#186)
2026-11-27 15:55:28 +08:00
ji ruo ddcd740d16 Merge pull request #192 from RuoJi6/RuoJi6/feat/issue-188-default-enable-screenshot-settings
feat(settings): 默认开启截图与证据相关设置并修复容器内 Playwright MCP 截图失效 (#188)
2026-11-27 15:55:28 +08:00
ji ruo 31b80a36d6 Merge pull request #191 from RuoJi6/RuoJi6/feat/issue-189-ai-auto-merge-findings
feat(findings): 漏洞合并改为由 AI 自动判断并直接完成 (#189)
2026-11-27 15:55:28 +08:00
ji ruo f7bf75f535 feat(agent): support reopening and steering tasks via resume_task, set_task_goals, and add_task_intent
- Add resume_task, set_task_goals, and add_task_intent orchestration tools bound to auto (and resume_task also bound to mainagent with task-context scoping) plus one-shot DB binding/prompt migrations.
- Wire task ID, NotifyGoal, and reviveTask into delegateToTask so set_task_goals and add_task_intent revive done/paused tasks in place while preserving graph/findings.
- Add shared resumeOrReopenTask and POST /api/tasks/{id}/resume (also wired into MCP resume_task) to reopen terminal tasks with open goals/intents and refuse closed tasks with no remaining work.
- Update auto and mainagent default prompts to prefer in-place resume/steering over spawning duplicate tasks.

Fixes #196
2026-11-27 15:31:16 +08:00
ji ruo ea4377ef9a fix: cap ARTEX container and tool resource use 2026-11-27 15:20:52 +08:00
ji ruo 835e289ee2 feat(findings): add manual remark and finding edit support
- Persist findings.remark with archive-restore compatibility, full-text search, and Markdown/CSV/JSON export
- Extend PATCH /api/exploration/findings/{id} to update name, vulnclass, severity, status, summary, evidence, report, and remark with atomic upfront validation
- Add dedicated Notes (remark) card and Edit Finding dialog on the finding detail page, plus remark preview/inline editing in the findings list and task findings tab

Fixes #198
2026-11-27 15:06:07 +08:00
ji ruo 48ae0ef22e fix(llm): recognize OpenCode Go usage limit errors for quota failover
- Add account/plan usage-limit exhaustion markers (`gousagelimiterror`, `usage limit reached`, `usage_limit_reached`, `usage limit exceeded`, `exceeded your usage limit`, `reached your usage limit`) to `agent.IsQuotaExhaustedMessage`.
- Preserve `transientQuotaLimit` filtering so RPM/TPM/rate_limit_error/too many requests remain transient.
- Add regression tests covering quota classification, 429->402 normalization without retry, and non-streaming task failover.

Fixes #184
2026-11-27 14:47:47 +08:00
ji ruo 6af65b622d fix(archive): skip unix sockets and other non-regular files during packaging
- Skip all non-directory, non-regular entries in `writeTaskArchivePackage` (symlinks, Unix domain sockets, named pipes, devices) before `tar.FileInfoHeader` instead of only skipping symlinks.
- Log the skipped entry kind and slash-normalized relative path.
- Add `TestTaskArchivePackageSkipsUnixSocket` regression test covering staging, packaging, extraction, and restoration when regular files and a Unix socket coexist.

Fixes #199
2026-11-27 14:31:52 +08:00
ji ruo 257b158528 feat(findings): switch vulnerability merging to direct AI auto-merge
- Retire suggest_finding_merge tool and suggested review verdict so Reporter directly merges confirmed duplicate root causes or leaves findings independent without pending manual confirmation cards.
- Add DB ListFindingIDsByTask and CreateAutoFindingCaseReviews plus auto-mode support in POST /api/exploration/finding-case-review without requiring manual finding_ids selection.
- Add idempotent startup migration finding_case_tools_v4_auto_merge to refresh schemas, disable suggest_finding_merge, and obsolete legacy pending suggestions.
- Remove manual suggestion cards from FindingCaseReviewPanel and replace manual selection trigger with one-click AI auto-merge on the Findings page and Task detail Findings tab.
- Update README, CHANGELOG, and agent/db/server tests.

Fixes #189
2026-11-26 00:54:28 +08:00
ji ruo ea49ba0a3a fix(intercept): avoid full-history polling and full-table counts
- Add partial covering index on intercept_pending(task_id, created_at DESC) INCLUDE (agent_name) WHERE status = 'pending'.
- Add GET /api/intercept/pending/summary (global count or per-task count + agent_names) and ?task_id= filtering on GET /api/intercept/pending.
- Cap unpaginated GET /api/intercept/task/{taskID} at 200 rows and remove unused tasks JOIN from non-search approval queries.
- Replace unbounded SELECT COUNT(*) in paginated approval queries with end-of-list shortcut, pg_class/pg_stat catalog estimate for large unfiltered tables, and bounded counting (10,000 cap) for large filtered sets.
- Deduplicate task detail and sessions-tab polling via single pending summary poll, switch sidebar badge to summary count, and guard approval polling against background tabs, overlapping requests, and deep-page/search churn.

Fixes #186
2026-11-26 00:54:26 +08:00
ji ruo b23d1776c7 feat(settings): default-enable screenshot/evidence settings and fix container Playwright MCP
- Default-enable browser_screenshot_enabled, browser_screenshot_timestamp_enabled, agent_traffic_binding, and task_intelligence_enabled when unset in DB (preserving explicit user false values).
- Align db/credentials.go SQL checks and frontend defaults/copy with DefaultTaskIntelligence = true.
- Fix container Playwright MCP screenshot failures: ensure --browser chromium in seed/reconcile, install Chromium via playwright-mcp install-browser --with-deps chromium in Dockerfile, prefer local playwright-mcp binary over npx, and run stdio MCP servers in the active agent working directory with stderr capture.

Fixes #188
2026-11-26 00:54:12 +08:00
ji ruo 253a8eeac3 chore(release): prepare v0.3.31 release notes v0.3.31 2026-11-23 18:44:27 +08:00
RuoJi6 1481694b97 Merge pull request #175 from RuoJi6/RuoJi6/issue-160-one-click-backup
feat: 一键备份与迁移 (#160)
2026-11-23 18:38:35 +08:00
ji ruo 566c533052 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	CHANGELOG.md
2026-11-23 18:38:26 +08:00
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 4d2c327df7 fix(backup): 加固一键备份与恢复安全性及大包流式传输 (#160)
- 导出前拒绝存在未暂停的运行中/排队中任务(409 backup_active_tasks + X-Artex-Error-Code),恢复事务内将未完成非暂停任务强制置为手动暂停,防止迁移后自动继续打目标,并同步更新确认文案与 README
- 启动恢复时若文件替换或暂存清理失败,ApplyPendingRestore 返回错误且 main 非零退出,交由守护脚本重试,避免带着新库与半套文件启动业务引擎
- 数据库表导出改为 8 MiB 分片流式写入 tar+zstd 并刷新 HTTP 响应,消除大表落盘临时文件与反代长静默超时;README 补齐 /api/system/backup/ 的 Nginx client_max_body_size 0 与 proxy_request_buffering off 配置
- 暂存新恢复包时先将旧 pending 移走、rename 失败则回滚,避免丢弃已有待恢复包
- 恢复接口返回唯一 restore_id 并写入暂存标记,前端改为精确匹配 restore_id 判断重启恢复完成,消除时钟偏差与旧结果误判
- 补充 Windows->Linux 归档路径改写、活跃任务拦截与恢复自动暂停、多片流式 COPY、文件替换失败快速退出续跑及暂存原子替换测试
2026-11-20 17:00:24 +08:00
ji ruo c6f7c29b71 feat: 一键备份与迁移 (#160)
- 系统配置新增「备份与迁移」:下载单个 tar.zst 备份(全部业务表的一致快照、数据目录、流量索引快照、skills)
- 上传恢复:先解包并按当前 schema 校验,通过后重启;启动时数据库单事务整体替换,文件逐项替换且可续做
- 归档包绝对路径改写到新数据目录;本机已有同名 skill 保留本机版本
- 抽出 extractTarZst 供流式解包复用
2026-11-19 23:34:02 +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