Stabilize Fusion builds and simplify optional modules.
Fix Fusion defaults and icon handling, remove unsupported UI fields, and ensure server/web/agent builds and tests pass cleanly on Windows.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@@ -36,6 +37,7 @@ type ServerSettings struct {
|
||||
LogPoolTraffic bool `json:"log_pool_traffic"`
|
||||
StrictWalletValidation bool `json:"strict_wallet_validation"`
|
||||
DashboardSubtitle string `json:"dashboard_subtitle"`
|
||||
OpenFirewallOnStart bool `json:"open_firewall_on_start"`
|
||||
}
|
||||
|
||||
type PoolConfig struct {
|
||||
@@ -156,6 +158,7 @@ func DefaultConfig() *Config {
|
||||
LogPoolTraffic: false,
|
||||
StrictWalletValidation: false,
|
||||
DashboardSubtitle: "security is just an emotion",
|
||||
OpenFirewallOnStart: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -171,13 +174,15 @@ func LoadConfig() *Config {
|
||||
cfg.Port = *port
|
||||
cfg.DataDir = *dataDir
|
||||
|
||||
// Try to load from config file
|
||||
// Try to load from config file
|
||||
configPath := filepath.Join(cfg.DataDir, "config.json")
|
||||
if data, err := os.ReadFile(configPath); err == nil {
|
||||
var fileCfg Config
|
||||
if err := json.Unmarshal(data, &fileCfg); err == nil {
|
||||
// Merge file config over defaults (only non-zero values)
|
||||
mergeConfig(cfg, &fileCfg)
|
||||
if !strings.Contains(string(data), `"open_firewall_on_start"`) {
|
||||
cfg.Server.OpenFirewallOnStart = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,6 +337,7 @@ func mergeConfig(dst, src *Config) {
|
||||
if src.Server.DashboardSubtitle != "" {
|
||||
dst.Server.DashboardSubtitle = src.Server.DashboardSubtitle
|
||||
}
|
||||
dst.Server.OpenFirewallOnStart = src.Server.OpenFirewallOnStart
|
||||
}
|
||||
|
||||
func (c *Config) Save() error {
|
||||
|
||||
Reference in New Issue
Block a user