2025-01-01 22:03:59 +00:00
|
|
|
import { readFileSync } from "fs";
|
|
|
|
const config = JSON.parse(readFileSync("./config.json").toString());
|
|
|
|
|
|
|
|
export default abstract class Config {
|
|
|
|
public static ports:IPorts = config.ports;
|
|
|
|
public static database:IDatabase = config.database;
|
|
|
|
public static session:ISession = config.session;
|
2025-01-03 03:11:00 +00:00
|
|
|
public static controllers:IControllers = config.controllers;
|
|
|
|
public static accounts:IAccounts = config.accounts;
|
2025-01-01 22:03:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface IPorts {
|
|
|
|
web: number
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IDatabase {
|
|
|
|
address: string,
|
|
|
|
port: number,
|
|
|
|
username: string,
|
|
|
|
password: string,
|
|
|
|
name: string
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ISession {
|
|
|
|
secret: string,
|
|
|
|
validity: number,
|
|
|
|
length: number
|
2025-01-03 03:11:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface IControllers {
|
|
|
|
enabled: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ISignup {
|
|
|
|
enabled: boolean,
|
|
|
|
key: string | null
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IPbkdf2 {
|
|
|
|
itterations: number,
|
|
|
|
keylength: number
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IAccounts {
|
|
|
|
signup: ISignup,
|
|
|
|
pbkdf2: IPbkdf2
|
2025-01-01 02:18:50 +00:00
|
|
|
}
|