internal: make internal go version match python version
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
6338785ce1
commit
819af78e2b
|
@ -5,16 +5,24 @@ import (
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BUILD() string {
|
func BUILD(def string) string {
|
||||||
build := os.Getenv("GIT_BUILD_HASH")
|
build := os.Getenv("GIT_BUILD_HASH")
|
||||||
if build == "" {
|
if build == "" {
|
||||||
return "tagged"
|
return def
|
||||||
}
|
}
|
||||||
return build
|
return build
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FullVersion() string {
|
||||||
|
ver := VERSION
|
||||||
|
if b := BUILD(""); b != "" {
|
||||||
|
ver = fmt.Sprintf("%s.%s", ver, b)
|
||||||
|
}
|
||||||
|
return ver
|
||||||
|
}
|
||||||
|
|
||||||
func OutpostUserAgent() string {
|
func OutpostUserAgent() string {
|
||||||
return fmt.Sprintf("authentik-outpost@%s (build=%s)", VERSION, BUILD())
|
return fmt.Sprintf("authentik-outpost@%s", FullVersion())
|
||||||
}
|
}
|
||||||
|
|
||||||
const VERSION = "2021.12.5"
|
const VERSION = "2021.12.5"
|
||||||
|
|
|
@ -171,7 +171,7 @@ func (a *APIController) StartBackgorundTasks() error {
|
||||||
"outpost_type": a.Server.Type(),
|
"outpost_type": a.Server.Type(),
|
||||||
"uuid": a.instanceUUID.String(),
|
"uuid": a.instanceUUID.String(),
|
||||||
"version": constants.VERSION,
|
"version": constants.VERSION,
|
||||||
"build": constants.BUILD(),
|
"build": constants.BUILD("tagged"),
|
||||||
}).Set(1)
|
}).Set(1)
|
||||||
go func() {
|
go func() {
|
||||||
a.logger.Debug("Starting WS Handler...")
|
a.logger.Debug("Starting WS Handler...")
|
||||||
|
|
|
@ -51,7 +51,7 @@ func (ac *APIController) initWS(akURL url.URL, outpostUUID string) error {
|
||||||
Instruction: WebsocketInstructionHello,
|
Instruction: WebsocketInstructionHello,
|
||||||
Args: map[string]interface{}{
|
Args: map[string]interface{}{
|
||||||
"version": constants.VERSION,
|
"version": constants.VERSION,
|
||||||
"buildHash": constants.BUILD(),
|
"buildHash": constants.BUILD("tagged"),
|
||||||
"uuid": ac.instanceUUID.String(),
|
"uuid": ac.instanceUUID.String(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ func (ac *APIController) startWSHandler() {
|
||||||
"outpost_type": ac.Server.Type(),
|
"outpost_type": ac.Server.Type(),
|
||||||
"uuid": ac.instanceUUID.String(),
|
"uuid": ac.instanceUUID.String(),
|
||||||
"version": constants.VERSION,
|
"version": constants.VERSION,
|
||||||
"build": constants.BUILD(),
|
"build": constants.BUILD("tagged"),
|
||||||
}).SetToCurrentTime()
|
}).SetToCurrentTime()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ func (ac *APIController) startWSHealth() {
|
||||||
Instruction: WebsocketInstructionHello,
|
Instruction: WebsocketInstructionHello,
|
||||||
Args: map[string]interface{}{
|
Args: map[string]interface{}{
|
||||||
"version": constants.VERSION,
|
"version": constants.VERSION,
|
||||||
"buildHash": constants.BUILD(),
|
"buildHash": constants.BUILD("tagged"),
|
||||||
"uuid": ac.instanceUUID.String(),
|
"uuid": ac.instanceUUID.String(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ func (ac *APIController) startIntervalUpdater() {
|
||||||
"outpost_type": ac.Server.Type(),
|
"outpost_type": ac.Server.Type(),
|
||||||
"uuid": ac.instanceUUID.String(),
|
"uuid": ac.instanceUUID.String(),
|
||||||
"version": constants.VERSION,
|
"version": constants.VERSION,
|
||||||
"build": constants.BUILD(),
|
"build": constants.BUILD("tagged"),
|
||||||
}).SetToCurrentTime()
|
}).SetToCurrentTime()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ func doGlobalSetup(outpost api.Outpost, globalConfig api.Config) {
|
||||||
} else {
|
} else {
|
||||||
l.Debug("Managed outpost, not setting global log level")
|
l.Debug("Managed outpost, not setting global log level")
|
||||||
}
|
}
|
||||||
l.WithField("hash", constants.BUILD()).WithField("version", constants.VERSION).Info("Starting authentik outpost")
|
l.WithField("hash", constants.BUILD("tagged")).WithField("version", constants.VERSION).Info("Starting authentik outpost")
|
||||||
|
|
||||||
if globalConfig.ErrorReporting.Enabled {
|
if globalConfig.ErrorReporting.Enabled {
|
||||||
dsn := "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8"
|
dsn := "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8"
|
||||||
|
|
|
@ -124,7 +124,7 @@ func (pi *ProviderInstance) GetBaseEntry() *ldap.Entry {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "vendorVersion",
|
Name: "vendorVersion",
|
||||||
Values: []string{fmt.Sprintf("authentik LDAP Outpost Version %s (build %s)", constants.VERSION, constants.BUILD())},
|
Values: []string{fmt.Sprintf("authentik LDAP Outpost Version %s", constants.FullVersion())},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ func (ds *DirectSearcher) SearchBase(req *search.Request, authz bool) (ldap.Serv
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "vendorVersion",
|
Name: "vendorVersion",
|
||||||
Values: []string{fmt.Sprintf("authentik LDAP Outpost Version %s (build %s)", constants.VERSION, constants.BUILD())},
|
Values: []string{fmt.Sprintf("authentik LDAP Outpost Version %s", constants.FullVersion())},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,7 +42,7 @@ Besides these user-specific headers, some application specific headers are also
|
||||||
|
|
||||||
The authentik application's slug.
|
The authentik application's slug.
|
||||||
|
|
||||||
- X-authentik-meta-version: `authentik-outpost@1.2.3 (build=tagged)`
|
- X-authentik-meta-version: `authentik-outpost@1.2.3`
|
||||||
|
|
||||||
The authentik outpost's version.
|
The authentik outpost's version.
|
||||||
|
|
||||||
|
|
Reference in New Issue