qq-bot-roost 1.0.12 → 1.0.13
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 +3 -3
- package/package.json +3 -3
- package/src/config.js +777 -765
- package/src/gitee.js +5 -4
- package/src/main.js +3 -0
- package/src/mirror.js +8 -2
- package/src/plugin/market.js +41 -3
- package/src/proxy.js +675 -0
- package/src/services/config-watch.js +2 -0
- package/src/tarball.js +3 -2
- package/src/updater.js +2 -1
- package/src/web/server.js +3741 -3651
- package/web/app.js +4934 -4742
- package/web/index.html +1337 -1318
package/src/tarball.js
CHANGED
|
@@ -22,6 +22,7 @@ import path from 'node:path';
|
|
|
22
22
|
import zlib from 'node:zlib';
|
|
23
23
|
import crypto from 'node:crypto';
|
|
24
24
|
import { createLogger } from './logger.js';
|
|
25
|
+
import { netFetch } from './proxy.js';
|
|
25
26
|
|
|
26
27
|
const log = createLogger('tarball');
|
|
27
28
|
|
|
@@ -161,8 +162,8 @@ export async function extractEntries(entries, destDir) {
|
|
|
161
162
|
*/
|
|
162
163
|
export async function fetchAndExtract(url, destDir, opts = {}) {
|
|
163
164
|
const { timeoutMs = 120000, retries = 1, onRetry, fetcher, expectSha256 = null } = opts;
|
|
164
|
-
//
|
|
165
|
-
const doFetch = fetcher ??
|
|
165
|
+
// 默认 netFetch(带代理支持);插件市场和框架更新会传一个带镜像兜底的实现
|
|
166
|
+
const doFetch = fetcher ?? netFetch;
|
|
166
167
|
|
|
167
168
|
let res = null;
|
|
168
169
|
let lastErr = null;
|
package/src/updater.js
CHANGED
|
@@ -18,6 +18,7 @@ import { compareVersion } from './semver.js';
|
|
|
18
18
|
import path from 'node:path';
|
|
19
19
|
import { createLogger } from './logger.js';
|
|
20
20
|
import { fetchAndExtract } from './tarball.js';
|
|
21
|
+
import { netFetch } from './proxy.js';
|
|
21
22
|
import { fetchViaMirror, currentMirror } from './mirror.js';
|
|
22
23
|
import { fetchGiteeTree, detectGiteeRef, giteeRawUrl } from './gitee.js';
|
|
23
24
|
import { hashDir } from './hashdir.js';
|
|
@@ -304,7 +305,7 @@ async function fetchLatestTagViaApi() {
|
|
|
304
305
|
*/
|
|
305
306
|
async function checkViaGitee(cur) {
|
|
306
307
|
const ref = await detectGiteeRef(REPO);
|
|
307
|
-
const res = await
|
|
308
|
+
const res = await netFetch(giteeRawUrl(REPO, ref, 'package.json'), {
|
|
308
309
|
headers: { 'User-Agent': 'qq-bot-roost-updater' },
|
|
309
310
|
signal: AbortSignal.timeout(10000),
|
|
310
311
|
});
|