mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-24 13:08:26 -05:00
remove version from service config
This commit is contained in:
committed by
Jörn Friedrich Dreyer
parent
b9f2b6b91e
commit
adc7b3b3d2
@@ -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(
|
||||
|
||||
@@ -2,6 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string
|
||||
Version string
|
||||
Name string
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user