refactor(global): move config to global package and consolidate handlers
- Move Config struct and related functions to global package - Consolidate handler utilities into utils package - Remove deprecated handlers and instance packages - Add new handlers package with settings and proxy functionality - Update config.json to include watchdog enabled flag
This commit is contained in:
@@ -13,6 +13,14 @@ type SoftwareInfo struct {
|
||||
BuildType string
|
||||
}
|
||||
|
||||
var Software = SoftwareInfo{
|
||||
Name: "Super-frpc",
|
||||
Version: "0.0.1",
|
||||
Developer: "Madobi Nanami",
|
||||
BuildVer: 1,
|
||||
BuildType: "debug",
|
||||
}
|
||||
|
||||
type StatusFlags struct {
|
||||
Debug bool
|
||||
Online bool
|
||||
@@ -25,16 +33,35 @@ var (
|
||||
LogsDB *sql.DB
|
||||
)
|
||||
|
||||
var Software = SoftwareInfo{
|
||||
Name: "Super-frpc",
|
||||
Version: "0.0.1",
|
||||
Developer: "Madobi Nanami",
|
||||
BuildVer: 1,
|
||||
BuildType: "debug",
|
||||
}
|
||||
|
||||
var Is = StatusFlags{
|
||||
Debug: false,
|
||||
Online: false,
|
||||
WatchdogConnected: false,
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
ListenAddr string `json:"listenAddr"`
|
||||
ListenPort string `json:"listenPort"`
|
||||
FrpcPath string `json:"frpcPath"`
|
||||
InstancePath string `json:"instancePath"`
|
||||
Debug bool `json:"debug"`
|
||||
Watchdog struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
Port int `json:"port"`
|
||||
} `json:"watchdog"`
|
||||
}
|
||||
|
||||
var CurrentConfig = Config{
|
||||
ListenAddr: "0.0.0.0",
|
||||
ListenPort: "7000",
|
||||
FrpcPath: "/usr/bin/frpc",
|
||||
InstancePath: "/var/lib/frpc",
|
||||
Debug: false,
|
||||
Watchdog: struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
Port int `json:"port"`
|
||||
}{
|
||||
Enabled: false,
|
||||
Port: 0,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user