diff --git a/accounts/pkg/command/server.go b/accounts/pkg/command/server.go index 906dd75b6..e94528702 100644 --- a/accounts/pkg/command/server.go +++ b/accounts/pkg/command/server.go @@ -13,6 +13,7 @@ import ( "github.com/owncloud/ocis/accounts/pkg/server/http" svc "github.com/owncloud/ocis/accounts/pkg/service/v0" "github.com/owncloud/ocis/accounts/pkg/tracing" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/urfave/cli/v2" ) @@ -41,7 +42,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - mtrcs.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + mtrcs.BuildInfo.WithLabelValues(version.String).Set(1) handler, err := svc.New(svc.Logger(logger), svc.Config(cfg)) if err != nil { diff --git a/accounts/pkg/config/service.go b/accounts/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/accounts/pkg/config/service.go +++ b/accounts/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/accounts/pkg/server/grpc/server.go b/accounts/pkg/server/grpc/server.go index d063eda47..8670c5a5c 100644 --- a/accounts/pkg/server/grpc/server.go +++ b/accounts/pkg/server/grpc/server.go @@ -3,6 +3,7 @@ package grpc import ( "github.com/owncloud/ocis/accounts/pkg/proto/v0" "github.com/owncloud/ocis/ocis-pkg/service/grpc" + "github.com/owncloud/ocis/ocis-pkg/version" ) // Server initializes a new go-micro service ready to run @@ -17,7 +18,7 @@ func Server(opts ...Option) grpc.Service { grpc.Namespace(options.Config.GRPC.Namespace), grpc.Logger(options.Logger), grpc.Flags(options.Flags...), - grpc.Version(options.Config.Service.Version), + grpc.Version(version.String), ) if err := proto.RegisterAccountsServiceHandler(service.Server(), handler); err != nil { diff --git a/accounts/pkg/server/http/server.go b/accounts/pkg/server/http/server.go index 306fa9347..4fb764fcb 100644 --- a/accounts/pkg/server/http/server.go +++ b/accounts/pkg/server/http/server.go @@ -21,7 +21,7 @@ func Server(opts ...Option) http.Service { service := http.NewService( http.Logger(options.Logger), http.Name(options.Name), - http.Version(options.Config.Service.Version), + http.Version(version.String), http.Address(options.Config.HTTP.Addr), http.Namespace(options.Config.HTTP.Namespace), http.Context(options.Context), diff --git a/glauth/pkg/command/server.go b/glauth/pkg/command/server.go index db5222db9..459d8a0eb 100644 --- a/glauth/pkg/command/server.go +++ b/glauth/pkg/command/server.go @@ -15,6 +15,7 @@ import ( "github.com/owncloud/ocis/glauth/pkg/tracing" pkgcrypto "github.com/owncloud/ocis/ocis-pkg/crypto" "github.com/owncloud/ocis/ocis-pkg/service/grpc" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/urfave/cli/v2" ) @@ -49,7 +50,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - metrics.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + metrics.BuildInfo.WithLabelValues(version.String).Set(1) { diff --git a/glauth/pkg/config/service.go b/glauth/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/glauth/pkg/config/service.go +++ b/glauth/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/graph-explorer/pkg/command/server.go b/graph-explorer/pkg/command/server.go index b16ec1150..7f753b3cc 100644 --- a/graph-explorer/pkg/command/server.go +++ b/graph-explorer/pkg/command/server.go @@ -11,6 +11,7 @@ import ( "github.com/owncloud/ocis/graph-explorer/pkg/server/debug" "github.com/owncloud/ocis/graph-explorer/pkg/server/http" "github.com/owncloud/ocis/graph-explorer/pkg/tracing" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/urfave/cli/v2" ) @@ -41,7 +42,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - mtrcs.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + mtrcs.BuildInfo.WithLabelValues(version.String).Set(1) { server, err := http.Server( diff --git a/graph-explorer/pkg/config/service.go b/graph-explorer/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/graph-explorer/pkg/config/service.go +++ b/graph-explorer/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/graph/pkg/command/server.go b/graph/pkg/command/server.go index 27bb58b13..8c9276cff 100644 --- a/graph/pkg/command/server.go +++ b/graph/pkg/command/server.go @@ -11,6 +11,7 @@ import ( "github.com/owncloud/ocis/graph/pkg/server/debug" "github.com/owncloud/ocis/graph/pkg/server/http" "github.com/owncloud/ocis/graph/pkg/tracing" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/urfave/cli/v2" ) @@ -45,7 +46,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - mtrcs.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + mtrcs.BuildInfo.WithLabelValues(version.String).Set(1) { server, err := http.Server( diff --git a/graph/pkg/config/service.go b/graph/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/graph/pkg/config/service.go +++ b/graph/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/idp/pkg/command/server.go b/idp/pkg/command/server.go index e955731c2..d80728911 100644 --- a/idp/pkg/command/server.go +++ b/idp/pkg/command/server.go @@ -11,6 +11,7 @@ import ( "github.com/owncloud/ocis/idp/pkg/server/debug" "github.com/owncloud/ocis/idp/pkg/server/http" "github.com/owncloud/ocis/idp/pkg/tracing" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/urfave/cli/v2" ) @@ -45,7 +46,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - metrics.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + metrics.BuildInfo.WithLabelValues(version.String).Set(1) { server, err := http.Server( diff --git a/idp/pkg/config/service.go b/idp/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/idp/pkg/config/service.go +++ b/idp/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/idp/pkg/server/debug/server.go b/idp/pkg/server/debug/server.go index bdfe92083..9da10444f 100644 --- a/idp/pkg/server/debug/server.go +++ b/idp/pkg/server/debug/server.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/idp/pkg/config" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" ) // Server initializes the debug service and server. @@ -15,7 +16,7 @@ func Server(opts ...Option) (*http.Server, error) { return debug.NewService( debug.Logger(options.Logger), debug.Name(options.Config.Service.Name), - debug.Version(options.Config.Service.Version), + debug.Version(version.String), debug.Address(options.Config.Debug.Addr), debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), diff --git a/idp/pkg/server/http/server.go b/idp/pkg/server/http/server.go index 0d9cf8b2f..08a1c550c 100644 --- a/idp/pkg/server/http/server.go +++ b/idp/pkg/server/http/server.go @@ -9,6 +9,7 @@ import ( pkgcrypto "github.com/owncloud/ocis/ocis-pkg/crypto" "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/http" + "github.com/owncloud/ocis/ocis-pkg/version" "go-micro.dev/v4" ) @@ -42,7 +43,7 @@ func Server(opts ...Option) (http.Service, error) { http.Logger(options.Logger), http.Namespace(options.Config.HTTP.Namespace), http.Name(options.Config.Service.Name), - http.Version(options.Config.Service.Version), + http.Version(version.String), http.Address(options.Config.HTTP.Addr), http.Context(options.Context), http.Flags(options.Flags...), @@ -60,7 +61,7 @@ func Server(opts ...Option) (http.Service, error) { middleware.Secure, middleware.Version( options.Config.Service.Name, - options.Config.Service.Version, + version.String, ), middleware.Logger( options.Logger, diff --git a/ocs/pkg/command/server.go b/ocs/pkg/command/server.go index 807a7786a..a5081a3cf 100644 --- a/ocs/pkg/command/server.go +++ b/ocs/pkg/command/server.go @@ -3,6 +3,7 @@ package command import ( "context" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocs/pkg/config/parser" "github.com/owncloud/ocis/ocs/pkg/logging" "github.com/owncloud/ocis/ocs/pkg/tracing" @@ -47,7 +48,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - metrics.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + metrics.BuildInfo.WithLabelValues(version.String).Set(1) { server, err := http.Server( diff --git a/ocs/pkg/config/service.go b/ocs/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/ocs/pkg/config/service.go +++ b/ocs/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/ocs/pkg/server/debug/server.go b/ocs/pkg/server/debug/server.go index 214c4a9c1..7a7b69d80 100644 --- a/ocs/pkg/server/debug/server.go +++ b/ocs/pkg/server/debug/server.go @@ -5,6 +5,7 @@ import ( "net/http" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocs/pkg/config" ) @@ -15,7 +16,7 @@ func Server(opts ...Option) (*http.Server, error) { return debug.NewService( debug.Logger(options.Logger), debug.Name(options.Config.Service.Name), - debug.Version(options.Config.Service.Version), + debug.Version(version.String), debug.Address(options.Config.Debug.Addr), debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), diff --git a/ocs/pkg/server/http/server.go b/ocs/pkg/server/http/server.go index 27c4e7e7f..06d380184 100644 --- a/ocs/pkg/server/http/server.go +++ b/ocs/pkg/server/http/server.go @@ -5,6 +5,7 @@ import ( "github.com/owncloud/ocis/ocis-pkg/cors" "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/http" + "github.com/owncloud/ocis/ocis-pkg/version" ocsmw "github.com/owncloud/ocis/ocs/pkg/middleware" svc "github.com/owncloud/ocis/ocs/pkg/service/v0" "go-micro.dev/v4" @@ -17,7 +18,7 @@ func Server(opts ...Option) (http.Service, error) { service := http.NewService( http.Logger(options.Logger), http.Name(options.Config.Service.Name), - http.Version(options.Config.Service.Version), + http.Version(version.String), http.Namespace(options.Config.HTTP.Namespace), http.Address(options.Config.HTTP.Addr), http.Context(options.Context), @@ -39,7 +40,10 @@ func Server(opts ...Option) (http.Service, error) { cors.AllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), middleware.Secure, - middleware.Version(options.Config.Service.Name, options.Config.Service.Version), + middleware.Version( + options.Config.Service.Name, + version.String, + ), middleware.Logger(options.Logger), ocsmw.LogTrace, ), diff --git a/proxy/pkg/command/server.go b/proxy/pkg/command/server.go index 501305bce..8d8045ab9 100644 --- a/proxy/pkg/command/server.go +++ b/proxy/pkg/command/server.go @@ -15,6 +15,7 @@ import ( "github.com/owncloud/ocis/ocis-pkg/log" pkgmiddleware "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/grpc" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/proxy/pkg/config" "github.com/owncloud/ocis/proxy/pkg/config/parser" "github.com/owncloud/ocis/proxy/pkg/cs3" @@ -64,7 +65,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - m.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + m.BuildInfo.WithLabelValues(version.String).Set(1) rp := proxy.NewMultiHostReverseProxy( proxy.Logger(logger), diff --git a/proxy/pkg/config/service.go b/proxy/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/proxy/pkg/config/service.go +++ b/proxy/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/proxy/pkg/server/debug/server.go b/proxy/pkg/server/debug/server.go index 5c4b38046..9158a697d 100644 --- a/proxy/pkg/server/debug/server.go +++ b/proxy/pkg/server/debug/server.go @@ -6,6 +6,7 @@ import ( "net/http" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/proxy/pkg/config" ) @@ -16,7 +17,7 @@ func Server(opts ...Option) (*http.Server, error) { return debug.NewService( debug.Logger(options.Logger), debug.Name(options.Config.Service.Name), - debug.Version(options.Config.Service.Version), + debug.Version(version.String), debug.Address(options.Config.Debug.Addr), debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), diff --git a/proxy/pkg/server/http/server.go b/proxy/pkg/server/http/server.go index 4ae43d824..14b377434 100644 --- a/proxy/pkg/server/http/server.go +++ b/proxy/pkg/server/http/server.go @@ -6,6 +6,7 @@ import ( pkgcrypto "github.com/owncloud/ocis/ocis-pkg/crypto" svc "github.com/owncloud/ocis/ocis-pkg/service/http" + "github.com/owncloud/ocis/ocis-pkg/version" "go-micro.dev/v4" ) @@ -43,7 +44,7 @@ func Server(opts ...Option) (svc.Service, error) { service := svc.NewService( svc.Name(options.Config.Service.Name), - svc.Version(options.Config.Service.Version), + svc.Version(version.String), svc.TLSConfig(tlsConfig), svc.Logger(options.Logger), svc.Address(options.Config.HTTP.Addr), diff --git a/settings/pkg/command/server.go b/settings/pkg/command/server.go index c26623a86..0728ef292 100644 --- a/settings/pkg/command/server.go +++ b/settings/pkg/command/server.go @@ -4,6 +4,7 @@ import ( "context" "github.com/oklog/run" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/settings/pkg/config" "github.com/owncloud/ocis/settings/pkg/config/parser" "github.com/owncloud/ocis/settings/pkg/logging" @@ -44,7 +45,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() mtrcs := metrics.New() - mtrcs.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + mtrcs.BuildInfo.WithLabelValues(version.String).Set(1) // prepare an HTTP server and add it to the group run. httpServer := http.Server( diff --git a/settings/pkg/config/service.go b/settings/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/settings/pkg/config/service.go +++ b/settings/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/settings/pkg/server/grpc/server.go b/settings/pkg/server/grpc/server.go index a2b5d1f1d..a3a2bde3b 100644 --- a/settings/pkg/server/grpc/server.go +++ b/settings/pkg/server/grpc/server.go @@ -2,6 +2,7 @@ package grpc import ( "github.com/owncloud/ocis/ocis-pkg/service/grpc" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/settings/pkg/proto/v0" svc "github.com/owncloud/ocis/settings/pkg/service/v0" ) @@ -13,7 +14,7 @@ func Server(opts ...Option) grpc.Service { service := grpc.NewService( grpc.Logger(options.Logger), grpc.Name(options.Name), - grpc.Version(options.Config.Service.Version), + grpc.Version(version.String), grpc.Address(options.Config.GRPC.Addr), grpc.Namespace(options.Config.GRPC.Namespace), grpc.Context(options.Context), diff --git a/settings/pkg/server/http/server.go b/settings/pkg/server/http/server.go index cb63ac5ec..29795d78f 100644 --- a/settings/pkg/server/http/server.go +++ b/settings/pkg/server/http/server.go @@ -21,7 +21,7 @@ func Server(opts ...Option) http.Service { service := http.NewService( http.Logger(options.Logger), http.Name(options.Name), - http.Version(options.Config.Service.Version), + http.Version(version.String), http.Address(options.Config.HTTP.Addr), http.Namespace(options.Config.HTTP.Namespace), http.Context(options.Context), diff --git a/store/pkg/command/server.go b/store/pkg/command/server.go index c4ebd5e9a..cf9a4ad20 100644 --- a/store/pkg/command/server.go +++ b/store/pkg/command/server.go @@ -5,6 +5,7 @@ import ( "github.com/oklog/run" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/store/pkg/config" "github.com/owncloud/ocis/store/pkg/config/parser" "github.com/owncloud/ocis/store/pkg/logging" @@ -47,7 +48,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - metrics.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + metrics.BuildInfo.WithLabelValues(version.String).Set(1) { server := grpc.Server( diff --git a/store/pkg/config/service.go b/store/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/store/pkg/config/service.go +++ b/store/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/store/pkg/server/debug/server.go b/store/pkg/server/debug/server.go index 975974c5c..874071c71 100644 --- a/store/pkg/server/debug/server.go +++ b/store/pkg/server/debug/server.go @@ -5,6 +5,7 @@ import ( "net/http" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/store/pkg/config" ) @@ -15,7 +16,7 @@ func Server(opts ...Option) (*http.Server, error) { return debug.NewService( debug.Logger(options.Logger), debug.Name(options.Config.Service.Name), - debug.Version(options.Config.Service.Version), + debug.Version(version.String), debug.Address(options.Config.Debug.Addr), debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), diff --git a/store/pkg/server/grpc/server.go b/store/pkg/server/grpc/server.go index 46ba11de8..632505486 100644 --- a/store/pkg/server/grpc/server.go +++ b/store/pkg/server/grpc/server.go @@ -2,6 +2,7 @@ package grpc import ( "github.com/owncloud/ocis/ocis-pkg/service/grpc" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/store/pkg/proto/v0" svc "github.com/owncloud/ocis/store/pkg/service/v0" ) @@ -13,7 +14,7 @@ func Server(opts ...Option) grpc.Service { service := grpc.NewService( grpc.Namespace(options.Config.GRPC.Namespace), grpc.Name(options.Config.Service.Name), - grpc.Version(options.Config.Service.Version), + grpc.Version(version.String), grpc.Context(options.Context), grpc.Address(options.Config.GRPC.Addr), grpc.Logger(options.Logger), diff --git a/thumbnails/pkg/command/server.go b/thumbnails/pkg/command/server.go index 990c549e3..4b7444c65 100644 --- a/thumbnails/pkg/command/server.go +++ b/thumbnails/pkg/command/server.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/oklog/run" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/thumbnails/pkg/config" "github.com/owncloud/ocis/thumbnails/pkg/config/parser" "github.com/owncloud/ocis/thumbnails/pkg/logging" @@ -46,7 +47,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - metrics.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + metrics.BuildInfo.WithLabelValues(version.String).Set(1) service := grpc.NewService( grpc.Logger(logger), diff --git a/thumbnails/pkg/config/service.go b/thumbnails/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/thumbnails/pkg/config/service.go +++ b/thumbnails/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/thumbnails/pkg/server/debug/server.go b/thumbnails/pkg/server/debug/server.go index 24fdee22c..dd7b40a1f 100644 --- a/thumbnails/pkg/server/debug/server.go +++ b/thumbnails/pkg/server/debug/server.go @@ -5,6 +5,7 @@ import ( "net/http" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/thumbnails/pkg/config" ) @@ -15,7 +16,7 @@ func Server(opts ...Option) (*http.Server, error) { return debug.NewService( debug.Logger(options.Logger), debug.Name(options.Config.Service.Name), - debug.Version(options.Config.Service.Version), + debug.Version(version.String), debug.Address(options.Config.Debug.Addr), debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), diff --git a/thumbnails/pkg/server/grpc/server.go b/thumbnails/pkg/server/grpc/server.go index efa6ed85a..b90dc699e 100644 --- a/thumbnails/pkg/server/grpc/server.go +++ b/thumbnails/pkg/server/grpc/server.go @@ -22,7 +22,7 @@ func NewService(opts ...Option) grpc.Service { grpc.Address(options.Address), grpc.Context(options.Context), grpc.Flags(options.Flags...), - grpc.Version(options.Config.Service.Version), + grpc.Version(version.String), ) tconf := options.Config.Thumbnail gc, err := pool.GetGatewayServiceClient(tconf.RevaGateway) diff --git a/web/pkg/config/defaultconfig.go b/web/pkg/config/defaultconfig.go index cf518a9de..42f22beda 100644 --- a/web/pkg/config/defaultconfig.go +++ b/web/pkg/config/defaultconfig.go @@ -1,7 +1,5 @@ package config -import "github.com/owncloud/ocis/ocis-pkg/version" - func DefaultConfig() *Config { return &Config{ Debug: Debug{ @@ -17,8 +15,7 @@ func DefaultConfig() *Config { CacheTTL: 604800, // 7 days }, Service: Service{ - Name: "web", - Version: version.String, // TODO: ensure everywhere or remove + Name: "web", }, Tracing: Tracing{ Enabled: false, diff --git a/web/pkg/config/service.go b/web/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/web/pkg/config/service.go +++ b/web/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/webdav/pkg/command/server.go b/webdav/pkg/command/server.go index 073a8eb80..720729efb 100644 --- a/webdav/pkg/command/server.go +++ b/webdav/pkg/command/server.go @@ -4,6 +4,7 @@ import ( "context" "github.com/oklog/run" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/webdav/pkg/config" "github.com/owncloud/ocis/webdav/pkg/config/parser" "github.com/owncloud/ocis/webdav/pkg/logging" @@ -47,7 +48,7 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - metrics.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1) + metrics.BuildInfo.WithLabelValues(version.String).Set(1) { server, err := http.Server( diff --git a/webdav/pkg/config/service.go b/webdav/pkg/config/service.go index c12faf344..f98aa3d27 100644 --- a/webdav/pkg/config/service.go +++ b/webdav/pkg/config/service.go @@ -2,6 +2,5 @@ package config // Service defines the available service configuration. type Service struct { - Name string - Version string + Name string } diff --git a/webdav/pkg/server/debug/server.go b/webdav/pkg/server/debug/server.go index ad9568b60..ff0ee6b4f 100644 --- a/webdav/pkg/server/debug/server.go +++ b/webdav/pkg/server/debug/server.go @@ -5,6 +5,7 @@ import ( "net/http" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/webdav/pkg/config" ) @@ -15,7 +16,7 @@ func Server(opts ...Option) (*http.Server, error) { return debug.NewService( debug.Logger(options.Logger), debug.Name(options.Config.Service.Name), - debug.Version(options.Config.Service.Version), + debug.Version(version.String), debug.Address(options.Config.Debug.Addr), debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), diff --git a/webdav/pkg/server/http/server.go b/webdav/pkg/server/http/server.go index e32172949..029245bba 100644 --- a/webdav/pkg/server/http/server.go +++ b/webdav/pkg/server/http/server.go @@ -5,6 +5,7 @@ import ( "github.com/owncloud/ocis/ocis-pkg/cors" "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/http" + "github.com/owncloud/ocis/ocis-pkg/version" svc "github.com/owncloud/ocis/webdav/pkg/service/v0" "go-micro.dev/v4" ) @@ -17,7 +18,7 @@ func Server(opts ...Option) (http.Service, error) { http.Logger(options.Logger), http.Namespace(options.Config.HTTP.Namespace), http.Name(options.Config.Service.Name), - http.Version(options.Config.Service.Version), + http.Version(version.String), http.Address(options.Config.HTTP.Addr), http.Context(options.Context), http.Flags(options.Flags...), @@ -40,7 +41,7 @@ func Server(opts ...Option) (http.Service, error) { middleware.Secure, middleware.Version( options.Config.Service.Name, - options.Config.Service.Version, + version.String, ), middleware.Logger( options.Logger,