summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gitlab-sshd/main.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmd/gitlab-sshd/main.go b/cmd/gitlab-sshd/main.go
index 443c142..04d6888 100644
--- a/cmd/gitlab-sshd/main.go
+++ b/cmd/gitlab-sshd/main.go
@@ -9,10 +9,16 @@ import (
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/logger"
"gitlab.com/gitlab-org/gitlab-shell/internal/sshd"
+ "gitlab.com/gitlab-org/labkit/monitoring"
)
var (
configDir = flag.String("config-dir", "", "The directory the config is in")
+
+ // BuildTime signifies the time the binary was build.
+ BuildTime = "2021-02-16T09:28:07+01:00" // Set at build time in the Makefile
+ // Version is the current version of GitLab Shell sshd.
+ Version = "(unknown version)" // Set at build time in the Makefile
)
func overrideConfigFromEnvironment(cfg *config.Config) {
@@ -50,6 +56,18 @@ func main() {
}
logger.ConfigureStandalone(cfg)
+ // Startup monitoring endpoint.
+ if cfg.Server.WebListen != "" {
+ go func() {
+ log.Fatal(
+ monitoring.Start(
+ monitoring.WithListenerAddress(cfg.Server.WebListen),
+ monitoring.WithBuildInformation(Version, BuildTime),
+ ),
+ )
+ }()
+ }
+
if err := sshd.Run(cfg); err != nil {
log.Fatalf("Failed to start GitLab built-in sshd: %v", err)
}