summaryrefslogtreecommitdiffstats
path: root/src/models
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-07-29 01:03:24 +0200
committersalmonik <salmonik@tuta.io>2026-07-29 01:03:24 +0200
commit74d2ada067bd2fd9436710ab7ac260e0eddf1314 (patch)
tree1f791bb895a611d8e729a735ba098a647808a157 /src/models
parentcreate example config on startup (diff)
downloadminecraft-ui-74d2ada067bd2fd9436710ab7ac260e0eddf1314.tar.gz
minecraft-ui-74d2ada067bd2fd9436710ab7ac260e0eddf1314.zip
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 <body> (was corrupting multipart uploads)
Diffstat (limited to 'src/models')
-rw-r--r--src/models/mod.rs14
1 files changed, 14 insertions, 0 deletions
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
@@ -9,6 +9,19 @@ pub struct Account {
9} 9}
10 10
11#[derive(Debug, Clone, Serialize, Deserialize)] 11#[derive(Debug, Clone, Serialize, Deserialize)]
12#[allow(dead_code)]
13pub struct Mod {
14 pub id: i64,
15 pub instance_id: i64,
16 pub filename: String,
17 pub display_name: Option<String>,
18 pub side: String,
19 pub accepted: bool,
20 pub rejection_reason: Option<String>,
21 pub created_at: String,
22}
23
24#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct Instance { 25pub struct Instance {
13 pub id: i64, 26 pub id: i64,
14 pub name: String, 27 pub name: String,
@@ -23,6 +36,7 @@ pub struct Instance {
23 pub gamemode: i32, 36 pub gamemode: i32,
24 pub max_players: i32, 37 pub max_players: i32,
25 pub pvp: bool, 38 pub pvp: bool,
39 pub whitelist_enabled: bool,
26 pub motd: String, 40 pub motd: String,
27 pub rcon_password: String, 41 pub rcon_password: String,
28 pub is_active: bool, 42 pub is_active: bool,