Fix SPN intel updates

This commit is contained in:
Daniel
2025-04-15 11:26:59 +02:00
parent 846646c7e9
commit 9801aae3e7
4 changed files with 21 additions and 7 deletions

View File

@@ -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,
}

View File

@@ -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",
}

View File

@@ -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) {

View File

@@ -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 {