pixivflow 2.32.0 → 2.33.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 CHANGED
@@ -4,10 +4,7 @@
4
4
 
5
5
  **Pixiv 下载、筛选与自动收集工具。**
6
6
 
7
- 可以直接下载单个 Pixiv 作品(插画、小说、动图),也可以按标签、热度、日期和收藏数
8
- 批量筛选,并通过 scheduler 定时自动收集。结果既能永久保存在本地,也能按需通过 HTTP
9
- 可靠交付给其他服务——下游是可选的,PixivFlow 自己就能跑完「发现 → 筛选 → 下载 → 保存」
10
- 的完整链路。
7
+ 可以直接下载单个 Pixiv 作品(插画、小说、动图),也可以按标签、热度、日期和收藏数等条件批量筛选,并通过 scheduler 定时自动收集。结果既能永久保存在本地,也能按需通过 HTTP 可靠交付给其他服务——下游是可选的,PixivFlow 自己就能跑完「发现 → 筛选 → 下载 → 保存」的完整链路。
11
8
 
12
9
  [![Version](https://img.shields.io/npm/v/pixivflow?style=flat-square)](https://www.npmjs.com/package/pixivflow)
13
10
  [![Node](https://img.shields.io/badge/Node.js-22.13%2B_LTS-green.svg?style=flat-square&logo=node.js)](https://nodejs.org/)
@@ -191,33 +188,34 @@ Email、Telegram、Discord、ntfy 等渠道;PixivFlow 不实现这些通知协
191
188
  热重载。完整双 Bot 缓存投递模板见
192
189
  [`config/fly-two-bots.example.json`](config/fly-two-bots.example.json)。
193
190
 
194
- ### 投递事务发件箱
191
+ ### 投递事务发件箱(Outbox)
195
192
 
196
- 投递是**事务发件箱(SQLite outbox)**式的,at-least-once 执行、effectively-once
197
- 可见效果:每个外部副作用(一次内容投递、一条通知)在 `outbox` 表落一行,带幂等键和
198
- 行级租约,独立 worker 立即泵送、指数退避重试(默认 5 分钟起步、最长 6 小时),超过
199
- `maxAttempts` 进 dead 状态并在投递账记 `failed`。进程崩溃 / 机器挂起后重启,残留的
200
- `processing` 租约过期即被新进程接管,重试同一个幂等意图——下游按
201
- `idempotent_replay`(同键,ACK 丢失重试)或 `duplicate_existing`(历史重复)收敛,
202
- 频道里仍然只有一条消息。旧版文件型 `delivery-outbox/*.json` 清单在启动时自动一次性
203
- 迁移进 SQLite,迁移幂等。「今天没有可投稿内容」这类通知与内容投递走同一张表、独立泵送,
204
- 审核端暂时挂掉不会互相阻塞。
193
+ 投递和通知都先写入 SQLite 发件箱(outbox),再由后台 worker 泵送:对外副作用
194
+ (一次内容投递、一条通知)在 `outbox` 表各占一行,带幂等键和行级租约,保证
195
+ 至少一次执行、最终只产生一次可见效果。
205
196
 
206
- 配置 `readinessUrl` 后,worker 每次认领都先检查依赖 `/ready`。非 2xx 只把 row 放回 pending,
207
- 不增加 attempt;这与 `/live` 的“进程还活着”语义严格分开。dead letter 通过正式 CLI 恢复:
197
+ - 失败会自动重试:指数退避(默认 5 分钟起步、最长 6 小时)。
198
+ - 超过 `maxAttempts` 进入 `dead` 状态,可用 `pixivflow outbox` 查看和重试。
199
+ - 进程崩溃/重启后,残留的 `processing` 租约过期后会被新进程接管,重复发送同一个
200
+ 幂等意图;下游按幂等键收敛,不会在频道里出现重复消息。
201
+ - 旧的文件型 `delivery-outbox/*.json` 会在启动时自动一次性迁移进 SQLite(迁移幂等)。
202
+ - 「今天没有可投稿内容」这类通知与内容投递走同一张表、独立泵送,互不阻塞。
203
+
204
+ 配置 `readinessUrl` 后,worker 每次认领都会先检查依赖 `/ready`;非 2xx 只把 row
205
+ 放回 pending,不增加 attempt。dead letter 通过正式 CLI 管理:
208
206
 
209
207
  ```bash
210
208
  pixivflow outbox list --status dead
211
209
  pixivflow outbox inspect <id>
212
- pixivflow outbox retry <id> # 只接受 dead row,保留 idempotency key
210
+ pixivflow outbox retry <id> # 只重试 dead row,保留幂等键
213
211
  pixivflow outbox retry --dead
214
212
  pixivflow outbox cancel <id> # 只取消尚未执行的 row
215
213
  ```
216
214
 
217
- `run-once` 会重新执行下载计划,不等价于 outbox replay;不要手改 SQLite 的
218
- `next_attempt_at`。长期运行环境的体检与收敛用 `pixivflow doctor`(卡住的 slot/outbox
219
- 租约、pending 投递、dead 行,`--repair` 收敛)与 `pixivflow reconcile`(把下游已确认的
220
- 历史重复登记进投递账本,默认 dry-run)。
215
+ `run-once` 会重新执行下载计划,不等价于 outbox replay,不要手动改 SQLite 的
216
+ `next_attempt_at`。长期体检与收敛用 `pixivflow doctor`(卡住的 slot/outbox
217
+ 租约、pending 投递、dead 行,`--repair` 收敛)与 `pixivflow reconcile`
218
+ (把下游已确认的历史重复登记进投递账本,默认 dry-run)。
221
219
 
222
220
  ## 常用命令
223
221
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "type": "commonjs",
3
3
  "name": "pixivflow",
4
- "version": "2.32.0",
4
+ "version": "2.33.0",
5
5
  "private": true
6
6
  }
package/dist/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BUILD = void 0;
4
4
  // GENERATED by scripts/write-version.js — do not edit manually.
5
- exports.BUILD = { version: '2.32.0', commit: 'db267d3a1a13' };
5
+ exports.BUILD = { version: '2.33.0', commit: 'ceb9c345fa1b' };
6
6
  //# sourceMappingURL=version.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "type": "commonjs",
3
3
  "name": "pixivflow-webui-backend",
4
- "version": "2.32.0",
4
+ "version": "2.33.0",
5
5
  "description": "PixivFlow WebUI Backend - CommonJS module"
6
6
  }
@@ -94,6 +94,20 @@ class WebUIServer {
94
94
  else {
95
95
  logger_1.logger.warn('WebUI authentication is DISABLED (set WEBUI_USERNAME and WEBUI_PASSWORD to enable basic auth)');
96
96
  }
97
+ // Fail closed for accidental public exposure: a non-loopback bind without
98
+ // credentials would expose config secrets, downloaded files and arbitrary
99
+ // download/exec controls to anyone. Local bind (localhost/127.0.0.1/::1)
100
+ // remains credential-free. Operators who *really* want a public
101
+ // unauthenticated server must opt in explicitly.
102
+ const hostIsLoopback = (h) => h === 'localhost' ||
103
+ h === '127.0.0.1' ||
104
+ h === '::1' ||
105
+ h.startsWith('127.');
106
+ if (!this.basicAuthEnabled && !hostIsLoopback(this.host) && process.env.WEBUI_ALLOW_PUBLIC_NO_AUTH !== 'true') {
107
+ throw new Error(`Refusing to bind WebUI to non-loopback host "${this.host}" without authentication. ` +
108
+ `Set WEBUI_USERNAME and WEBUI_PASSWORD (recommended), or set ` +
109
+ `WEBUI_ALLOW_PUBLIC_NO_AUTH=true only if you fully understand the risk.`);
110
+ }
97
111
  // Setup API routes
98
112
  (0, server_routes_1.setupRoutes)(this.app);
99
113
  // Setup static file serving
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixivflow",
3
- "version": "2.32.0",
3
+ "version": "2.33.0",
4
4
  "description": "🎨 Pixiv 下载、筛选与自动收集工具 - 批量下载插画和小说、按标签/热度/日期筛选、定时任务与可靠 HTTP 交付 | Pixiv downloader and automation toolkit with filtering, scheduling and reliable HTTP delivery",
5
5
  "repository": {
6
6
  "type": "git",