diff --git a/cmds/hub/main.go b/cmds/hub/main.go index ee369b77..58f587e4 100644 --- a/cmds/hub/main.go +++ b/cmds/hub/main.go @@ -79,6 +79,21 @@ func initializeGlobals(cmd *cobra.Command, args []string) { log.SetLogLevel(log.WarningLevel) _ = log.Start(log.InfoLevel.String(), true, "") + // Configure SPN binary updates. + configure.DefaultBinaryIndexName = "SPN Binaries" + configure.DefaultStableBinaryIndexURLs = []string{ + "https://updates.safing.io/spn-stable.v3.json", + } + configure.DefaultBetaBinaryIndexURLs = []string{ + "https://updates.safing.io/spn-beta.v3.json", + } + configure.DefaultStagingBinaryIndexURLs = []string{ + "https://updates.safing.io/spn-staging.v3.json", + } + configure.DefaultSupportBinaryIndexURLs = []string{ + "https://updates.safing.io/spn-support.v3.json", + } + // Configure service. cmdbase.SvcFactory = func(svcCfg *service.ServiceConfig) (cmdbase.ServiceInstance, error) { svc, err := spn.New(svcCfg) @@ -93,7 +108,7 @@ func initializeGlobals(cmd *cobra.Command, args []string) { LogDir: logDir, LogLevel: logLevel, - BinariesIndexURLs: configure.DefaultSpnStableBinaryIndexURLs, + BinariesIndexURLs: configure.DefaultStableBinaryIndexURLs, IntelIndexURLs: configure.DefaultIntelIndexURLs, VerifyBinaryUpdates: configure.BinarySigningTrustStore, } diff --git a/service/configure/updates.go b/service/configure/updates.go index a84042c6..d3eb20e0 100644 --- a/service/configure/updates.go +++ b/service/configure/updates.go @@ -11,9 +11,6 @@ var ( DefaultStableBinaryIndexURLs = []string{ "https://updates.safing.io/stable.v3.json", } - DefaultSpnStableBinaryIndexURLs = []string{ - "https://updates.safing.io/spn-stable.v3.json", - } DefaultBetaBinaryIndexURLs = []string{ "https://updates.safing.io/beta.v3.json", } diff --git a/service/updates/index.go b/service/updates/index.go index 13285f9d..63546012 100644 --- a/service/updates/index.go +++ b/service/updates/index.go @@ -241,7 +241,10 @@ func (index *Index) ShouldUpgradeTo(newIndex *Index) error { return nil case index.Name != newIndex.Name: - return errors.New("new index name does not match") + return fmt.Errorf( + "new index name (%q) does not match current index name (%q)", + newIndex.Name, index.Name, + ) case index.isLocallyGenerated: if newIndex.versionNum.GreaterThan(index.versionNum) { diff --git a/service/updates/module.go b/service/updates/module.go index 024496c8..03ba6cb8 100644 --- a/service/updates/module.go +++ b/service/updates/module.go @@ -18,7 +18,6 @@ import ( "github.com/safing/portmaster/base/log" "github.com/safing/portmaster/base/notifications" "github.com/safing/portmaster/base/utils" - "github.com/safing/portmaster/service/configure" "github.com/safing/portmaster/service/mgr" "github.com/safing/portmaster/service/ui" ) @@ -203,7 +202,7 @@ func New(instance instance, name string, cfg Config) (*Updater, error) { module.corruptedInstallation = fmt.Errorf("invalid index: %w", err) } index, err = GenerateIndexFromDir(cfg.Directory, IndexScanConfig{ - Name: configure.DefaultBinaryIndexName, + Name: cfg.Name, Version: info.VersionNumber(), }) if err == nil && index.init(currentPlatform) == nil {