From 9dbc2f21177f82fb488fd433abd9f7760610c52e Mon Sep 17 00:00:00 2001 From: Gregor Noczinski Date: Mon, 26 Aug 2024 19:02:50 +0200 Subject: [PATCH] Improve version handling --- .github/workflows/ci.yml | 2 +- cmd/bifroest/run.go | 9 ++++++--- pkg/service/service.go | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1180ed..8bf4a0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,4 +97,4 @@ jobs: with: retention-days: 1 name: dist - path: dist + path: var/dist diff --git a/cmd/bifroest/run.go b/cmd/bifroest/run.go index 9d06ce3..50d93c5 100644 --- a/cmd/bifroest/run.go +++ b/cmd/bifroest/run.go @@ -2,12 +2,14 @@ package main import ( "context" - "github.com/alecthomas/kingpin" - log "github.com/echocat/slf4g" - "github.com/engity-com/bifroest/pkg/service" "os" "os/signal" "syscall" + + "github.com/alecthomas/kingpin" + log "github.com/echocat/slf4g" + + "github.com/engity-com/bifroest/pkg/service" ) var _ = registerCommand(func(app *kingpin.Application) { @@ -25,6 +27,7 @@ var _ = registerCommand(func(app *kingpin.Application) { func doRun() error { svc := service.Service{ Configuration: *configurationRef.Get(), + Version: versionV, } fail := func(err error) error { diff --git a/pkg/service/service.go b/pkg/service/service.go index 4d71a0b..254c6db 100644 --- a/pkg/service/service.go +++ b/pkg/service/service.go @@ -33,6 +33,7 @@ var ( type Service struct { Configuration configuration.Configuration + Version common.Version Logger log.Logger } @@ -269,7 +270,7 @@ func (this *service) isRelevantError(err error) bool { func (this *service) createNewServerConfig(ssh.Context) *gssh.ServerConfig { return &gssh.ServerConfig{ - ServerVersion: "SSH-2.0-Engity-Bifroest_0.1.0", + ServerVersion: "SSH-2.0-Engity-Bifroest_" + this.Version.Version(), MaxAuthTries: int(this.Configuration.Ssh.MaxAuthTries), } }