2024-04-18 23:18:49 +01:00
|
|
|
import { readFileSync } from "fs";
|
|
|
|
|
|
|
|
const config = JSON.parse(readFileSync("./config.json").toString());
|
|
|
|
|
2024-07-03 23:47:45 +01:00
|
|
|
export default abstract class Config {
|
2024-04-22 16:05:42 +01:00
|
|
|
public static ports:ConfigPorts = config.ports;
|
2024-04-23 00:58:07 +01:00
|
|
|
public static session:ConfigSession = config.session;
|
2024-04-26 10:21:27 +01:00
|
|
|
public static githost:string = config.githost;
|
2024-04-21 15:35:47 +01:00
|
|
|
public static database:ConfigDatabase = config.database;
|
|
|
|
}
|
|
|
|
|
2024-04-22 16:05:42 +01:00
|
|
|
interface ConfigPorts {
|
|
|
|
http: number,
|
2024-07-03 23:47:45 +01:00
|
|
|
ws: number,
|
|
|
|
metrics: number
|
2024-04-22 16:05:42 +01:00
|
|
|
}
|
|
|
|
|
2024-04-23 00:58:07 +01:00
|
|
|
interface ConfigSession {
|
|
|
|
validity: number,
|
|
|
|
length: number,
|
|
|
|
secret: string
|
|
|
|
}
|
|
|
|
|
2024-04-21 15:35:47 +01:00
|
|
|
interface ConfigDatabase {
|
|
|
|
address: string,
|
|
|
|
port: number,
|
|
|
|
username: string,
|
|
|
|
password: string,
|
2024-04-22 02:01:14 +01:00
|
|
|
name: string,
|
|
|
|
pbkdf2: DatabasePbkdf2
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DatabasePbkdf2 {
|
|
|
|
itterations: number,
|
|
|
|
keylength: number
|
2024-04-18 23:18:49 +01:00
|
|
|
}
|