mirror of https://github.com/jetkvm/kvm.git
clean up comments and add default API URL
This commit is contained in:
parent
1d7f8ddc29
commit
1abf1f03b7
|
|
@ -10,5 +10,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"git.ignoreLimitWarning": true,
|
"git.ignoreLimitWarning": true,
|
||||||
"cmake.sourceDirectory": "internal/native/cgo"
|
"cmake.sourceDirectory": "/workspaces/kvm-static-ip/internal/native/cgo",
|
||||||
|
"cmake.ignoreCMakeListsMissing": true
|
||||||
}
|
}
|
||||||
10
config.go
10
config.go
|
|
@ -16,6 +16,10 @@ import (
|
||||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
DefaultAPIURL = "https://api.jetkvm.com"
|
||||||
|
)
|
||||||
|
|
||||||
type WakeOnLanDevice struct {
|
type WakeOnLanDevice struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
MacAddress string `json:"macAddress"`
|
MacAddress string `json:"macAddress"`
|
||||||
|
|
@ -114,7 +118,7 @@ type Config struct {
|
||||||
// GetUpdateAPIURL returns the update API URL
|
// GetUpdateAPIURL returns the update API URL
|
||||||
func (c *Config) GetUpdateAPIURL() string {
|
func (c *Config) GetUpdateAPIURL() string {
|
||||||
if c.UpdateAPIURL == "" {
|
if c.UpdateAPIURL == "" {
|
||||||
return "https://api.jetkvm.com"
|
return DefaultAPIURL
|
||||||
}
|
}
|
||||||
return strings.TrimSuffix(c.UpdateAPIURL, "/") + "/releases"
|
return strings.TrimSuffix(c.UpdateAPIURL, "/") + "/releases"
|
||||||
}
|
}
|
||||||
|
|
@ -168,8 +172,8 @@ var (
|
||||||
|
|
||||||
func getDefaultConfig() Config {
|
func getDefaultConfig() Config {
|
||||||
return Config{
|
return Config{
|
||||||
CloudURL: "https://api.jetkvm.com",
|
CloudURL: DefaultAPIURL,
|
||||||
UpdateAPIURL: "https://api.jetkvm.com",
|
UpdateAPIURL: DefaultAPIURL,
|
||||||
CloudAppURL: "https://app.jetkvm.com",
|
CloudAppURL: "https://app.jetkvm.com",
|
||||||
AutoUpdateEnabled: true, // Set a default value
|
AutoUpdateEnabled: true, // Set a default value
|
||||||
ActiveExtension: "",
|
ActiveExtension: "",
|
||||||
|
|
|
||||||
2
main.go
2
main.go
|
|
@ -50,8 +50,8 @@ func Main() {
|
||||||
|
|
||||||
initOta()
|
initOta()
|
||||||
|
|
||||||
initDisplay()
|
|
||||||
initNative(systemVersionLocal, appVersionLocal)
|
initNative(systemVersionLocal, appVersionLocal)
|
||||||
|
initDisplay()
|
||||||
|
|
||||||
http.DefaultClient.Timeout = 1 * time.Minute
|
http.DefaultClient.Timeout = 1 * time.Minute
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -280,4 +280,4 @@ PION_LOG_TRACE=${LOG_TRACE_SCOPES} ./jetkvm_app_debug | tee -a /tmp/jetkvm_app_d
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Deployment complete."
|
echo "Deployment complete."
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue