From 74d2ada067bd2fd9436710ab7ac260e0eddf1314 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 29 Jul 2026 01:03:24 +0200 Subject: Add per-instance mod management with client-side detection - New mod validation engine (src/mods.rs) with constant-pool class-file scanning: detects server-side content (block, tileentity, command, worldgen) vs client-only API (gui, renderer, forge/client) - 7 client-only mods correctly detected (AppleSkin, CraftingTweaks, Durability101, EnchantmentDescriptions, InventoryHUD, MouseTweaks, TrashSlot); 51 server-capable; 1 unknown - Routes + templating for mod upload (jar/zip), listing, delete, rescan - Multipart upload with 500MB limit (bypasses axum's default 2MB) - Per-instance mod summary card on edit page - Whitelist toggle checkbox on edit page (persisted, drives ENABLE_WHITELIST) - Dynamic Java image tag (java8/java17/java21) based on MC version - Class scan is informational-only; rejection based on metadata side=CLIENT - has_modpack flag cleanup on mod delete - Remove hx-boost from (was corrupting multipart uploads) --- src/models/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/models') diff --git a/src/models/mod.rs b/src/models/mod.rs index 0b083ff..5cca3ff 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -8,6 +8,19 @@ pub struct Account { pub password_change_required: bool, } +#[derive(Debug, Clone, Serialize, Deserialize)] +#[allow(dead_code)] +pub struct Mod { + pub id: i64, + pub instance_id: i64, + pub filename: String, + pub display_name: Option, + pub side: String, + pub accepted: bool, + pub rejection_reason: Option, + pub created_at: String, +} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Instance { pub id: i64, @@ -23,6 +36,7 @@ pub struct Instance { pub gamemode: i32, pub max_players: i32, pub pvp: bool, + pub whitelist_enabled: bool, pub motd: String, pub rcon_password: String, pub is_active: bool, -- cgit v1.2.3