chore: ⬆️ up deps (properly)
This commit is contained in:
parent
a75a19cd17
commit
2fb65cdd86
5 changed files with 668 additions and 686 deletions
11
package.json
11
package.json
|
@ -38,18 +38,17 @@
|
||||||
"chokidar": "^3.3.1"
|
"chokidar": "^3.3.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@bull-board/api": "5.7.2",
|
"@bull-board/api": "5.8.0",
|
||||||
"@bull-board/ui": "5.7.2",
|
"@bull-board/ui": "5.8.0",
|
||||||
"@napi-rs/cli": "^2.16.2",
|
"@napi-rs/cli": "^2.16.2",
|
||||||
"@tensorflow/tfjs": "^3.21.0",
|
"@tensorflow/tfjs": "^4.10.0",
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
"seedrandom": "^3.0.5"
|
"seedrandom": "^3.0.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/gulp": "4.0.13",
|
"@types/gulp": "4.0.13",
|
||||||
"@types/gulp-rename": "2.0.2",
|
"@types/gulp-rename": "2.0.2",
|
||||||
"@types/node": "20.4.9",
|
"@types/node": "20.5.8",
|
||||||
"chalk": "4.1.2",
|
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"cypress": "10.11.0",
|
"cypress": "10.11.0",
|
||||||
"execa": "5.1.1",
|
"execa": "5.1.1",
|
||||||
|
@ -61,6 +60,6 @@
|
||||||
"install-peers": "^1.0.4",
|
"install-peers": "^1.0.4",
|
||||||
"rome": "^12.1.3",
|
"rome": "^12.1.3",
|
||||||
"start-server-and-test": "1.15.2",
|
"start-server-and-test": "1.15.2",
|
||||||
"typescript": "5.1.6"
|
"typescript": "5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,9 @@
|
||||||
"@tensorflow/tfjs-node": "3.21.1"
|
"@tensorflow/tfjs-node": "3.21.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@bull-board/api": "5.7.2",
|
"@bull-board/api": "5.8.0",
|
||||||
"@bull-board/koa": "5.7.2",
|
"@bull-board/koa": "5.8.0",
|
||||||
"@bull-board/ui": "5.7.2",
|
"@bull-board/ui": "5.8.0",
|
||||||
"@discordapp/twemoji": "14.1.2",
|
"@discordapp/twemoji": "14.1.2",
|
||||||
"@elastic/elasticsearch": "7.17.0",
|
"@elastic/elasticsearch": "7.17.0",
|
||||||
"@koa/cors": "3.4.3",
|
"@koa/cors": "3.4.3",
|
||||||
|
@ -41,17 +41,16 @@
|
||||||
"@tensorflow/tfjs": "^4.2.0",
|
"@tensorflow/tfjs": "^4.2.0",
|
||||||
"adm-zip": "^0.5.10",
|
"adm-zip": "^0.5.10",
|
||||||
"ajv": "8.12.0",
|
"ajv": "8.12.0",
|
||||||
"archiver": "5.3.1",
|
"archiver": "6.0.0",
|
||||||
"argon2": "^0.30.3",
|
"argon2": "^0.31.1",
|
||||||
"autolinker": "4.0.0",
|
"autolinker": "4.0.0",
|
||||||
"autwh": "0.1.0",
|
"autwh": "0.1.0",
|
||||||
"aws-sdk": "2.1413.0",
|
"aws-sdk": "2.1413.0",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"blurhash": "2.0.5",
|
"blurhash": "2.0.5",
|
||||||
"bull": "4.11.2",
|
"bull": "4.11.3",
|
||||||
"cacheable-lookup": "TheEssem/cacheable-lookup",
|
"cacheable-lookup": "TheEssem/cacheable-lookup",
|
||||||
"cbor": "8.1.0",
|
|
||||||
"chalk": "5.3.0",
|
"chalk": "5.3.0",
|
||||||
"chalk-template": "0.4.0",
|
"chalk-template": "0.4.0",
|
||||||
"chokidar": "^3.5.3",
|
"chokidar": "^3.5.3",
|
||||||
|
@ -63,19 +62,19 @@
|
||||||
"deep-email-validator": "0.1.21",
|
"deep-email-validator": "0.1.21",
|
||||||
"escape-regexp": "0.0.1",
|
"escape-regexp": "0.0.1",
|
||||||
"feed": "4.2.2",
|
"feed": "4.2.2",
|
||||||
"file-type": "17.1.6",
|
"file-type": "18.5.0",
|
||||||
"firefish-js": "workspace:*",
|
"firefish-js": "workspace:*",
|
||||||
"fluent-ffmpeg": "2.1.2",
|
"fluent-ffmpeg": "2.1.2",
|
||||||
"got": "12.5.3",
|
"got": "13.0.0",
|
||||||
"gunzip-maybe": "^1.4.2",
|
"gunzip-maybe": "^1.4.2",
|
||||||
"hpagent": "0.1.2",
|
"hpagent": "1.2.0",
|
||||||
"ioredis": "5.3.2",
|
"ioredis": "5.3.2",
|
||||||
"ip-cidr": "3.1.0",
|
"ip-cidr": "3.1.0",
|
||||||
"is-svg": "4.3.2",
|
"is-svg": "5.0.0",
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
"jsdom": "20.0.3",
|
"jsdom": "22.1.0",
|
||||||
"json5": "2.2.3",
|
"json5": "2.2.3",
|
||||||
"jsonld": "8.2.0",
|
"jsonld": "8.2.1",
|
||||||
"jsrsasign": "10.8.6",
|
"jsrsasign": "10.8.6",
|
||||||
"koa": "2.14.2",
|
"koa": "2.14.2",
|
||||||
"koa-body": "^6.0.1",
|
"koa-body": "^6.0.1",
|
||||||
|
@ -89,10 +88,10 @@
|
||||||
"koa-slow": "2.1.0",
|
"koa-slow": "2.1.0",
|
||||||
"koa-views": "7.0.2",
|
"koa-views": "7.0.2",
|
||||||
"megalodon": "workspace:*",
|
"megalodon": "workspace:*",
|
||||||
"meilisearch": "0.33.0",
|
"meilisearch": "0.34.1",
|
||||||
"mfm-js": "0.23.3",
|
"mfm-js": "0.23.3",
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
"msgpackr": "1.9.6",
|
"msgpackr": "1.9.7",
|
||||||
"multer": "1.4.4-lts.1",
|
"multer": "1.4.4-lts.1",
|
||||||
"native-utils": "link:native-utils",
|
"native-utils": "link:native-utils",
|
||||||
"nested-property": "4.0.0",
|
"nested-property": "4.0.0",
|
||||||
|
@ -104,19 +103,18 @@
|
||||||
"os-utils": "0.0.14",
|
"os-utils": "0.0.14",
|
||||||
"otpauth": "^9.1.4",
|
"otpauth": "^9.1.4",
|
||||||
"parse5": "7.1.2",
|
"parse5": "7.1.2",
|
||||||
"pg": "8.11.2",
|
"pg": "8.11.3",
|
||||||
"private-ip": "2.3.4",
|
"private-ip": "3.0.1",
|
||||||
"probe-image-size": "7.2.3",
|
"probe-image-size": "7.2.3",
|
||||||
"promise-limit": "2.7.0",
|
"promise-limit": "2.7.0",
|
||||||
"punycode": "2.3.0",
|
"punycode": "2.3.0",
|
||||||
"pureimage": "0.3.15",
|
"pureimage": "0.4.8",
|
||||||
"qrcode": "1.5.3",
|
"qrcode": "1.5.3",
|
||||||
"qs": "6.11.2",
|
"qs": "6.11.2",
|
||||||
"random-seed": "0.3.0",
|
"random-seed": "0.3.0",
|
||||||
"ratelimiter": "3.4.1",
|
"ratelimiter": "3.4.1",
|
||||||
"re2": "1.20.1",
|
"re2": "1.20.3",
|
||||||
"redis-lock": "0.1.4",
|
"redis-semaphore": "5.5.0",
|
||||||
"redis-semaphore": "5.4.0",
|
|
||||||
"reflect-metadata": "0.1.13",
|
"reflect-metadata": "0.1.13",
|
||||||
"rename": "1.0.4",
|
"rename": "1.0.4",
|
||||||
"rndstr": "1.0.0",
|
"rndstr": "1.0.0",
|
||||||
|
@ -124,12 +122,12 @@
|
||||||
"sanitize-html": "2.11.0",
|
"sanitize-html": "2.11.0",
|
||||||
"seedrandom": "^3.0.5",
|
"seedrandom": "^3.0.5",
|
||||||
"semver": "7.5.4",
|
"semver": "7.5.4",
|
||||||
"sharp": "0.32.4",
|
"sharp": "0.32.5",
|
||||||
"sonic-channel": "^1.3.1",
|
"sonic-channel": "^1.3.1",
|
||||||
"stringz": "2.1.0",
|
"stringz": "2.1.0",
|
||||||
"summaly": "2.7.0",
|
"summaly": "2.7.0",
|
||||||
"syslog-pro": "1.0.0",
|
"syslog-pro": "1.0.0",
|
||||||
"systeminformation": "5.18.13",
|
"systeminformation": "5.21.3",
|
||||||
"tar-stream": "^3.1.6",
|
"tar-stream": "^3.1.6",
|
||||||
"tesseract.js": "^4.1.1",
|
"tesseract.js": "^4.1.1",
|
||||||
"tinycolor2": "1.6.0",
|
"tinycolor2": "1.6.0",
|
||||||
|
@ -138,7 +136,7 @@
|
||||||
"typeorm": "0.3.17",
|
"typeorm": "0.3.17",
|
||||||
"ulid": "2.3.0",
|
"ulid": "2.3.0",
|
||||||
"uuid": "9.0.0",
|
"uuid": "9.0.0",
|
||||||
"web-push": "3.6.4",
|
"web-push": "3.6.5",
|
||||||
"websocket": "1.0.34",
|
"websocket": "1.0.34",
|
||||||
"xev": "3.0.2"
|
"xev": "3.0.2"
|
||||||
},
|
},
|
||||||
|
@ -147,7 +145,6 @@
|
||||||
"@swc/core": "^1.3.75",
|
"@swc/core": "^1.3.75",
|
||||||
"@types/adm-zip": "^0.5.0",
|
"@types/adm-zip": "^0.5.0",
|
||||||
"@types/bcryptjs": "2.4.2",
|
"@types/bcryptjs": "2.4.2",
|
||||||
"@types/cbor": "6.0.0",
|
|
||||||
"@types/escape-regexp": "0.0.1",
|
"@types/escape-regexp": "0.0.1",
|
||||||
"@types/fluent-ffmpeg": "2.1.21",
|
"@types/fluent-ffmpeg": "2.1.21",
|
||||||
"@types/js-yaml": "4.0.5",
|
"@types/js-yaml": "4.0.5",
|
||||||
|
|
|
@ -1,33 +1,40 @@
|
||||||
import { redisClient } from "../db/redis.js";
|
import { redisClient } from "../db/redis.js";
|
||||||
import { promisify } from "node:util";
|
import { Mutex } from "redis-semaphore";
|
||||||
import redisLock from "redis-lock";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retry delay (ms) for lock acquisition
|
* Retry delay (ms) for lock acquisition
|
||||||
*/
|
*/
|
||||||
const retryDelay = 100;
|
const retryDelay = 100;
|
||||||
|
|
||||||
const lock: (key: string, timeout?: number) => Promise<() => void> = redisClient
|
|
||||||
? promisify(redisLock(redisClient, retryDelay))
|
|
||||||
: async () => () => {};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get AP Object lock
|
* Get AP Object lock
|
||||||
* @param uri AP object ID
|
* @param uri AP object ID
|
||||||
* @param timeout Lock timeout (ms), The timeout releases previous lock.
|
* @param timeout Lock timeout (ms), The timeout releases previous lock.
|
||||||
* @returns Unlock function
|
* @returns Unlock function
|
||||||
*/
|
*/
|
||||||
export function getApLock(uri: string, timeout = 30 * 1000) {
|
export async function getApLock(uri: string, timeout = 30 * 1000) {
|
||||||
return lock(`ap-object:${uri}`, timeout);
|
const lock = new Mutex(redisClient, `ap-object:${uri}`, {
|
||||||
|
lockTimeout: timeout,
|
||||||
|
retryInterval: retryDelay,
|
||||||
|
});
|
||||||
|
await lock.acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getFetchInstanceMetadataLock(
|
export async function getFetchInstanceMetadataLock(
|
||||||
host: string,
|
host: string,
|
||||||
timeout = 30 * 1000,
|
timeout = 30 * 1000,
|
||||||
) {
|
) {
|
||||||
return lock(`instance:${host}`, timeout);
|
const lock = new Mutex(redisClient, `instance:${host}`, {
|
||||||
|
lockTimeout: timeout,
|
||||||
|
retryInterval: retryDelay,
|
||||||
|
});
|
||||||
|
await lock.acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getChartInsertLock(lockKey: string, timeout = 30 * 1000) {
|
export async function getChartInsertLock(lockKey: string, timeout = 30 * 1000) {
|
||||||
return lock(`chart-insert:${lockKey}`, timeout);
|
const lock = new Mutex(redisClient, `chart-insert:${lockKey}`, {
|
||||||
|
lockTimeout: timeout,
|
||||||
|
retryInterval: retryDelay,
|
||||||
|
});
|
||||||
|
await lock.acquire();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { promisify } from "node:util";
|
import { decode } from "msgpackr";
|
||||||
import * as cbor from "cbor";
|
|
||||||
import define from "../../../define.js";
|
import define from "../../../define.js";
|
||||||
import {
|
import {
|
||||||
UserProfiles,
|
UserProfiles,
|
||||||
|
@ -12,7 +11,6 @@ import { procedures, hash } from "../../../2fa.js";
|
||||||
import { publishMainStream } from "@/services/stream.js";
|
import { publishMainStream } from "@/services/stream.js";
|
||||||
import { comparePassword } from "@/misc/password.js";
|
import { comparePassword } from "@/misc/password.js";
|
||||||
|
|
||||||
const cborDecodeFirst = promisify(cbor.decodeFirst) as any;
|
|
||||||
const rpIdHashReal = hash(Buffer.from(config.hostname, "utf-8"));
|
const rpIdHashReal = hash(Buffer.from(config.hostname, "utf-8"));
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
|
@ -64,7 +62,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
|
|
||||||
const clientDataJSONHash = hash(Buffer.from(ps.clientDataJSON, "utf-8"));
|
const clientDataJSONHash = hash(Buffer.from(ps.clientDataJSON, "utf-8"));
|
||||||
|
|
||||||
const attestation = await cborDecodeFirst(ps.attestationObject);
|
const attestation = decode(Buffer.from(ps.attestationObject, "utf-8"));
|
||||||
|
|
||||||
const rpIdHash = attestation.authData.slice(0, 32);
|
const rpIdHash = attestation.authData.slice(0, 32);
|
||||||
if (!rpIdHashReal.equals(rpIdHash)) {
|
if (!rpIdHashReal.equals(rpIdHash)) {
|
||||||
|
@ -81,7 +79,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
const credentialIdLength = authData.readUInt16BE(53);
|
const credentialIdLength = authData.readUInt16BE(53);
|
||||||
const credentialId = authData.slice(55, 55 + credentialIdLength);
|
const credentialId = authData.slice(55, 55 + credentialIdLength);
|
||||||
const publicKeyData = authData.slice(55 + credentialIdLength);
|
const publicKeyData = authData.slice(55 + credentialIdLength);
|
||||||
const publicKey: Map<number, any> = await cborDecodeFirst(publicKeyData);
|
const publicKey: Map<number, any> = decode(publicKeyData);
|
||||||
if (publicKey.get(3) !== -7) {
|
if (publicKey.get(3) !== -7) {
|
||||||
throw new Error("alg mismatch");
|
throw new Error("alg mismatch");
|
||||||
}
|
}
|
||||||
|
|
1257
pnpm-lock.yaml
1257
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue