finish setup insert method, refactor sql migration file

This commit is contained in:
lbenedar
2026-04-17 17:33:21 +03:00
parent 1b7c7e9ae3
commit 21abe68858
47 changed files with 2054 additions and 1056 deletions

View File

@@ -32,45 +32,49 @@ type SetupOptions struct {
HotReload bool `json:"hotReload"`
Language string `json:"language"`
LocalHostname string `json:"localHostname"`
Port int `json:"port"`
ProxySSL bool `json:"proxySSL"`
Telemetry bool `json:"telemetry"`
UpdateChannel string `json:"updateChannel"`
Upnp bool `json:"upnp"`
DeleteNEDB bool `json:"deleteNEDB"`
NoBackups bool `json:"noBackups"`
// PasswordSalt any `json:"passwordSalt"`
Port int `json:"port"`
// Protocol any `json:"protocol"`
// ProxyPort any `json:"proxyPort"`
ProxySSL bool `json:"proxySSL"`
// RoutePrefix any `json:"routePrefix"`
// SslCert any `json:"sslCert"`
// SslKey any `json:"sslKey"`
Telemetry bool `json:"telemetry"`
UpdateChannel string `json:"updateChannel"`
Upnp bool `json:"upnp"`
// UpnpLeaseDuration any `json:"upnpLeaseDuration"`
// World any `json:"world"`
DeleteNEDB bool `json:"deleteNEDB"`
// AdminPassword string `json:"adminPassword"`
NoBackups bool `json:"noBackups"`
}
func (s *SetupOptions) ToDB(dest *db.SetupOptions) bool {
func (s *SetupOptions) ToDB(dest **db.SetupOptions) bool {
if dest == nil {
return false
}
dest.CompressSocket = s.CompressSocket
dest.CompressStatic = s.CompressStatic
dest.CSSTheme = s.CSSTheme
dest.DataPath = s.DataPath
dest.Fullscreen = s.Fullscreen
dest.Hostname = s.Hostname
dest.HotReload = s.HotReload
dest.Language = s.Language
dest.LocalHostname = s.LocalHostname
dest.Port = s.Port
dest.ProxySSL = s.ProxySSL
dest.Telemetry = s.Telemetry
dest.UpdateChannel = s.UpdateChannel
dest.Upnp = s.Upnp
dest.DeleteNEDB = s.DeleteNEDB
dest.NoBackups = s.NoBackups
options := &db.SetupOptions{
CompressSocket: s.CompressSocket,
CompressStatic: s.CompressStatic,
CSSTheme: s.CSSTheme,
DataPath: s.DataPath,
Fullscreen: s.Fullscreen,
Hostname: s.Hostname,
HotReload: s.HotReload,
Language: s.Language,
LocalHostname: s.LocalHostname,
Port: s.Port,
ProxySSL: s.ProxySSL,
Telemetry: s.Telemetry,
UpdateChannel: s.UpdateChannel,
Upnp: s.Upnp,
DeleteNEDB: s.DeleteNEDB,
NoBackups: s.NoBackups,
}
*dest = options
return true
}