From 170f659aa31800531936e7881179595cef31ac7e Mon Sep 17 00:00:00 2001 From: ice-cronus <105345303+ice-cronus@users.noreply.github.com> Date: Fri, 30 Aug 2024 12:20:50 +0300 Subject: [PATCH] fix base path on swagger to be replaced on nginx --- application.yaml | 2 +- cmd/freezer-refrigerant/freezer_refrigerant.go | 7 ++++--- go.mod | 6 +++--- go.sum | 12 ++++++------ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/application.yaml b/application.yaml index f9a6c9b..0d6e293 100644 --- a/application.yaml +++ b/application.yaml @@ -8,7 +8,6 @@ cmd/freezer: host: localhost:2443 version: local defaultEndpointTimeout: 30s - tenant: sunwaves httpServer: port: 2443 certPath: cmd/freezer/.testdata/localhost.crt @@ -35,6 +34,7 @@ cmd/freezer-refrigerant: host: localhost:3443 version: local defaultEndpointTimeout: 30s + #tenant: sunwaves httpServer: port: 3443 certPath: cmd/freezer-refrigerant/.testdata/localhost.crt diff --git a/cmd/freezer-refrigerant/freezer_refrigerant.go b/cmd/freezer-refrigerant/freezer_refrigerant.go index 3b21490..fdf3eef 100644 --- a/cmd/freezer-refrigerant/freezer_refrigerant.go +++ b/cmd/freezer-refrigerant/freezer_refrigerant.go @@ -32,11 +32,12 @@ func main() { appCfg.MustLoadFromKey(applicationYamlKey, &cfg) api.SwaggerInfo.Host = cfg.Host api.SwaggerInfo.Version = cfg.Version - swaggerRoot := swaggerRootSuffix + nginxPrefix := "" if cfg.Tenant != "" { - swaggerRoot = "/" + cfg.Tenant + swaggerRootSuffix + nginxPrefix = "/" + cfg.Tenant + api.SwaggerInfo.BasePath = nginxPrefix } - server.New(new(service), applicationYamlKey, swaggerRoot).ListenAndServe(ctx, cancel) + server.New(new(service), applicationYamlKey, swaggerRootSuffix, nginxPrefix).ListenAndServe(ctx, cancel) } func (s *service) RegisterRoutes(router *server.Router) { diff --git a/go.mod b/go.mod index 7011777..10d981e 100644 --- a/go.mod +++ b/go.mod @@ -10,9 +10,9 @@ require ( github.com/ethereum/go-ethereum v1.14.8 github.com/goccy/go-json v0.10.3 github.com/hashicorp/go-multierror v1.1.1 - github.com/ice-blockchain/eskimo v1.401.0 + github.com/ice-blockchain/eskimo v1.402.0 github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb - github.com/ice-blockchain/wintr v1.150.0 + github.com/ice-blockchain/wintr v1.151.0 github.com/imroc/req/v3 v3.43.7 github.com/oklog/ulid/v2 v2.1.0 github.com/pkg/errors v0.9.1 @@ -108,7 +108,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e // indirect - github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect + github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 // indirect github.com/google/s2a-go v0.1.8 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.3 // indirect diff --git a/go.sum b/go.sum index 5007e38..f64f564 100644 --- a/go.sum +++ b/go.sum @@ -265,8 +265,8 @@ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 h1:sEDPKUw6iPjczdu33njxFjO6tYa9bfc0z/QyB/zSsBw= +github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= @@ -302,12 +302,12 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ice-blockchain/eskimo v1.401.0 h1:K13EuOLEJ+j60o9ZhA4na8Chb0Lms/9fU6Zqk4odphc= -github.com/ice-blockchain/eskimo v1.401.0/go.mod h1:JOmKPnBsnpJX2CgCl2Muj2Tl9PzbArEZ5Mf4KnS0xZk= +github.com/ice-blockchain/eskimo v1.402.0 h1:xPRG9IPFG7og+kvwKrmbt9o3TjuG5lmmB08nmqqWUG4= +github.com/ice-blockchain/eskimo v1.402.0/go.mod h1:2TNy4DTthRgPnLCzPp7BdlhopK1pcrVXrlYjcSiRIZw= github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb h1:8TnFP3mc7O+tc44kv2e0/TpZKnEVUaKH+UstwfBwRkk= github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb/go.mod h1:ZsQU7i3mxhgBBu43Oev7WPFbIjP4TniN/b1UPNGbrq8= -github.com/ice-blockchain/wintr v1.150.0 h1:ZzQrPKPVFYRpD3xgQ7/Cmrjz8eeu6UMQ9TvE+brVK0U= -github.com/ice-blockchain/wintr v1.150.0/go.mod h1:wrl5hbd6j/RUr79zglI/Q2QWht2bntf50uUt9hNWK1M= +github.com/ice-blockchain/wintr v1.151.0 h1:wYtEjKyrEHPIhisQG7didKTQW5li7WZEP8i4LHsGPhI= +github.com/ice-blockchain/wintr v1.151.0/go.mod h1:E3Cb/qkJJgQQBTrNwj63YMKHSWDvKssNrLZpZQK/Txs= github.com/imroc/req/v3 v3.43.7 h1:dOcNb9n0X83N5/5/AOkiU+cLhzx8QFXjv5MhikazzQA= github.com/imroc/req/v3 v3.43.7/go.mod h1:SQIz5iYop16MJxbo8ib+4LnostGCok8NQf8ToyQc2xA= github.com/ip2location/ip2location-go/v9 v9.7.0 h1:ipwl67HOWcrw+6GOChkEXcreRQR37NabqBd2ayYa4Q0=