mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix(plugin): 🐛 Fix misleading error message related to plugin initialization
This commit is contained in:
parent
11bb0a6f49
commit
3b704b4c8c
3 changed files with 65 additions and 33 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { getLogger } from "@logtape/logtape";
|
||||
import chalk from "chalk";
|
||||
import { User } from "~/classes/database/user";
|
||||
import type { Config } from "~/packages/config-manager";
|
||||
|
||||
export const checkConfig = async (config: Config) => {
|
||||
|
|
@ -68,8 +69,15 @@ const checkFederationConfig = async (config: Config) => {
|
|||
const logger = getLogger("server");
|
||||
|
||||
if (!(config.instance.keys.public && config.instance.keys.private)) {
|
||||
logger.fatal`The federation keys are not set in the config at instance.keys.public and instance.keys.private`;
|
||||
logger.fatal`You can generate a keypair using the CLI command ${chalk.bold("generate-keys")}`;
|
||||
logger.fatal`The federation keys are not set in the config`;
|
||||
logger.fatal`Below are generated keys for you to copy in the config at instance.keys.public and instance.keys.private`;
|
||||
|
||||
// Generate a key for them
|
||||
const { public_key, private_key } = await User.generateKeys();
|
||||
|
||||
logger.fatal`Generated public key: ${chalk.gray(public_key)}`;
|
||||
logger.fatal`Generated private key: ${chalk.gray(private_key)}`;
|
||||
|
||||
// Hang until Ctrl+C is pressed
|
||||
await Bun.sleep(Number.POSITIVE_INFINITY);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue