Revert "Add missing admin action files and navigation links"
This reverts commit 41be6835bf.
This commit is contained in:
1 parent
4a1e1115b3
commit
4d515bc400
338 files changed
+5949
-28144
No files matched your search
@@ -41,7 +41,9 @@ async function getApplied(): Promise<Set<string>> {
|
||||
const mysql = await import("mysql2/promise");
|
||||
const conn = await mysql.createConnection(url);
|
||||
try {
|
||||
const [rows] = await conn.execute(`SELECT migration FROM \`${TRACKING_TABLE}\` ORDER BY id`);
|
||||
const [rows] = await conn.execute(
|
||||
`SELECT migration FROM \`${TRACKING_TABLE}\` ORDER BY id`,
|
||||
);
|
||||
return new Set((rows as { migration: string }[]).map((r) => r.migration));
|
||||
} catch {
|
||||
return new Set();
|
||||
@@ -77,7 +79,10 @@ async function apply(migration: MigrationFile): Promise<void> {
|
||||
await conn.execute(stmt);
|
||||
}
|
||||
|
||||
await conn.execute(`INSERT INTO \`${TRACKING_TABLE}\` (migration) VALUES (?)`, [migration.id]);
|
||||
await conn.execute(
|
||||
`INSERT INTO \`${TRACKING_TABLE}\` (migration) VALUES (?)`,
|
||||
[migration.id],
|
||||
);
|
||||
console.log(`[migrate] Applied: ${migration.name}`);
|
||||
} finally {
|
||||
await conn.end();
|
||||
|
||||
@@ -29,9 +29,7 @@ function decryptCbc(payload: string, key: Buffer, serialize = true): string {
|
||||
value: string;
|
||||
mac: string;
|
||||
};
|
||||
const expected = createHmac("sha256", key)
|
||||
.update(json.iv + json.value)
|
||||
.digest("hex");
|
||||
const expected = createHmac("sha256", key).update(json.iv + json.value).digest("hex");
|
||||
const a = Buffer.from(expected, "hex");
|
||||
const b = Buffer.from(json.mac, "hex");
|
||||
if (a.length !== b.length || !timingSafeEqual(a, b)) {
|
||||
@@ -61,8 +59,8 @@ function isAlreadyGcm(payload: string, key: Buffer): boolean {
|
||||
try {
|
||||
const json = JSON.parse(Buffer.from(payload, "base64").toString("utf8"));
|
||||
if (!json.tag && !json.mac) return false; // can't determine format
|
||||
if (json.tag) return true; // has authTag => GCM
|
||||
return false; // has mac => CBC
|
||||
if (json.tag) return true; // has authTag => GCM
|
||||
return false; // has mac => CBC
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user