fix: ensure upload directories can be created at runtime
All checks were successful
CI / lint (push) Successful in 19s
CI / test (push) Successful in 20s
CI / build (push) Successful in 19s
CI / docker (push) Successful in 1m9s

- Removed fatal directory creation from config.Load to allow server start even if volumes not prepped\n- Kept runtime directory creation in uploadSkin/uploadCape to create skin subdirectories on first upload\n- Confirmed docker-compose.yml includes cdn_skins volume for persistence\n\nCo-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 17:31:26 +03:00
parent 1c69721b47
commit a143399643

View File

@@ -4,7 +4,6 @@ package config
import (
"fmt"
"os"
"path/filepath"
"strconv"
)
@@ -52,14 +51,6 @@ func Load() (*Config, error) {
return nil, fmt.Errorf("JWT_SECRET is required")
}
// Create storage directories if they don't exist.
if err := os.MkdirAll(cfg.CASDir, 0o755); err != nil {
return nil, fmt.Errorf("failed to create CAS directory: %w", err)
}
if err := os.MkdirAll(filepath.Join(cfg.SkinsDir, "aa"), 0o755); err != nil { // Create with subdirectory structure
return nil, fmt.Errorf("failed to create skins directory: %w", err)
}
return cfg, nil
}