Add CLI setup and QQ webhook integration

This commit is contained in:
zenord
2026-08-15 16:02:05 +08:00
parent 00325efb50
commit d79264b11a
22 changed files with 1389 additions and 99 deletions
+15
View File
@@ -0,0 +1,15 @@
import crypto from "node:crypto";
import type { AppConfig } from "../config.js";
import type { PromptSession } from "./prompt.js";
export async function configureGenericWebhook(
prompt: PromptSession,
existing: AppConfig["platforms"]["webhook"]
): Promise<AppConfig["platforms"]["webhook"]> {
console.log("\nGeneric webhook setup");
console.log("Use POST /webhook/generic with optional X-Gori-Signature HMAC-SHA256 authentication.");
const generated = existing.secret && existing.secret !== "replace-me" ? existing.secret : crypto.randomBytes(24).toString("hex");
const secret = await prompt.ask("Webhook secret", generated);
return { enabled: true, secret };
}