From e3772c3828fb1ddf51f42189e084252559299087 Mon Sep 17 00:00:00 2001 From: Andreas Dewes Date: Mon, 13 Dec 2021 14:17:39 +0100 Subject: [PATCH] Updated all dependencies; fixed incompatibilties. --- cmd/helpers/cli.go | 7 +- cmd/proxy/main.go | 8 ++- cmd/sd/main.go | 8 ++- forms/directory.go | 2 +- forms/signing.go | 4 +- go.mod | 8 ++- go.sum | 72 +++++++++++++++---- helpers/settings.go | 32 ++++++--- proxy/forms.go | 2 +- proxy/helpers/settings.go | 25 +------ sd/helpers/settings.go | 26 +------ sd/server.go | 2 +- settings.go | 2 +- settings/dev/001_default.yml | 20 +++--- settings/dev/roles/hd-1/001_default.yml | 32 ++++----- settings/dev/roles/ls-1/001_default.yml | 22 +++--- settings/dev/roles/op-1/001_default.yml | 28 ++++---- .../dev/roles/private-proxy-1/001_default.yml | 18 ++--- .../roles/private-proxy-eps-1/001_default.yml | 32 ++++----- .../dev/roles/public-proxy-1/001_default.yml | 12 ++-- .../roles/public-proxy-eps-1/001_default.yml | 36 +++++----- settings/dev/roles/sd-1/001_default.yml | 10 +-- settings/test/001_default.yml | 2 +- settings/test/roles/hd-1/001_default.yml | 12 ++-- settings/test/roles/op-1/001_default.yml | 6 +- testing/fixtures/settings.go | 18 ++++- 26 files changed, 245 insertions(+), 201 deletions(-) diff --git a/cmd/helpers/cli.go b/cmd/helpers/cli.go index 9e5318f..9ca1b3e 100644 --- a/cmd/helpers/cli.go +++ b/cmd/helpers/cli.go @@ -40,8 +40,11 @@ func Decorate(commands []cli.Command, decorator Decorator, service string) []cli } func Settings(definitions *eps.Definitions) (*eps.Settings, error) { - settingsPaths := helpers.SettingsPaths() - return helpers.Settings(settingsPaths, definitions) + if settingsPaths, fs, err := helpers.SettingsPaths("EPS_SETTINGS"); err != nil { + return nil, err + } else { + return helpers.Settings(settingsPaths, fs, definitions) + } } var CommonCommands = []cli.Command{ diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index 2290f23..bc0c10d 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -20,9 +20,10 @@ import ( "github.com/iris-connect/eps" cmdHelpers "github.com/iris-connect/eps/cmd/helpers" "github.com/iris-connect/eps/definitions" + "github.com/iris-connect/eps/helpers" "github.com/iris-connect/eps/metrics" "github.com/iris-connect/eps/proxy" - "github.com/iris-connect/eps/proxy/helpers" + proxyHelpers "github.com/iris-connect/eps/proxy/helpers" "github.com/urfave/cli" "os" "os/signal" @@ -150,7 +151,10 @@ func CLI(settings *proxy.Settings) { } func main() { - if settings, err := helpers.Settings(helpers.SettingsPaths(), &definitions.Default); err != nil { + if settingsPaths, fs, err := helpers.SettingsPaths("PROXY_SETTINGS"); err != nil { + eps.Log.Error(err) + return + } else if settings, err := proxyHelpers.Settings(settingsPaths, fs, &definitions.Default); err != nil { eps.Log.Error(err) return } else { diff --git a/cmd/sd/main.go b/cmd/sd/main.go index f26c387..534fb0f 100644 --- a/cmd/sd/main.go +++ b/cmd/sd/main.go @@ -20,9 +20,10 @@ import ( "github.com/iris-connect/eps" cmdHelpers "github.com/iris-connect/eps/cmd/helpers" "github.com/iris-connect/eps/definitions" + "github.com/iris-connect/eps/helpers" "github.com/iris-connect/eps/metrics" "github.com/iris-connect/eps/sd" - "github.com/iris-connect/eps/sd/helpers" + sdHelpers "github.com/iris-connect/eps/sd/helpers" "github.com/urfave/cli" "os" "os/signal" @@ -93,7 +94,10 @@ func CLI(settings *sd.Settings) { } func main() { - if settings, err := helpers.Settings(helpers.SettingsPaths(), &definitions.Default); err != nil { + if settingsPaths, fs, err := helpers.SettingsPaths("SD_SETTINGS"); err != nil { + eps.Log.Error(err) + return + } else if settings, err := sdHelpers.Settings(settingsPaths, fs, &definitions.Default); err != nil { eps.Log.Error(err) return } else { diff --git a/forms/directory.go b/forms/directory.go index 46d1a70..54f4f6c 100644 --- a/forms/directory.go +++ b/forms/directory.go @@ -374,7 +374,7 @@ var SignedChangeRecordForm = forms.Form{ forms.IsOptional{Default: ""}, forms.IsString{}, forms.MatchesRegex{ - Regex: regexp.MustCompile(`^([a-f0-9]{64}|)$`), + Regexp: regexp.MustCompile(`^([a-f0-9]{64}|)$`), }, }, }, diff --git a/forms/signing.go b/forms/signing.go index bba7397..ba54819 100644 --- a/forms/signing.go +++ b/forms/signing.go @@ -45,7 +45,7 @@ var SignatureForm = forms.Form{ Validators: []forms.Validator{ forms.IsString{}, forms.MatchesRegex{ - Regex: regexp.MustCompile(`^\d{10,100}$`), + Regexp: regexp.MustCompile(`^\d{10,100}$`), }, }, }, @@ -54,7 +54,7 @@ var SignatureForm = forms.Form{ Validators: []forms.Validator{ forms.IsString{}, forms.MatchesRegex{ - Regex: regexp.MustCompile(`^\d{10,100}$`), + Regexp: regexp.MustCompile(`^\d{10,100}$`), }, }, }, diff --git a/go.mod b/go.mod index 4cdfd43..2f95928 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,17 @@ module github.com/iris-connect/eps go 1.16 require ( + github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect github.com/go-redis/redis v6.15.9+incompatible github.com/golang/protobuf v1.5.2 - github.com/kiprotect/go-helpers v0.0.0-20210719141457-5b87e3cc7847 + github.com/kiprotect/go-helpers v0.0.0-20211210144244-79ce90e73e79 + github.com/onsi/ginkgo v1.16.5 // indirect + github.com/onsi/gomega v1.17.0 // indirect github.com/prometheus/client_golang v1.11.0 - github.com/protocolbuffers/protobuf v3.15.8+incompatible // indirect github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli v1.22.5 + golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect google.golang.org/grpc v1.37.0 - google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 // indirect google.golang.org/protobuf v1.26.0 ) diff --git a/go.sum b/go.sum index b718ed9..b3f8bee 100644 --- a/go.sum +++ b/go.sum @@ -15,8 +15,9 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -24,6 +25,9 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -33,6 +37,7 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -60,16 +65,15 @@ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kiprotect/go-helpers v0.0.0-20210514164310-2378c475ba2d h1:GzjwdKetgLy5+U3w70OC5glvulKLjhCvlWYNYQp5P5A= -github.com/kiprotect/go-helpers v0.0.0-20210514164310-2378c475ba2d/go.mod h1:eIQRg8JS++hWm0qzHR0XlWZgCD4zBQOnQHlrHxaHUQU= -github.com/kiprotect/go-helpers v0.0.0-20210719141457-5b87e3cc7847 h1:dJeZf1LEI0Y+v5/BQVK5zVtuEk03rAnfs+uCZGyFiiM= -github.com/kiprotect/go-helpers v0.0.0-20210719141457-5b87e3cc7847/go.mod h1:eIQRg8JS++hWm0qzHR0XlWZgCD4zBQOnQHlrHxaHUQU= +github.com/kiprotect/go-helpers v0.0.0-20211210144244-79ce90e73e79 h1:DkoSA58JBhgaK+cL4z421isWIPvSbaB2ovrofUTIp/I= +github.com/kiprotect/go-helpers v0.0.0-20211210144244-79ce90e73e79/go.mod h1:eIQRg8JS++hWm0qzHR0XlWZgCD4zBQOnQHlrHxaHUQU= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -86,6 +90,18 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -110,10 +126,9 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/protocolbuffers/protobuf v3.15.8+incompatible/go.mod h1:DdhgU1nye99PVSHQwKVPGBaTs902wvndr/KhlFhJxmw= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -129,8 +144,10 @@ github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -138,16 +155,22 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -155,31 +178,49 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -192,7 +233,6 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.37.0 h1:uSZWeQJX5j11bIQ4AJoj+McDBo29cY1MCoC1wO3ts+c= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -209,11 +249,15 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/helpers/settings.go b/helpers/settings.go index b0f7848..f2ba669 100644 --- a/helpers/settings.go +++ b/helpers/settings.go @@ -25,30 +25,44 @@ import ( epsForms "github.com/iris-connect/eps/forms" "github.com/kiprotect/go-helpers/forms" "github.com/kiprotect/go-helpers/settings" + "io/fs" "os" + "path/filepath" "strings" ) -var EnvSettingsName = "EPS_SETTINGS" - -func SettingsPaths() []string { - envValue := os.Getenv(EnvSettingsName) - if envValue == "" { - return []string{} +func SettingsPaths(envSettingsName string) ([]string, fs.FS, error) { + if paths, err := RealSettingsPaths(envSettingsName); err != nil { + return nil, nil, err + } else { + modifiedPaths := make([]string, len(paths)) + for i, path := range paths { + modifiedPaths[i] = path[1:] + } + return modifiedPaths, os.DirFS("/"), nil } +} + +func RealSettingsPaths(envSettingsName string) ([]string, error) { + envValue := os.Getenv(envSettingsName) values := strings.Split(envValue, ":") sanitizedValues := make([]string, 0, len(values)) for _, value := range values { if value == "" { continue } + var err error + if value, err = filepath.Abs(value); err != nil { + return nil, err + } sanitizedValues = append(sanitizedValues, value) } - return sanitizedValues + return sanitizedValues, nil } -func Settings(settingsPaths []string, definitions *eps.Definitions) (*eps.Settings, error) { - if rawSettings, err := settings.MakeSettings(settingsPaths); err != nil { +func Settings(settingsPaths []string, fs fs.FS, definitions *eps.Definitions) (*eps.Settings, error) { + eps.Log.Info(settingsPaths) + if rawSettings, err := settings.MakeSettings(settingsPaths, fs); err != nil { return nil, err } else if params, err := epsForms.SettingsForm.ValidateWithContext(rawSettings.Values, map[string]interface{}{"definitions": definitions}); err != nil { return nil, err diff --git a/proxy/forms.go b/proxy/forms.go index 9b5fb33..54517b3 100644 --- a/proxy/forms.go +++ b/proxy/forms.go @@ -35,7 +35,7 @@ var DirectorySettingsForm = forms.Form{ forms.IsList{ Validators: []forms.Validator{ forms.IsString{}, - forms.MatchesRegex{Regex: regexp.MustCompile(`^\.`)}, + forms.MatchesRegex{Regexp: regexp.MustCompile(`^\.`)}, }, }, }, diff --git a/proxy/helpers/settings.go b/proxy/helpers/settings.go index 94a43ac..14aca5b 100644 --- a/proxy/helpers/settings.go +++ b/proxy/helpers/settings.go @@ -20,30 +20,11 @@ import ( "github.com/iris-connect/eps" "github.com/iris-connect/eps/proxy" "github.com/kiprotect/go-helpers/settings" - "os" - "strings" + "io/fs" ) -var EnvSettingsName = "PROXY_SETTINGS" - -func SettingsPaths() []string { - envValue := os.Getenv(EnvSettingsName) - if envValue == "" { - return []string{} - } - values := strings.Split(envValue, ":") - sanitizedValues := make([]string, 0, len(values)) - for _, value := range values { - if value == "" { - continue - } - sanitizedValues = append(sanitizedValues, value) - } - return sanitizedValues -} - -func Settings(settingsPaths []string, definitions *eps.Definitions) (*proxy.Settings, error) { - if rawSettings, err := settings.MakeSettings(settingsPaths); err != nil { +func Settings(settingsPaths []string, fs fs.FS, definitions *eps.Definitions) (*proxy.Settings, error) { + if rawSettings, err := settings.MakeSettings(settingsPaths, fs); err != nil { return nil, err } else if params, err := proxy.SettingsForm.ValidateWithContext(rawSettings.Values, map[string]interface{}{"definitions": definitions}); err != nil { return nil, err diff --git a/sd/helpers/settings.go b/sd/helpers/settings.go index 06596a6..a5c6e29 100644 --- a/sd/helpers/settings.go +++ b/sd/helpers/settings.go @@ -20,31 +20,11 @@ import ( "github.com/iris-connect/eps" "github.com/iris-connect/eps/sd" "github.com/kiprotect/go-helpers/settings" - "os" - "strings" + "io/fs" ) -var EnvSettingsName = "SD_SETTINGS" - -func SettingsPaths() []string { - envValue := os.Getenv(EnvSettingsName) - if envValue == "" { - return []string{} - } - values := strings.Split(envValue, ":") - sanitizedValues := make([]string, 0, len(values)) - for _, value := range values { - if value == "" { - continue - } - sanitizedValues = append(sanitizedValues, value) - } - return sanitizedValues -} - -func Settings(settingsPaths []string, definitions *eps.Definitions) (*sd.Settings, error) { - - if rawSettings, err := settings.MakeSettings(settingsPaths); err != nil { +func Settings(settingsPaths []string, fs fs.FS, definitions *eps.Definitions) (*sd.Settings, error) { + if rawSettings, err := settings.MakeSettings(settingsPaths, fs); err != nil { return nil, err } else if params, err := sd.SettingsForm.ValidateWithContext(rawSettings.Values, map[string]interface{}{"definitions": definitions}); err != nil { return nil, err diff --git a/sd/server.go b/sd/server.go index f43e22e..9edd8f1 100644 --- a/sd/server.go +++ b/sd/server.go @@ -138,7 +138,7 @@ var GetRecordsForm = forms.Form{ forms.IsOptional{Default: ""}, forms.IsString{}, forms.MatchesRegex{ - Regex: regexp.MustCompile(`^([a-f0-9]{64}|)$`), + Regexp: regexp.MustCompile(`^([a-f0-9]{64}|)$`), }, }, }, diff --git a/settings.go b/settings.go index 4456a3a..cc46247 100644 --- a/settings.go +++ b/settings.go @@ -17,7 +17,7 @@ package eps type DatastoreSettings struct { - Type string `json:"type"` + Type string `json:"type"` Settings interface{} `json:"settings"` } diff --git a/settings/dev/001_default.yml b/settings/dev/001_default.yml index 5608509..66f7ef5 100644 --- a/settings/dev/001_default.yml +++ b/settings/dev/001_default.yml @@ -7,7 +7,7 @@ vars: directory: type: json settings: - path: "$DIR/directory.json" + path: "/$DIR/directory.json" channels: # defines all the channels that we want to open when starting the server - name: Stdout channel type: stdout @@ -17,16 +17,16 @@ channels: # defines all the channels that we want to open when starting the serv settings: bind_address: "localhost:4444" tls: - ca_certificate_files: ["$DIR/certs/root.crt"] - certificate_file: "$DIR/certs/$OP.crt" - key_file: "$DIR/certs/$OP.key" + ca_certificate_files: ["/$DIR/certs/root.crt"] + certificate_file: "/$DIR/certs/$OP.crt" + key_file: "/$DIR/certs/$OP.key" - name: main gRPC client # creates outgoing gRPC connections to deliver and receive messages type: grpc_client settings: tls: - ca_certificate_files: ["$DIR/certs/root.crt"] - certificate_file: "$DIR/certs/$OP.crt" - key_file: "$DIR/certs/$OP.key" + ca_certificate_files: ["/$DIR/certs/root.crt"] + certificate_file: "/$DIR/certs/$OP.crt" + key_file: "/$DIR/certs/$OP.key" - name: main JSON-RPC server # accepts incoming JSONRPC connections to deliver and receive messages type: jsonrpc_server settings: @@ -34,9 +34,9 @@ channels: # defines all the channels that we want to open when starting the serv cors: allowed_hosts: ["^http(?:s)?://localhost\\:\\d+$"] tls: - ca_certificate_files: ["$DIR/certs/root.crt"] - certificate_file: "$DIR/certs/$OP.crt" - key_file: "$DIR/certs/$OP.key" + ca_certificate_files: ["/$DIR/certs/root.crt"] + certificate_file: "/$DIR/certs/$OP.crt" + key_file: "/$DIR/certs/$OP.key" - name: main JSON-RPC client # creates outgoing JSONRPC connections to deliver and receive messages type: jsonrpc_client settings: diff --git a/settings/dev/roles/hd-1/001_default.yml b/settings/dev/roles/hd-1/001_default.yml index e2600a0..11a64c5 100644 --- a/settings/dev/roles/hd-1/001_default.yml +++ b/settings/dev/roles/hd-1/001_default.yml @@ -5,16 +5,16 @@ directory: # to use the JSON directory, uncomment this and comment everything below... # type: json # settings: -# path: "$DIR/../../directory" +# path: "/$DIR/../../directory" type: api settings: jsonrpc_client: tls: - certificate_file: "$DIR/../../certs/hd-1.crt" - key_file: "$DIR/../../certs/hd-1.key" - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_intermediate_certificate_files: ["$DIR/../../certs/intermediate.crt"] + certificate_file: "/$DIR/../../certs/hd-1.crt" + key_file: "/$DIR/../../certs/hd-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_intermediate_certificate_files: ["/$DIR/../../certs/intermediate.crt"] endpoints: ["https://localhost:3322/jsonrpc"] server_names: ["sd-1"] channels: # defines all the channels that we want to open when starting the server @@ -26,9 +26,9 @@ channels: # defines all the channels that we want to open when starting the serv type: grpc_client settings: tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/hd-1.crt" - key_file: "$DIR/../../certs/hd-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/hd-1.crt" + key_file: "/$DIR/../../certs/hd-1.key" - name: main JSON-RPC server # accepts incoming JSONRPC connections to deliver and receive messages type: jsonrpc_server settings: @@ -36,11 +36,11 @@ channels: # defines all the channels that we want to open when starting the serv cors: allowed_hosts: ["^http(?:s)?://localhost\\:\\d+$"] tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/hd-1.crt" - key_file: "$DIR/../../certs/hd-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/hd-1.crt" + key_file: "/$DIR/../../certs/hd-1.key" signing: - certificate_file: "$DIR/../../certs/hd-1-sign.crt" - key_file: "$DIR/../../certs/hd-1-sign.key" - ca_certificate_file: "$DIR/../../certs/root.crt" - ca_intermediate_certificate_files: ["$DIR/../../certs/intermediate.crt"] \ No newline at end of file + certificate_file: "/$DIR/../../certs/hd-1-sign.crt" + key_file: "/$DIR/../../certs/hd-1-sign.key" + ca_certificate_file: "/$DIR/../../certs/root.crt" + ca_intermediate_certificate_files: ["/$DIR/../../certs/intermediate.crt"] \ No newline at end of file diff --git a/settings/dev/roles/ls-1/001_default.yml b/settings/dev/roles/ls-1/001_default.yml index 0ed697c..cc6ddb2 100644 --- a/settings/dev/roles/ls-1/001_default.yml +++ b/settings/dev/roles/ls-1/001_default.yml @@ -4,11 +4,11 @@ directory: settings: jsonrpc_client: tls: - certificate_file: "$DIR/../../certs/hd-1.crt" - key_file: "$DIR/../../certs/hd-1.key" - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_intermediate_certificate_files: ["$DIR/../../certs/intermediate.crt"] + certificate_file: "/$DIR/../../certs/hd-1.crt" + key_file: "/$DIR/../../certs/hd-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_intermediate_certificate_files: ["/$DIR/../../certs/intermediate.crt"] endpoints: ["https://localhost:3322/jsonrpc"] server_names: ["sd-1"] channels: # defines all the channels that we want to open when starting the server @@ -20,9 +20,9 @@ channels: # defines all the channels that we want to open when starting the serv settings: bind_address: "localhost:4445" tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/ls-1.crt" - key_file: "$DIR/../../certs/ls-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/ls-1.crt" + key_file: "/$DIR/../../certs/ls-1.key" - name: main JSON-RPC server # accepts incoming JSONRPC connections to deliver and receive messages type: jsonrpc_server settings: @@ -30,9 +30,9 @@ channels: # defines all the channels that we want to open when starting the serv cors: allowed_hosts: ["^http(?:s)?://localhost\\:\\d+$"] tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/ls-1.crt" - key_file: "$DIR/../../certs/ls-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/ls-1.crt" + key_file: "/$DIR/../../certs/ls-1.key" - name: main JSON-RPC client # creates outgoing JSONRPC connections to deliver and receive messages type: jsonrpc_client services: [locations] diff --git a/settings/dev/roles/op-1/001_default.yml b/settings/dev/roles/op-1/001_default.yml index 979564e..1eb0c85 100644 --- a/settings/dev/roles/op-1/001_default.yml +++ b/settings/dev/roles/op-1/001_default.yml @@ -4,11 +4,11 @@ directory: settings: jsonrpc_client: tls: - certificate_file: "$DIR/../../certs/hd-1.crt" - key_file: "$DIR/../../certs/hd-1.key" - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_intermediate_certificate_files: ["$DIR/../../certs/intermediate.crt"] + certificate_file: "/$DIR/../../certs/hd-1.crt" + key_file: "/$DIR/../../certs/hd-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_intermediate_certificate_files: ["/$DIR/../../certs/intermediate.crt"] endpoints: ["https://localhost:3322/jsonrpc"] server_names: ["sd-1"] channels: # defines all the channels that we want to open when starting the server @@ -20,16 +20,16 @@ channels: # defines all the channels that we want to open when starting the serv settings: bind_address: "localhost:4444" tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/op-1.crt" - key_file: "$DIR/../../certs/op-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/op-1.crt" + key_file: "/$DIR/../../certs/op-1.key" - name: main gRPC client # creates outgoing gRPC connections to deliver and receive messages type: grpc_client settings: tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/op-1.crt" - key_file: "$DIR/../../certs/op-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/op-1.crt" + key_file: "/$DIR/../../certs/op-1.key" - name: main JSON-RPC server # accepts incoming JSONRPC connections to deliver and receive messages type: jsonrpc_server settings: @@ -37,9 +37,9 @@ channels: # defines all the channels that we want to open when starting the serv cors: allowed_hosts: ["^http(?:s)?://localhost\\:\\d+$"] tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/op-1.crt" - key_file: "$DIR/../../certs/op-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/op-1.crt" + key_file: "/$DIR/../../certs/op-1.key" - name: main JSON-RPC client # creates outgoing JSONRPC connections to deliver and receive messages type: jsonrpc_client settings: diff --git a/settings/dev/roles/private-proxy-1/001_default.yml b/settings/dev/roles/private-proxy-1/001_default.yml index d14b7cf..93086ec 100644 --- a/settings/dev/roles/private-proxy-1/001_default.yml +++ b/settings/dev/roles/private-proxy-1/001_default.yml @@ -7,9 +7,9 @@ private: tls: verify_client: false server_name: internal-server - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/internal-server.crt" - key_file: "$DIR/../../certs/internal-server.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/internal-server.crt" + key_file: "/$DIR/../../certs/internal-server.key" #verify_service_call: true name: private-proxy-1.ga datastore: @@ -27,14 +27,14 @@ private: endpoint: https://localhost:7766/jsonrpc tls: server_name: private-proxy-1.ga - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/private-proxy-1.ga.crt" - key_file: "$DIR/../../certs/private-proxy-1.ga.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/private-proxy-1.ga.crt" + key_file: "/$DIR/../../certs/private-proxy-1.ga.key" jsonrpc_server: # the JSON-RPC server that the EPS server uses for communication bind_address: "localhost:8877" cors: allowed_hosts: ["^http(?:s)?://localhost\\:\\d+$"] #tls: - # ca_certificate_files: ["$DIR/../../certs/root.crt"] - # certificate_file: "$DIR/../../certs/private-proxy-1.ga.crt" - # key_file: "$DIR/../../certs/private-proxy-1.ga.key" + # ca_certificate_files: ["/$DIR/../../certs/root.crt"] + # certificate_file: "/$DIR/../../certs/private-proxy-1.ga.crt" + # key_file: "/$DIR/../../certs/private-proxy-1.ga.key" diff --git a/settings/dev/roles/private-proxy-eps-1/001_default.yml b/settings/dev/roles/private-proxy-eps-1/001_default.yml index 7221b56..47e6763 100644 --- a/settings/dev/roles/private-proxy-eps-1/001_default.yml +++ b/settings/dev/roles/private-proxy-eps-1/001_default.yml @@ -3,16 +3,16 @@ directory: # to use the JSON directory, uncomment this and comment everything below... # type: json # settings: -# path: "$DIR/../../directory" +# path: "/$DIR/../../directory" type: api settings: jsonrpc_client: tls: - certificate_file: "$DIR/../../certs/hd-1.crt" - key_file: "$DIR/../../certs/hd-1.key" - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_intermediate_certificate_files: ["$DIR/../../certs/intermediate.crt"] + certificate_file: "/$DIR/../../certs/hd-1.crt" + key_file: "/$DIR/../../certs/hd-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_intermediate_certificate_files: ["/$DIR/../../certs/intermediate.crt"] endpoints: ["https://localhost:3322/jsonrpc"] server_names: ["sd-1"] channels: # defines all the channels that we want to open when starting the server @@ -24,16 +24,16 @@ channels: # defines all the channels that we want to open when starting the serv - type: minute limit: 1000 tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/private-proxy-1.ga.crt" - key_file: "$DIR/../../certs/private-proxy-1.ga.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/private-proxy-1.ga.crt" + key_file: "/$DIR/../../certs/private-proxy-1.ga.key" - name: main gRPC client # creates outgoing gRPC connections to deliver and receive messages type: grpc_client settings: tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/private-proxy-1.ga.crt" - key_file: "$DIR/../../certs/private-proxy-1.ga.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/private-proxy-1.ga.crt" + key_file: "/$DIR/../../certs/private-proxy-1.ga.key" server_name: foo - name: main JSON-RPC server # accepts incoming JSONRPC connections to deliver and receive messages type: jsonrpc_server @@ -43,12 +43,12 @@ channels: # defines all the channels that we want to open when starting the serv allowed_hosts: ["^http(?:s)?://localhost\\:\\d+$"] tls: verify_client: false - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/private-proxy-1.ga.crt" - key_file: "$DIR/../../certs/private-proxy-1.ga.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/private-proxy-1.ga.crt" + key_file: "/$DIR/../../certs/private-proxy-1.ga.key" - name: main JSON-RPC client # creates outgoing JSONRPC connections to deliver and receive messages type: jsonrpc_client settings: endpoint: http://127.0.0.1:8877/jsonrpc #tls: - # ca_certificate_files: ["$DIR/../../certs/root.crt"] + # ca_certificate_files: ["/$DIR/../../certs/root.crt"] diff --git a/settings/dev/roles/public-proxy-1/001_default.yml b/settings/dev/roles/public-proxy-1/001_default.yml index 8bc8929..5eb3ac5 100644 --- a/settings/dev/roles/public-proxy-1/001_default.yml +++ b/settings/dev/roles/public-proxy-1/001_default.yml @@ -20,15 +20,15 @@ public: endpoint: https://localhost:5544/jsonrpc tls: server_name: public-proxy-1.ga - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/public-proxy-1.ga.crt" - key_file: "$DIR/../../certs/public-proxy-1.ga.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/public-proxy-1.ga.crt" + key_file: "/$DIR/../../certs/public-proxy-1.ga.key" jsonrpc_server: # the JSON-RPC server that the EPS server uses for communication bind_address: "localhost:6655" cors: allowed_hosts: ["^http(?:s)?://localhost\\:\\d+$"] tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/public-proxy-1.ga.crt" - key_file: "$DIR/../../certs/public-proxy-1.ga.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/public-proxy-1.ga.crt" + key_file: "/$DIR/../../certs/public-proxy-1.ga.key" validate_client: false \ No newline at end of file diff --git a/settings/dev/roles/public-proxy-eps-1/001_default.yml b/settings/dev/roles/public-proxy-eps-1/001_default.yml index 2983219..6d37bef 100644 --- a/settings/dev/roles/public-proxy-eps-1/001_default.yml +++ b/settings/dev/roles/public-proxy-eps-1/001_default.yml @@ -2,17 +2,17 @@ name: public-proxy-1.ga directory: # type: json # settings: -# path: "$DIR/../../directory" +# path: "/$DIR/../../directory" type: api settings: jsonrpc_client: #proxy_url: http://localhost:8083/jsonrpc tls: - certificate_file: "$DIR/../../certs/hd-1.crt" - key_file: "$DIR/../../certs/hd-1.key" - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_intermediate_certificate_files: ["$DIR/../../certs/intermediate.crt"] + certificate_file: "/$DIR/../../certs/hd-1.crt" + key_file: "/$DIR/../../certs/hd-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_intermediate_certificate_files: ["/$DIR/../../certs/intermediate.crt"] endpoints: ["https://localhost:3322/jsonrpc"] server_names: ["sd-1"] channels: # defines all the channels that we want to open when starting the server @@ -24,16 +24,16 @@ channels: # defines all the channels that we want to open when starting the serv - type: minute limit: 1000 tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/public-proxy-1.ga.crt" - key_file: "$DIR/../../certs/public-proxy-1.ga.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/public-proxy-1.ga.crt" + key_file: "/$DIR/../../certs/public-proxy-1.ga.key" - name: main gRPC client # creates outgoing gRPC connections to deliver and receive messages type: grpc_client settings: tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/public-proxy-1.ga.crt" - key_file: "$DIR/../../certs/public-proxy-1.ga.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/public-proxy-1.ga.crt" + key_file: "/$DIR/../../certs/public-proxy-1.ga.key" - name: main JSON-RPC server # accepts incoming JSONRPC connections to deliver and receive messages type: jsonrpc_server settings: @@ -41,15 +41,15 @@ channels: # defines all the channels that we want to open when starting the serv cors: allowed_hosts: ["^http(?:s)?://localhost\\:\\d+$"] tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/public-proxy-1.ga.crt" - key_file: "$DIR/../../certs/public-proxy-1.ga.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/public-proxy-1.ga.crt" + key_file: "/$DIR/../../certs/public-proxy-1.ga.key" - name: main JSON-RPC client # creates outgoing JSONRPC connections to deliver and receive messages type: jsonrpc_client settings: endpoint: https://localhost:6655/jsonrpc tls: server_name: public-proxy-1.ga - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/public-proxy-1.ga.crt" - key_file: "$DIR/../../certs/public-proxy-1.ga.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/public-proxy-1.ga.crt" + key_file: "/$DIR/../../certs/public-proxy-1.ga.key" diff --git a/settings/dev/roles/sd-1/001_default.yml b/settings/dev/roles/sd-1/001_default.yml index 2a89ff9..5495dfb 100644 --- a/settings/dev/roles/sd-1/001_default.yml +++ b/settings/dev/roles/sd-1/001_default.yml @@ -8,9 +8,9 @@ jsonrpc_server: # the JSON-RPC server that the EPS server uses for communication cors: allowed_hosts: ["^http(?:s)?://localhost\\:\\d+$"] tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/sd-1.crt" - key_file: "$DIR/../../certs/sd-1.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/sd-1.crt" + key_file: "/$DIR/../../certs/sd-1.key" directory: datastore: type: redis @@ -23,5 +23,5 @@ directory: # type: file # settings: # filename: /tmp/service-directory.records - ca_certificate_files: ["$DIR/../../certs/root.crt"] - ca_intermediate_certificate_files: ["$DIR/../../certs/intermediate.crt"] \ No newline at end of file + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + ca_intermediate_certificate_files: ["/$DIR/../../certs/intermediate.crt"] \ No newline at end of file diff --git a/settings/test/001_default.yml b/settings/test/001_default.yml index 0b714fe..205edfe 100644 --- a/settings/test/001_default.yml +++ b/settings/test/001_default.yml @@ -1,4 +1,4 @@ directory: type: json settings: - path: "$DIR/directory" + path: "/$DIR/directory" diff --git a/settings/test/roles/hd-1/001_default.yml b/settings/test/roles/hd-1/001_default.yml index 9ef42f6..d51792c 100644 --- a/settings/test/roles/hd-1/001_default.yml +++ b/settings/test/roles/hd-1/001_default.yml @@ -10,9 +10,9 @@ channels: # defines all the channels that we want to open when starting the serv settings: bind_address: "localhost:4444" tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/$OP.crt" - key_file: "$DIR/../../certs/$OP.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/$OP.crt" + key_file: "/$DIR/../../certs/$OP.key" - name: main JSON-RPC server # accepts incoming JSONRPC connections to deliver and receive messages type: jsonrpc_server settings: @@ -20,9 +20,9 @@ channels: # defines all the channels that we want to open when starting the serv cors: allowed_hosts: ["^http(?:s)?://localhost\\:\\d+$"] tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/$OP.crt" - key_file: "$DIR/../../certs/$OP.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/$OP.crt" + key_file: "/$DIR/../../certs/$OP.key" - name: main stdout channel type: stdout settings: {} diff --git a/settings/test/roles/op-1/001_default.yml b/settings/test/roles/op-1/001_default.yml index 0a4207a..3b33aca 100644 --- a/settings/test/roles/op-1/001_default.yml +++ b/settings/test/roles/op-1/001_default.yml @@ -9,6 +9,6 @@ channels: type: grpc_client settings: tls: - ca_certificate_files: ["$DIR/../../certs/root.crt"] - certificate_file: "$DIR/../../certs/$OP.crt" - key_file: "$DIR/../../certs/$OP.key" + ca_certificate_files: ["/$DIR/../../certs/root.crt"] + certificate_file: "/$DIR/../../certs/$OP.crt" + key_file: "/$DIR/../../certs/$OP.key" diff --git a/testing/fixtures/settings.go b/testing/fixtures/settings.go index fe76ec0..10bfdd1 100644 --- a/testing/fixtures/settings.go +++ b/testing/fixtures/settings.go @@ -25,7 +25,8 @@ import ( ) type Settings struct { - Paths []string + Paths []string + EnvSettingsName string } func (c Settings) Setup(fixtures map[string]interface{}) (interface{}, error) { @@ -36,7 +37,17 @@ func (c Settings) Setup(fixtures map[string]interface{}) (interface{}, error) { if defs, ok = fixtures["definitions"].(*eps.Definitions); !ok { defs = &definitions.Default } - settingsPaths := helpers.SettingsPaths() + + if c.EnvSettingsName == "" { + c.EnvSettingsName = "EPS_SETTINGS" + } + + settingsPaths, fs, err := helpers.SettingsPaths(c.EnvSettingsName) + + if err != nil { + return nil, err + } + if c.Paths != nil { if len(settingsPaths) != 1 { return nil, fmt.Errorf("expected a single settings path prefix") @@ -45,12 +56,13 @@ func (c Settings) Setup(fixtures map[string]interface{}) (interface{}, error) { for _, pth := range c.Paths { fullPaths = append(fullPaths, path.Join(append(settingsPaths, pth)...)) } + eps.Log.Info(fullPaths) paths = fullPaths } else { paths = settingsPaths } eps.Log.SetLevel(eps.DebugLogLevel) - return helpers.Settings(paths, defs) + return helpers.Settings(paths, fs, defs) } func (c Settings) Teardown(fixture interface{}) error {