diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts index bee8c8b0cd..b496a0c7c4 100644 --- a/packages/backend/src/boot/master.ts +++ b/packages/backend/src/boot/master.ts @@ -1,6 +1,6 @@ import * as fs from "node:fs"; -import { fileURLToPath } from "node:url"; -import { dirname } from "node:path"; +import {fileURLToPath} from "node:url"; +import {dirname} from "node:path"; import * as os from "node:os"; import cluster from "node:cluster"; import chalk from "chalk"; @@ -9,28 +9,26 @@ import semver from "semver"; import Logger from "@/services/logger.js"; import loadConfig from "@/config/load.js"; -import type { Config } from "@/config/types.js"; -import { lessThan } from "@/prelude/array.js"; -import { envOption } from "../env.js"; -import { showMachineInfo } from "@/misc/show-machine-info.js"; -import { db, initDb } from "../db/postgre.js"; +import type {Config} from "@/config/types.js"; +import {envOption} from "../env.js"; +import {showMachineInfo} from "@/misc/show-machine-info.js"; +import {db, initDb} from "../db/postgre.js"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); -const meta = JSON.parse( - fs.readFileSync(`${_dirname}/../../../../built/meta.json`, "utf-8"), -); - const logger = new Logger("core", "cyan"); const bootLogger = logger.createSubLogger("boot", "magenta", false); const themeColor = chalk.hex("#31748f"); function greet() { + const meta = JSON.parse( + fs.readFileSync(`${_dirname}/../../../../package.json`, "utf-8"), + ); + if (!envOption.quiet) { //#region Calckey logo - const v = `v${meta.version}`; console.log(themeColor(" ___ _ _ ")); console.log(themeColor(" / __\\__ _| | ___| | _____ _ _ ")); console.log(themeColor(" / / / _` | |/ __| |/ / _ | | |")); diff --git a/packages/backend/src/config/load.ts b/packages/backend/src/config/load.ts index 9b8ee5edbb..77e1ea8d7f 100644 --- a/packages/backend/src/config/load.ts +++ b/packages/backend/src/config/load.ts @@ -3,10 +3,10 @@ */ import * as fs from "node:fs"; -import { fileURLToPath } from "node:url"; -import { dirname } from "node:path"; +import {fileURLToPath} from "node:url"; +import {dirname} from "node:path"; import * as yaml from "js-yaml"; -import type { Source, Mixin } from "./types.js"; +import type {Mixin, Source} from "./types.js"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); @@ -24,14 +24,9 @@ const path = export default function load() { const meta = JSON.parse( - fs.readFileSync(`${_dirname}/../../../../built/meta.json`, "utf-8"), - ); - const clientManifest = JSON.parse( - fs.readFileSync( - `${_dirname}/../../../../built/_client_dist_/manifest.json`, - "utf-8", - ), + fs.readFileSync(`${_dirname}/../../../../package.json`, "utf-8"), ); + const config = yaml.load(fs.readFileSync(path, "utf-8")) as Source; const mixin = {} as Mixin; @@ -52,7 +47,6 @@ export default function load() { mixin.authUrl = `${mixin.scheme}://${mixin.host}/auth`; mixin.driveUrl = `${mixin.scheme}://${mixin.host}/files`; mixin.userAgent = `Calckey/${meta.version} (${config.url})`; - mixin.clientEntry = clientManifest["src/init.ts"]; if (!config.redis.prefix) config.redis.prefix = mixin.host; diff --git a/packages/backend/src/config/types.ts b/packages/backend/src/config/types.ts index 54332c9932..38ca0a8f82 100644 --- a/packages/backend/src/config/types.ts +++ b/packages/backend/src/config/types.ts @@ -145,7 +145,6 @@ export type Mixin = { authUrl: string; driveUrl: string; userAgent: string; - clientEntry: string; }; export type Config = Source & Mixin;