mirror of
https://github.com/YuzuZensai/Minikura.git
synced 2026-09-13 10:49:21 +00:00
♻️ refactor: remove stale code and comments
This commit is contained in:
@@ -7,7 +7,6 @@ datasource db {
|
||||
provider = "postgresql"
|
||||
}
|
||||
|
||||
// Better Auth Models
|
||||
model User {
|
||||
id String @id
|
||||
name String
|
||||
@@ -68,7 +67,6 @@ model Verification {
|
||||
@@map("verification")
|
||||
}
|
||||
|
||||
// Application Models
|
||||
enum ServerType {
|
||||
STATEFUL
|
||||
STATELESS
|
||||
@@ -141,16 +139,13 @@ model Server {
|
||||
env_variables CustomEnvironmentVariable[] @relation("ServerEnvVars")
|
||||
api_key String @unique
|
||||
|
||||
// Minecraft specific configurations
|
||||
jar_type MinecraftServerJarType @default(VANILLA)
|
||||
minecraft_version String @default("LATEST") // e.g., "LATEST", "1.20.4", "SNAPSHOT"
|
||||
|
||||
// JVM Options
|
||||
jvm_opts String? // Custom JVM options
|
||||
use_aikar_flags Boolean @default(false)
|
||||
use_meowice_flags Boolean @default(false)
|
||||
|
||||
// Server Properties (common ones)
|
||||
difficulty ServerDifficulty @default(EASY)
|
||||
game_mode GameMode @default(SURVIVAL)
|
||||
max_players Int @default(20)
|
||||
|
||||
@@ -10,7 +10,6 @@ export const NAMESPACE = process.env.KUBERNETES_NAMESPACE || "minikura";
|
||||
|
||||
export const ENABLE_CRD_REFLECTION = process.env.ENABLE_CRD_REFLECTION === "true";
|
||||
|
||||
// Resource types
|
||||
export const RESOURCE_TYPES = {
|
||||
MINECRAFT_SERVER: {
|
||||
kind: "MinecraftServer",
|
||||
@@ -26,8 +25,7 @@ export const RESOURCE_TYPES = {
|
||||
},
|
||||
};
|
||||
|
||||
// Polling intervals (in milliseconds)
|
||||
export const SYNC_INTERVAL = 30 * 1000; // 30 seconds
|
||||
export const SYNC_INTERVAL = 30 * 1000;
|
||||
|
||||
export const IMAGES = {
|
||||
MINECRAFT: "itzg/minecraft-server",
|
||||
|
||||
@@ -9,7 +9,6 @@ export const RESOURCE_DEFAULTS = {
|
||||
},
|
||||
} as const;
|
||||
|
||||
// 80% of container memory goes to JVM heap; 20% headroom
|
||||
export const JAVA_MEMORY_FACTOR = 0.8;
|
||||
|
||||
export const DEFAULT_SERVER_MEMORY = "1G";
|
||||
|
||||
@@ -4,7 +4,6 @@ import type {
|
||||
Server as PrismaServer,
|
||||
} from "@minikura/db";
|
||||
|
||||
// Base interface
|
||||
export interface CustomResource {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
@@ -45,8 +44,6 @@ export interface MinecraftServerCRD extends CustomResource {
|
||||
status?: MinecraftServerStatus;
|
||||
}
|
||||
|
||||
// Reverse Proxy Types
|
||||
|
||||
export type ReverseProxyConfig = Pick<
|
||||
PrismaReverseProxyServer,
|
||||
| "id"
|
||||
|
||||
@@ -7,8 +7,6 @@ export function getErrorMessage(error: unknown): string {
|
||||
}
|
||||
return String(error);
|
||||
}
|
||||
|
||||
/** Returns age string like "3d", "12h", "5m" */
|
||||
export function getAge(timestamp: Date | string | undefined): string {
|
||||
if (!timestamp) return "unknown";
|
||||
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import pino from "pino";
|
||||
|
||||
export function createLogger(component: string): pino.Logger;
|
||||
export function createLogger(context: Record<string, string | number>): pino.Logger;
|
||||
export function createLogger(
|
||||
context: Record<string, string | number>,
|
||||
): pino.Logger;
|
||||
export function createLogger(
|
||||
componentOrContext: string | Record<string, string | number>,
|
||||
componentOrContext: string | Record<string, string | number>
|
||||
): pino.Logger {
|
||||
const isString = typeof componentOrContext === "string";
|
||||
const baseContext = isString
|
||||
? { component: componentOrContext }
|
||||
: componentOrContext;
|
||||
const baseContext = isString ? { component: componentOrContext } : componentOrContext;
|
||||
|
||||
return pino({
|
||||
level: process.env.LOG_LEVEL || "info",
|
||||
|
||||
Reference in New Issue
Block a user