root: start deduplicating code

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-06-16 12:35:17 +02:00
parent e154e28611
commit 6dc38b0132
8 changed files with 30 additions and 43 deletions

View File

@ -1,3 +1,20 @@
package constants
import (
"fmt"
"os"
)
const VERSION = "2021.6.1-rc6"
func BUILD() string {
build := os.Getenv("GIT_BUILD_HASH")
if build == "" {
return "tagged"
}
return build
}
func OutpostUserAgent() string {
return fmt.Sprintf("authentik-outpost@%s (%s)", VERSION, BUILD())
}