Auto updater APIs (#1523)
* APIs for querying and executing an update in place. For #924 * Use the process pid to query systemd for status * Use parent pid and invocation ID to guess if running from systemd * Stream cmd output to client + report errors * Update comment to refer to INVOCATION_ID
This commit is contained in:
@@ -34,6 +34,9 @@ var GitCommit = ""
|
||||
// BuildPlatform is the optional platform this release was built for.
|
||||
var BuildPlatform = "dev"
|
||||
|
||||
// EnableAutoUpdate will explicitly enable in-place auto-updates via the admin.
|
||||
var EnableAutoUpdate = false
|
||||
|
||||
// GetCommit will return an identifier used for identifying the point in time this build took place.
|
||||
func GetCommit() string {
|
||||
if GitCommit == "" {
|
||||
@@ -53,9 +56,9 @@ const MaxSocketPayloadSize = 2048
|
||||
|
||||
// GetReleaseString gets the version string.
|
||||
func GetReleaseString() string {
|
||||
var versionNumber = VersionNumber
|
||||
var buildPlatform = BuildPlatform
|
||||
var gitCommit = GetCommit()
|
||||
versionNumber := VersionNumber
|
||||
buildPlatform := BuildPlatform
|
||||
gitCommit := GetCommit()
|
||||
|
||||
return fmt.Sprintf("Owncast v%s-%s (%s)", versionNumber, buildPlatform, gitCommit)
|
||||
}
|
||||
|
||||
8
config/updaterConfig_enabled.go
Normal file
8
config/updaterConfig_enabled.go
Normal file
@@ -0,0 +1,8 @@
|
||||
//go:build enable_updates
|
||||
// +build enable_updates
|
||||
|
||||
package config
|
||||
|
||||
func init() {
|
||||
EnableAutoUpdate = true
|
||||
}
|
||||
Reference in New Issue
Block a user