mirror of
https://github.com/fosrl/newt.git
synced 2026-10-26 13:39:05 +01:00
Support importing into the cli
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/fosrl/newt/internal/telemetry"
|
||||
"github.com/fosrl/newt/logger"
|
||||
newtpkg "github.com/fosrl/newt/newt"
|
||||
"github.com/fosrl/newt/newtconfig"
|
||||
"github.com/fosrl/newt/updates"
|
||||
"github.com/fosrl/newt/websocket"
|
||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||
@@ -62,7 +63,14 @@ func main() {
|
||||
func runNewtMain(ctx context.Context) {
|
||||
logger.Init(nil)
|
||||
|
||||
cfg := loadNewtConfig()
|
||||
cfg, err := newtconfig.Load(newtconfig.Options{
|
||||
Args: os.Args[1:],
|
||||
Version: newtVersion,
|
||||
Platform: newtPlatform,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Fatal("Configuration error: %v", err)
|
||||
}
|
||||
|
||||
if cfg.UseNativeMainInterface {
|
||||
if err := permissions.CheckNativeInterfacePermissions(); err != nil {
|
||||
@@ -70,10 +78,6 @@ func runNewtMain(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
if err := validateTLSConfig(cfg); err != nil {
|
||||
logger.Fatal("TLS configuration error: %v", err)
|
||||
}
|
||||
|
||||
logger.Debug("Endpoint: %v", cfg.Endpoint)
|
||||
logger.Debug("Log Level: %v", cfg.LogLevel)
|
||||
logger.Debug("Docker Network Validation Enabled: %v", cfg.DockerEnforceNetworkValidation)
|
||||
|
||||
Reference in New Issue
Block a user