driftnet 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -5
- package/README.zh-TW.md +39 -5
- package/dist/driftnet.mjs +3979 -1965
- package/package.json +1 -1
- package/public/index.html +250 -23
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
**English** · [繁體中文](https://github.com/KevinChu1110/driftnet/blob/main/README.zh-TW.md)
|
|
9
9
|
|
|
10
|
-
[📖 What it is](#-what-it-is) · [🎥 See it work](#-see-it-work) · [✨ Core features](#-core-features) · [🚀 Quick start](#-quick-start) · [How links are handled](#how-your-links-are-handled) · [Ways in](#ways-in) · [Web page](#the-web-page) · [Models](#models) · [Agents](#agents) · [Settings](#settings) · [Online](#putting-it-online-optional) · [Your data](#where-your-data-goes) · [Contributing](#contributing)
|
|
10
|
+
[📖 What it is](#-what-it-is) · [🎥 See it work](#-see-it-work) · [✨ Core features](#-core-features) · [🚀 Quick start](#-quick-start) · [How links are handled](#how-your-links-are-handled) · [Ways in](#ways-in) · [Command line](#command-line) · [Web page](#the-web-page) · [Models](#models) · [Agents](#agents) · [Settings](#settings) · [Online](#putting-it-online-optional) · [Your data](#where-your-data-goes) · [Contributing](#contributing)
|
|
11
11
|
|
|
12
12
|
[](https://github.com/KevinChu1110/driftnet/blob/main/LICENSE)
|
|
13
13
|
[](https://www.npmjs.com/package/driftnet)
|
|
@@ -173,6 +173,10 @@ without running one: on real links, a Chinese article went from 831 to 404 token
|
|
|
173
173
|
|
|
174
174
|
</details>
|
|
175
175
|
|
|
176
|
+
## Link health
|
|
177
|
+
|
|
178
|
+
Links rot and repos get archived. Set `DRIFTNET_HEALTH=weekly` (recommended; it is off by default because it makes network requests) and driftnet re-checks each card about once a week, a few at a time. GitHub repos go through the API (stars, archived, last push; set `GITHUB_TOKEN` for a higher limit, and it pauses on a rate limit); other links get a quiet `HEAD` through the same private-address guard. A card is marked `dead` (404 / gone, or a name that no longer resolves), `archived`, `stale` (no push for 18 months) or `moved` (repo renamed); server errors and timeouts change nothing and are retried. Marked cards show a badge, appear under **Needs review** on the page and in `driftnet_search_items` with `view=needs_review`, and the card's check button (or `POST /api/items/:id/health`) tests one link right now.
|
|
179
|
+
|
|
176
180
|
## Ways in
|
|
177
181
|
|
|
178
182
|
| | Set up | On a laptop? | Sent while it was off |
|
|
@@ -188,11 +192,33 @@ without running one: on real links, a Chinese article went from 831 to 404 token
|
|
|
188
192
|
**In a chat**, messages without a link are ignored. Each link gets one line back: what it is and
|
|
189
193
|
where to read it on the web page. Want the summary in the chat instead, or no reply at all? Set
|
|
190
194
|
`DRIFTNET_REPLY=full` or `off`. Vote with `👍12` or `👎12 reason` (`+#12` / `-#12` work too; a message with a link is never a vote).
|
|
195
|
+
**Weekly digest.** Set `DRIFTNET_DIGEST=weekly` (or `daily`) and `DRIFTNET_DIGEST_TO` (or use ⚙ Settings → General) and driftnet posts one short
|
|
196
|
+
message at the chosen time: how many cards are new, how many wait in the Inbox, the five best new cards (worth, then shares) and what was shared
|
|
197
|
+
2+ times. Nothing new, nothing sent. Times are the **server's local time** (set `TZ` to change it). If driftnet was off at the scheduled time it
|
|
198
|
+
sends one catch-up digest on the next start, never more. Links in it are your plain public URL (`DRIFTNET_PUBLIC_URL`), never the read-only share key,
|
|
199
|
+
since the text lands in a group. Try it with `POST /api/digest/send {"dryRun": true}`. A webhook also gets a `digest.sent` event.
|
|
200
|
+
|
|
191
201
|
Bot tokens are read when driftnet starts: put them in `~/.driftnet/.env`, then stop and start it again.
|
|
192
202
|
|
|
193
203
|
<p align="center"><img src="https://raw.githubusercontent.com/KevinChu1110/driftnet/main/assets/discord-zh-TW.jpg" alt="driftnet answering a Discord message with two links: one line per link, each pointing to its page" width="80%"></p>
|
|
194
204
|
<sub>A real run in Discord (<code>DRIFTNET_LANGUAGE=Traditional Chinese (Taiwan)</code>): two links in one message, one line back for each. Name and server address hidden.</sub>
|
|
195
205
|
|
|
206
|
+
## Command line
|
|
207
|
+
|
|
208
|
+
With driftnet running (`npx driftnet`), the same command talks to it. `search` and `export` also work when it is not running (they read `~/.driftnet/driftnet.db` directly); `add` and `import` need it running.
|
|
209
|
+
|
|
210
|
+
| Command | Example |
|
|
211
|
+
|---|---|
|
|
212
|
+
| `driftnet add <url> [--note "…"]` | `npx driftnet add https://github.com/acme/widget --note "for the demo"` |
|
|
213
|
+
| `driftnet search [query…] [--folder id] [--kind …] [--view inbox\|favorites\|trash] [--limit N] [--json]` | `npx driftnet search vector database --kind repo --limit 5` |
|
|
214
|
+
| `driftnet open [id]` | `npx driftnet open 12` |
|
|
215
|
+
| `driftnet export [--format json\|md\|vault] [-o file]` | `npx driftnet export --format vault -o links.zip` |
|
|
216
|
+
| `driftnet import <file> [--keep-folders] [--yes]` | `npx driftnet import bookmarks.html --keep-folders` |
|
|
217
|
+
| `driftnet status` | `npx driftnet status` |
|
|
218
|
+
| `driftnet completion bash\|zsh` | `eval "$(driftnet completion zsh)"` |
|
|
219
|
+
|
|
220
|
+
For a server elsewhere, add `--url http://host:8787 --token <password>` (or set `DRIFTNET_URL` and `DRIFTNET_TOKEN`; the password is also read from `~/.driftnet/.env`).
|
|
221
|
+
|
|
196
222
|
## The web page
|
|
197
223
|
|
|
198
224
|
<p align="center"><img src="https://raw.githubusercontent.com/KevinChu1110/driftnet/main/assets/screenshot-en.jpg" alt="The driftnet web page: your folder tree on the left, summarised tools on the right" width="100%"></p>
|
|
@@ -246,6 +272,12 @@ phone the sidebar folds into a ☰ drawer, and a line under the search box says
|
|
|
246
272
|
newest, most shared), compact cards, tags, chat text, light or dark.
|
|
247
273
|
- **Export** everything as one Markdown file, or as a zip of Markdown files with front matter that
|
|
248
274
|
Obsidian opens as a vault and Notion imports (Import → Markdown & CSV).
|
|
275
|
+
- **Import bookmarks.** ⚙ Settings → *Import bookmarks* takes a browser bookmarks file (Chrome, Firefox,
|
|
276
|
+
Safari, Edge: HTML), a Pocket export (HTML or CSV), a Raindrop CSV, a JSON list of links, or any text
|
|
277
|
+
or Markdown with links in it. It shows how many are new before anything starts; tick *Keep my bookmark
|
|
278
|
+
folders* to mirror them under an **Imported** folder, otherwise the classifier sorts as usual. Links you
|
|
279
|
+
already have, repeats, non-web and private addresses are skipped, up to 5,000 per import. With a model
|
|
280
|
+
set up, each new link is one model call, so hundreds of links mean hundreds of calls.
|
|
249
281
|
- **Shared links open read-only.** A card link from a chat bot or an agent carries the read-only share
|
|
250
282
|
key, so it opens on a phone without a password; edit buttons appear after **Unlock** with the admin
|
|
251
283
|
password. Forgot it? Open driftnet on the computer it runs on: Settings there sets a new one.
|
|
@@ -464,13 +496,18 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
464
496
|
| `DRIFTNET_MIN_CONFIDENCE` | `0.4` | Below this, the model classifies instead of Jev |
|
|
465
497
|
| `DRIFTNET_DIGEST_TOKENS` | `350` | Token budget of the page outline |
|
|
466
498
|
| `DRIFTNET_FOLDERS` | `ai` | Starting folder template on a new database: `ai` (AI & coding), `research` (papers, articles, datasets…) or `everyday` (cooking, travel, money…). An empty catalogue also offers the choice on the page |
|
|
467
|
-
| `
|
|
499
|
+
| `DRIFTNET_DIGEST` | `off` | Scheduled digest into your chats: `off`, `daily` or `weekly` ([Weekly digest](#ways-in)) |
|
|
500
|
+
| `DRIFTNET_DIGEST_AT` | `09:00` | Time of day, `HH:MM`, in the server's local time (the `TZ` variable is respected) |
|
|
501
|
+
| `DRIFTNET_DIGEST_DAY` | `mon` | Day of the week for `weekly`: `mon`…`sun` |
|
|
502
|
+
| `DRIFTNET_DIGEST_TO` | — | Where it goes, comma separated: `telegram:<chat id>`, `discord:<channel id>`, `slack:<channel id>`, `line:<user, group or room id>`; uses the bot tokens already set |
|
|
503
|
+
| `DRIFTNET_WEBHOOK_URL` | — | POST each card change here as JSON (`item.added` / `item.updated` / `item.trashed` / `item.restored`, plus `digest.sent`), 5 s timeout, one retry after 1 s, redirects not followed |
|
|
468
504
|
| `DRIFTNET_WEBHOOK_SECRET` | — | Signs each delivery: `X-Driftnet-Signature: sha256=<hmac of "<X-Driftnet-Timestamp>.<body>">`. Reject old timestamps to stop replays; `X-Driftnet-Delivery` stays the same on the retry |
|
|
469
505
|
| `DRIFTNET_WEBHOOK_ALLOW_LOCAL` | — | `1` allows a webhook on a private address (n8n on your LAN), for that exact host only |
|
|
470
506
|
| `DRIFTNET_CATEGORIES` | built-in | JSON file of starting folders, `{ "id": "description" }`, used once on a new database; after that, edit folders on the page |
|
|
471
507
|
| `GITHUB_TOKEN` | — | GitHub API limit from 60 to 5,000 requests per hour |
|
|
472
508
|
| `DRIFTNET_SUMMARY_RULES` | — | Your own instructions for every summary, e.g. “Say whether it is free.” Agents get them too |
|
|
473
509
|
| `DRIFTNET_BLOCK_DOMAINS` | — | Domains never catalogued (subdomains included), comma separated |
|
|
510
|
+
| `DRIFTNET_HEALTH` | `off` | `weekly` re-checks links about once a week and marks dead, archived and stale cards (see Link health). Off by default: it makes network requests |
|
|
474
511
|
| `DRIFTNET_PLUGINS` | `~/.driftnet/plugins` | Folder of extractor plugins (`.js` / `.mjs`), see [`examples/plugins`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins) |
|
|
475
512
|
| `DRIFTNET_TOKEN` | — | Admin password: writes, settings, agent tokens, MCP with every tool, the agent queue. Settable on the page |
|
|
476
513
|
| `DRIFTNET_READ_KEY` | — | Read-only share key (header or `?key=`): reading and the read-only MCP tools |
|
|
@@ -494,9 +531,9 @@ set by the environment itself (systemd, Docker, your shell) wins and shows there
|
|
|
494
531
|
|
|
495
532
|
**HTTP:** `GET /` · `GET /api/items[/:id]` (`?view=favorites|trash`) · `POST /api/items/:id/feedback` ·
|
|
496
533
|
`POST /api/items/:id/{trash,restore,favorite,unfavorite,move}` · `GET|POST /api/folders` · `PATCH|DELETE /api/folders/:id` · `POST /api/ingest` ·
|
|
497
|
-
`POST /api/chat` · `POST /api/pending` · `POST /api/items/:id/enrich` · `GET /api/stats` ·
|
|
498
|
-
`PUT /api/items/:id/note` · `GET|POST /api/notes` · `PUT|DELETE /api/notes/:id` · `GET /api/export` (`?format=vault`) ·
|
|
499
|
-
`GET|PUT /api/settings` (this machine, or with the token) · `GET|POST /api/agent-tokens` · `DELETE /api/agent-tokens/:id[?purge=1]` (revoke, or remove a revoked one; admin password only) · `GET /api/categories` · `POST /api/items/:id/refresh` · `POST /api/folders/template` · `GET /llms.txt` · `GET /feed.xml` · `GET /openapi.json` · `/mcp`
|
|
534
|
+
`POST /api/chat` · `POST /api/digest/send` (`{"dryRun": true}` shows the text) · `POST /api/pending` · `POST /api/items/:id/enrich` · `GET /api/stats` ·
|
|
535
|
+
`PUT /api/items/:id/note` · `GET|POST /api/notes` · `PUT|DELETE /api/notes/:id` · `GET /api/export` (`?format=vault`) · `POST /api/import` · `GET /api/import/:job` ·
|
|
536
|
+
`GET|PUT /api/settings` (this machine, or with the token) · `GET|POST /api/agent-tokens` · `DELETE /api/agent-tokens/:id[?purge=1]` (revoke, or remove a revoked one; admin password only) · `GET /api/categories` · `POST /api/items/:id/refresh` · `POST /api/items/:id/health` · `POST /api/folders/template` · `GET /llms.txt` · `GET /feed.xml` · `GET /openapi.json` · `/mcp`
|
|
500
537
|
|
|
501
538
|
</details>
|
|
502
539
|
|
package/README.zh-TW.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
[English](https://github.com/KevinChu1110/driftnet/blob/main/README.md) · **繁體中文**
|
|
9
9
|
|
|
10
|
-
[📖 這是什麼](#-這是什麼) · [🎥 實際看看](#-實際看看) · [✨ 核心功能](#-核心功能) · [🚀 開始使用](#-開始使用) · [連結怎麼被處理](#連結怎麼被處理) · [接法](#接法) · [網頁](#網頁) · [模型](#模型) · [Agent](#agent) · [設定](#設定) · [放上網路](#放上網路選用) · [資料去哪裡](#資料去哪裡) · [參與開發](#參與開發)
|
|
10
|
+
[📖 這是什麼](#-這是什麼) · [🎥 實際看看](#-實際看看) · [✨ 核心功能](#-核心功能) · [🚀 開始使用](#-開始使用) · [連結怎麼被處理](#連結怎麼被處理) · [接法](#接法) · [指令列](#指令列) · [網頁](#網頁) · [模型](#模型) · [Agent](#agent) · [設定](#設定) · [放上網路](#放上網路選用) · [資料去哪裡](#資料去哪裡) · [參與開發](#參與開發)
|
|
11
11
|
|
|
12
12
|
[](https://github.com/KevinChu1110/driftnet/blob/main/LICENSE)
|
|
13
13
|
[](https://www.npmjs.com/package/driftnet)
|
|
@@ -169,6 +169,10 @@ curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
|
169
169
|
|
|
170
170
|
</details>
|
|
171
171
|
|
|
172
|
+
## 連結健康檢查
|
|
173
|
+
|
|
174
|
+
連結會失效、儲存庫會被封存。設定 `DRIFTNET_HEALTH=weekly`(建議開啟;預設關閉,因為會對外發送請求),driftnet 就會每週左右重新檢查每張卡片,一次檢查幾張。GitHub 儲存庫走 API(星數、是否封存、最後推送;可設 `GITHUB_TOKEN` 提高上限,遇到速率限制會自動暫停);其他連結則用同一套私有位址防護發一個輕量的 `HEAD`。卡片會被標成 `dead`(404/已移除,或網域已不存在)、`archived`(已封存)、`stale`(超過 18 個月沒有推送)或 `moved`(儲存庫改名/搬家);伺服器錯誤和逾時不會改變狀態,之後會再試。被標記的卡片會顯示徽章,出現在網頁的「需要檢查」和 `driftnet_search_items` 的 `view=needs_review`,卡片上的「檢查連結」按鈕(或 `POST /api/items/:id/health`)可以立刻測一個連結。
|
|
175
|
+
|
|
172
176
|
## 接法
|
|
173
177
|
|
|
174
178
|
| | 設定 | 筆電上能用? | 關機期間的訊息 |
|
|
@@ -183,11 +187,32 @@ curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
|
183
187
|
|
|
184
188
|
**在聊天室裡**,沒有連結的訊息一律忽略。每個連結只回一行:它是什麼,以及在網頁上的哪裡看。想在聊天室直接看摘要,
|
|
185
189
|
或完全不回?設 `DRIFTNET_REPLY=full` 或 `off`。用 `👍12` 或 `👎12 原因` 投票(也可用 `+#12`/`-#12`;含連結的訊息一定不會被當成投票)。
|
|
190
|
+
**每週摘要。** 設 `DRIFTNET_DIGEST=weekly`(或 `daily`)和 `DRIFTNET_DIGEST_TO`(也可在 ⚙ 設定 → 一般 設定),driftnet 會在指定時間貼一則簡短訊息:
|
|
191
|
+
新增幾張卡片、收件匣還有幾張待整理、最好的五張新卡片(依價值、再依分享次數)、以及被分享 2 次以上的項目。沒有新內容就不發。時間用**伺服器的本地時間**
|
|
192
|
+
(要改就設 `TZ`)。排定時間 driftnet 剛好沒開的話,下次啟動會補發一則,不會多發。內文連結一律是公開網址(`DRIFTNET_PUBLIC_URL`),
|
|
193
|
+
不會帶唯讀分享金鑰,因為訊息會貼進群組。用 `POST /api/digest/send {"dryRun": true}` 試看看。Webhook 也會收到 `digest.sent` 事件。
|
|
194
|
+
|
|
186
195
|
聊天機器人的 token 在 driftnet 啟動時讀取:寫進 `~/.driftnet/.env` 後,把 driftnet 關掉再重新啟動。
|
|
187
196
|
|
|
188
197
|
<p align="center"><img src="https://raw.githubusercontent.com/KevinChu1110/driftnet/main/assets/discord-zh-TW.jpg" alt="driftnet 回覆一則含兩個連結的 Discord 訊息:每個連結一行,各自指向網頁" width="80%"></p>
|
|
189
198
|
<sub>Discord 實測畫面:一則訊息兩個連結,各回一行。使用者名稱和伺服器網址已隱藏。</sub>
|
|
190
199
|
|
|
200
|
+
## 指令列
|
|
201
|
+
|
|
202
|
+
driftnet 在跑的時候(`npx driftnet`),同一個指令就能跟它說話。`search` 和 `export` 在它沒開時也能用(直接讀 `~/.driftnet/driftnet.db`);`add` 和 `import` 需要它在跑。
|
|
203
|
+
|
|
204
|
+
| 指令 | 範例 |
|
|
205
|
+
|---|---|
|
|
206
|
+
| `driftnet add <url> [--note "…"]` | `npx driftnet add https://github.com/acme/widget --note "demo 要用"` |
|
|
207
|
+
| `driftnet search [關鍵字…] [--folder id] [--kind …] [--view inbox\|favorites\|trash] [--limit N] [--json]` | `npx driftnet search 向量資料庫 --kind repo --limit 5` |
|
|
208
|
+
| `driftnet open [id]` | `npx driftnet open 12` |
|
|
209
|
+
| `driftnet export [--format json\|md\|vault] [-o 檔案]` | `npx driftnet export --format vault -o links.zip` |
|
|
210
|
+
| `driftnet import <檔案> [--keep-folders] [--yes]` | `npx driftnet import bookmarks.html --keep-folders` |
|
|
211
|
+
| `driftnet status` | `npx driftnet status` |
|
|
212
|
+
| `driftnet completion bash\|zsh` | `eval "$(driftnet completion zsh)"` |
|
|
213
|
+
|
|
214
|
+
連到別台機器:加 `--url http://host:8787 --token <密碼>`(或設 `DRIFTNET_URL`、`DRIFTNET_TOKEN`;密碼也會從 `~/.driftnet/.env` 讀)。
|
|
215
|
+
|
|
191
216
|
## 網頁
|
|
192
217
|
|
|
193
218
|
<p align="center"><img src="https://raw.githubusercontent.com/KevinChu1110/driftnet/main/assets/screenshot-zh-TW.jpg" alt="driftnet 網頁:左邊是自己的資料夾樹,右邊是整理好的工具" width="100%"></p>
|
|
@@ -225,6 +250,10 @@ curl -X POST localhost:8787/api/chat -H 'content-type: application/json' \
|
|
|
225
250
|
不用重新啟動就生效。每個瀏覽器各自的顯示:排序(值得看/最新/最多人分享)、精簡卡片、標籤、聊天原文、深淺色。
|
|
226
251
|
- **匯出**全部內容:一個 Markdown 檔,或一包附 front matter 的 Markdown(zip),Obsidian 可以直接當 vault 開,
|
|
227
252
|
Notion 可以匯入(匯入 → Markdown & CSV)。
|
|
253
|
+
- **匯入書籤。**⚙ 設定 →「匯入書籤」可以選瀏覽器的書籤檔(Chrome、Firefox、Safari、Edge:HTML)、Pocket 匯出檔(HTML 或 CSV)、
|
|
254
|
+
Raindrop CSV、JSON 連結清單,或任何含連結的文字/Markdown。開始前會先告訴你有多少是新的;勾選「保留我的書籤資料夾」會照原樣放進
|
|
255
|
+
**Imported** 資料夾,不勾就交給分類器照常整理。已經有的、重複的、非網頁與內網位址會略過,一次最多 5,000 個。
|
|
256
|
+
若已設定模型,每個新連結都會呼叫一次模型,幾百個連結就是幾百次。
|
|
228
257
|
- **分享出去的連結是唯讀的。**聊天機器人和 agent 給你的卡片連結帶著唯讀分享碼,手機點開不用密碼;按「解鎖編輯」輸入管理密碼後,
|
|
229
258
|
才會出現編輯按鈕。忘記密碼的話,到跑 driftnet 的那台電腦打開網頁,設定裡可以直接設新的。
|
|
230
259
|
- **鍵盤。**`⌘K`/`Ctrl+K` 開指令面板(跳到資料夾或卡片、切換檢視、匯出、設定……)。`j`/`k` 上下一張、`f` 最愛、`m` 移動(打字找資料夾)、`n` 筆記、`#` 垃圾桶、`x` 選取、`z` 復原、`/` 搜尋、`g m` 樹狀圖、`?` 看全部快捷鍵。
|
|
@@ -427,13 +456,18 @@ agent 寫回來的內容跟其他不可信的輸入一樣要檢查:格式、
|
|
|
427
456
|
| `DRIFTNET_MIN_CONFIDENCE` | `0.4` | Jev 信心低於此值時改由模型分類 |
|
|
428
457
|
| `DRIFTNET_DIGEST_TOKENS` | `350` | 頁面大綱的 token 預算 |
|
|
429
458
|
| `DRIFTNET_FOLDERS` | `ai` | 新資料庫的起始資料夾樣板:`ai`(AI 與程式)、`research`(論文、文章、資料集……)或 `everyday`(料理、旅行、理財……)。清單還是空的時候,網頁上也能選 |
|
|
430
|
-
| `
|
|
459
|
+
| `DRIFTNET_DIGEST` | `off` | 定時把摘要貼進你的聊天室:`off`、`daily` 或 `weekly`(見[每週摘要](#接法)) |
|
|
460
|
+
| `DRIFTNET_DIGEST_AT` | `09:00` | 每天的時間,`HH:MM`,用伺服器的本地時間(會遵守 `TZ` 變數) |
|
|
461
|
+
| `DRIFTNET_DIGEST_DAY` | `mon` | `weekly` 的星期幾:`mon`…`sun` |
|
|
462
|
+
| `DRIFTNET_DIGEST_TO` | — | 送到哪裡,以逗號分隔:`telegram:<聊天室 id>`、`discord:<頻道 id>`、`slack:<頻道 id>`、`line:<使用者、群組或聊天室 id>`;使用已設定的機器人 token |
|
|
463
|
+
| `DRIFTNET_WEBHOOK_URL` | — | 卡片有變動就以 JSON POST 到這裡(`item.added`/`item.updated`/`item.trashed`/`item.restored`,另有 `digest.sent`),逾時 5 秒、1 秒後重試一次、不跟隨轉址 |
|
|
431
464
|
| `DRIFTNET_WEBHOOK_SECRET` | — | 為每次推送簽章:`X-Driftnet-Signature: sha256=<"<X-Driftnet-Timestamp>.<內容>" 的 hmac>`。拒收太舊的時間戳記即可防重送;重試時 `X-Driftnet-Delivery` 不變 |
|
|
432
465
|
| `DRIFTNET_WEBHOOK_ALLOW_LOCAL` | — | 設 `1` 允許 Webhook 打到內網位址(例如區網裡的 n8n),只限你填的那台主機 |
|
|
433
466
|
| `DRIFTNET_CATEGORIES` | 內建 | 起始資料夾的 JSON 檔:`{ "id": "說明" }`,只在新資料庫用一次,之後直接在網頁上改 |
|
|
434
467
|
| `GITHUB_TOKEN` | — | GitHub API 上限從每小時 60 次提高到 5,000 次 |
|
|
435
468
|
| `DRIFTNET_SUMMARY_RULES` | — | 每次摘要都要遵守的自訂規則,例如「說明是否免費」;agent 也會收到 |
|
|
436
469
|
| `DRIFTNET_BLOCK_DOMAINS` | — | 永遠不收錄的網域(含子網域),用逗號分隔 |
|
|
470
|
+
| `DRIFTNET_HEALTH` | `off` | `weekly` 約每週重新檢查連結,並標記失效、封存、久未更新的卡片(見「連結健康檢查」)。預設關閉:會對外發送請求 |
|
|
437
471
|
| `DRIFTNET_PLUGINS` | `~/.driftnet/plugins` | 擷取器外掛(`.js`/`.mjs`)的資料夾,範例見 [`examples/plugins`](https://github.com/KevinChu1110/driftnet/blob/main/examples/plugins) |
|
|
438
472
|
| `DRIFTNET_TOKEN` | — | 管理密碼:寫入、改設定、管理 agent 金鑰、完整的 MCP 工具、agent 佇列。可以在網頁上設定 |
|
|
439
473
|
| `DRIFTNET_READ_KEY` | — | 唯讀分享碼(放 header 或 `?key=`):只能讀,MCP 也只有讀取類工具 |
|
|
@@ -457,9 +491,9 @@ agent 寫回來的內容跟其他不可信的輸入一樣要檢查:格式、
|
|
|
457
491
|
|
|
458
492
|
**HTTP:** `GET /` · `GET /api/items[/:id]`(`?view=favorites|trash`)· `POST /api/items/:id/feedback` ·
|
|
459
493
|
`POST /api/items/:id/{trash,restore,favorite,unfavorite,move}` · `GET|POST /api/folders` · `PATCH|DELETE /api/folders/:id` · `POST /api/ingest` ·
|
|
460
|
-
`POST /api/chat` · `POST /api/pending` · `POST /api/items/:id/enrich` · `GET /api/stats` ·
|
|
461
|
-
`PUT /api/items/:id/note` · `GET|POST /api/notes` · `PUT|DELETE /api/notes/:id` · `GET /api/export`(`?format=vault`)·
|
|
462
|
-
`GET|PUT /api/settings`(限本機,或帶 token)· `GET|POST /api/agent-tokens` · `DELETE /api/agent-tokens/:id[?purge=1]`(撤銷,或移除已撤銷的;限管理密碼)· `GET /api/categories` · `POST /api/items/:id/refresh` · `POST /api/folders/template` · `GET /llms.txt` · `GET /feed.xml` · `GET /openapi.json` · `/mcp`
|
|
494
|
+
`POST /api/chat` · `POST /api/digest/send`(`{"dryRun": true}` 只顯示內容)· `POST /api/pending` · `POST /api/items/:id/enrich` · `GET /api/stats` ·
|
|
495
|
+
`PUT /api/items/:id/note` · `GET|POST /api/notes` · `PUT|DELETE /api/notes/:id` · `GET /api/export`(`?format=vault`)· `POST /api/import` · `GET /api/import/:job` ·
|
|
496
|
+
`GET|PUT /api/settings`(限本機,或帶 token)· `GET|POST /api/agent-tokens` · `DELETE /api/agent-tokens/:id[?purge=1]`(撤銷,或移除已撤銷的;限管理密碼)· `GET /api/categories` · `POST /api/items/:id/refresh` · `POST /api/items/:id/health` · `POST /api/folders/template` · `GET /llms.txt` · `GET /feed.xml` · `GET /openapi.json` · `/mcp`
|
|
463
497
|
|
|
464
498
|
</details>
|
|
465
499
|
|