mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
26 lines
567 B
Go
26 lines
567 B
Go
package updates
|
|
|
|
import (
|
|
"github.com/safing/portbase/api"
|
|
)
|
|
|
|
const (
|
|
apiPathCheckForUpdates = "updates/check"
|
|
)
|
|
|
|
func registerAPIEndpoints() error {
|
|
return api.RegisterEndpoint(api.Endpoint{
|
|
Path: apiPathCheckForUpdates,
|
|
Write: api.PermitUser,
|
|
BelongsTo: module,
|
|
ActionFunc: func(_ *api.Request) (msg string, err error) {
|
|
forceUpdate.Set()
|
|
if err := TriggerUpdate(); err != nil {
|
|
return "", err
|
|
}
|
|
return "triggered update check", nil
|
|
},
|
|
Name: "Check for Updates",
|
|
Description: "Triggers checking for updates.",
|
|
})
|
|
}
|