fix(app): collection connects only to the addresses it checked, within 15 s, logging no address
- the fetcher resolves once, requires every address to be public and connects only to those (TLS still checks the name), so DNS rebinding cannot reach the local network; redirects too - 15 s for the whole fetch also against servers that send slowly; no URL in any log line - a site whose title alone changed is kept again - target names that differ only in case are refused (one Windows folder) - the worker always gets the collection file, so results older than the keep days go also with no targets or the feature off - the results screen lists every target with results, not only those in the newest 100 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -322,17 +322,21 @@ which carry Discord's own time.
|
||||
With `JARVIS_COLLECT_PATH` set, the worker collects on its own thread, apart from the voice and the
|
||||
brain (`app/src/admin.spec.md`, "Background collection"). The file is
|
||||
`{"dir": "<data>/collect", "keepDays": 30, "targets": [{"name", "kind", "value", "everyMinutes"}]}`;
|
||||
the app writes only enabled targets. Nothing is collected without targets.
|
||||
the app writes only enabled targets. Nothing is collected without targets, but old day files are
|
||||
still deleted (below).
|
||||
|
||||
- A target runs when `everyMinutes` passed since its last run (also across restarts; the last run is
|
||||
kept in `<dir>/<name>/state.json`), one target at a time, checked every 30 s. A failed run counts
|
||||
as a run, so a broken site is tried again only at its next interval.
|
||||
- Kinds: `site` keeps the page's title and text (at most 20,000 characters) when it differs from the
|
||||
last kept one; `rss` (RSS or Atom) keeps each new item (title, link, time, summary of at most 2,000
|
||||
- Kinds: `site` keeps the page's title and text (at most 20,000 characters) when either differs from
|
||||
the last kept ones; `rss` (RSS or Atom) keeps each new item (title, link, time, summary of at most 2,000
|
||||
characters, new by its id or link); `search` keeps each new web search result (title and link) for
|
||||
the words, from DuckDuckGo's lite page, which needs no key (its bot challenge is a failed run, not "no results").
|
||||
- Every request goes through the web search's address check (`web_search.spec.md`): only public
|
||||
http(s) addresses, every redirect checked again, at most 1 MB, 15 s. The collected text is web
|
||||
- Every request checks its address like the web search (`web_search.spec.md`): only http(s), and
|
||||
every address the name resolves to must be public; the connection goes only to the checked
|
||||
addresses in their order (TLS still checks the name), so a second lookup cannot lead into the
|
||||
local network. Every redirect is checked the same way. At most 1 MB and 15 s in all (redirects included); a server
|
||||
that sends slowly is cut off. The check logs nothing about the address. The collected text is web
|
||||
content: it goes only to `<dir>/<name>/<YYYY-MM-DD>.jsonl` (one JSON object per line: `at`, then
|
||||
`title`, `url`, `text` as the kind has them), never to the brain or a log.
|
||||
- Day files older than `keepDays` are deleted in every folder of `dir` at each check, also of
|
||||
|
||||
Reference in New Issue
Block a user