Add CLI setup and QQ webhook integration
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
Reference in New Issue
Block a user