From 2496c368e3ed95003064f1e515870dbc33b6cff5 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Tue, 28 Mar 2023 11:43:49 +0200 Subject: [PATCH 01/92] GitHub Actions Update (#951) * change to actions/setup-go * test codeql change * intenten fix * remove strategy * comment cleanup * removed test branch * convert main branch to development tag * set development tag on main branch --- .github/workflows/codeql-analysis.yml | 79 ++++++++---------------- .github/workflows/development-docker.yml | 11 +++- .github/workflows/makefile.yml | 4 +- 3 files changed, 36 insertions(+), 58 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index cd1290f3e..1730412b0 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,22 +1,12 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# name: "CodeQL" on: push: - branches: [ main ] + branches: + - main pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] + branches: + - main schedule: - cron: '33 15 * * 1' @@ -24,44 +14,25 @@ jobs: analyze: name: Analyze runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - + steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Checkout repository + uses: actions/checkout@v3 + + # Use Golang cache + - name: Setup Golang + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: go + + - name: Build with Makefile + run: make build + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/development-docker.yml b/.github/workflows/development-docker.yml index 86eeb1a5e..9822e22db 100644 --- a/.github/workflows/development-docker.yml +++ b/.github/workflows/development-docker.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - fb-* permissions: security-events: write @@ -111,9 +112,15 @@ jobs: echo "build_time=${BUILD_TIME}" >> $GITHUB_OUTPUT echo "BUILD_TIME: ${BUILD_TIME}" - TAGS="ghcr.io/${REPOSITORY}:${BRANCH} , ghcr.io/${REPOSITORY}:development" + TAGS="ghcr.io/${REPOSITORY}:${BRANCH}" + if [[ "${BRANCH}" == "main" ]]; then + TAGS="${TAGS} , ghcr.io/${REPOSITORY}:development" + fi if [[ "${{ github.repository_owner }}" == "0xERR0R" ]]; then - TAGS="${TAGS} , spx01/blocky:${BRANCH} , spx01/blocky:development" + TAGS="${TAGS} , spx01/blocky:${BRANCH}" + if [[ "${BRANCH}" == "main" ]]; then + TAGS="${TAGS} , spx01/blocky:development" + fi fi echo "tags=${TAGS}" >> $GITHUB_OUTPUT echo "TAGS: ${TAGS}" diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index 34cf1d12f..fa4809c21 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -46,8 +46,8 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v3 - - name: Setup Golang with cache - uses: magnetikonline/action-golang-cache@v4 + - name: Setup Golang + uses: actions/setup-go@v4 if: matrix.go == true with: go-version-file: go.mod From 30ead041762afa534f236208f3a90836948fa4a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 12:04:01 +0200 Subject: [PATCH 02/92] build(deps): bump github.com/abice/go-enum from 0.5.5 to 0.5.6 (#955) Bumps [github.com/abice/go-enum](https://github.com/abice/go-enum) from 0.5.5 to 0.5.6. - [Release notes](https://github.com/abice/go-enum/releases) - [Changelog](https://github.com/abice/go-enum/blob/master/.goreleaser.yml) - [Commits](https://github.com/abice/go-enum/compare/v0.5.5...v0.5.6) --- updated-dependencies: - dependency-name: github.com/abice/go-enum dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 10 ++++++---- go.sum | 31 ++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 281ba3844..bdf637b7b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/0xERR0R/blocky go 1.20 require ( - github.com/abice/go-enum v0.5.5 + github.com/abice/go-enum v0.5.6 github.com/alicebob/miniredis/v2 v2.30.1 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef github.com/avast/retry-go/v4 v4.3.3 @@ -45,6 +45,8 @@ require ( require ( github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/Microsoft/go-winio v0.5.2 // indirect github.com/cenkalti/backoff/v4 v4.2.0 // indirect github.com/containerd/containerd v1.6.19 // indirect @@ -65,6 +67,8 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/opencontainers/runc v1.1.4 // indirect + github.com/shopspring/decimal v1.2.0 // indirect + github.com/spf13/cast v1.3.1 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/tools/cmd/cover v0.1.0-deprecated // indirect google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect @@ -74,8 +78,6 @@ require ( require ( github.com/KyleBanks/depth v1.2.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver v1.5.0 // indirect - github.com/Masterminds/sprig v2.22.0+incompatible // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d github.com/beorn7/perks v1.0.1 // indirect @@ -119,7 +121,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect - github.com/urfave/cli/v2 v2.24.1 // indirect + github.com/urfave/cli/v2 v2.25.1 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect golang.org/x/crypto v0.6.0 // indirect diff --git a/go.sum b/go.sum index ef185b0ff..765d2a424 100644 --- a/go.sum +++ b/go.sum @@ -41,15 +41,15 @@ github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/hcsshim v0.9.7 h1:mKNHW/Xvv1aFH87Jb6ERDzXTJTLPlmzfZ28VBFD/bfg= -github.com/abice/go-enum v0.5.5 h1:UTCWg71nZQGMJnN6X00UyWciy87ugnOCYIpd3LzQa8o= -github.com/abice/go-enum v0.5.5/go.mod h1:RoqIDsXjFQzxTgtHwgo4X9+SQLiTnF1YNOeQ7X1uSSE= +github.com/abice/go-enum v0.5.6 h1:Ury51IQXUppbIl56MqRU/++A8SSeLG4plePphPjxW1s= +github.com/abice/go-enum v0.5.6/go.mod h1:X2GpCT8VkCXLkVm48hebWx3cVgFJ8zM5nY5iUrJZO1Q= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -70,7 +70,7 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bradleyjkemp/cupaloy v2.3.0+incompatible h1:UafIjBvWQmS9i/xRg+CamMrnLTKNzo+bdmT/oH34c2Y= +github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -229,6 +229,7 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -250,6 +251,7 @@ github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4 github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= @@ -318,8 +320,10 @@ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.1.52 h1:Bmlc/qsNNULOe6bpXcUTsuOajd0DzRHwup6D9k1An0c= github.com/miekg/dns v1.1.52/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/patternmatcher v0.5.0 h1:YCZgJOeULcxLw1Q+sVR636pmS7sPEn1Qo2iAN6M7DBo= @@ -399,6 +403,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD 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/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= 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= @@ -407,6 +413,8 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -433,8 +441,8 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG github.com/testcontainers/testcontainers-go v0.19.0 h1:3bmFPuQRgVIQwxZJERyzB8AogmJW3Qzh8iDyfJbPhi8= github.com/testcontainers/testcontainers-go v0.19.0/go.mod h1:3YsSoxK0rGEUzbGD4gUVt1Nm3GJpCIq94GX+2LSf3d4= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.24.1 h1:/QYYr7g0EhwXEML8jO+8OYt5trPnLHS0p3mrgExJ5NU= -github.com/urfave/cli/v2 v2.24.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw= +github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= @@ -464,6 +472,7 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U 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-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -538,6 +547,7 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= @@ -619,11 +629,13 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= @@ -635,6 +647,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= From 2a2269683ffc004eaf4bfdec90baf8a5daf35a20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 07:43:50 +0200 Subject: [PATCH 03/92] build(deps): bump github.com/swaggo/swag from 1.8.11 to 1.8.12 (#964) Bumps [github.com/swaggo/swag](https://github.com/swaggo/swag) from 1.8.11 to 1.8.12. - [Release notes](https://github.com/swaggo/swag/releases) - [Changelog](https://github.com/swaggo/swag/blob/master/.goreleaser.yml) - [Commits](https://github.com/swaggo/swag/compare/v1.8.11...v1.8.12) --- updated-dependencies: - dependency-name: github.com/swaggo/swag dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index bdf637b7b..734577a24 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.6.1 github.com/stretchr/testify v1.8.2 - github.com/swaggo/swag v1.8.11 + github.com/swaggo/swag v1.8.12 github.com/x-cray/logrus-prefixed-formatter v0.5.2 golang.org/x/net v0.8.0 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 765d2a424..e33383f39 100644 --- a/go.sum +++ b/go.sum @@ -435,8 +435,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/swaggo/swag v1.8.11 h1:Fp1dNNtDvbCf+8kvehZbHQnlF6AxHGjmw6H/xAMrZfY= -github.com/swaggo/swag v1.8.11/go.mod h1:2GXgpNI9iy5OdsYWu8zXfRAGnOAPxYxTWTyM0XOTYZQ= +github.com/swaggo/swag v1.8.12 h1:pctzkNPu0AlQP2royqX3apjKCQonAnf7KGoxeO4y64w= +github.com/swaggo/swag v1.8.12/go.mod h1:lNfm6Gg+oAq3zRJQNEMBE66LIJKM44mxFqhEEgy2its= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/testcontainers/testcontainers-go v0.19.0 h1:3bmFPuQRgVIQwxZJERyzB8AogmJW3Qzh8iDyfJbPhi8= github.com/testcontainers/testcontainers-go v0.19.0/go.mod h1:3YsSoxK0rGEUzbGD4gUVt1Nm3GJpCIq94GX+2LSf3d4= From b856837ad9f6aca27c8bce70c8cfb67520cc72fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 07:44:18 +0200 Subject: [PATCH 04/92] build(deps): bump github.com/miekg/dns from 1.1.52 to 1.1.53 (#965) Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.52 to 1.1.53. - [Release notes](https://github.com/miekg/dns/releases) - [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release) - [Commits](https://github.com/miekg/dns/compare/v1.1.52...v1.1.53) --- updated-dependencies: - dependency-name: github.com/miekg/dns dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 734577a24..454b4340a 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/hashicorp/golang-lru v0.5.4 github.com/mattn/go-colorable v0.1.13 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect - github.com/miekg/dns v1.1.52 + github.com/miekg/dns v1.1.53 github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.9.2 github.com/onsi/gomega v1.27.5 diff --git a/go.sum b/go.sum index e33383f39..22f0bcbaa 100644 --- a/go.sum +++ b/go.sum @@ -318,8 +318,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/miekg/dns v1.1.52 h1:Bmlc/qsNNULOe6bpXcUTsuOajd0DzRHwup6D9k1An0c= -github.com/miekg/dns v1.1.52/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= +github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw= +github.com/miekg/dns v1.1.53/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= From f887e82fdc31c4cf565b02725ffbd48f253124f2 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Tue, 28 Mar 2023 18:51:41 -0400 Subject: [PATCH 05/92] fix: support IDNA in lists Not sure this is actually supported by most adblocker, but we might as well be permissive. --- lists/parsers/hosts.go | 23 ++++++++++++++++++++++- lists/parsers/hosts_test.go | 30 +++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/lists/parsers/hosts.go b/lists/parsers/hosts.go index 32323d7bc..e95a997e7 100644 --- a/lists/parsers/hosts.go +++ b/lists/parsers/hosts.go @@ -12,6 +12,7 @@ import ( "github.com/asaskevich/govalidator" "github.com/hashicorp/go-multierror" + "golang.org/x/net/idna" ) const maxDomainNameLength = 255 // https://www.rfc-editor.org/rfc/rfc1034#section-3.1 @@ -92,7 +93,8 @@ func (e *HostListEntry) UnmarshalText(data []byte) error { host := scanner.Text() - if err := validateHostsListEntry(host); err != nil { + host, err := normalizeHostsListEntry(host) + if err != nil { return err } @@ -191,6 +193,25 @@ func (e HostsFileEntry) forEachHost(callback func(string) error) error { return nil } +func normalizeHostsListEntry(host string) (string, error) { + // Lookup is the profile preferred for DNS queries, we use Punycode here as it does less validation. + // That avoids rejecting domains in a list for reasons that amount to "that domain should not be used" + // since the goal of the list is to determine whether the domain should be used or not, we leave + // that decision to it. + idnaProfile := idna.Punycode + + host, err := idnaProfile.ToASCII(host) + if err != nil { + return "", fmt.Errorf("%w: %s", err, host) + } + + if err := validateHostsListEntry(host); err != nil { + return "", err + } + + return host, nil +} + func validateDomainName(host string) error { if len(host) > maxDomainNameLength { return fmt.Errorf("domain name is too long: %s", host) diff --git a/lists/parsers/hosts_test.go b/lists/parsers/hosts_test.go index 76567d80a..fcbe316df 100644 --- a/lists/parsers/hosts_test.go +++ b/lists/parsers/hosts_test.go @@ -303,6 +303,14 @@ var _ = Describe("HostList", func() { "# comment", " ", "domain.tld # comment", + + // http://www.i18nguy.com/markup/idna-examples.html + "belgië.icom.museum", + "الأردن.icom.museum", + "한국.icom.museum", + + // Domain name w/ rune not supported by `idna.Lookup` + "domain_underscore.tld", ) }) @@ -317,11 +325,31 @@ var _ = Describe("HostList", func() { Expect(entry.String()).Should(Equal("domain.tld")) Expect(sut.Position()).Should(Equal("line 4")) + entry, err = sut.Next(context.Background()) + Expect(err).Should(Succeed()) + Expect(entry.String()).Should(Equal("xn--belgi-rsa.icom.museum")) + Expect(sut.Position()).Should(Equal("line 5")) + + entry, err = sut.Next(context.Background()) + Expect(err).Should(Succeed()) + Expect(entry.String()).Should(Equal("xn--igbhzh7gpa.icom.museum")) + Expect(sut.Position()).Should(Equal("line 6")) + + entry, err = sut.Next(context.Background()) + Expect(err).Should(Succeed()) + Expect(entry.String()).Should(Equal("xn--3e0b707e.icom.museum")) + Expect(sut.Position()).Should(Equal("line 7")) + + entry, err = sut.Next(context.Background()) + Expect(err).Should(Succeed()) + Expect(entry.String()).Should(Equal("domain_underscore.tld")) + Expect(sut.Position()).Should(Equal("line 8")) + _, err = sut.Next(context.Background()) Expect(err).ShouldNot(Succeed()) Expect(err).Should(MatchError(io.EOF)) Expect(IsNonResumableErr(err)).Should(BeTrue()) - Expect(sut.Position()).Should(Equal("line 5")) + Expect(sut.Position()).Should(Equal("line 9")) }) }) From 9b15e4807e75e01b5c26e25e156a75c700627dfd Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Tue, 28 Mar 2023 12:56:58 -0400 Subject: [PATCH 06/92] fix: log `startStrategy` instead of deprecated `failStartOnListError` --- config/blocking.go | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/config/blocking.go b/config/blocking.go index be13e435c..152c8c81d 100644 --- a/config/blocking.go +++ b/config/blocking.go @@ -9,19 +9,18 @@ import ( // BlockingConfig configuration for query blocking type BlockingConfig struct { - BlackLists map[string][]string `yaml:"blackLists"` - WhiteLists map[string][]string `yaml:"whiteLists"` - ClientGroupsBlock map[string][]string `yaml:"clientGroupsBlock"` - BlockType string `yaml:"blockType" default:"ZEROIP"` - BlockTTL Duration `yaml:"blockTTL" default:"6h"` - DownloadTimeout Duration `yaml:"downloadTimeout" default:"60s"` - DownloadAttempts uint `yaml:"downloadAttempts" default:"3"` - DownloadCooldown Duration `yaml:"downloadCooldown" default:"1s"` - RefreshPeriod Duration `yaml:"refreshPeriod" default:"4h"` - // Deprecated - FailStartOnListError bool `yaml:"failStartOnListError" default:"false"` - ProcessingConcurrency uint `yaml:"processingConcurrency" default:"4"` - StartStrategy StartStrategyType `yaml:"startStrategy" default:"blocking"` + BlackLists map[string][]string `yaml:"blackLists"` + WhiteLists map[string][]string `yaml:"whiteLists"` + ClientGroupsBlock map[string][]string `yaml:"clientGroupsBlock"` + BlockType string `yaml:"blockType" default:"ZEROIP"` + BlockTTL Duration `yaml:"blockTTL" default:"6h"` + DownloadTimeout Duration `yaml:"downloadTimeout" default:"60s"` + DownloadAttempts uint `yaml:"downloadAttempts" default:"3"` + DownloadCooldown Duration `yaml:"downloadCooldown" default:"1s"` + RefreshPeriod Duration `yaml:"refreshPeriod" default:"4h"` + FailStartOnListError bool `yaml:"failStartOnListError" default:"false"` // Deprecated + ProcessingConcurrency uint `yaml:"processingConcurrency" default:"4"` + StartStrategy StartStrategyType `yaml:"startStrategy" default:"blocking"` } // IsEnabled implements `config.Configurable`. @@ -45,7 +44,7 @@ func (c *BlockingConfig) LogConfig(logger *logrus.Entry) { logger.Infof("downloadTimeout = %s", c.DownloadTimeout) - logger.Infof("failStartOnListError = %t", c.FailStartOnListError) + logger.Infof("startStrategy = %s", c.StartStrategy) if c.RefreshPeriod > 0 { logger.Infof("refresh = every %s", c.RefreshPeriod) From 4d01349d69c82c8dc648e5437894a456404a0b44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 07:42:47 +0200 Subject: [PATCH 07/92] build(deps): bump github.com/onsi/gomega from 1.27.5 to 1.27.6 (#968) Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.5 to 1.27.6. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.27.5...v1.27.6) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 454b4340a..b96805813 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/miekg/dns v1.1.53 github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.9.2 - github.com/onsi/gomega v1.27.5 + github.com/onsi/gomega v1.27.6 github.com/prometheus/client_golang v1.14.0 github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.6.1 diff --git a/go.sum b/go.sum index 22f0bcbaa..c51c3aa08 100644 --- a/go.sum +++ b/go.sum @@ -350,8 +350,8 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU= github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts= -github.com/onsi/gomega v1.27.5 h1:T/X6I0RNFw/kTqgfkZPcQ5KU6vCnWNBGdtrIx2dpGeQ= -github.com/onsi/gomega v1.27.5/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= +github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= +github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= From 2b1786a42dbd09897ef8bc2a42d76c333922760b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 07:43:37 +0200 Subject: [PATCH 08/92] build(deps): bump github.com/opencontainers/runc from 1.1.4 to 1.1.5 (#967) Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.4 to 1.1.5. - [Release notes](https://github.com/opencontainers/runc/releases) - [Changelog](https://github.com/opencontainers/runc/blob/v1.1.5/CHANGELOG.md) - [Commits](https://github.com/opencontainers/runc/compare/v1.1.4...v1.1.5) --- updated-dependencies: - dependency-name: github.com/opencontainers/runc dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b96805813..d0df27d85 100644 --- a/go.mod +++ b/go.mod @@ -66,7 +66,7 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect - github.com/opencontainers/runc v1.1.4 // indirect + github.com/opencontainers/runc v1.1.5 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/cast v1.3.1 // indirect golang.org/x/sync v0.1.0 // indirect diff --git a/go.sum b/go.sum index c51c3aa08..18a2934ff 100644 --- a/go.sum +++ b/go.sum @@ -356,8 +356,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= -github.com/opencontainers/runc v1.1.4 h1:nRCz/8sKg6K6jgYAFLDlXzPeITBZJyX28DBVhWD+5dg= -github.com/opencontainers/runc v1.1.4/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= +github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= From 68a8476e489a0ce0f1640af4fdda186c1f51b1ce Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Mon, 3 Apr 2023 16:33:16 +0200 Subject: [PATCH 09/92] chore(build): Automation workflows (#972) * Added fork sync workflow(syncs the main branch with upstream every 30 minutes) * Added monthly workflow run deletion(all skipped or canceld and runs older than 30days will be deleted) * Removed Docker image build for main branch on forks * Added documentation how to enable sync and docker build workflows --- .github/workflows/delete-workflow-runs.yml | 37 +++++++++++++++++++ .github/workflows/development-docker.yml | 11 ++++-- .github/workflows/fork-sync.yml | 36 ++++++++++++++++++ .../stringcache/chained_grouped_cache_test.go | 1 - .../in_memory_grouped_cache_test.go | 2 - config/blocking_test.go | 4 +- config/caching_test.go | 4 +- config/client_lookup_test.go | 4 +- config/conditional_upstream_test.go | 4 +- config/custom_dns_test.go | 4 +- config/filtering_test.go | 4 +- config/hosts_file_test.go | 4 +- config/metrics_test.go | 4 +- config/parallel_best_test.go | 4 +- config/query_log_test.go | 4 +- config/rewriter_test.go | 4 +- docs/additional_information.md | 12 ++++++ lists/parsers/adapt.go | 2 +- lists/parsers/filtererrors_test.go | 4 +- lists/parsers/hosts_test.go | 12 ++---- lists/parsers/parser_test.go | 4 +- util/arpa.go | 4 +- 22 files changed, 110 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/delete-workflow-runs.yml create mode 100644 .github/workflows/fork-sync.yml diff --git a/.github/workflows/delete-workflow-runs.yml b/.github/workflows/delete-workflow-runs.yml new file mode 100644 index 000000000..e7582882d --- /dev/null +++ b/.github/workflows/delete-workflow-runs.yml @@ -0,0 +1,37 @@ +name: Delete workflow runs + +on: + schedule: + - cron: '0 0 1 * *' + workflow_dispatch: + +jobs: + del_runs: + name: Delete workflow runs + runs-on: ubuntu-latest + steps: + - name: Delete skipped + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: 0 + keep_minimum_runs: 0 + delete_run_by_conclusion_pattern: skipped + + - name: Delete cancelled + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: 0 + keep_minimum_runs: 0 + delete_run_by_conclusion_pattern: cancelled + + - name: Delete workflow runs(older than a month) + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: 30 + keep_minimum_runs: 6 \ No newline at end of file diff --git a/.github/workflows/development-docker.yml b/.github/workflows/development-docker.yml index 9822e22db..1d4bf7adf 100644 --- a/.github/workflows/development-docker.yml +++ b/.github/workflows/development-docker.yml @@ -35,15 +35,18 @@ jobs: if [[ "${ENABLED,,}" != "true" ]]; then echo "enabled=0" >> $GITHUB_OUTPUT - echo "Workflow is disabled" echo "### Workflow is disabled" >> $GITHUB_STEP_SUMMARY echo "To enable this workflow by creating a secret 'DEVELOPMENT_DOCKER' with the value 'true'" >> $GITHUB_STEP_SUMMARY else - echo "enabled=1" >> $GITHUB_OUTPUT - - echo "Workflow is enabled" + if [[ "${{ github.repository_owner }}" != "0xERR0R" && "${GITHUB_REF#refs/heads/}" == "main" ]]; then + echo "enabled=0" >> $GITHUB_OUTPUT + echo "Workflow is disabled for main branch on forks" + else + echo "enabled=1" >> $GITHUB_OUTPUT + echo "Workflow is enabled" + fi fi docker: diff --git a/.github/workflows/fork-sync.yml b/.github/workflows/fork-sync.yml new file mode 100644 index 000000000..e66f1356d --- /dev/null +++ b/.github/workflows/fork-sync.yml @@ -0,0 +1,36 @@ +name: Sync Fork + +on: + schedule: + - cron: '*/30 * * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + +jobs: + sync: + name: Sync with Upstream + runs-on: ubuntu-latest + if: github.repository_owner != '0xERR0R' + steps: + - name: Enabled Check + id: check + shell: bash + run: | + if [[ "${{ secrets.FORK_SYNC_TOKEN }}" != "" ]]; then + echo "enabled=1" >> $GITHUB_OUTPUT + + echo "Workflow is enabled" + else + echo "enabled=0" >> $GITHUB_OUTPUT + + echo "Workflow is disabled(create FORK_SYNC_TOKEN secret with repo write permission to enable it)" + fi + - name: Sync + if: ${{ steps.check.outputs.enabled == 1 }} + env: + GH_TOKEN: ${{ secrets.FORK_SYNC_TOKEN }} + shell: bash + run: | + gh repo sync ${{ github.repository }} -b main diff --git a/cache/stringcache/chained_grouped_cache_test.go b/cache/stringcache/chained_grouped_cache_test.go index 5823f6f25..e83f9560e 100644 --- a/cache/stringcache/chained_grouped_cache_test.go +++ b/cache/stringcache/chained_grouped_cache_test.go @@ -89,6 +89,5 @@ var _ = Describe("Chained grouped cache", func() { Expect(cache.Contains("both", []string{"group1", "group2"})).Should(ConsistOf("group2")) }) }) - }) }) diff --git a/cache/stringcache/in_memory_grouped_cache_test.go b/cache/stringcache/in_memory_grouped_cache_test.go index 71bf5ef16..7692935a9 100644 --- a/cache/stringcache/in_memory_grouped_cache_test.go +++ b/cache/stringcache/in_memory_grouped_cache_test.go @@ -32,7 +32,6 @@ var _ = Describe("In-Memory grouped cache", func() { Expect(cache.Contains("searchString", []string{"group1"})).Should(BeEmpty()) }) }) - }) Describe("Cache creation", func() { When("cache with 1 group was created", func() { @@ -127,6 +126,5 @@ var _ = Describe("In-Memory grouped cache", func() { Expect(cache.Contains("both", []string{"group1", "group2"})).Should(ConsistOf("group2")) }) }) - }) }) diff --git a/config/blocking_test.go b/config/blocking_test.go index b806b028e..59258525c 100644 --- a/config/blocking_test.go +++ b/config/blocking_test.go @@ -10,9 +10,7 @@ import ( ) var _ = Describe("BlockingConfig", func() { - var ( - cfg BlockingConfig - ) + var cfg BlockingConfig suiteBeforeEach() diff --git a/config/caching_test.go b/config/caching_test.go index a295d0c95..1b80c7ac7 100644 --- a/config/caching_test.go +++ b/config/caching_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("CachingConfig", func() { - var ( - cfg CachingConfig - ) + var cfg CachingConfig suiteBeforeEach() diff --git a/config/client_lookup_test.go b/config/client_lookup_test.go index bdf169b71..a388dd959 100644 --- a/config/client_lookup_test.go +++ b/config/client_lookup_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("ClientLookupConfig", func() { - var ( - cfg ClientLookupConfig - ) + var cfg ClientLookupConfig suiteBeforeEach() diff --git a/config/conditional_upstream_test.go b/config/conditional_upstream_test.go index 7016a14c9..9f8d6eb31 100644 --- a/config/conditional_upstream_test.go +++ b/config/conditional_upstream_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("ConditionalUpstreamConfig", func() { - var ( - cfg ConditionalUpstreamConfig - ) + var cfg ConditionalUpstreamConfig suiteBeforeEach() diff --git a/config/custom_dns_test.go b/config/custom_dns_test.go index 0361bf20b..a96061cdd 100644 --- a/config/custom_dns_test.go +++ b/config/custom_dns_test.go @@ -10,9 +10,7 @@ import ( ) var _ = Describe("CustomDNSConfig", func() { - var ( - cfg CustomDNSConfig - ) + var cfg CustomDNSConfig suiteBeforeEach() diff --git a/config/filtering_test.go b/config/filtering_test.go index 648cd1865..4b4ce1682 100644 --- a/config/filtering_test.go +++ b/config/filtering_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("FilteringConfig", func() { - var ( - cfg FilteringConfig - ) + var cfg FilteringConfig suiteBeforeEach() diff --git a/config/hosts_file_test.go b/config/hosts_file_test.go index aa112080d..5f67feb81 100644 --- a/config/hosts_file_test.go +++ b/config/hosts_file_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("HostsFileConfig", func() { - var ( - cfg HostsFileConfig - ) + var cfg HostsFileConfig suiteBeforeEach() diff --git a/config/metrics_test.go b/config/metrics_test.go index afedbe77f..b5f968b2f 100644 --- a/config/metrics_test.go +++ b/config/metrics_test.go @@ -7,9 +7,7 @@ import ( ) var _ = Describe("MetricsConfig", func() { - var ( - cfg MetricsConfig - ) + var cfg MetricsConfig suiteBeforeEach() diff --git a/config/parallel_best_test.go b/config/parallel_best_test.go index 1f8f6e959..9acef009e 100644 --- a/config/parallel_best_test.go +++ b/config/parallel_best_test.go @@ -7,9 +7,7 @@ import ( ) var _ = Describe("ParallelBestConfig", func() { - var ( - cfg ParallelBestConfig - ) + var cfg ParallelBestConfig suiteBeforeEach() diff --git a/config/query_log_test.go b/config/query_log_test.go index 208f755c9..582fa34b1 100644 --- a/config/query_log_test.go +++ b/config/query_log_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("QueryLogConfig", func() { - var ( - cfg QueryLogConfig - ) + var cfg QueryLogConfig suiteBeforeEach() diff --git a/config/rewriter_test.go b/config/rewriter_test.go index 5b92083e0..a7414d560 100644 --- a/config/rewriter_test.go +++ b/config/rewriter_test.go @@ -7,9 +7,7 @@ import ( ) var _ = Describe("RewriterConfig", func() { - var ( - cfg RewriterConfig - ) + var cfg RewriterConfig suiteBeforeEach() diff --git a/docs/additional_information.md b/docs/additional_information.md index 59e0b3298..d54800cdb 100644 --- a/docs/additional_information.md +++ b/docs/additional_information.md @@ -108,4 +108,16 @@ Main: [:material-docker:Docker Hub](https://hub.docker.com/r/spx01/blocky) Mirror: [:material-github:GitHub Container Registry](https://ghcr.io/0xerr0r/blocky) +## Developer Information + +### Docker Images + +To enable Docker image creation on a GitHub fork create a secret with the name `DEVELOPMENT_DOCKER` and the value `true`. +This will trigger a workflow on every push of a branch starting with `fb-` and create an image with the branch name. + +### Automatic fork sync + +To enable automatic fork synchronisation create a secret with the name `FORK_SYNC_TOKEN` with an access token that has write permission to the fork repository. +The enabled workflow will sync the main branch every 30 minutes with its upstream. + --8<-- "docs/includes/abbreviations.md" diff --git a/lists/parsers/adapt.go b/lists/parsers/adapt.go index 8f6ce355e..6c08fc699 100644 --- a/lists/parsers/adapt.go +++ b/lists/parsers/adapt.go @@ -16,7 +16,7 @@ func TryAdapt[From, To any](inner SeriesParser[From], adapt func(From) (To, erro // TryAdaptMethod returns a parser that wraps `inner` and tries to convert each parsed value // using the given method with pointer receiver of `To`. -func TryAdaptMethod[ToPtr *To, From any, To any]( +func TryAdaptMethod[ToPtr *To, From, To any]( inner SeriesParser[From], method func(ToPtr, From) error, ) SeriesParser[*To] { return TryAdapt(inner, func(from From) (*To, error) { diff --git a/lists/parsers/filtererrors_test.go b/lists/parsers/filtererrors_test.go index 2c3fc7d1b..001552e6c 100644 --- a/lists/parsers/filtererrors_test.go +++ b/lists/parsers/filtererrors_test.go @@ -11,9 +11,7 @@ import ( var _ = Describe("errorFilter", func() { Describe("AllowErrors", func() { - var ( - parser SeriesParser[struct{}] - ) + var parser SeriesParser[struct{}] BeforeEach(func() { parser = newMockParser(func(res chan<- struct{}, err chan<- error) { diff --git a/lists/parsers/hosts_test.go b/lists/parsers/hosts_test.go index fcbe316df..f9b00f5fc 100644 --- a/lists/parsers/hosts_test.go +++ b/lists/parsers/hosts_test.go @@ -86,9 +86,7 @@ var _ = Describe("Hosts", func() { }) Describe("HostsIterator.ForEachHost", func() { - var ( - entry *HostsIterator - ) + var entry *HostsIterator BeforeEach(func() { sutReader = linesReader( @@ -227,9 +225,7 @@ var _ = Describe("HostsFile", func() { }) Describe("HostsFileEntry.forEachHost", func() { - var ( - entry *HostsFileEntry - ) + var entry *HostsFileEntry BeforeEach(func() { sutReader = linesReader( @@ -374,9 +370,7 @@ var _ = Describe("HostList", func() { }) Describe("HostListEntry.forEachHost", func() { - var ( - entry *HostListEntry - ) + var entry *HostListEntry BeforeEach(func() { sutReader = linesReader( diff --git a/lists/parsers/parser_test.go b/lists/parsers/parser_test.go index 45db523b3..25565f781 100644 --- a/lists/parsers/parser_test.go +++ b/lists/parsers/parser_test.go @@ -11,9 +11,7 @@ import ( ) var _ = Describe("ForEach", func() { - var ( - lines SeriesParser[string] - ) + var lines SeriesParser[string] BeforeEach(func() { lines = Lines(linesReader( diff --git a/util/arpa.go b/util/arpa.go index ee69b6945..f1bc4ab4a 100644 --- a/util/arpa.go +++ b/util/arpa.go @@ -15,9 +15,7 @@ const ( byteBits = 8 ) -var ( - ErrInvalidArpaAddrLen = errors.New("arpa hostname is not of expected length") -) +var ErrInvalidArpaAddrLen = errors.New("arpa hostname is not of expected length") func ParseIPFromArpaAddr(arpa string) (net.IP, error) { if strings.HasSuffix(arpa, IPv4PtrSuffix) { From 74fcd500d384f18527f7544776b9a0f5123dab85 Mon Sep 17 00:00:00 2001 From: Dimitri Herzog Date: Tue, 4 Apr 2023 09:25:45 +0200 Subject: [PATCH 10/92] chore(build): add format with gofumpt to build (#974) --- Makefile | 6 +++--- tools.go | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 825f6dd42..d318cd489 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ else go generate ./... endif -build: generate ## Build binary +build: fmt generate ## Build binary go build $(GO_BUILD_FLAGS) -ldflags="$(GO_BUILD_LD_FLAGS)" -o $(GO_BUILD_OUTPUT) ifdef BIN_USER $(info setting owner of $(GO_BUILD_OUTPUT) to $(BIN_USER)) @@ -74,7 +74,7 @@ e2e-test: ## run e2e tests race: ## run tests with race detector go run github.com/onsi/ginkgo/v2/ginkgo --label-filter="!e2e" --race ./... -lint: ## run golangcli-lint checks +lint: fmt ## run golangcli-lint checks go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANG_LINT_VERSION) run --timeout 5m run: build ## Build and run binary @@ -82,7 +82,7 @@ run: build ## Build and run binary fmt: ## gofmt and goimports all go files go run mvdan.cc/gofumpt -l -w -extra . - find . -name '*.go' -exec goimports -w {} + + find . -name '*.go' -exec go run golang.org/x/tools/cmd/goimports -w {} + docker-build: generate ## Build docker image docker buildx build \ diff --git a/tools.go b/tools.go index 75de3c1aa..87b0a1d8f 100644 --- a/tools.go +++ b/tools.go @@ -11,5 +11,6 @@ import ( _ "github.com/dosgo/zigtool/zigcpp" _ "github.com/onsi/ginkgo/v2/ginkgo" _ "github.com/swaggo/swag/cmd/swag" + _ "golang.org/x/tools/cmd/goimports" _ "mvdan.cc/gofumpt" ) From eda3b505cd295899aeabe318bf18a64be498bc70 Mon Sep 17 00:00:00 2001 From: Dimitri Herzog Date: Wed, 5 Apr 2023 09:46:23 +0200 Subject: [PATCH 11/92] chore(test): set default timeout for eventually --- e2e/e2e_suite_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/e2e/e2e_suite_test.go b/e2e/e2e_suite_test.go index 561794dc7..ebfd5e019 100644 --- a/e2e/e2e_suite_test.go +++ b/e2e/e2e_suite_test.go @@ -3,6 +3,7 @@ package e2e import ( "context" "testing" + "time" "github.com/0xERR0R/blocky/helpertest" @@ -44,4 +45,5 @@ var _ = BeforeSuite(func() { tmpDir = helpertest.NewTmpFolder("config") Expect(tmpDir.Error).Should(Succeed()) DeferCleanup(tmpDir.Clean) + SetDefaultEventuallyTimeout(5 * time.Second) }) From 8614fde9d084d1afb1efd733d82846b6433c6ee7 Mon Sep 17 00:00:00 2001 From: Dimitri Herzog Date: Wed, 5 Apr 2023 09:52:15 +0200 Subject: [PATCH 12/92] chore(test): add HTTP listener readiness check --- e2e/containers.go | 76 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/e2e/containers.go b/e2e/containers.go index e7c6558a7..1161f6232 100644 --- a/e2e/containers.go +++ b/e2e/containers.go @@ -6,9 +6,13 @@ import ( "fmt" "io" "net" + "net/http" "strings" "time" + log "github.com/sirupsen/logrus" + + "github.com/0xERR0R/blocky/config" "github.com/0xERR0R/blocky/helpertest" "github.com/0xERR0R/blocky/util" "github.com/avast/retry-go/v4" @@ -165,6 +169,11 @@ func createBlockyContainer(tmpDir *helpertest.TmpFolder, lines ...string) (testc return nil, f1.Error } + cfg, err := config.LoadConfig(f1.Path, true) + if err != nil { + return nil, fmt.Errorf("can't create config struct %w", err) + } + const modeOwner = 700 ctx := context.Background() @@ -196,29 +205,86 @@ func createBlockyContainer(tmpDir *helpertest.TmpFolder, lines ...string) (testc ginkgo.AddReportEntry("blocky container log", string(b)) } } + + return container, err } - // check if DNS interface is working. + // check if DNS/HTTP interface is working. // Sometimes the internal health check returns OK, but the container port is not mapped yet + err = checkBlockyReadiness(cfg, container) + + if err != nil { + return container, fmt.Errorf("container not ready: %w", err) + } + + return container, nil +} + +func checkBlockyReadiness(cfg *config.Config, container testcontainers.Container) error { + var err error + const retryAttempts = 3 + err = retry.Do( func() error { _, err = doDNSRequest(container, util.NewMsgWithQuestion("healthcheck.blocky.", dns.Type(dns.TypeA))) return err }, + retry.OnRetry(func(n uint, err error) { + log.Infof("Performing retry DNS request #%d: %s\n", n, err) + }), retry.Attempts(retryAttempts), retry.DelayType(retry.BackOffDelay), retry.Delay(time.Second)) if err != nil { - return container, fmt.Errorf("can't perform the healthcheck request: %w", err) + return fmt.Errorf("can't perform the DNS healthcheck request: %w", err) } - return container, err + for _, httpPort := range cfg.Ports.HTTP { + parts := strings.Split(httpPort, ":") + port := parts[len(parts)-1] + err = retry.Do( + func() error { + return doHTTPRequest(container, port) + }, + retry.OnRetry(func(n uint, err error) { + log.Infof("Performing retry HTTP request #%d: %s\n", n, err) + }), + retry.Attempts(retryAttempts), + retry.DelayType(retry.BackOffDelay), + retry.Delay(time.Second)) + + if err != nil { + return fmt.Errorf("can't perform the HTTP request: %w", err) + } + } + + return nil +} + +func doHTTPRequest(container testcontainers.Container, containerPort string) error { + host, port, err := getContainerHostPort(container, nat.Port(fmt.Sprintf("%s/tcp", containerPort))) + if err != nil { + return err + } + + resp, err := http.Get(fmt.Sprintf("http://%s", net.JoinHostPort(host, port))) + if err != nil { + return err + } + + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("received not OK status: %d", resp.StatusCode) + } + + return err } -func doDNSRequest(blocky testcontainers.Container, message *dns.Msg) (*dns.Msg, error) { +func doDNSRequest(container testcontainers.Container, message *dns.Msg) (*dns.Msg, error) { const timeout = 5 * time.Second c := &dns.Client{ @@ -226,7 +292,7 @@ func doDNSRequest(blocky testcontainers.Container, message *dns.Msg) (*dns.Msg, Timeout: timeout, } - host, port, err := getContainerHostPort(blocky, "53/tcp") + host, port, err := getContainerHostPort(container, "53/tcp") if err != nil { return nil, err } From 7b13810246adccc54701934456631281f7f8cf9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 12:56:37 +0000 Subject: [PATCH 13/92] build(deps): bump github.com/spf13/cobra from 1.6.1 to 1.7.0 Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.6.1 to 1.7.0. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/compare/v1.6.1...v1.7.0) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index d0df27d85..24f106444 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/onsi/gomega v1.27.6 github.com/prometheus/client_golang v1.14.0 github.com/sirupsen/logrus v1.9.0 - github.com/spf13/cobra v1.6.1 + github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.2 github.com/swaggo/swag v1.8.12 github.com/x-cray/logrus-prefixed-formatter v0.5.2 @@ -98,7 +98,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.13 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jinzhu/inflection v1.0.0 // indirect @@ -130,7 +130,7 @@ require ( golang.org/x/sys v0.6.0 // indirect golang.org/x/term v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect - golang.org/x/tools v0.7.0 // indirect + golang.org/x/tools v0.7.0 google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 18a2934ff..e77ca2308 100644 --- a/go.sum +++ b/go.sum @@ -254,8 +254,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1: github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= @@ -415,8 +415,8 @@ github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0 github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= From c88270bc3520d26e30324c0e9016776068926b98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 02:55:25 +0200 Subject: [PATCH 14/92] build(deps): bump golang.org/x/net from 0.8.0 to 0.9.0 (#982) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.8.0 to 0.9.0. - [Release notes](https://github.com/golang/net/releases) - [Commits](https://github.com/golang/net/compare/v0.8.0...v0.9.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 24f106444..8e2691817 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/stretchr/testify v1.8.2 github.com/swaggo/swag v1.8.12 github.com/x-cray/logrus-prefixed-formatter v0.5.2 - golang.org/x/net v0.8.0 + golang.org/x/net v0.9.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.4.7 gorm.io/driver/postgres v1.5.0 @@ -127,9 +127,9 @@ require ( golang.org/x/crypto v0.6.0 // indirect golang.org/x/exp v0.0.0-20230307190834-24139beb5833 golang.org/x/mod v0.9.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect + golang.org/x/sys v0.7.0 // indirect + golang.org/x/term v0.7.0 // indirect + golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.7.0 google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index e77ca2308..5d352524c 100644 --- a/go.sum +++ b/go.sum @@ -549,8 +549,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= 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/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -631,14 +631,14 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -649,8 +649,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 74516ca0b9414b581ff2e31c8c30eb69fddf30cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 04:12:44 +0200 Subject: [PATCH 15/92] build(deps): bump mvdan.cc/gofumpt from 0.4.0 to 0.5.0 (#984) Bumps [mvdan.cc/gofumpt](https://github.com/mvdan/gofumpt) from 0.4.0 to 0.5.0. - [Release notes](https://github.com/mvdan/gofumpt/releases) - [Changelog](https://github.com/mvdan/gofumpt/blob/master/CHANGELOG.md) - [Commits](https://github.com/mvdan/gofumpt/compare/v0.4.0...v0.5.0) --- updated-dependencies: - dependency-name: mvdan.cc/gofumpt dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 17 ++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 8e2691817..1cdae788d 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/docker/go-connections v0.4.0 github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198 github.com/testcontainers/testcontainers-go v0.19.0 - mvdan.cc/gofumpt v0.4.0 + mvdan.cc/gofumpt v0.5.0 ) require ( @@ -126,11 +126,11 @@ require ( github.com/yuin/gopher-lua v1.1.0 // indirect golang.org/x/crypto v0.6.0 // indirect golang.org/x/exp v0.0.0-20230307190834-24139beb5833 - golang.org/x/mod v0.9.0 // indirect + golang.org/x/mod v0.10.0 // indirect golang.org/x/sys v0.7.0 // indirect golang.org/x/term v0.7.0 // indirect golang.org/x/text v0.9.0 // indirect - golang.org/x/tools v0.7.0 + golang.org/x/tools v0.8.0 google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 5d352524c..e4074086b 100644 --- a/go.sum +++ b/go.sum @@ -127,7 +127,7 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -360,7 +360,6 @@ github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/ github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= 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 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -398,7 +397,7 @@ github.com/ramr/go-reaper v0.2.1/go.mod h1:AVypdzrcCXjSc/JYnlXl8TsB+z84WyFzxWE8J github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 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= @@ -509,8 +508,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -699,8 +698,8 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y= +golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/tools/cmd/cover v0.1.0-deprecated h1:Rwy+mWYz6loAF+LnG1jHG/JWMHRMMC2/1XX3Ejkx9lA= golang.org/x/tools/cmd/cover v0.1.0-deprecated/go.mod h1:hMDiIvlpN1NoVgmjLjUJE9tMHyxHjFX7RuQ+rW12mSA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -834,8 +833,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM= -mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ= +mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= +mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 015b565137f2a79ed4d0be7ba548e7ca6c2acb06 Mon Sep 17 00:00:00 2001 From: mandrav Date: Wed, 12 Apr 2023 21:43:49 +0300 Subject: [PATCH 16/92] Add maxErrorsPerFile blocking configuration (#986) * Add maxErrorsPerFile blocking configuration The default max errors per file of 5 is too small IMHO. This commit makes this number user-configurable. * squash: fix lint * squash: docs * squash: change type to int to allow -1 * squash: test that the `maxErrorsPerFile` is actually used --------- Co-authored-by: ThinkChaos --- config/blocking.go | 3 ++ docs/config.yml | 4 +++ docs/configuration.md | 14 +++++++- lists/list_cache.go | 7 ++-- lists/list_cache_benchmark_test.go | 2 +- lists/list_cache_test.go | 57 +++++++++++++++++++----------- resolver/blocking_resolver.go | 4 +-- 7 files changed, 64 insertions(+), 27 deletions(-) diff --git a/config/blocking.go b/config/blocking.go index 152c8c81d..2adfd9e24 100644 --- a/config/blocking.go +++ b/config/blocking.go @@ -21,6 +21,7 @@ type BlockingConfig struct { FailStartOnListError bool `yaml:"failStartOnListError" default:"false"` // Deprecated ProcessingConcurrency uint `yaml:"processingConcurrency" default:"4"` StartStrategy StartStrategyType `yaml:"startStrategy" default:"blocking"` + MaxErrorsPerFile int `yaml:"maxErrorsPerFile" default:"5"` } // IsEnabled implements `config.Configurable`. @@ -46,6 +47,8 @@ func (c *BlockingConfig) LogConfig(logger *logrus.Entry) { logger.Infof("startStrategy = %s", c.StartStrategy) + logger.Infof("maxErrorsPerFile = %d", c.MaxErrorsPerFile) + if c.RefreshPeriod > 0 { logger.Infof("refresh = every %s", c.RefreshPeriod) } else { diff --git a/docs/config.yml b/docs/config.yml index 738efd126..7bb0d6ad6 100644 --- a/docs/config.yml +++ b/docs/config.yml @@ -111,6 +111,10 @@ blocking: downloadCooldown: 10s # optional: if failOnError, application startup will fail if at least one list can't be downloaded / opened. Default: blocking startStrategy: failOnError + # Number of errors allowed in a list before it is considered invalid. + # A value of -1 disables the limit. + # Default: 5 + maxErrorsPerFile: 5 # optional: configuration for caching of DNS responses caching: diff --git a/docs/configuration.md b/docs/configuration.md index dffa4acb9..c63127165 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -496,7 +496,7 @@ You can configure the list download attempts according to your internet connecti ### Start strategy You can configure the blocking behavior during application start of blocky. -If no starategy is selected blocking will be used. +If no strategy is selected blocking will be used. | startStrategy | Description | |---------------|-------------------------------------------------------------------------------------------------------| @@ -511,6 +511,18 @@ If no starategy is selected blocking will be used. startStrategy: failOnError ``` +### Max Errors per file + +Number of errors allowed in a list before it is considered invalid and parsing stops. +A value of -1 disables the limit. + +!!! example + + ```yaml + blocking: + maxErrorsPerFile: 10 + ``` + ### Concurrency Blocky downloads and processes links in a single group concurrently. With parameter `processingConcurrency` you can adjust diff --git a/lists/list_cache.go b/lists/list_cache.go index 0bf60ff67..8e17ae760 100644 --- a/lists/list_cache.go +++ b/lists/list_cache.go @@ -23,7 +23,6 @@ import ( const ( defaultProcessingConcurrency = 4 chanCap = 1000 - maxErrorsPerFile = 5 ) // ListCacheType represents the type of cached list ENUM( @@ -47,6 +46,7 @@ type ListCache struct { downloader FileDownloader listType ListCacheType processingConcurrency uint + maxErrorsPerFile int } // LogConfig implements `config.Configurable`. @@ -64,7 +64,7 @@ func (b *ListCache) LogConfig(logger *logrus.Entry) { // NewListCache creates new list instance func NewListCache(t ListCacheType, groupToLinks map[string][]string, refreshPeriod time.Duration, - downloader FileDownloader, processingConcurrency uint, async bool, + downloader FileDownloader, processingConcurrency uint, async bool, maxErrorsPerFile int, ) (*ListCache, error) { if processingConcurrency == 0 { processingConcurrency = defaultProcessingConcurrency @@ -80,6 +80,7 @@ func NewListCache(t ListCacheType, groupToLinks map[string][]string, refreshPeri downloader: downloader, listType: t, processingConcurrency: processingConcurrency, + maxErrorsPerFile: maxErrorsPerFile, } var initError error @@ -261,7 +262,7 @@ func (b *ListCache) parseFile(ctx context.Context, name, link string, resultCh c } defer r.Close() - p := parsers.AllowErrors(parsers.Hosts(r), maxErrorsPerFile) + p := parsers.AllowErrors(parsers.Hosts(r), b.maxErrorsPerFile) p.OnErr(func(err error) { logger().Warnf("parse error: %s, trying to continue", err) }) diff --git a/lists/list_cache_benchmark_test.go b/lists/list_cache_benchmark_test.go index f40f3024f..565da927c 100644 --- a/lists/list_cache_benchmark_test.go +++ b/lists/list_cache_benchmark_test.go @@ -12,7 +12,7 @@ func BenchmarkRefresh(b *testing.B) { "gr1": {file1, file2, file3}, } - cache, _ := NewListCache(ListCacheTypeBlacklist, lists, -1, NewDownloader(), 5, false) + cache, _ := NewListCache(ListCacheTypeBlacklist, lists, -1, NewDownloader(), 5, false, 5) b.ReportAllocs() diff --git a/lists/list_cache_test.go b/lists/list_cache_test.go index 9543a7f1f..2c2fdd83a 100644 --- a/lists/list_cache_test.go +++ b/lists/list_cache_test.go @@ -27,8 +27,10 @@ var _ = Describe("ListCache", func() { tmpDir *TmpFolder emptyFile, file1, file2, file3 *TmpFile server1, server2, server3 *httptest.Server + maxErrorsPerFile int ) BeforeEach(func() { + maxErrorsPerFile = 5 tmpDir = NewTmpFolder("ListCache") Expect(tmpDir.Error).Should(Succeed()) DeferCleanup(tmpDir.Clean) @@ -56,7 +58,9 @@ var _ = Describe("ListCache", func() { lists := map[string][]string{ "gr0": {emptyFile.Path}, } - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false) + sut, err := NewListCache( + ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, + ) Expect(err).Should(Succeed()) group := sut.Match("", []string{"gr0"}) @@ -69,7 +73,9 @@ var _ = Describe("ListCache", func() { lists := map[string][]string{ "gr1": {emptyFile.Path}, } - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false) + sut, err := NewListCache( + ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, + ) Expect(err).Should(Succeed()) group := sut.Match("google.com", []string{"gr1"}) @@ -93,6 +99,7 @@ var _ = Describe("ListCache", func() { mockDownloader, defaultProcessingConcurrency, false, + maxErrorsPerFile, ) Expect(err).Should(Succeed()) @@ -119,7 +126,7 @@ var _ = Describe("ListCache", func() { } sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false) + defaultProcessingConcurrency, false, maxErrorsPerFile) Expect(err).Should(Succeed()) group := sut.Match("inlinedomain1.com", []string{"gr1"}) @@ -148,6 +155,7 @@ var _ = Describe("ListCache", func() { mockDownloader, defaultProcessingConcurrency, false, + maxErrorsPerFile, ) Expect(err).Should(Succeed()) @@ -186,7 +194,7 @@ var _ = Describe("ListCache", func() { } sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, mockDownloader, - defaultProcessingConcurrency, false) + defaultProcessingConcurrency, false, maxErrorsPerFile) Expect(err).Should(Succeed()) By("Lists loaded without err", func() { @@ -209,7 +217,9 @@ var _ = Describe("ListCache", func() { "gr2": {server3.URL}, } - sut, _ := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false) + sut, _ := NewListCache( + ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, + ) group := sut.Match("blocked1.com", []string{"gr1", "gr2"}) Expect(group).Should(ContainElement("gr1")) @@ -228,7 +238,9 @@ var _ = Describe("ListCache", func() { "gr2": {server3.URL, "someotherfile"}, } - sut, _ := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false) + sut, _ := NewListCache( + ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, + ) group := sut.Match("blocked1.com", []string{"gr1", "gr2"}) Expect(group).Should(ContainElement("gr1")) @@ -252,7 +264,9 @@ var _ = Describe("ListCache", func() { resultCnt = cnt }) - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false) + sut, err := NewListCache( + ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, + ) Expect(err).Should(Succeed()) group := sut.Match("blocked1.com", []string{}) @@ -267,7 +281,9 @@ var _ = Describe("ListCache", func() { "gr2": {"file://" + file3.Path}, } - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false) + sut, err := NewListCache( + ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, + ) Expect(err).Should(Succeed()) Expect(sut.groupedCache.ElementCount("gr1")).Should(Equal(3)) @@ -293,7 +309,7 @@ var _ = Describe("ListCache", func() { } sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false) + defaultProcessingConcurrency, false, maxErrorsPerFile) Expect(err).Should(Succeed()) Expect(sut.groupedCache.ElementCount("gr1")).Should(Equal(lines1 + lines2 + lines3)) @@ -310,7 +326,7 @@ var _ = Describe("ListCache", func() { } sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false) + defaultProcessingConcurrency, false, maxErrorsPerFile) Expect(err).Should(Succeed()) Expect(sut.groupedCache.ElementCount("gr1")).Should(Equal(2)) @@ -333,7 +349,7 @@ var _ = Describe("ListCache", func() { } sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false) + defaultProcessingConcurrency, false, maxErrorsPerFile) Expect(err).Should(Succeed()) group := sut.Match("inlinedomain1.com", []string{"gr1"}) @@ -341,17 +357,18 @@ var _ = Describe("ListCache", func() { }) }) When("Text file has too many errors", func() { - It("should fail parsing", func() { + BeforeEach(func() { + maxErrorsPerFile = 0 + }) + FIt("should fail parsing", func() { lists := map[string][]string{ "gr1": { - inlineList( - strings.Repeat("invaliddomain!\n", maxErrorsPerFile+1), // too many errors - ), + inlineList("invaliddomain!"), // too many errors since `maxErrorsPerFile` is 0 }, } _, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false) + defaultProcessingConcurrency, false, maxErrorsPerFile) Expect(err).ShouldNot(Succeed()) Expect(err).Should(MatchError(parsers.ErrTooManyErrors)) }) @@ -363,7 +380,7 @@ var _ = Describe("ListCache", func() { } sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false) + defaultProcessingConcurrency, false, maxErrorsPerFile) Expect(err).Should(Succeed()) group := sut.Match("inlinedomain1.com", []string{"gr1"}) @@ -377,7 +394,7 @@ var _ = Describe("ListCache", func() { } sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false) + defaultProcessingConcurrency, false, maxErrorsPerFile) Expect(err).Should(Succeed()) group := sut.Match("apple.com", []string{"gr1"}) @@ -405,7 +422,7 @@ var _ = Describe("ListCache", func() { } sut, err := NewListCache(ListCacheTypeBlacklist, lists, time.Hour, NewDownloader(), - defaultProcessingConcurrency, false) + defaultProcessingConcurrency, false, maxErrorsPerFile) Expect(err).Should(Succeed()) sut.LogConfig(logger) @@ -424,7 +441,7 @@ var _ = Describe("ListCache", func() { } _, err := NewListCache(ListCacheTypeBlacklist, lists, -1, NewDownloader(), - defaultProcessingConcurrency, true) + defaultProcessingConcurrency, true, maxErrorsPerFile) Expect(err).Should(Succeed()) }) }) diff --git a/resolver/blocking_resolver.go b/resolver/blocking_resolver.go index f89024c9f..24285a7ea 100644 --- a/resolver/blocking_resolver.go +++ b/resolver/blocking_resolver.go @@ -105,10 +105,10 @@ func NewBlockingResolver( downloader := createDownloader(cfg, bootstrap) blacklistMatcher, blErr := lists.NewListCache(lists.ListCacheTypeBlacklist, cfg.BlackLists, refreshPeriod, downloader, cfg.ProcessingConcurrency, - (cfg.StartStrategy == config.StartStrategyTypeFast)) + (cfg.StartStrategy == config.StartStrategyTypeFast), cfg.MaxErrorsPerFile) whitelistMatcher, wlErr := lists.NewListCache(lists.ListCacheTypeWhitelist, cfg.WhiteLists, refreshPeriod, downloader, cfg.ProcessingConcurrency, - (cfg.StartStrategy == config.StartStrategyTypeFast)) + (cfg.StartStrategy == config.StartStrategyTypeFast), cfg.MaxErrorsPerFile) whitelistOnlyGroups := determineWhitelistOnlyGroups(&cfg) err = multierror.Append(err, blErr, wlErr).ErrorOrNil() From 8253075f28ffba93df58cdf43c4aab987f049949 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Thu, 13 Apr 2023 03:10:40 -0400 Subject: [PATCH 17/92] test: remove focus in list_cache suite (#990) Accidentally left `FIt` when committing the test. --- lists/list_cache_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lists/list_cache_test.go b/lists/list_cache_test.go index 2c2fdd83a..73ef39538 100644 --- a/lists/list_cache_test.go +++ b/lists/list_cache_test.go @@ -360,7 +360,7 @@ var _ = Describe("ListCache", func() { BeforeEach(func() { maxErrorsPerFile = 0 }) - FIt("should fail parsing", func() { + It("should fail parsing", func() { lists := map[string][]string{ "gr1": { inlineList("invaliddomain!"), // too many errors since `maxErrorsPerFile` is 0 From ea95d36f37a80c59e72c6de15bf04b1651ca6c16 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Fri, 14 Apr 2023 12:39:47 -0400 Subject: [PATCH 18/92] fix: make domain validation in list parser more lenient --- go.mod | 1 - go.sum | 2 -- lists/parsers/hosts.go | 13 ++++++++++--- lists/parsers/hosts_test.go | 16 +++++++++++++++- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 1cdae788d..095aaed6e 100644 --- a/go.mod +++ b/go.mod @@ -79,7 +79,6 @@ require ( github.com/KyleBanks/depth v1.2.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect diff --git a/go.sum b/go.sum index e4074086b..080850c7c 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,6 @@ github.com/alicebob/miniredis/v2 v2.30.1/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6u github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/avast/retry-go/v4 v4.3.3 h1:G56Bp6mU0b5HE1SkaoVjscZjlQb0oy4mezwY/cGH19w= github.com/avast/retry-go/v4 v4.3.3/go.mod h1:rg6XFaiuFYII0Xu3RDbZQkxCofFwruZKW8oEF1jpWiU= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= diff --git a/lists/parsers/hosts.go b/lists/parsers/hosts.go index e95a997e7..67ef77f9a 100644 --- a/lists/parsers/hosts.go +++ b/lists/parsers/hosts.go @@ -10,14 +10,21 @@ import ( "regexp" "strings" - "github.com/asaskevich/govalidator" "github.com/hashicorp/go-multierror" "golang.org/x/net/idna" ) -const maxDomainNameLength = 255 // https://www.rfc-editor.org/rfc/rfc1034#section-3.1 +const ( + maxDomainNameLength = 255 // https://www.rfc-editor.org/rfc/rfc1034#section-3.1 -var domainNameRegex = regexp.MustCompile(govalidator.DNSName) + dnsLabelPattern = `[a-zA-Z0-9_-]{1,63}` +) + +// Validate a domain name, but with extra flexibility: +// - no restriction on the start or end of labels +// +// https://www.rfc-editor.org/rfc/rfc1034#section-3.5 +var domainNameRegex = regexp.MustCompile(`^` + dnsLabelPattern + `(\.` + dnsLabelPattern + `)*[\._]?$`) // Hosts parses `r` as a series of `HostsIterator`. // It supports both the hosts file and host list formats. diff --git a/lists/parsers/hosts_test.go b/lists/parsers/hosts_test.go index f9b00f5fc..0d6e51141 100644 --- a/lists/parsers/hosts_test.go +++ b/lists/parsers/hosts_test.go @@ -307,6 +307,10 @@ var _ = Describe("HostList", func() { // Domain name w/ rune not supported by `idna.Lookup` "domain_underscore.tld", + + // invalid domain names we want to support + "-start-with-a-hyphen.com", + "end-with-a-hyphen-.com", ) }) @@ -341,11 +345,21 @@ var _ = Describe("HostList", func() { Expect(entry.String()).Should(Equal("domain_underscore.tld")) Expect(sut.Position()).Should(Equal("line 8")) + entry, err = sut.Next(context.Background()) + Expect(err).Should(Succeed()) + Expect(entry.String()).Should(Equal("-start-with-a-hyphen.com")) + Expect(sut.Position()).Should(Equal("line 9")) + + entry, err = sut.Next(context.Background()) + Expect(err).Should(Succeed()) + Expect(entry.String()).Should(Equal("end-with-a-hyphen-.com")) + Expect(sut.Position()).Should(Equal("line 10")) + _, err = sut.Next(context.Background()) Expect(err).ShouldNot(Succeed()) Expect(err).Should(MatchError(io.EOF)) Expect(IsNonResumableErr(err)).Should(BeTrue()) - Expect(sut.Position()).Should(Equal("line 9")) + Expect(sut.Position()).Should(Equal("line 11")) }) }) From 8d48a21aea2d8957d1a7fbf3efc4d606513aab43 Mon Sep 17 00:00:00 2001 From: log-to-code <87340486+log-to-code@users.noreply.github.com> Date: Sat, 15 Apr 2023 14:56:29 -0700 Subject: [PATCH 19/92] Add homebrew link to the installation docs (#995) --- docs/installation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/installation.md b/docs/installation.md index 394895cbd..ed8cee8f4 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -180,4 +180,8 @@ See [https://github.com/m0zgen/blocky-installer](https://github.com/m0zgen/block See [https://www.freebsd.org/cgi/ports.cgi?query=blocky&stype=all](https://www.freebsd.org/cgi/ports.cgi?query=blocky&stype=all) +### Homebrew package for MacOS + +See [https://formulae.brew.sh/formula/blocky](https://formulae.brew.sh/formula/blocky) + --8<-- "docs/includes/abbreviations.md" From 5fc02bb7fb7420a1a292eab07bc6faf8697c9a2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:19:31 +0000 Subject: [PATCH 20/92] build(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 23.0.1+incompatible to 23.0.3+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v23.0.1...v23.0.3) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 095aaed6e..be498fbba 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( github.com/containerd/containerd v1.6.19 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/docker/distribution v2.8.1+incompatible // indirect - github.com/docker/docker v23.0.1+incompatible // indirect + github.com/docker/docker v23.0.3+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect diff --git a/go.sum b/go.sum index 080850c7c..564ffb89a 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v23.0.1+incompatible h1:vjgvJZxprTTE1A37nm+CLNAdwu6xZekyoiVlUZEINcY= -github.com/docker/docker v23.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho= +github.com/docker/docker v23.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= From c786d41a0fcdf719e58cedc578c83380d04dcfea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 04:59:28 +0000 Subject: [PATCH 21/92] build(deps): bump gorm.io/gorm Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.24.7-0.20230306060331-85eaf9eeda11 to 1.25.0. - [Release notes](https://github.com/go-gorm/gorm/releases) - [Commits](https://github.com/go-gorm/gorm/commits/v1.25.0) --- updated-dependencies: - dependency-name: gorm.io/gorm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index be498fbba..92b722652 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( gorm.io/driver/mysql v1.4.7 gorm.io/driver/postgres v1.5.0 gorm.io/driver/sqlite v1.4.4 - gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11 + gorm.io/gorm v1.25.0 ) require ( diff --git a/go.sum b/go.sum index 564ffb89a..82d16815d 100644 --- a/go.sum +++ b/go.sum @@ -821,8 +821,9 @@ gorm.io/driver/sqlite v1.4.4 h1:gIufGoR0dQzjkyqDyYSCvsYR6fba1Gw5YKDqKeChxFc= gorm.io/driver/sqlite v1.4.4/go.mod h1:0Aq3iPO+v9ZKbcdiz8gLWRw5VOPcBOPUQJFLq5e2ecI= gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= -gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11 h1:9qNbmu21nNThCNnF5i2R3kw2aL27U8ZwbzccNjOmW0g= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= +gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 2205aa7528aeaccf46e8f9c36fd46d7f86a1edf3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 04:58:26 +0000 Subject: [PATCH 22/92] build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.14.0 to 1.15.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.14.0...v1.15.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 10 +- go.sum | 352 ++------------------------------------------------------- 2 files changed, 15 insertions(+), 347 deletions(-) diff --git a/go.mod b/go.mod index 92b722652..7e0ddf513 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.9.2 github.com/onsi/gomega v1.27.6 - github.com/prometheus/client_golang v1.14.0 + github.com/prometheus/client_golang v1.15.0 github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.2 @@ -80,7 +80,7 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect @@ -114,8 +114,8 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect github.com/ramr/go-reaper v0.2.1 github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -130,6 +130,6 @@ require ( golang.org/x/term v0.7.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.8.0 - google.golang.org/protobuf v1.28.1 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 82d16815d..e78ae1576 100644 --- a/go.sum +++ b/go.sum @@ -1,40 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= @@ -50,11 +18,6 @@ github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v github.com/Microsoft/hcsshim v0.9.7 h1:mKNHW/Xvv1aFH87Jb6ERDzXTJTLPlmzfZ28VBFD/bfg= github.com/abice/go-enum v0.5.6 h1:Ury51IQXUppbIl56MqRU/++A8SSeLG4plePphPjxW1s= github.com/abice/go-enum v0.5.6/go.mod h1:X2GpCT8VkCXLkVm48hebWx3cVgFJ8zM5nY5iUrJZO1Q= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.30.1 h1:HM1rlQjq1bm9yQcsawJqSZBJ9AYgxvjkMsNtddh90+g= @@ -64,8 +27,6 @@ github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= github.com/avast/retry-go/v4 v4.3.3 h1:G56Bp6mU0b5HE1SkaoVjscZjlQb0oy4mezwY/cGH19w= github.com/avast/retry-go/v4 v4.3.3/go.mod h1:rg6XFaiuFYII0Xu3RDbZQkxCofFwruZKW8oEF1jpWiU= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= @@ -73,8 +34,8 @@ github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+M github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -133,17 +94,6 @@ github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -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= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -161,32 +111,19 @@ github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -200,39 +137,22 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b h1:wDUNC2eKiL35DbLvsDhiblTUXHxcOPwQSCzi7xpQUN4= github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b/go.mod h1:VzxiSdG6j1pi7rwGm/xYI5RbtpBgM8sARDXlvEvxlu0= @@ -241,13 +161,10 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= @@ -268,22 +185,10 @@ github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -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/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -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/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.13 h1:eSvu8Tmq6j2psUJqJrLcWH6K3w5Dwc+qipbaA6eVEN4= github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -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= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= @@ -311,7 +216,6 @@ github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOj github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/goveralls v0.0.11 h1:eJXea6R6IFlL1QMKNMzDvvHv/hwGrnvyig4N+0+XiMM= github.com/mattn/goveralls v0.0.11/go.mod h1:gU8SyhNswsJKchEV93xRQxX6X3Ei4PJdQk/6ZHvrvRk= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= @@ -331,18 +235,11 @@ github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5 github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f h1:J/7hjLaHLD7epG0m6TBMGmp4NQ+ibBYLfeyJWdAIFLA= github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f/go.mod h1:15ce4BGCFxt7I5NQKT+HV0yEDxmf6fSysfEDiVo3zFM= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mroth/weightedrand/v2 v2.0.1 h1:zrEVDIaau/E4QLOKu02kpg8T8myweFlMGikIgbIdrRA= github.com/mroth/weightedrand/v2 v2.0.1/go.mod h1:f2faGsfOGOwc1p94wzHKKZyTpcJUW7OJ/9U4yfiNAOU= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -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/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -358,42 +255,22 @@ github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/ github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -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 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= +github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/ramr/go-reaper v0.2.1 h1:zww+wlQOvTjBZuk1920R/e0GFEb6O7+B0WQLV6dM924= github.com/ramr/go-reaper v0.2.1/go.mod h1:AVypdzrcCXjSc/JYnlXl8TsB+z84WyFzxWE8Jh0MOJc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -403,9 +280,6 @@ github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= 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= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= @@ -417,13 +291,11 @@ github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRM github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -448,24 +320,14 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJ github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -473,35 +335,11 @@ golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4 golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -510,108 +348,49 @@ golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/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-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/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-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= 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/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/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-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/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-20200803210538-64077c9b5642/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-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -620,8 +399,6 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -636,63 +413,22 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -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.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= 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-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -704,72 +440,18 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= 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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad h1:kqrS+lhvaMHCxul6sKQvKJ8nAAhlVItmZV822hYFH/U= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= @@ -782,28 +464,22 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -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.3/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/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= @@ -826,14 +502,6 @@ gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From d0c6a1d450ed30b89bcb8116056567257f8c8a64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 13:34:36 +0000 Subject: [PATCH 23/92] build(deps): bump gorm.io/driver/sqlite from 1.4.4 to 1.5.0 Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.4.4 to 1.5.0. - [Release notes](https://github.com/go-gorm/sqlite/releases) - [Commits](https://github.com/go-gorm/sqlite/compare/v1.4.4...v1.5.0) --- updated-dependencies: - dependency-name: gorm.io/driver/sqlite dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 7e0ddf513..f968850f2 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.4.7 gorm.io/driver/postgres v1.5.0 - gorm.io/driver/sqlite v1.4.4 + gorm.io/driver/sqlite v1.5.0 gorm.io/gorm v1.25.0 ) diff --git a/go.sum b/go.sum index e78ae1576..fa57f8e61 100644 --- a/go.sum +++ b/go.sum @@ -493,10 +493,9 @@ gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y= gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc= gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U= gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A= -gorm.io/driver/sqlite v1.4.4 h1:gIufGoR0dQzjkyqDyYSCvsYR6fba1Gw5YKDqKeChxFc= -gorm.io/driver/sqlite v1.4.4/go.mod h1:0Aq3iPO+v9ZKbcdiz8gLWRw5VOPcBOPUQJFLq5e2ecI= +gorm.io/driver/sqlite v1.5.0 h1:zKYbzRCpBrT1bNijRnxLDJWPjVfImGEn0lSnUY5gZ+c= +gorm.io/driver/sqlite v1.5.0/go.mod h1:kDMDfntV9u/vuMmz8APHtHF0b4nyBB7sfCieC6G8k8I= gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= From c7d6cca51747987cbef11bcc6ac912009d4737ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 14:20:30 +0000 Subject: [PATCH 24/92] build(deps): bump gorm.io/driver/mysql from 1.4.7 to 1.5.0 Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.4.7 to 1.5.0. - [Release notes](https://github.com/go-gorm/mysql/releases) - [Commits](https://github.com/go-gorm/mysql/compare/v1.4.7...v1.5.0) --- updated-dependencies: - dependency-name: gorm.io/driver/mysql dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index f968850f2..3a52dee84 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/x-cray/logrus-prefixed-formatter v0.5.2 golang.org/x/net v0.9.0 gopkg.in/yaml.v2 v2.4.0 - gorm.io/driver/mysql v1.4.7 + gorm.io/driver/mysql v1.5.0 gorm.io/driver/postgres v1.5.0 gorm.io/driver/sqlite v1.5.0 gorm.io/gorm v1.25.0 diff --git a/go.sum b/go.sum index fa57f8e61..d2bfdaf9e 100644 --- a/go.sum +++ b/go.sum @@ -180,7 +180,6 @@ github.com/jackc/pgx/v5 v5.3.0/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHo github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -489,13 +488,12 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y= -gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc= +gorm.io/driver/mysql v1.5.0 h1:6hSAT5QcyIaty0jfnff0z0CLDjyRgZ8mlMHLqSt7uXM= +gorm.io/driver/mysql v1.5.0/go.mod h1:FFla/fJuCvyTi7rJQd27qlNX2v3L6deTR1GgTjSOLPo= gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U= gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A= gorm.io/driver/sqlite v1.5.0 h1:zKYbzRCpBrT1bNijRnxLDJWPjVfImGEn0lSnUY5gZ+c= gorm.io/driver/sqlite v1.5.0/go.mod h1:kDMDfntV9u/vuMmz8APHtHF0b4nyBB7sfCieC6G8k8I= -gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= From 28669327ad50f3832006e5286fdb1a92c788ce09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 13:35:08 +0000 Subject: [PATCH 25/92] build(deps): bump github.com/swaggo/swag from 1.8.12 to 1.16.1 Bumps [github.com/swaggo/swag](https://github.com/swaggo/swag) from 1.8.12 to 1.16.1. - [Release notes](https://github.com/swaggo/swag/releases) - [Changelog](https://github.com/swaggo/swag/blob/master/.goreleaser.yml) - [Commits](https://github.com/swaggo/swag/compare/v1.8.12...v1.16.1) --- updated-dependencies: - dependency-name: github.com/swaggo/swag dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 3a52dee84..5e622ceb8 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.2 - github.com/swaggo/swag v1.8.12 + github.com/swaggo/swag v1.16.1 github.com/x-cray/logrus-prefixed-formatter v0.5.2 golang.org/x/net v0.9.0 gopkg.in/yaml.v2 v2.4.0 @@ -73,6 +73,7 @@ require ( golang.org/x/tools/cmd/cover v0.1.0-deprecated // indirect google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect google.golang.org/grpc v1.47.0 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) require ( @@ -84,7 +85,6 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/ghodss/yaml v1.0.0 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/spec v0.20.7 // indirect diff --git a/go.sum b/go.sum index d2bfdaf9e..f2eba4bab 100644 --- a/go.sum +++ b/go.sum @@ -88,7 +88,6 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= @@ -303,8 +302,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/swaggo/swag v1.8.12 h1:pctzkNPu0AlQP2royqX3apjKCQonAnf7KGoxeO4y64w= -github.com/swaggo/swag v1.8.12/go.mod h1:lNfm6Gg+oAq3zRJQNEMBE66LIJKM44mxFqhEEgy2its= +github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= +github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/testcontainers/testcontainers-go v0.19.0 h1:3bmFPuQRgVIQwxZJERyzB8AogmJW3Qzh8iDyfJbPhi8= github.com/testcontainers/testcontainers-go v0.19.0/go.mod h1:3YsSoxK0rGEUzbGD4gUVt1Nm3GJpCIq94GX+2LSf3d4= @@ -502,3 +501,5 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= From ed0006498812cc820b2e98557e462a159f46b9ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 13:35:08 +0000 Subject: [PATCH 26/92] build(deps): bump github.com/alicebob/miniredis/v2 from 2.30.1 to 2.30.2 Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.30.1 to 2.30.2. - [Release notes](https://github.com/alicebob/miniredis/releases) - [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md) - [Commits](https://github.com/alicebob/miniredis/compare/v2.30.1...v2.30.2) --- updated-dependencies: - dependency-name: github.com/alicebob/miniredis/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5e622ceb8..a150270e6 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/abice/go-enum v0.5.6 - github.com/alicebob/miniredis/v2 v2.30.1 + github.com/alicebob/miniredis/v2 v2.30.2 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef github.com/avast/retry-go/v4 v4.3.3 github.com/creasty/defaults v1.7.0 diff --git a/go.sum b/go.sum index f2eba4bab..2e6c31f4e 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/abice/go-enum v0.5.6 h1:Ury51IQXUppbIl56MqRU/++A8SSeLG4plePphPjxW1s= github.com/abice/go-enum v0.5.6/go.mod h1:X2GpCT8VkCXLkVm48hebWx3cVgFJ8zM5nY5iUrJZO1Q= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.1 h1:HM1rlQjq1bm9yQcsawJqSZBJ9AYgxvjkMsNtddh90+g= -github.com/alicebob/miniredis/v2 v2.30.1/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I= +github.com/alicebob/miniredis/v2 v2.30.2/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= From 1d25cca4e540f68cc66dd9287ceb46ea9e548e65 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Wed, 26 Apr 2023 08:57:22 +0200 Subject: [PATCH 27/92] Goreleaser fix (#1003) * use zig for goreleaser * added test workflow * Revert "added test workflow" This reverts commit 9c55c5fd9ef9ea74ea24724b9c634d32ab0f3e8c. * added goreleaser test * autorun goreleaser tests * add pseudo tag for goreleaser * added test * added arm test * arch test * missing qemu setup? * test alternate run * test rework * path fix? * 18 won't run * another test * permission fix * amd64 matrix * added macos * added windows test * consolidate unix tests * fix path * fix path2 * matrix consolidation * +x fails on macos * fix runner * windows fix * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos * auto test binaries on release --------- Co-authored-by: ThinkChaos --- .github/workflows/goreleaser-test.yml | 139 ++++++++++++++++++++++++++ .github/workflows/release.yml | 3 + .goreleaser.yml | 12 ++- 3 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/goreleaser-test.yml diff --git a/.github/workflows/goreleaser-test.yml b/.github/workflows/goreleaser-test.yml new file mode 100644 index 000000000..4d265d631 --- /dev/null +++ b/.github/workflows/goreleaser-test.yml @@ -0,0 +1,139 @@ +name: GoReleaser Test + +on: + push: + tags: + - v* + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build binaries with goreleaser + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - name: Setup Zig + uses: goto-bus-stop/setup-zig@v2 + + - name: Run GoReleaser check + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: check + + - name: Run GoReleaser build + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: build --clean --snapshot + + - name: Upload dist folder + uses: actions/upload-artifact@v3 + with: + name: dist_folder + path: dist + retention-days: 1 + + tests: + name: Test binaries + runs-on: ${{matrix.runner}} + needs: build + strategy: + matrix: + distro: [ubuntu16.04, ubuntu18.04, ubuntu20.04, ubuntu22.04, bullseye, buster, stretch] + arch: [armv7,aarch64] + os: [linux] + runner: [ubuntu-latest] + include: + - distro: stretch + runner: ubuntu-latest + arch: armv6 + os: linux + - distro: buster + runner: ubuntu-latest + arch: armv6 + os: linux + - distro: bullseye + runner: ubuntu-latest + arch: armv6 + os: linux + - distro: ubuntu20.04 + runner: ubuntu-20.04 + arch: amd64 + os: linux + - distro: ubuntu22.04 + runner: ubuntu-22.04 + arch: amd64 + os: linux + - distro: macos + runner: macos-11 + arch: amd64 + os: darwin + - distro: macos + runner: macos-12 + arch: amd64 + os: darwin + - distro: windows + runner: windows-latest + arch: amd64 + os: windows + + steps: + - name: Download dist folder + id: download + uses: actions/download-artifact@v3 + with: + name: dist_folder + + - name: Get binary path + id: get_path + if: matrix.os != 'windows' + shell: bash + run: | + archs=(["aarch64"]="arm64" ["armv6"]="arm_6" ["armv7"]="arm_7" ["amd64"]="amd64_v1") + BINPATH="${{steps.download.outputs.download-path}}/blocky_${{ matrix.os }}_${archs[ ${{ matrix.arch }} ]}/blocky" + echo "bin=${BINPATH}" >> "$GITHUB_OUTPUT" + echo "Binary path: ${BINPATH}" + + - name: Enable execution + if: matrix.os != 'windows' + shell: bash + run: | + chmod +x '${{ steps.get_path.outputs.bin }}' + + - name: Test binary on ${{ matrix.arch }} + if: matrix.arch != 'amd64' + uses: uraimo/run-on-arch-action@v2 + with: + distro: ${{ matrix.distro }} + arch: ${{ matrix.arch }} + dockerRunArgs: | + --volume "${{steps.download.outputs.download-path}}:${{steps.download.outputs.download-path}}" + shell: /bin/sh + run: | + '${{ steps.get_path.outputs.bin }}' version + + - name: Test binary on amd64 + if: matrix.arch == 'amd64' && matrix.os != 'windows' + shell: bash + run: | + '${{ steps.get_path.outputs.bin }}' version + + - name: Test windows binary + if: matrix.os == 'windows' + shell: cmd + run: | + ${{steps.download.outputs.download-path}}\blocky_windows_amd64_v1\blocky.exe version \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d4b7f97a..3bb4d2a13 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,6 +80,9 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + - name: Setup Zig + uses: goto-bus-stop/setup-zig@v2 + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v4 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 9747095bb..7dd5a9649 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -3,6 +3,8 @@ project_name: blocky before: hooks: - go mod tidy + - go install github.com/dosgo/zigtool/zigcc@latest + - go install github.com/dosgo/zigtool/zigcpp@latest builds: - goos: - linux @@ -24,7 +26,15 @@ builds: - goos: windows goarch: arm64 ldflags: - - -w -s -X github.com/0xERR0R/blocky/util.Version=v{{.Version}} -X github.com/0xERR0R/blocky/util.BuildTime={{time "20060102-150405"}} + - -w + - -s + - -X github.com/0xERR0R/blocky/util.Version=v{{.Version}} + - -X github.com/0xERR0R/blocky/util.BuildTime={{time "20060102-150405"}} + - -X github.com/0xERR0R/blocky/util.Architecture={{.Arch}}{{.Arm}} + env: + - CGO_ENABLED=0 + - CC=zigcc + - CXX=zigcpp release: draft: true archives: From e4f467cead818a9572a15272a567a330987f075a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 04:59:25 +0000 Subject: [PATCH 28/92] build(deps): bump github.com/avast/retry-go/v4 from 4.3.3 to 4.3.4 Bumps [github.com/avast/retry-go/v4](https://github.com/avast/retry-go) from 4.3.3 to 4.3.4. - [Release notes](https://github.com/avast/retry-go/releases) - [Commits](https://github.com/avast/retry-go/compare/4.3.3...4.3.4) --- updated-dependencies: - dependency-name: github.com/avast/retry-go/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a150270e6..dfdd07d6a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/abice/go-enum v0.5.6 github.com/alicebob/miniredis/v2 v2.30.2 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef - github.com/avast/retry-go/v4 v4.3.3 + github.com/avast/retry-go/v4 v4.3.4 github.com/creasty/defaults v1.7.0 github.com/go-chi/chi/v5 v5.0.8 github.com/go-chi/cors v1.2.1 diff --git a/go.sum b/go.sum index 2e6c31f4e..f2327ddce 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ github.com/alicebob/miniredis/v2 v2.30.2/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6u github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= -github.com/avast/retry-go/v4 v4.3.3 h1:G56Bp6mU0b5HE1SkaoVjscZjlQb0oy4mezwY/cGH19w= -github.com/avast/retry-go/v4 v4.3.3/go.mod h1:rg6XFaiuFYII0Xu3RDbZQkxCofFwruZKW8oEF1jpWiU= +github.com/avast/retry-go/v4 v4.3.4 h1:pHLkL7jvCvP317I8Ge+Km2Yhntv3SdkJm7uekkqbKhM= +github.com/avast/retry-go/v4 v4.3.4/go.mod h1:rv+Nla6Vk3/ilU0H51VHddWHiwimzX66yZ0JT6T+UvE= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= From 1b478d047a2601596794976a13573b20e6204480 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 May 2023 04:58:31 +0000 Subject: [PATCH 29/92] build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.0 to 1.15.1. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.15.0...v1.15.1) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index dfdd07d6a..cd064a322 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.9.2 github.com/onsi/gomega v1.27.6 - github.com/prometheus/client_golang v1.15.0 + github.com/prometheus/client_golang v1.15.1 github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.2 diff --git a/go.sum b/go.sum index f2327ddce..1b0efb988 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= -github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= +github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= From 795f3ddf93efed893a2ff467e4afbe252d3c6417 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Mon, 15 May 2023 10:24:07 -0400 Subject: [PATCH 30/92] fix: configuration for FQDN only resolver (#1025) --- config/config.go | 2 +- config/config_test.go | 6 ++++++ docs/config.yml | 6 ++++++ docs/configuration.md | 3 ++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 455757ed9..64568b2c4 100644 --- a/config/config.go +++ b/config/config.go @@ -178,7 +178,7 @@ type Config struct { KeyFile string `yaml:"keyFile"` BootstrapDNS BootstrapDNSConfig `yaml:"bootstrapDns"` HostsFile HostsFileConfig `yaml:"hostsFile"` - FqdnOnly FqdnOnlyConfig `yaml:",inline"` + FqdnOnly FqdnOnlyConfig `yaml:"fqdnOnly"` Filtering FilteringConfig `yaml:"filtering"` Ede EdeConfig `yaml:"ede"` // Deprecated diff --git a/config/config_test.go b/config/config_test.go index 7eea1e660..1ca8c432a 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -550,6 +550,7 @@ func defaultTestFileConfig() { Expect(config.Blocking.BlockTTL).Should(Equal(Duration(time.Minute))) Expect(config.Blocking.RefreshPeriod).Should(Equal(Duration(2 * time.Hour))) Expect(config.Filtering.QueryTypes).Should(HaveLen(2)) + Expect(config.FqdnOnly.Enable).Should(BeTrue()) Expect(config.Caching.MaxCachingTime.IsZero()).Should(BeTrue()) Expect(config.Caching.MinCachingTime.IsZero()).Should(BeTrue()) @@ -580,6 +581,8 @@ func writeConfigYml(tmpDir *helpertest.TmpFolder) *helpertest.TmpFile { " queryTypes:", " - AAAA", " - A", + "fqdnOnly:", + " enable: true", "blocking:", " blackLists:", " ads:", @@ -617,6 +620,7 @@ func writeConfigYml(tmpDir *helpertest.TmpFolder) *helpertest.TmpFile { "startVerifyUpstream: false") } +//nolint:funlen func writeConfigDir(tmpDir *helpertest.TmpFolder) error { f1 := tmpDir.CreateStringFile("config1.yaml", "upstream:", @@ -668,6 +672,8 @@ func writeConfigDir(tmpDir *helpertest.TmpFolder) error { " singleNameOrder:", " - 2", " - 1", + "fqdnOnly:", + " enable: true", "queryLog:", " type: csv-client", " target: /opt/log", diff --git a/docs/config.yml b/docs/config.yml index 7bb0d6ad6..89bb67513 100644 --- a/docs/config.yml +++ b/docs/config.yml @@ -217,6 +217,7 @@ minTlsServeVersion: 1.3 # if https port > 0: path to cert and key file for SSL encryption. if not set, self-signed certificate will be generated #certFile: server.crt #keyFile: server.key + # optional: use these DNS servers to resolve blacklist urls and upstream DNS servers. It is useful if no system DNS resolver is configured, and/or to encrypt the bootstrap queries. bootstrapDns: - tcp+udp:1.1.1.1 @@ -230,6 +231,11 @@ filtering: queryTypes: - AAAA +# optional: return NXDOMAIN for queries that are not FQDNs. +fqdnOnly: + # default: false + enable: true + # optional: if path defined, use this file for query resolution (A, AAAA and rDNS). Default: empty hostsFile: # optional: Path to hosts file (e.g. /etc/hosts on Linux) diff --git a/docs/configuration.md b/docs/configuration.md index c63127165..37ab1682e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -195,7 +195,8 @@ Please be aware that by enabling it your hostname resolution will break unless e !!! example ```yaml - fqdnOnly: true + fqdnOnly: + enable: true ``` ## Custom DNS From b198560cdaa6b640f65e9a8e73b5203f46638ef9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 05:00:36 +0000 Subject: [PATCH 31/92] build(deps): bump github.com/miekg/dns from 1.1.53 to 1.1.54 Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.53 to 1.1.54. - [Release notes](https://github.com/miekg/dns/releases) - [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release) - [Commits](https://github.com/miekg/dns/compare/v1.1.53...v1.1.54) --- updated-dependencies: - dependency-name: github.com/miekg/dns dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cd064a322..59a1455b1 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/hashicorp/golang-lru v0.5.4 github.com/mattn/go-colorable v0.1.13 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect - github.com/miekg/dns v1.1.53 + github.com/miekg/dns v1.1.54 github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.9.2 github.com/onsi/gomega v1.27.6 diff --git a/go.sum b/go.sum index 1b0efb988..22aaa2015 100644 --- a/go.sum +++ b/go.sum @@ -218,8 +218,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw= -github.com/miekg/dns v1.1.53/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= +github.com/miekg/dns v1.1.54 h1:5jon9mWcb0sFJGpnI99tOMhCPyJ+RPVz5b63MQG0VWI= +github.com/miekg/dns v1.1.54/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= From 53d6d461a5e8295a05e63ee61fb785e179261782 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 May 2023 04:58:52 +0000 Subject: [PATCH 32/92] build(deps): bump golang.org/x/net from 0.9.0 to 0.10.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.9.0 to 0.10.0. - [Commits](https://github.com/golang/net/compare/v0.9.0...v0.10.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 59a1455b1..d74e9da72 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/stretchr/testify v1.8.2 github.com/swaggo/swag v1.16.1 github.com/x-cray/logrus-prefixed-formatter v0.5.2 - golang.org/x/net v0.9.0 + golang.org/x/net v0.10.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.0 gorm.io/driver/postgres v1.5.0 @@ -126,8 +126,8 @@ require ( golang.org/x/crypto v0.6.0 // indirect golang.org/x/exp v0.0.0-20230307190834-24139beb5833 golang.org/x/mod v0.10.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.7.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.8.0 google.golang.org/protobuf v1.30.0 // indirect diff --git a/go.sum b/go.sum index 22aaa2015..6713e68c7 100644 --- a/go.sum +++ b/go.sum @@ -360,8 +360,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -403,14 +403,14 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From 3970c432cd72089030177f3f67ab4e9192f60bc0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 04:58:57 +0000 Subject: [PATCH 33/92] build(deps): bump golang.org/x/tools from 0.8.0 to 0.9.1 Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.8.0 to 0.9.1. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.8.0...v0.9.1) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index d74e9da72..a3240a5d5 100644 --- a/go.mod +++ b/go.mod @@ -69,7 +69,7 @@ require ( github.com/opencontainers/runc v1.1.5 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/cast v1.3.1 // indirect - golang.org/x/sync v0.1.0 // indirect + golang.org/x/sync v0.2.0 // indirect golang.org/x/tools/cmd/cover v0.1.0-deprecated // indirect google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect google.golang.org/grpc v1.47.0 // indirect @@ -129,7 +129,7 @@ require ( golang.org/x/sys v0.8.0 // indirect golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect - golang.org/x/tools v0.8.0 + golang.org/x/tools v0.9.1 google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 6713e68c7..0080f6715 100644 --- a/go.sum +++ b/go.sum @@ -372,8 +372,9 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/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-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -430,8 +431,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y= -golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools/cmd/cover v0.1.0-deprecated h1:Rwy+mWYz6loAF+LnG1jHG/JWMHRMMC2/1XX3Ejkx9lA= golang.org/x/tools/cmd/cover v0.1.0-deprecated/go.mod h1:hMDiIvlpN1NoVgmjLjUJE9tMHyxHjFX7RuQ+rW12mSA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From c33ed147897012b2a1bdd23ca88d09740137e343 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 May 2023 04:58:43 +0000 Subject: [PATCH 34/92] build(deps): bump github.com/testcontainers/testcontainers-go Bumps [github.com/testcontainers/testcontainers-go](https://github.com/testcontainers/testcontainers-go) from 0.19.0 to 0.20.1. - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](https://github.com/testcontainers/testcontainers-go/compare/v0.19.0...v0.20.1) --- updated-dependencies: - dependency-name: github.com/testcontainers/testcontainers-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index a3240a5d5..bdcaad0ec 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/docker/go-connections v0.4.0 github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198 - github.com/testcontainers/testcontainers-go v0.19.0 + github.com/testcontainers/testcontainers-go v0.20.1 mvdan.cc/gofumpt v0.5.0 ) @@ -52,7 +52,7 @@ require ( github.com/containerd/containerd v1.6.19 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/docker/distribution v2.8.1+incompatible // indirect - github.com/docker/docker v23.0.3+incompatible // indirect + github.com/docker/docker v23.0.5+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect diff --git a/go.sum b/go.sum index 0080f6715..a7c4c0e91 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho= -github.com/docker/docker v23.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v23.0.5+incompatible h1:DaxtlTJjFSnLOXVNUBU1+6kXGz2lpDoEAH6QoxaSg8k= +github.com/docker/docker v23.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -305,8 +305,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/testcontainers/testcontainers-go v0.19.0 h1:3bmFPuQRgVIQwxZJERyzB8AogmJW3Qzh8iDyfJbPhi8= -github.com/testcontainers/testcontainers-go v0.19.0/go.mod h1:3YsSoxK0rGEUzbGD4gUVt1Nm3GJpCIq94GX+2LSf3d4= +github.com/testcontainers/testcontainers-go v0.20.1 h1:mK15UPJ8c5P+NsQKmkqzs/jMdJt6JMs5vlw2y4j92c0= +github.com/testcontainers/testcontainers-go v0.20.1/go.mod h1:zb+NOlCQBkZ7RQp4QI+YMIHyO2CQ/qsXzNF5eLJ24SY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw= github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= From 1a9f629a951d91aedfb00aa2a0e80306b75fedad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 May 2023 04:59:02 +0000 Subject: [PATCH 35/92] build(deps): bump github.com/sirupsen/logrus from 1.9.0 to 1.9.2 Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.0 to 1.9.2. - [Release notes](https://github.com/sirupsen/logrus/releases) - [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md) - [Commits](https://github.com/sirupsen/logrus/compare/v1.9.0...v1.9.2) --- updated-dependencies: - dependency-name: github.com/sirupsen/logrus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index bdcaad0ec..ae01994e2 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/onsi/ginkgo/v2 v2.9.2 github.com/onsi/gomega v1.27.6 github.com/prometheus/client_golang v1.15.1 - github.com/sirupsen/logrus v1.9.0 + github.com/sirupsen/logrus v1.9.2 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.2 github.com/swaggo/swag v1.16.1 diff --git a/go.sum b/go.sum index a7c4c0e91..f03ac237a 100644 --- a/go.sum +++ b/go.sum @@ -280,8 +280,8 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= +github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= From 2a5552631cf4f8bc4b931770859a4110725d3ffa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 05:41:15 +0000 Subject: [PATCH 36/92] build(deps): bump github.com/docker/distribution Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.8.1+incompatible to 2.8.2+incompatible. - [Release notes](https://github.com/docker/distribution/releases) - [Commits](https://github.com/docker/distribution/compare/v2.8.1...v2.8.2) --- updated-dependencies: - dependency-name: github.com/docker/distribution dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ae01994e2..19b453554 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/cenkalti/backoff/v4 v4.2.0 // indirect github.com/containerd/containerd v1.6.19 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect - github.com/docker/distribution v2.8.1+incompatible // indirect + github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/docker v23.0.5+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect github.com/go-logr/logr v1.2.3 // indirect diff --git a/go.sum b/go.sum index f03ac237a..3c87455d8 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,8 @@ 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= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v23.0.5+incompatible h1:DaxtlTJjFSnLOXVNUBU1+6kXGz2lpDoEAH6QoxaSg8k= github.com/docker/docker v23.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= From 0bc39140788bd4a72aaf5db988dfd4e6d1fe231f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 05:41:31 +0000 Subject: [PATCH 37/92] build(deps): bump github.com/onsi/ginkgo/v2 from 2.9.2 to 2.9.5 Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.9.2 to 2.9.5. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.9.2...v2.9.5) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 19b453554..2ed91e1db 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/miekg/dns v1.1.54 github.com/mroth/weightedrand/v2 v2.0.1 - github.com/onsi/ginkgo/v2 v2.9.2 + github.com/onsi/ginkgo/v2 v2.9.5 github.com/onsi/gomega v1.27.6 github.com/prometheus/client_golang v1.15.1 github.com/sirupsen/logrus v1.9.2 @@ -54,7 +54,7 @@ require ( github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/docker v23.0.5+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.2.4 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect github.com/jackc/pgx/v5 v5.3.0 // indirect diff --git a/go.sum b/go.sum index 3c87455d8..f4b7da77c 100644 --- a/go.sum +++ b/go.sum @@ -93,8 +93,8 @@ github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -241,8 +241,8 @@ github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU= -github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts= +github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q= +github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k= github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= From c7a540b55bb21a6409203b77ad02daf3962f2c90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 05:41:11 +0000 Subject: [PATCH 38/92] build(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.3. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.3) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 2ed91e1db..1bfed361b 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/prometheus/client_golang v1.15.1 github.com/sirupsen/logrus v1.9.2 github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.3 github.com/swaggo/swag v1.16.1 github.com/x-cray/logrus-prefixed-formatter v0.5.2 golang.org/x/net v0.10.0 diff --git a/go.sum b/go.sum index f4b7da77c..5001c357d 100644 --- a/go.sum +++ b/go.sum @@ -300,8 +300,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= From 879a79c69da697175143d2013f61812d3615526f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 06:34:40 +0000 Subject: [PATCH 39/92] build(deps): bump github.com/onsi/gomega from 1.27.6 to 1.27.7 Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.6 to 1.27.7. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.27.6...v1.27.7) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1bfed361b..61f621253 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/miekg/dns v1.1.54 github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.9.5 - github.com/onsi/gomega v1.27.6 + github.com/onsi/gomega v1.27.7 github.com/prometheus/client_golang v1.15.1 github.com/sirupsen/logrus v1.9.2 github.com/spf13/cobra v1.7.0 diff --git a/go.sum b/go.sum index 5001c357d..b065c495e 100644 --- a/go.sum +++ b/go.sum @@ -243,8 +243,8 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q= github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k= -github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= -github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= +github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU= +github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= From 45850f434c262ff82f19ec21b3d7f42ac7cd87f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 04:59:30 +0000 Subject: [PATCH 40/92] build(deps): bump gorm.io/driver/sqlite from 1.5.0 to 1.5.1 Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.5.0 to 1.5.1. - [Commits](https://github.com/go-gorm/sqlite/compare/v1.5.0...v1.5.1) --- updated-dependencies: - dependency-name: gorm.io/driver/sqlite dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 61f621253..db6b33066 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.0 gorm.io/driver/postgres v1.5.0 - gorm.io/driver/sqlite v1.5.0 + gorm.io/driver/sqlite v1.5.1 gorm.io/gorm v1.25.0 ) @@ -106,7 +106,7 @@ require ( github.com/labstack/gommon v0.4.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.16 // indirect - github.com/mattn/go-sqlite3 v1.14.15 // indirect + github.com/mattn/go-sqlite3 v1.14.16 // indirect github.com/mattn/goveralls v0.0.11 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect diff --git a/go.sum b/go.sum index b065c495e..7f2e6bfdd 100644 --- a/go.sum +++ b/go.sum @@ -210,8 +210,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI= -github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/goveralls v0.0.11 h1:eJXea6R6IFlL1QMKNMzDvvHv/hwGrnvyig4N+0+XiMM= github.com/mattn/goveralls v0.0.11/go.mod h1:gU8SyhNswsJKchEV93xRQxX6X3Ei4PJdQk/6ZHvrvRk= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= @@ -493,8 +493,8 @@ gorm.io/driver/mysql v1.5.0 h1:6hSAT5QcyIaty0jfnff0z0CLDjyRgZ8mlMHLqSt7uXM= gorm.io/driver/mysql v1.5.0/go.mod h1:FFla/fJuCvyTi7rJQd27qlNX2v3L6deTR1GgTjSOLPo= gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U= gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A= -gorm.io/driver/sqlite v1.5.0 h1:zKYbzRCpBrT1bNijRnxLDJWPjVfImGEn0lSnUY5gZ+c= -gorm.io/driver/sqlite v1.5.0/go.mod h1:kDMDfntV9u/vuMmz8APHtHF0b4nyBB7sfCieC6G8k8I= +gorm.io/driver/sqlite v1.5.1 h1:hYyrLkAWE71bcarJDPdZNTLWtr8XrSjOWyjUYI6xdL4= +gorm.io/driver/sqlite v1.5.1/go.mod h1:7MZZ2Z8bqyfSQA1gYEV6MagQWj3cpUkJj9Z+d1HEMEQ= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= From f20480989c2f62408061bb98ca67591183c5d4f2 Mon Sep 17 00:00:00 2001 From: 73567876543783 <74454337+73567876543783@users.noreply.github.com> Date: Tue, 13 Jun 2023 16:15:16 +0200 Subject: [PATCH 41/92] Update deprecated port specification in example config (#1042) Co-authored-by: bas --- docs/installation.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index ed8cee8f4..3639218e1 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -27,8 +27,9 @@ blocking: clientGroupsBlock: default: - ads -port: 53 -httpPort: 4000 +ports: + dns: 53 + http: 4000 ``` ## Run as standalone binary From 0431a6487c16d38033e579bba17960598c53f1ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 May 2023 11:50:05 +0000 Subject: [PATCH 42/92] build(deps): bump gorm.io/driver/postgres from 1.5.0 to 1.5.2 Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.5.0 to 1.5.2. - [Commits](https://github.com/go-gorm/postgres/compare/v1.5.0...v1.5.2) --- updated-dependencies: - dependency-name: gorm.io/driver/postgres dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 23 ++++++----------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index db6b33066..4e9657ac4 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( golang.org/x/net v0.10.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.0 - gorm.io/driver/postgres v1.5.0 + gorm.io/driver/postgres v1.5.2 gorm.io/driver/sqlite v1.5.1 gorm.io/gorm v1.25.0 ) @@ -57,7 +57,7 @@ require ( github.com/go-logr/logr v1.2.4 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect - github.com/jackc/pgx/v5 v5.3.0 // indirect + github.com/jackc/pgx/v5 v5.3.1 // indirect github.com/klauspost/compress v1.11.13 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/moby/patternmatcher v0.5.0 // indirect @@ -123,7 +123,7 @@ require ( github.com/urfave/cli/v2 v2.25.1 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect - golang.org/x/crypto v0.6.0 // indirect + golang.org/x/crypto v0.8.0 // indirect golang.org/x/exp v0.0.0-20230307190834-24139beb5833 golang.org/x/mod v0.10.0 // indirect golang.org/x/sys v0.8.0 // indirect diff --git a/go.sum b/go.sum index 7f2e6bfdd..e37874238 100644 --- a/go.sum +++ b/go.sum @@ -174,9 +174,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.3.0 h1:/NQi8KHMpKWHInxXesC8yD4DhkXPrVhmnwYkjp9AmBA= -github.com/jackc/pgx/v5 v5.3.0/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= -github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU= +github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= @@ -189,7 +188,6 @@ github.com/klauspost/compress v1.11.13 h1:eSvu8Tmq6j2psUJqJrLcWH6K3w5Dwc+qipbaA6 github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -269,7 +267,6 @@ github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB github.com/ramr/go-reaper v0.2.1 h1:zww+wlQOvTjBZuk1920R/e0GFEb6O7+B0WQLV6dM924= github.com/ramr/go-reaper v0.2.1/go.mod h1:AVypdzrcCXjSc/JYnlXl8TsB+z84WyFzxWE8Jh0MOJc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -299,7 +296,6 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= @@ -331,8 +327,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= +golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= @@ -360,7 +356,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -373,7 +368,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -404,13 +398,11 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -418,7 +410,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= @@ -475,8 +466,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -491,8 +480,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.5.0 h1:6hSAT5QcyIaty0jfnff0z0CLDjyRgZ8mlMHLqSt7uXM= gorm.io/driver/mysql v1.5.0/go.mod h1:FFla/fJuCvyTi7rJQd27qlNX2v3L6deTR1GgTjSOLPo= -gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U= -gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A= +gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0= +gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8= gorm.io/driver/sqlite v1.5.1 h1:hYyrLkAWE71bcarJDPdZNTLWtr8XrSjOWyjUYI6xdL4= gorm.io/driver/sqlite v1.5.1/go.mod h1:7MZZ2Z8bqyfSQA1gYEV6MagQWj3cpUkJj9Z+d1HEMEQ= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= From 2ccc4144d1f00e4c4238e4483ab29e18d69cf1ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Jun 2023 05:00:31 +0000 Subject: [PATCH 43/92] build(deps): bump github.com/alicebob/miniredis/v2 from 2.30.2 to 2.30.3 Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.30.2 to 2.30.3. - [Release notes](https://github.com/alicebob/miniredis/releases) - [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md) - [Commits](https://github.com/alicebob/miniredis/compare/v2.30.2...v2.30.3) --- updated-dependencies: - dependency-name: github.com/alicebob/miniredis/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4e9657ac4..4e0de1933 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/abice/go-enum v0.5.6 - github.com/alicebob/miniredis/v2 v2.30.2 + github.com/alicebob/miniredis/v2 v2.30.3 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef github.com/avast/retry-go/v4 v4.3.4 github.com/creasty/defaults v1.7.0 diff --git a/go.sum b/go.sum index e37874238..41e14aad2 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/abice/go-enum v0.5.6 h1:Ury51IQXUppbIl56MqRU/++A8SSeLG4plePphPjxW1s= github.com/abice/go-enum v0.5.6/go.mod h1:X2GpCT8VkCXLkVm48hebWx3cVgFJ8zM5nY5iUrJZO1Q= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I= -github.com/alicebob/miniredis/v2 v2.30.2/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/alicebob/miniredis/v2 v2.30.3 h1:hrqDB4cHFSHQf4gO3xu6YKQg8PqJpNjLYsQAFYHstqw= +github.com/alicebob/miniredis/v2 v2.30.3/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= From 1766be03c7261bc1c90e458c0f77c957ea1b4755 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 04:58:55 +0000 Subject: [PATCH 44/92] build(deps): bump github.com/sirupsen/logrus from 1.9.2 to 1.9.3 Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.2 to 1.9.3. - [Release notes](https://github.com/sirupsen/logrus/releases) - [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md) - [Commits](https://github.com/sirupsen/logrus/compare/v1.9.2...v1.9.3) --- updated-dependencies: - dependency-name: github.com/sirupsen/logrus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4e0de1933..3b99a3bff 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/onsi/ginkgo/v2 v2.9.5 github.com/onsi/gomega v1.27.7 github.com/prometheus/client_golang v1.15.1 - github.com/sirupsen/logrus v1.9.2 + github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.3 github.com/swaggo/swag v1.16.1 diff --git a/go.sum b/go.sum index 41e14aad2..fd0200453 100644 --- a/go.sum +++ b/go.sum @@ -277,8 +277,8 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= -github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= From a039c41226ec6de3e397d8adb2bc2bf7915d1581 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 15:15:54 +0000 Subject: [PATCH 45/92] build(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4 Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.3 to 1.8.4. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.3...v1.8.4) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3b99a3bff..36c22089d 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/prometheus/client_golang v1.15.1 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.3 + github.com/stretchr/testify v1.8.4 github.com/swaggo/swag v1.16.1 github.com/x-cray/logrus-prefixed-formatter v0.5.2 golang.org/x/net v0.10.0 diff --git a/go.sum b/go.sum index fd0200453..b6cd17e8b 100644 --- a/go.sum +++ b/go.sum @@ -297,8 +297,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= From 173d31b482b220195d952b1b1ef928b7c44d1d6d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 15:16:14 +0000 Subject: [PATCH 46/92] build(deps): bump github.com/onsi/gomega from 1.27.7 to 1.27.8 Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.7 to 1.27.8. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.27.7...v1.27.8) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 36c22089d..eb694d904 100644 --- a/go.mod +++ b/go.mod @@ -19,8 +19,8 @@ require ( github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/miekg/dns v1.1.54 github.com/mroth/weightedrand/v2 v2.0.1 - github.com/onsi/ginkgo/v2 v2.9.5 - github.com/onsi/gomega v1.27.7 + github.com/onsi/ginkgo/v2 v2.9.7 + github.com/onsi/gomega v1.27.8 github.com/prometheus/client_golang v1.15.1 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 diff --git a/go.sum b/go.sum index b6cd17e8b..f2149a457 100644 --- a/go.sum +++ b/go.sum @@ -239,10 +239,10 @@ github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q= -github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k= -github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU= -github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4= +github.com/onsi/ginkgo/v2 v2.9.7 h1:06xGQy5www2oN160RtEZoTvnP2sPhEfePYmCDc2szss= +github.com/onsi/ginkgo/v2 v2.9.7/go.mod h1:cxrmXWykAwTwhQsJOPfdIDiJ+l2RYq7U8hFU+M/1uw0= +github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= +github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= From 7c07de77fe877d7ad240d05a21626a87f069c4b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 15:16:00 +0000 Subject: [PATCH 47/92] build(deps): bump golang.org/x/tools from 0.9.1 to 0.10.0 Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.9.1 to 0.10.0. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.9.1...v0.10.0) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 16 ++++++++-------- go.sum | 32 ++++++++++++++++---------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index eb694d904..77cd3d6b1 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/swaggo/swag v1.16.1 github.com/x-cray/logrus-prefixed-formatter v0.5.2 - golang.org/x/net v0.10.0 + golang.org/x/net v0.11.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.0 gorm.io/driver/postgres v1.5.2 @@ -69,7 +69,7 @@ require ( github.com/opencontainers/runc v1.1.5 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/cast v1.3.1 // indirect - golang.org/x/sync v0.2.0 // indirect + golang.org/x/sync v0.3.0 // indirect golang.org/x/tools/cmd/cover v0.1.0-deprecated // indirect google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect google.golang.org/grpc v1.47.0 // indirect @@ -123,13 +123,13 @@ require ( github.com/urfave/cli/v2 v2.25.1 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect - golang.org/x/crypto v0.8.0 // indirect + golang.org/x/crypto v0.10.0 // indirect golang.org/x/exp v0.0.0-20230307190834-24139beb5833 - golang.org/x/mod v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - golang.org/x/tools v0.9.1 + golang.org/x/mod v0.11.0 // indirect + golang.org/x/sys v0.9.0 // indirect + golang.org/x/term v0.9.0 // indirect + golang.org/x/text v0.10.0 // indirect + golang.org/x/tools v0.10.0 google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f2149a457..8758b4ea8 100644 --- a/go.sum +++ b/go.sum @@ -327,8 +327,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= @@ -339,8 +339,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -356,8 +356,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -368,8 +368,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -398,20 +398,20 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= 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= @@ -423,8 +423,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= -golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= +golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= golang.org/x/tools/cmd/cover v0.1.0-deprecated h1:Rwy+mWYz6loAF+LnG1jHG/JWMHRMMC2/1XX3Ejkx9lA= golang.org/x/tools/cmd/cover v0.1.0-deprecated/go.mod h1:hMDiIvlpN1NoVgmjLjUJE9tMHyxHjFX7RuQ+rW12mSA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 6be1c6529f5bb712be22823212b07c1eaf6a1d14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 04:58:33 +0000 Subject: [PATCH 48/92] build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.1 to 1.16.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.15.1...v1.16.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 77cd3d6b1..4b3cde4f5 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.9.7 github.com/onsi/gomega v1.27.8 - github.com/prometheus/client_golang v1.15.1 + github.com/prometheus/client_golang v1.16.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 @@ -115,7 +115,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect github.com/ramr/go-reaper v0.2.1 github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect diff --git a/go.sum b/go.sum index 8758b4ea8..80cb64e49 100644 --- a/go.sum +++ b/go.sum @@ -255,15 +255,15 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/ramr/go-reaper v0.2.1 h1:zww+wlQOvTjBZuk1920R/e0GFEb6O7+B0WQLV6dM924= github.com/ramr/go-reaper v0.2.1/go.mod h1:AVypdzrcCXjSc/JYnlXl8TsB+z84WyFzxWE8Jh0MOJc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= From d7d354b0d8119e787c42abe6d8cde26f2ff58540 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Jun 2023 04:58:26 +0000 Subject: [PATCH 49/92] build(deps): bump github.com/testcontainers/testcontainers-go Bumps [github.com/testcontainers/testcontainers-go](https://github.com/testcontainers/testcontainers-go) from 0.20.1 to 0.21.0. - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](https://github.com/testcontainers/testcontainers-go/compare/v0.20.1...v0.21.0) --- updated-dependencies: - dependency-name: github.com/testcontainers/testcontainers-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 19 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 4b3cde4f5..c683e9e6f 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/docker/go-connections v0.4.0 github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198 - github.com/testcontainers/testcontainers-go v0.20.1 + github.com/testcontainers/testcontainers-go v0.21.0 mvdan.cc/gofumpt v0.5.0 ) @@ -62,7 +62,7 @@ require ( github.com/magiconair/properties v1.8.7 // indirect github.com/moby/patternmatcher v0.5.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect - github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f // indirect + github.com/moby/term v0.5.0 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect @@ -96,7 +96,7 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/huandu/xstrings v1.3.3 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect @@ -124,7 +124,7 @@ require ( github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect golang.org/x/crypto v0.10.0 // indirect - golang.org/x/exp v0.0.0-20230307190834-24139beb5833 + golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea golang.org/x/mod v0.11.0 // indirect golang.org/x/sys v0.9.0 // indirect golang.org/x/term v0.9.0 // indirect diff --git a/go.sum b/go.sum index 80cb64e49..e46025e4f 100644 --- a/go.sum +++ b/go.sum @@ -59,7 +59,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creasty/defaults v1.7.0 h1:eNdqZvc5B509z18lD8yc212CAqJNvfT1Jq6L8WowdBA= github.com/creasty/defaults v1.7.0/go.mod h1:iGzKe6pbEHnpMPtfDXZEr0NVxWnPTjb1bbDy08fPzYM= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= @@ -166,8 +166,8 @@ github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4 github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= @@ -229,8 +229,8 @@ github.com/moby/patternmatcher v0.5.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YO github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= -github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f h1:J/7hjLaHLD7epG0m6TBMGmp4NQ+ibBYLfeyJWdAIFLA= -github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f/go.mod h1:15ce4BGCFxt7I5NQKT+HV0yEDxmf6fSysfEDiVo3zFM= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mroth/weightedrand/v2 v2.0.1 h1:zrEVDIaau/E4QLOKu02kpg8T8myweFlMGikIgbIdrRA= @@ -302,8 +302,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/testcontainers/testcontainers-go v0.20.1 h1:mK15UPJ8c5P+NsQKmkqzs/jMdJt6JMs5vlw2y4j92c0= -github.com/testcontainers/testcontainers-go v0.20.1/go.mod h1:zb+NOlCQBkZ7RQp4QI+YMIHyO2CQ/qsXzNF5eLJ24SY= +github.com/testcontainers/testcontainers-go v0.21.0 h1:syePAxdeTzfkap+RrJaQZpJQ/s/fsUgn11xIvHrOE9U= +github.com/testcontainers/testcontainers-go v0.21.0/go.mod h1:c1ez3WVRHq7T/Aj+X3TIipFBwkBaNT5iNCY8+1b83Ng= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw= github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= @@ -330,8 +330,8 @@ golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4 golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4= +golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= 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= @@ -475,7 +475,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.5.0 h1:6hSAT5QcyIaty0jfnff0z0CLDjyRgZ8mlMHLqSt7uXM= From b533b5685cc19ba5110da5d55c6feb19a1477bbf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Jun 2023 04:42:57 +0000 Subject: [PATCH 50/92] build(deps): bump gorm.io/gorm from 1.25.0 to 1.25.2 Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.25.0 to 1.25.2. - [Release notes](https://github.com/go-gorm/gorm/releases) - [Commits](https://github.com/go-gorm/gorm/compare/v1.25.0...v1.25.2) --- updated-dependencies: - dependency-name: gorm.io/gorm dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c683e9e6f..634ea550e 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( gorm.io/driver/mysql v1.5.0 gorm.io/driver/postgres v1.5.2 gorm.io/driver/sqlite v1.5.1 - gorm.io/gorm v1.25.0 + gorm.io/gorm v1.25.2 ) require ( diff --git a/go.sum b/go.sum index e46025e4f..97a577b79 100644 --- a/go.sum +++ b/go.sum @@ -484,8 +484,8 @@ gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBp gorm.io/driver/sqlite v1.5.1 h1:hYyrLkAWE71bcarJDPdZNTLWtr8XrSjOWyjUYI6xdL4= gorm.io/driver/sqlite v1.5.1/go.mod h1:7MZZ2Z8bqyfSQA1gYEV6MagQWj3cpUkJj9Z+d1HEMEQ= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= -gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho= +gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= 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= From 954ad5668a21b2cf895becdbb50bd4da4d2ee38d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Jun 2023 19:50:58 +0000 Subject: [PATCH 51/92] build(deps): bump github.com/onsi/ginkgo/v2 from 2.9.5 to 2.11.0 Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.9.5 to 2.11.0. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.9.5...v2.11.0) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 634ea550e..3b8cd3fb1 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/miekg/dns v1.1.54 github.com/mroth/weightedrand/v2 v2.0.1 - github.com/onsi/ginkgo/v2 v2.9.7 + github.com/onsi/ginkgo/v2 v2.11.0 github.com/onsi/gomega v1.27.8 github.com/prometheus/client_golang v1.16.0 github.com/sirupsen/logrus v1.9.3 diff --git a/go.sum b/go.sum index 97a577b79..a911bd75a 100644 --- a/go.sum +++ b/go.sum @@ -239,8 +239,8 @@ github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.9.7 h1:06xGQy5www2oN160RtEZoTvnP2sPhEfePYmCDc2szss= -github.com/onsi/ginkgo/v2 v2.9.7/go.mod h1:cxrmXWykAwTwhQsJOPfdIDiJ+l2RYq7U8hFU+M/1uw0= +github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= From 7dacf6fdac0279c119fe6c6d31a6743cb7e9f6a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Jun 2023 20:00:29 +0000 Subject: [PATCH 52/92] build(deps): bump github.com/alicebob/miniredis/v2 from 2.30.3 to 2.30.4 Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.30.3 to 2.30.4. - [Release notes](https://github.com/alicebob/miniredis/releases) - [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md) - [Commits](https://github.com/alicebob/miniredis/compare/v2.30.3...v2.30.4) --- updated-dependencies: - dependency-name: github.com/alicebob/miniredis/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3b8cd3fb1..8cab1fd0c 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/abice/go-enum v0.5.6 - github.com/alicebob/miniredis/v2 v2.30.3 + github.com/alicebob/miniredis/v2 v2.30.4 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef github.com/avast/retry-go/v4 v4.3.4 github.com/creasty/defaults v1.7.0 diff --git a/go.sum b/go.sum index a911bd75a..b894cf3b4 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/abice/go-enum v0.5.6 h1:Ury51IQXUppbIl56MqRU/++A8SSeLG4plePphPjxW1s= github.com/abice/go-enum v0.5.6/go.mod h1:X2GpCT8VkCXLkVm48hebWx3cVgFJ8zM5nY5iUrJZO1Q= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.3 h1:hrqDB4cHFSHQf4gO3xu6YKQg8PqJpNjLYsQAFYHstqw= -github.com/alicebob/miniredis/v2 v2.30.3/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOSchFS7Eo= +github.com/alicebob/miniredis/v2 v2.30.4/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= From fa73eddbd4be134be03a0d6687146ea1740e180c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Jun 2023 20:49:47 +0000 Subject: [PATCH 53/92] build(deps): bump github.com/miekg/dns from 1.1.54 to 1.1.55 Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.54 to 1.1.55. - [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release) - [Commits](https://github.com/miekg/dns/compare/v1.1.54...v1.1.55) --- updated-dependencies: - dependency-name: github.com/miekg/dns dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8cab1fd0c..376f6329b 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/hashicorp/golang-lru v0.5.4 github.com/mattn/go-colorable v0.1.13 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect - github.com/miekg/dns v1.1.54 + github.com/miekg/dns v1.1.55 github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.11.0 github.com/onsi/gomega v1.27.8 diff --git a/go.sum b/go.sum index b894cf3b4..04d61a219 100644 --- a/go.sum +++ b/go.sum @@ -216,8 +216,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/miekg/dns v1.1.54 h1:5jon9mWcb0sFJGpnI99tOMhCPyJ+RPVz5b63MQG0VWI= -github.com/miekg/dns v1.1.54/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= +github.com/miekg/dns v1.1.55 h1:GoQ4hpsj0nFLYe+bWiCToyrBEJXkQfOOIvFGFy0lEgo= +github.com/miekg/dns v1.1.55/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= From a077b1a66ab5349f8c7459591d15964eba447a77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 21:24:43 +0000 Subject: [PATCH 54/92] build(deps): bump google.golang.org/grpc from 1.47.0 to 1.53.0 Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.47.0 to 1.53.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.47.0...v1.53.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 4 +-- go.sum | 98 +++------------------------------------------------------- 2 files changed, 6 insertions(+), 96 deletions(-) diff --git a/go.mod b/go.mod index 376f6329b..7db51cb09 100644 --- a/go.mod +++ b/go.mod @@ -71,8 +71,8 @@ require ( github.com/spf13/cast v1.3.1 // indirect golang.org/x/sync v0.3.0 // indirect golang.org/x/tools/cmd/cover v0.1.0-deprecated // indirect - google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect - google.golang.org/grpc v1.47.0 // indirect + google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect + google.golang.org/grpc v1.53.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 04d61a219..f83b8bbd3 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -22,7 +20,6 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZp github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOSchFS7Eo= github.com/alicebob/miniredis/v2 v2.30.4/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= github.com/avast/retry-go/v4 v4.3.4 h1:pHLkL7jvCvP317I8Ge+Km2Yhntv3SdkJm7uekkqbKhM= @@ -32,8 +29,6 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= @@ -41,13 +36,6 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/containerd v1.6.19 h1:F0qgQPrG0P2JPgwpxWxYavrVeXAG0ezUIB9Z/4FTUAU= github.com/containerd/containerd v1.6.19/go.mod h1:HZCDMn4v/Xl2579/MvtOC2M206i+JJ6VxFWU/NetrGY= @@ -79,16 +67,9 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198 h1:3b37D/Oxs95GmDsGKNx21aBYWF270emHjqUExsAL01g= github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198/go.mod h1:NUrh34aXXgbs4C2HkTmRmkzsKhtrFPRitYkbZMDDONo= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -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.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= @@ -116,43 +97,22 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -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= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b h1:wDUNC2eKiL35DbLvsDhiblTUXHxcOPwQSCzi7xpQUN4= github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b/go.mod h1:VzxiSdG6j1pi7rwGm/xYI5RbtpBgM8sARDXlvEvxlu0= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -257,7 +217,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= @@ -266,7 +225,6 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/ramr/go-reaper v0.2.1 h1:zww+wlQOvTjBZuk1920R/e0GFEb6O7+B0WQLV6dM924= github.com/ramr/go-reaper v0.2.1/go.mod h1:AVypdzrcCXjSc/JYnlXl8TsB+z84WyFzxWE8Jh0MOJc= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -321,7 +279,6 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= 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= @@ -329,27 +286,17 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4= golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= -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.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -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-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-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200822124328-c89045814202/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-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -358,10 +305,6 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -370,7 +313,6 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/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= @@ -378,10 +320,8 @@ golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/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-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -407,17 +347,12 @@ golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= 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/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -431,35 +366,13 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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/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= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad h1:kqrS+lhvaMHCxul6sKQvKJ8nAAhlVItmZV822hYFH/U= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -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= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -468,7 +381,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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= @@ -487,8 +399,6 @@ gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqw gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho= gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -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= mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= From 42db8ec943c9063b2001df3a2703eefa395080f4 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Sun, 7 May 2023 18:14:15 -0400 Subject: [PATCH 55/92] fix: parse the API URL using the non-deprecated options --- cmd/root.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 3eb088be7..1b52a6c51 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -88,8 +88,8 @@ func initConfig() { log.ConfigureLogger(&cfg.Log) - if len(cfg.HTTPPorts) != 0 { - split := strings.Split(cfg.HTTPPorts[0], ":") + if len(cfg.Ports.HTTP) != 0 { + split := strings.Split(cfg.Ports.HTTP[0], ":") lastIdx := len(split) - 1 From 5e4c155793a3db62275a7c4df9830f3cd4e6940b Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Mon, 19 Jun 2023 19:47:48 -0400 Subject: [PATCH 56/92] refactor(config): add migration package to simplify deprecating settings Deprecated settings use pointers to allow knowing if they are actually set in the user config. They are also nested in a struct which ensures they aren't still used since any old code would fail to compile, and easily make them discoverable by `migration.Migrate`. --- config/blocking.go | 17 +++- config/config.go | 130 ++++++++----------------- config/config_test.go | 68 ++++++++----- config/migration/migration.go | 174 ++++++++++++++++++++++++++++++++++ 4 files changed, 269 insertions(+), 120 deletions(-) create mode 100644 config/migration/migration.go diff --git a/config/blocking.go b/config/blocking.go index 2adfd9e24..f4f4ac129 100644 --- a/config/blocking.go +++ b/config/blocking.go @@ -3,6 +3,7 @@ package config import ( "strings" + . "github.com/0xERR0R/blocky/config/migration" //nolint:revive,stylecheck "github.com/0xERR0R/blocky/log" "github.com/sirupsen/logrus" ) @@ -18,10 +19,24 @@ type BlockingConfig struct { DownloadAttempts uint `yaml:"downloadAttempts" default:"3"` DownloadCooldown Duration `yaml:"downloadCooldown" default:"1s"` RefreshPeriod Duration `yaml:"refreshPeriod" default:"4h"` - FailStartOnListError bool `yaml:"failStartOnListError" default:"false"` // Deprecated ProcessingConcurrency uint `yaml:"processingConcurrency" default:"4"` StartStrategy StartStrategyType `yaml:"startStrategy" default:"blocking"` MaxErrorsPerFile int `yaml:"maxErrorsPerFile" default:"5"` + + // Deprecated options + Deprecated struct { + FailStartOnListError *bool `yaml:"failStartOnListError"` + } `yaml:",inline"` +} + +func (c *BlockingConfig) migrate(logger *logrus.Entry) bool { + return Migrate(logger, "blocking", c.Deprecated, map[string]Migrator{ + "failStartOnListError": Apply(To("startStrategy", c), func(oldValue bool) { + if oldValue && c.StartStrategy != StartStrategyTypeFast { + c.StartStrategy = StartStrategyTypeFailOnError + } + }), + }) } // IsEnabled implements `config.Configurable`. diff --git a/config/config.go b/config/config.go index 64568b2c4..1fa2e135f 100644 --- a/config/config.go +++ b/config/config.go @@ -14,6 +14,7 @@ import ( "github.com/miekg/dns" "github.com/sirupsen/logrus" + . "github.com/0xERR0R/blocky/config/migration" //nolint:revive,stylecheck "github.com/0xERR0R/blocky/log" "github.com/creasty/defaults" "gopkg.in/yaml.v2" @@ -181,24 +182,19 @@ type Config struct { FqdnOnly FqdnOnlyConfig `yaml:"fqdnOnly"` Filtering FilteringConfig `yaml:"filtering"` Ede EdeConfig `yaml:"ede"` - // Deprecated - DisableIPv6 bool `yaml:"disableIPv6" default:"false"` - // Deprecated - LogLevel log.Level `yaml:"logLevel" default:"info"` - // Deprecated - LogFormat log.FormatType `yaml:"logFormat" default:"text"` - // Deprecated - LogPrivacy bool `yaml:"logPrivacy" default:"false"` - // Deprecated - LogTimestamp bool `yaml:"logTimestamp" default:"true"` - // Deprecated - DNSPorts ListenConfig `yaml:"port" default:"53"` - // Deprecated - HTTPPorts ListenConfig `yaml:"httpPort"` - // Deprecated - HTTPSPorts ListenConfig `yaml:"httpsPort"` - // Deprecated - TLSPorts ListenConfig `yaml:"tlsPort"` + + // Deprecated options + Deprecated struct { + DisableIPv6 *bool `yaml:"disableIPv6"` + LogLevel *log.Level `yaml:"logLevel"` + LogFormat *log.FormatType `yaml:"logFormat"` + LogPrivacy *bool `yaml:"logPrivacy"` + LogTimestamp *bool `yaml:"logTimestamp"` + DNSPorts *ListenConfig `yaml:"port"` + HTTPPorts *ListenConfig `yaml:"httpPort"` + HTTPSPorts *ListenConfig `yaml:"httpsPort"` + TLSPorts *ListenConfig `yaml:"tlsPort"` + } `yaml:",inline"` } type PortsConfig struct { @@ -374,88 +370,36 @@ func unmarshalConfig(data []byte, cfg *Config) error { return fmt.Errorf("wrong file structure: %w", err) } - validateConfig(cfg) - - return nil -} - -func validateConfig(cfg *Config) { - if cfg.DisableIPv6 { - log.Log().Warnf("'disableIPv6' is deprecated. Please use 'filtering.queryTypes' with 'AAAA' instead.") - - cfg.Filtering.QueryTypes.Insert(dns.Type(dns.TypeAAAA)) - } - - if cfg.Blocking.FailStartOnListError { - log.Log().Warnf("'blocking.failStartOnListError' is deprecated. Please use 'blocking.startStrategy'" + - " with 'failOnError' instead.") - - if cfg.Blocking.StartStrategy == StartStrategyTypeBlocking { - cfg.Blocking.StartStrategy = StartStrategyTypeFailOnError - } else if cfg.Blocking.StartStrategy == StartStrategyTypeFast { - log.Log().Warnf("'blocking.startStrategy' with 'fast' will ignore 'blocking.failStartOnListError'.") - } - } - - fixDeprecatedLog(cfg) - - fixDeprecatedPorts(cfg) -} - -// fixDeprecatedLog ensures backwards compatibility for logging options -func fixDeprecatedLog(cfg *Config) { - if cfg.LogLevel != log.LevelInfo && cfg.Log.Level == log.LevelInfo { - log.Log().Warnf("'logLevel' is deprecated. Please use 'log.level' instead.") - - cfg.Log.Level = cfg.LogLevel - } - - if cfg.LogFormat != log.FormatTypeText && cfg.Log.Format == log.FormatTypeText { - log.Log().Warnf("'logFormat' is deprecated. Please use 'log.format' instead.") + logger := logrus.NewEntry(log.Log()) - cfg.Log.Format = cfg.LogFormat + usesDepredOpts := cfg.migrate(logger) + if usesDepredOpts { + logger.Error("configuration uses deprecated options, see warning logs for details") } - if cfg.LogPrivacy && !cfg.Log.Privacy { - log.Log().Warnf("'logPrivacy' is deprecated. Please use 'log.privacy' instead.") - - cfg.Log.Privacy = cfg.LogPrivacy - } - - if !cfg.LogTimestamp && cfg.Log.Timestamp { - log.Log().Warnf("'logTimestamp' is deprecated. Please use 'log.timestamp' instead.") - - cfg.Log.Timestamp = cfg.LogTimestamp - } + return nil } -// fixDeprecatedPorts ensures backwards compatibility for ports options -func fixDeprecatedPorts(cfg *Config) { - defaultDNSPort := ListenConfig([]string{"53"}) - if (len(cfg.DNSPorts) > 1 || (len(cfg.DNSPorts) == 1 && cfg.DNSPorts[0] != defaultDNSPort[0])) && - (len(cfg.Ports.DNS) == 1 && cfg.Ports.DNS[0] == defaultDNSPort[0]) { - log.Log().Warnf("'port' is deprecated. Please use 'ports.dns' instead.") - - cfg.Ports.DNS = cfg.DNSPorts - } - - if len(cfg.HTTPPorts) > 0 && len(cfg.Ports.HTTP) == 0 { - log.Log().Warnf("'httpPort' is deprecated. Please use 'ports.http' instead.") - - cfg.Ports.HTTP = cfg.HTTPPorts - } - - if len(cfg.HTTPSPorts) > 0 && len(cfg.Ports.HTTPS) == 0 { - log.Log().Warnf("'httpsPort' is deprecated. Please use 'ports.https' instead.") - - cfg.Ports.HTTPS = cfg.HTTPSPorts - } +func (cfg *Config) migrate(logger *logrus.Entry) bool { + usesDepredOpts := Migrate(logger, "", cfg.Deprecated, map[string]Migrator{ + "disableIPv6": Apply(To("filtering.queryTypes", &cfg.Filtering), func(oldValue bool) { + if oldValue { + cfg.Filtering.QueryTypes.Insert(dns.Type(dns.TypeAAAA)) + } + }), + "port": Move(To("ports.dns", &cfg.Ports)), + "httpPort": Move(To("ports.http", &cfg.Ports)), + "httpsPort": Move(To("ports.https", &cfg.Ports)), + "tlsPort": Move(To("ports.tls", &cfg.Ports)), + "logLevel": Move(To("log.level", &cfg.Log)), + "logFormat": Move(To("log.format", &cfg.Log)), + "logPrivacy": Move(To("log.privacy", &cfg.Log)), + "logTimestamp": Move(To("log.timestamp", &cfg.Log)), + }) - if len(cfg.TLSPorts) > 0 && len(cfg.Ports.TLS) == 0 { - log.Log().Warnf("'tlsPort' is deprecated. Please use 'ports.tls' instead.") + usesDepredOpts = cfg.Blocking.migrate(logger) || usesDepredOpts - cfg.Ports.TLS = cfg.TLSPorts - } + return usesDepredOpts } // GetConfig returns the current config diff --git a/config/config_test.go b/config/config_test.go index 1ca8c432a..ccef7a31d 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -19,6 +19,8 @@ var _ = Describe("Config", func() { err error ) + suiteBeforeEach() + BeforeEach(func() { tmpDir = helpertest.NewTmpFolder("config") Expect(tmpDir.Error).Should(Succeed()) @@ -34,8 +36,9 @@ var _ = Describe("Config", func() { When("parameter 'disableIPv6' is set", func() { It("should add 'AAAA' to filter.queryTypes", func() { - c.DisableIPv6 = true - validateConfig(&c) + c.Deprecated.DisableIPv6 = ptrOf(true) + c.migrate(logger) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("disableIPv6"))) Expect(c.Filtering.QueryTypes).Should(HaveKey(QType(dns.TypeAAAA))) Expect(c.Filtering.QueryTypes.Contains(dns.Type(dns.TypeAAAA))).Should(BeTrue()) }) @@ -43,50 +46,52 @@ var _ = Describe("Config", func() { When("parameter 'failStartOnListError' is set", func() { BeforeEach(func() { - c.Blocking = BlockingConfig{ - FailStartOnListError: true, - StartStrategy: StartStrategyTypeBlocking, - } + c.Blocking.Deprecated.FailStartOnListError = ptrOf(true) }) It("should change StartStrategy blocking to failOnError", func() { - validateConfig(&c) + c.Blocking.StartStrategy = StartStrategyTypeBlocking + c.migrate(logger) Expect(c.Blocking.StartStrategy).Should(Equal(StartStrategyTypeFailOnError)) }) It("shouldn't change StartStrategy if set to fast", func() { c.Blocking.StartStrategy = StartStrategyTypeFast - validateConfig(&c) + c.migrate(logger) Expect(c.Blocking.StartStrategy).Should(Equal(StartStrategyTypeFast)) }) }) When("parameter 'logLevel' is set", func() { It("should convert to log.level", func() { - c.LogLevel = log.LevelDebug - validateConfig(&c) + c.Deprecated.LogLevel = ptrOf(log.LevelDebug) + c.migrate(logger) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("log.level"))) Expect(c.Log.Level).Should(Equal(log.LevelDebug)) }) }) When("parameter 'logFormat' is set", func() { It("should convert to log.format", func() { - c.LogFormat = log.FormatTypeJson - validateConfig(&c) + c.Deprecated.LogFormat = ptrOf(log.FormatTypeJson) + c.migrate(logger) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("log.format"))) Expect(c.Log.Format).Should(Equal(log.FormatTypeJson)) }) }) When("parameter 'logPrivacy' is set", func() { It("should convert to log.privacy", func() { - c.LogPrivacy = true - validateConfig(&c) + c.Deprecated.LogPrivacy = ptrOf(true) + c.migrate(logger) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("log.privacy"))) Expect(c.Log.Privacy).Should(BeTrue()) }) }) When("parameter 'logTimestamp' is set", func() { It("should convert to log.timestamp", func() { - c.LogTimestamp = false - validateConfig(&c) + c.Deprecated.LogTimestamp = ptrOf(false) + c.migrate(logger) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("log.timestamp"))) Expect(c.Log.Timestamp).Should(BeFalse()) }) }) @@ -94,8 +99,9 @@ var _ = Describe("Config", func() { When("parameter 'port' is set", func() { It("should convert to ports.dns", func() { ports := ListenConfig([]string{"5333"}) - c.DNSPorts = ports - validateConfig(&c) + c.Deprecated.DNSPorts = ptrOf(ports) + c.migrate(logger) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("ports.dns"))) Expect(c.Ports.DNS).Should(Equal(ports)) }) }) @@ -103,8 +109,9 @@ var _ = Describe("Config", func() { When("parameter 'httpPort' is set", func() { It("should convert to ports.http", func() { ports := ListenConfig([]string{"5333"}) - c.HTTPPorts = ports - validateConfig(&c) + c.Deprecated.HTTPPorts = ptrOf(ports) + c.migrate(logger) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("ports.http"))) Expect(c.Ports.HTTP).Should(Equal(ports)) }) }) @@ -112,8 +119,9 @@ var _ = Describe("Config", func() { When("parameter 'httpsPort' is set", func() { It("should convert to ports.https", func() { ports := ListenConfig([]string{"5333"}) - c.HTTPSPorts = ports - validateConfig(&c) + c.Deprecated.HTTPSPorts = ptrOf(ports) + c.migrate(logger) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("ports.https"))) Expect(c.Ports.HTTPS).Should(Equal(ports)) }) }) @@ -121,8 +129,9 @@ var _ = Describe("Config", func() { When("parameter 'tlsPort' is set", func() { It("should convert to ports.tls", func() { ports := ListenConfig([]string{"5333"}) - c.TLSPorts = ports - validateConfig(&c) + c.Deprecated.TLSPorts = ptrOf(ports) + c.migrate(logger) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("ports.tls"))) Expect(c.Ports.TLS).Should(Equal(ports)) }) }) @@ -315,7 +324,7 @@ bootstrapDns: _, err = LoadConfig(tmpDir.JoinPath("config.yml"), false) Expect(err).Should(Succeed()) - Expect(config.LogLevel).Should(Equal(log.LevelInfo)) + Expect(config.Log.Level).Should(Equal(log.LevelInfo)) }) }) }) @@ -528,7 +537,7 @@ bootstrapDns: }) func defaultTestFileConfig() { - Expect(config.DNSPorts).Should(Equal(ListenConfig{"55553", ":55554", "[::1]:55555"})) + Expect(config.Ports.DNS).Should(Equal(ListenConfig{"55553", ":55554", "[::1]:55555"})) Expect(config.Upstream.ExternalResolvers["default"]).Should(HaveLen(3)) Expect(config.Upstream.ExternalResolvers["default"][0].Host).Should(Equal("8.8.8.8")) Expect(config.Upstream.ExternalResolvers["default"][1].Host).Should(Equal("8.8.4.4")) @@ -685,3 +694,10 @@ func writeConfigDir(tmpDir *helpertest.TmpFolder) error { return f2.Error } + +// Tiny helper to get a new pointer with a value. +// +// Avoids needing 2 lines: `x := new(T)` and `*x = val` +func ptrOf[T any](val T) *T { + return &val +} diff --git a/config/migration/migration.go b/config/migration/migration.go new file mode 100644 index 000000000..66a394e8c --- /dev/null +++ b/config/migration/migration.go @@ -0,0 +1,174 @@ +// Package migration helps with migrating deprecated config options. +// +// `panic` is only used for programmer errors, meaning they will only trigger during development. +package migration + +import ( + "fmt" + "reflect" + "strings" + + "github.com/creasty/defaults" + "github.com/sirupsen/logrus" + "golang.org/x/exp/maps" +) + +// Migrate checks each field of `deprecated` to see if a migration can and should be run. +// +// Each field must be a pointer: this allows knowing if the user has set a value in the config. +func Migrate(logger *logrus.Entry, optPrefix string, deprecated any, newOptions map[string]Migrator) bool { + deprecatedVal := reflect.ValueOf(deprecated) + deprecatedTyp := deprecatedVal.Type() + + usesDepredOpts := false + + for i := 0; i < deprecatedTyp.NumField(); i++ { + field := deprecatedTyp.Field(i) + fieldTag := field.Tag.Get("yaml") + oldName := fullname(optPrefix, fieldTag) + + migrator, ok := newOptions[fieldTag] + if !ok { + panic(fmt.Errorf("deprecated option %s has no matching %T", oldName, migrator)) + } + + delete(newOptions, fieldTag) // so we know it's been checked + + migrator.dest.prefix = optPrefix + + val := deprecatedVal.Field(i) + if val.Type().Kind() != reflect.Pointer { + panic(fmt.Errorf("deprecated option %s must be a pointer", oldName)) + } + + if val.IsNil() { + // Deprecated option is not defined in the user's config + continue + } + + usesDepredOpts = true + val = val.Elem() // deref the pointer + + if !migrator.dest.IsDefault() { + logger. + WithFields(logrus.Fields{ + migrator.dest.Name(): migrator.dest.Value.Interface(), + oldName: val.Interface(), + }). + Errorf( + "config options %q (new) and %q (deprecated) are both set, ignoring the deprecated one", + migrator.dest, oldName, + ) + + continue + } + + logger.Warnf("config option %q is deprecated, please use %q instead", oldName, migrator.dest) + + migrator.apply(oldName, val) + } + + if len(newOptions) != 0 { + panic(fmt.Errorf("%q has unused migrations: %v", optPrefix, maps.Keys(newOptions))) + } + + return usesDepredOpts +} + +type applyFunc func(oldName string, oldValue reflect.Value) + +type Migrator struct { + dest *Dest + apply applyFunc +} + +func newMigrator(dest *Dest, apply applyFunc) Migrator { + return Migrator{dest, apply} +} + +// Move copies the deprecated option's value to `dest`. +func Move(dest *Dest) Migrator { + return newMigrator(dest, func(oldName string, oldValue reflect.Value) { + dest.Value.Set(oldValue) + }) +} + +// Apply calls `apply` with the deprecated value casted to `T`. +func Apply[T any](dest *Dest, apply func(oldValue T)) Migrator { + return newMigrator(dest, func(oldName string, oldValue reflect.Value) { + valItf := oldValue.Interface() + valTyped, ok := valItf.(T) + if !ok { + panic(fmt.Errorf("%q migration types don't match: cannot convert %v to %T", oldName, valItf, valTyped)) + } + + apply(valTyped) + }) +} + +type Dest struct { + prefix string + name string + + Value reflect.Value + Default any +} + +// To creates a new `Dest` from an option name (relative to the `Migrate` prefix) and the struct containing that option. +func To[T any](newName string, newContainerStruct *T) *Dest { + stVal := reflect.ValueOf(newContainerStruct).Elem() + + if stVal.Type().Kind() == reflect.Pointer { + panic(fmt.Errorf("newContainerStruct for %s is a double pointer: %T", newName, newContainerStruct)) + } + + // Find the field matching `newName` in `newContainerStruct` + fieldIdx, newVal := func() (int, reflect.Value) { + parts := strings.Split(newName, ".") + tag := parts[len(parts)-1] + + for i := 0; i < stVal.NumField(); i++ { + field := stVal.Type().Field(i) + if field.Tag.Get("yaml") == tag { + return i, stVal.Field(i) + } + } + + panic(fmt.Errorf("migrated option %q not found in %T", newName, *newContainerStruct)) + }() + + // Get the default value of the new option + newDefaultVal := func() reflect.Value { + defaultVals := new(T) + defaults.MustSet(defaultVals) + + return reflect.ValueOf(defaultVals).Elem().Field(fieldIdx) + }() + + return &Dest{ + prefix: "", // set by Run + name: newName, + Value: newVal, + Default: newDefaultVal.Interface(), + } +} + +func (d *Dest) Name() string { + return fullname(d.prefix, d.name) +} + +func (d *Dest) IsDefault() bool { + return reflect.DeepEqual(d.Value.Interface(), d.Default) +} + +func (d *Dest) String() string { + return d.Name() +} + +func fullname(prefix, name string) string { + if len(prefix) == 0 { + return name + } + + return fmt.Sprintf("%s.%s", prefix, name) +} From cfc3699ab5dec76321c15d9bcfaa32688dba9c38 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Mon, 17 Apr 2023 12:21:56 -0400 Subject: [PATCH 57/92] feat: support multiple hosts files --- .golangci.yml | 3 +- config/blocking.go | 71 +++---- config/blocking_test.go | 27 +-- config/bytes_source.go | 111 ++++++++++ config/bytes_source_enum.go | 101 +++++++++ config/caching_test.go | 16 ++ config/config.go | 115 +++++++++- config/config_enum.go | 31 ++- config/config_test.go | 249 ++++++++++++++++++++-- config/hosts_file.go | 38 +++- config/hosts_file_test.go | 30 ++- docs/config.yml | 92 ++++++-- docs/configuration.md | 244 +++++++++++++-------- e2e/blocking_test.go | 10 +- evt/events.go | 2 +- go.mod | 3 +- go.sum | 8 +- lists/downloader.go | 88 ++------ lists/downloader_test.go | 109 +++++----- lists/list_cache.go | 283 ++++++++++-------------- lists/list_cache_benchmark_test.go | 13 +- lists/list_cache_test.go | 307 +++++++++++++-------------- lists/sourcereader.go | 69 ++++++ resolver/blocking_resolver.go | 23 +- resolver/blocking_resolver_test.go | 74 +++---- resolver/hosts_file_resolver.go | 128 +++++++---- resolver/hosts_file_resolver_test.go | 27 ++- server/server.go | 12 +- server/server_test.go | 14 +- 29 files changed, 1491 insertions(+), 807 deletions(-) create mode 100644 config/bytes_source.go create mode 100644 config/bytes_source_enum.go create mode 100644 lists/sourcereader.go diff --git a/.golangci.yml b/.golangci.yml index 531531359..3572589d5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -80,6 +80,7 @@ issues: # Exclude some linters from running on tests files. - path: _test\.go linters: - - gochecknoglobals - dupl + - funlen + - gochecknoglobals - gosec diff --git a/config/blocking.go b/config/blocking.go index f4f4ac129..364d8dfc0 100644 --- a/config/blocking.go +++ b/config/blocking.go @@ -1,8 +1,6 @@ package config import ( - "strings" - . "github.com/0xERR0R/blocky/config/migration" //nolint:revive,stylecheck "github.com/0xERR0R/blocky/log" "github.com/sirupsen/logrus" @@ -10,32 +8,40 @@ import ( // BlockingConfig configuration for query blocking type BlockingConfig struct { - BlackLists map[string][]string `yaml:"blackLists"` - WhiteLists map[string][]string `yaml:"whiteLists"` - ClientGroupsBlock map[string][]string `yaml:"clientGroupsBlock"` - BlockType string `yaml:"blockType" default:"ZEROIP"` - BlockTTL Duration `yaml:"blockTTL" default:"6h"` - DownloadTimeout Duration `yaml:"downloadTimeout" default:"60s"` - DownloadAttempts uint `yaml:"downloadAttempts" default:"3"` - DownloadCooldown Duration `yaml:"downloadCooldown" default:"1s"` - RefreshPeriod Duration `yaml:"refreshPeriod" default:"4h"` - ProcessingConcurrency uint `yaml:"processingConcurrency" default:"4"` - StartStrategy StartStrategyType `yaml:"startStrategy" default:"blocking"` - MaxErrorsPerFile int `yaml:"maxErrorsPerFile" default:"5"` + BlackLists map[string][]BytesSource `yaml:"blackLists"` + WhiteLists map[string][]BytesSource `yaml:"whiteLists"` + ClientGroupsBlock map[string][]string `yaml:"clientGroupsBlock"` + BlockType string `yaml:"blockType" default:"ZEROIP"` + BlockTTL Duration `yaml:"blockTTL" default:"6h"` + Loading SourceLoadingConfig `yaml:"loading"` // Deprecated options Deprecated struct { - FailStartOnListError *bool `yaml:"failStartOnListError"` + DownloadTimeout *Duration `yaml:"downloadTimeout"` + DownloadAttempts *uint `yaml:"downloadAttempts"` + DownloadCooldown *Duration `yaml:"downloadCooldown"` + RefreshPeriod *Duration `yaml:"refreshPeriod"` + FailStartOnListError *bool `yaml:"failStartOnListError"` + ProcessingConcurrency *uint `yaml:"processingConcurrency"` + StartStrategy *StartStrategyType `yaml:"startStrategy"` + MaxErrorsPerFile *int `yaml:"maxErrorsPerFile"` } `yaml:",inline"` } func (c *BlockingConfig) migrate(logger *logrus.Entry) bool { return Migrate(logger, "blocking", c.Deprecated, map[string]Migrator{ - "failStartOnListError": Apply(To("startStrategy", c), func(oldValue bool) { - if oldValue && c.StartStrategy != StartStrategyTypeFast { - c.StartStrategy = StartStrategyTypeFailOnError + "downloadTimeout": Move(To("loading.downloads.timeout", &c.Loading.Downloads)), + "downloadAttempts": Move(To("loading.downloads.attempts", &c.Loading.Downloads)), + "downloadCooldown": Move(To("loading.downloads.cooldown", &c.Loading.Downloads)), + "refreshPeriod": Move(To("loading.refreshPeriod", &c.Loading)), + "failStartOnListError": Apply(To("loading.strategy", &c.Loading), func(oldValue bool) { + if oldValue { + c.Loading.Strategy = StartStrategyTypeFailOnError } }), + "processingConcurrency": Move(To("loading.concurrency", &c.Loading)), + "startStrategy": Move(To("loading.strategy", &c.Loading)), + "maxErrorsPerFile": Move(To("loading.maxErrorsPerSource", &c.Loading)), }) } @@ -44,7 +50,7 @@ func (c *BlockingConfig) IsEnabled() bool { return len(c.ClientGroupsBlock) != 0 } -// IsEnabled implements `config.Configurable`. +// LogConfig implements `config.Configurable`. func (c *BlockingConfig) LogConfig(logger *logrus.Entry) { logger.Info("clientGroupsBlock:") @@ -58,17 +64,8 @@ func (c *BlockingConfig) LogConfig(logger *logrus.Entry) { logger.Infof("blockTTL = %s", c.BlockTTL) } - logger.Infof("downloadTimeout = %s", c.DownloadTimeout) - - logger.Infof("startStrategy = %s", c.StartStrategy) - - logger.Infof("maxErrorsPerFile = %d", c.MaxErrorsPerFile) - - if c.RefreshPeriod > 0 { - logger.Infof("refresh = every %s", c.RefreshPeriod) - } else { - logger.Debug("refresh = disabled") - } + logger.Info("loading:") + log.WithIndent(logger, " ", c.Loading.LogConfig) logger.Info("blacklist:") log.WithIndent(logger, " ", func(logger *logrus.Entry) { @@ -81,18 +78,12 @@ func (c *BlockingConfig) LogConfig(logger *logrus.Entry) { }) } -func (c *BlockingConfig) logListGroups(logger *logrus.Entry, listGroups map[string][]string) { - for group, links := range listGroups { +func (c *BlockingConfig) logListGroups(logger *logrus.Entry, listGroups map[string][]BytesSource) { + for group, sources := range listGroups { logger.Infof("%s:", group) - for _, link := range links { - if idx := strings.IndexRune(link, '\n'); idx != -1 && idx < len(link) { // found and not last char - link = link[:idx] // first line only - - logger.Infof(" - %s [...]", link) - } else { - logger.Infof(" - %s", link) - } + for _, source := range sources { + logger.Infof(" - %s", source) } } } diff --git a/config/blocking_test.go b/config/blocking_test.go index 59258525c..17b1a6ff1 100644 --- a/config/blocking_test.go +++ b/config/blocking_test.go @@ -6,7 +6,6 @@ import ( "github.com/creasty/defaults" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/sirupsen/logrus" ) var _ = Describe("BlockingConfig", func() { @@ -18,13 +17,12 @@ var _ = Describe("BlockingConfig", func() { cfg = BlockingConfig{ BlockType: "ZEROIP", BlockTTL: Duration(time.Minute), - BlackLists: map[string][]string{ - "gr1": {"/a/file/path"}, + BlackLists: map[string][]BytesSource{ + "gr1": NewBytesSources("/a/file/path"), }, ClientGroupsBlock: map[string][]string{ "default": {"gr1"}, }, - RefreshPeriod: Duration(time.Hour), } }) @@ -59,26 +57,7 @@ var _ = Describe("BlockingConfig", func() { Expect(hook.Calls).ShouldNot(BeEmpty()) Expect(hook.Messages[0]).Should(Equal("clientGroupsBlock:")) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("refresh = every 1 hour"))) - }) - When("refresh is disabled", func() { - It("should reflect that", func() { - cfg.RefreshPeriod = Duration(-1) - - logger.Logger.Level = logrus.InfoLevel - - cfg.LogConfig(logger) - - Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).ShouldNot(ContainElement(ContainSubstring("refresh = disabled"))) - - logger.Logger.Level = logrus.TraceLevel - - cfg.LogConfig(logger) - - Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("refresh = disabled"))) - }) + Expect(hook.Messages).Should(ContainElement(Equal("blockType = ZEROIP"))) }) }) }) diff --git a/config/bytes_source.go b/config/bytes_source.go new file mode 100644 index 000000000..c78277ae0 --- /dev/null +++ b/config/bytes_source.go @@ -0,0 +1,111 @@ +//go:generate go run github.com/abice/go-enum -f=$GOFILE --marshal --names --values +package config + +import ( + "fmt" + "strings" +) + +const maxTextSourceDisplayLen = 12 + +// var BytesSourceNone = BytesSource{} + +// BytesSourceType supported BytesSource types. ENUM( +// text=1 // Inline YAML block. +// http // HTTP(S). +// file // Local file. +// ) +type BytesSourceType uint16 + +type BytesSource struct { + Type BytesSourceType + From string +} + +func (s BytesSource) String() string { + switch s.Type { + case BytesSourceTypeText: + break + + case BytesSourceTypeHttp: + return s.From + + case BytesSourceTypeFile: + return fmt.Sprintf("file://%s", s.From) + + default: + return fmt.Sprintf("unknown source (%s: %s)", s.Type, s.From) + } + + text := s.From + truncated := false + + if idx := strings.IndexRune(text, '\n'); idx != -1 { + text = text[:idx] // first line only + truncated = idx < len(text) // don't count removing last char + } + + if len(text) > maxTextSourceDisplayLen { // truncate + text = text[:maxTextSourceDisplayLen] + truncated = true + } + + if truncated { + return fmt.Sprintf("%s...", text[:maxTextSourceDisplayLen]) + } + + return text +} + +// UnmarshalText implements `encoding.TextUnmarshaler`. +func (s *BytesSource) UnmarshalText(data []byte) error { + source := string(data) + + switch { + // Inline definition in YAML (with literal style Block Scalar) + case strings.ContainsAny(source, "\n"): + *s = BytesSource{Type: BytesSourceTypeText, From: source} + + // HTTP(S) + case strings.HasPrefix(source, "http"): + *s = BytesSource{Type: BytesSourceTypeHttp, From: source} + + // Probably path to a local file + default: + *s = BytesSource{Type: BytesSourceTypeFile, From: strings.TrimPrefix(source, "file://")} + } + + return nil +} + +func newBytesSource(source string) BytesSource { + var res BytesSource + + // UnmarshalText never returns an error + _ = res.UnmarshalText([]byte(source)) + + return res +} + +func NewBytesSources(sources ...string) []BytesSource { + res := make([]BytesSource, 0, len(sources)) + + for _, source := range sources { + res = append(res, newBytesSource(source)) + } + + return res +} + +func TextBytesSource(lines ...string) BytesSource { + return BytesSource{Type: BytesSourceTypeText, From: inlineList(lines...)} +} + +func inlineList(lines ...string) string { + res := strings.Join(lines, "\n") + + // ensure at least one line ending so it's parsed as an inline block + res += "\n" + + return res +} diff --git a/config/bytes_source_enum.go b/config/bytes_source_enum.go new file mode 100644 index 000000000..7c4dd8591 --- /dev/null +++ b/config/bytes_source_enum.go @@ -0,0 +1,101 @@ +// Code generated by go-enum DO NOT EDIT. +// Version: +// Revision: +// Build Date: +// Built By: + +package config + +import ( + "fmt" + "strings" +) + +const ( + // BytesSourceTypeText is a BytesSourceType of type Text. + // Inline YAML block. + BytesSourceTypeText BytesSourceType = iota + 1 + // BytesSourceTypeHttp is a BytesSourceType of type Http. + // HTTP(S). + BytesSourceTypeHttp + // BytesSourceTypeFile is a BytesSourceType of type File. + // Local file. + BytesSourceTypeFile +) + +var ErrInvalidBytesSourceType = fmt.Errorf("not a valid BytesSourceType, try [%s]", strings.Join(_BytesSourceTypeNames, ", ")) + +const _BytesSourceTypeName = "texthttpfile" + +var _BytesSourceTypeNames = []string{ + _BytesSourceTypeName[0:4], + _BytesSourceTypeName[4:8], + _BytesSourceTypeName[8:12], +} + +// BytesSourceTypeNames returns a list of possible string values of BytesSourceType. +func BytesSourceTypeNames() []string { + tmp := make([]string, len(_BytesSourceTypeNames)) + copy(tmp, _BytesSourceTypeNames) + return tmp +} + +// BytesSourceTypeValues returns a list of the values for BytesSourceType +func BytesSourceTypeValues() []BytesSourceType { + return []BytesSourceType{ + BytesSourceTypeText, + BytesSourceTypeHttp, + BytesSourceTypeFile, + } +} + +var _BytesSourceTypeMap = map[BytesSourceType]string{ + BytesSourceTypeText: _BytesSourceTypeName[0:4], + BytesSourceTypeHttp: _BytesSourceTypeName[4:8], + BytesSourceTypeFile: _BytesSourceTypeName[8:12], +} + +// String implements the Stringer interface. +func (x BytesSourceType) String() string { + if str, ok := _BytesSourceTypeMap[x]; ok { + return str + } + return fmt.Sprintf("BytesSourceType(%d)", x) +} + +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x BytesSourceType) IsValid() bool { + _, ok := _BytesSourceTypeMap[x] + return ok +} + +var _BytesSourceTypeValue = map[string]BytesSourceType{ + _BytesSourceTypeName[0:4]: BytesSourceTypeText, + _BytesSourceTypeName[4:8]: BytesSourceTypeHttp, + _BytesSourceTypeName[8:12]: BytesSourceTypeFile, +} + +// ParseBytesSourceType attempts to convert a string to a BytesSourceType. +func ParseBytesSourceType(name string) (BytesSourceType, error) { + if x, ok := _BytesSourceTypeValue[name]; ok { + return x, nil + } + return BytesSourceType(0), fmt.Errorf("%s is %w", name, ErrInvalidBytesSourceType) +} + +// MarshalText implements the text marshaller method. +func (x BytesSourceType) MarshalText() ([]byte, error) { + return []byte(x.String()), nil +} + +// UnmarshalText implements the text unmarshaller method. +func (x *BytesSourceType) UnmarshalText(text []byte) error { + name := string(text) + tmp, err := ParseBytesSourceType(name) + if err != nil { + return err + } + *x = tmp + return nil +} diff --git a/config/caching_test.go b/config/caching_test.go index 1b80c7ac7..1cc2c6353 100644 --- a/config/caching_test.go +++ b/config/caching_test.go @@ -60,4 +60,20 @@ var _ = Describe("CachingConfig", func() { }) }) }) + + Describe("EnablePrefetch", func() { + When("prefetching is enabled", func() { + BeforeEach(func() { + cfg = CachingConfig{} + }) + + It("should return configuration", func() { + cfg.EnablePrefetch() + + Expect(cfg.Prefetching).Should(BeTrue()) + Expect(cfg.PrefetchThreshold).Should(Equal(0)) + Expect(cfg.MaxCachingTime).ShouldNot(BeZero()) + }) + }) + }) }) diff --git a/config/config.go b/config/config.go index 1fa2e135f..1580352fc 100644 --- a/config/config.go +++ b/config/config.go @@ -2,6 +2,7 @@ package config import ( + "context" "errors" "fmt" "net" @@ -10,6 +11,7 @@ import ( "strconv" "strings" "sync" + "time" "github.com/miekg/dns" "github.com/sirupsen/logrus" @@ -32,7 +34,7 @@ type Configurable interface { // LogConfig logs the receiver's configuration. // - // Calling this method when `IsEnabled` returns false is undefined. + // The behavior of this method is undefined when `IsEnabled` returns false. LogConfig(*logrus.Entry) } @@ -93,6 +95,30 @@ type QueryLogType int16 // ) type StartStrategyType uint16 +func (s *StartStrategyType) do(setup func() error, logErr func(error)) error { + if *s == StartStrategyTypeFast { + go func() { + err := setup() + if err != nil { + logErr(err) + } + }() + + return nil + } + + err := setup() + if err != nil { + logErr(err) + + if *s == StartStrategyTypeFailOnError { + return err + } + } + + return nil +} + // QueryLogField data field to be logged // ENUM(clientIP,clientName,responseReason,responseAnswer,question,duration) type QueryLogField string @@ -259,6 +285,86 @@ func (c *toEnable) LogConfig(logger *logrus.Entry) { logger.Info("enabled") } +type SourceLoadingConfig struct { + Concurrency uint `yaml:"concurrency" default:"4"` + MaxErrorsPerSource int `yaml:"maxErrorsPerSource" default:"5"` + RefreshPeriod Duration `yaml:"refreshPeriod" default:"4h"` + Strategy StartStrategyType `yaml:"strategy" default:"blocking"` + Downloads DownloaderConfig `yaml:"downloads"` +} + +func (c *SourceLoadingConfig) LogConfig(logger *logrus.Entry) { + logger.Infof("concurrency = %d", c.Concurrency) + logger.Debugf("maxErrorsPerSource = %d", c.MaxErrorsPerSource) + logger.Debugf("strategy = %s", c.Strategy) + + if c.RefreshPeriod > 0 { + logger.Infof("refresh = every %s", c.RefreshPeriod) + } else { + logger.Debug("refresh = disabled") + } + + logger.Info("downloads:") + log.WithIndent(logger, " ", c.Downloads.LogConfig) +} + +func (c *SourceLoadingConfig) StartPeriodicRefresh(refresh func(context.Context) error, logErr func(error)) error { + refreshAndRecover := func(ctx context.Context) (rerr error) { + defer func() { + if val := recover(); val != nil { + rerr = fmt.Errorf("refresh function panicked: %v", val) + } + }() + + return refresh(ctx) + } + + err := c.Strategy.do(func() error { return refreshAndRecover(context.Background()) }, logErr) + if err != nil { + return err + } + + if c.RefreshPeriod > 0 { + go c.periodically(refreshAndRecover, logErr) + } + + return nil +} + +func (c *SourceLoadingConfig) periodically(refresh func(context.Context) error, logErr func(error)) { + ticker := time.NewTicker(c.RefreshPeriod.ToDuration()) + defer ticker.Stop() + + for range ticker.C { + err := refresh(context.Background()) + if err != nil { + logErr(err) + } + } +} + +type DownloaderConfig struct { + Timeout Duration `yaml:"timeout" default:"5s"` + Attempts uint `yaml:"attempts" default:"3"` + Cooldown Duration `yaml:"cooldown" default:"500ms"` +} + +func (c *DownloaderConfig) LogConfig(logger *logrus.Entry) { + logger.Infof("timeout = %s", c.Timeout) + logger.Infof("attempts = %d", c.Attempts) + logger.Debugf("cooldown = %s", c.Cooldown) +} + +func WithDefaults[T any]() (T, error) { + var cfg T + + if err := defaults.Set(&cfg); err != nil { + return cfg, fmt.Errorf("can't apply %T defaults: %w", cfg, err) + } + + return cfg, nil +} + //nolint:gochecknoglobals var ( config = &Config{} @@ -270,9 +376,9 @@ func LoadConfig(path string, mandatory bool) (*Config, error) { cfgLock.Lock() defer cfgLock.Unlock() - cfg := Config{} - if err := defaults.Set(&cfg); err != nil { - return nil, fmt.Errorf("can't apply default values: %w", err) + cfg, err := WithDefaults[Config]() + if err != nil { + return nil, err } fs, err := os.Stat(path) @@ -398,6 +504,7 @@ func (cfg *Config) migrate(logger *logrus.Entry) bool { }) usesDepredOpts = cfg.Blocking.migrate(logger) || usesDepredOpts + usesDepredOpts = cfg.HostsFile.migrate(logger) || usesDepredOpts return usesDepredOpts } diff --git a/config/config_enum.go b/config/config_enum.go index 337b258b3..e445ac5d7 100644 --- a/config/config_enum.go +++ b/config/config_enum.go @@ -63,6 +63,13 @@ func (x IPVersion) String() string { return fmt.Sprintf("IPVersion(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x IPVersion) IsValid() bool { + _, ok := _IPVersionMap[x] + return ok +} + var _IPVersionValue = map[string]IPVersion{ _IPVersionName[0:4]: IPVersionDual, _IPVersionName[4:6]: IPVersionV4, @@ -145,6 +152,13 @@ func (x NetProtocol) String() string { return fmt.Sprintf("NetProtocol(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x NetProtocol) IsValid() bool { + _, ok := _NetProtocolMap[x] + return ok +} + var _NetProtocolValue = map[string]NetProtocol{ _NetProtocolName[0:7]: NetProtocolTcpUdp, _NetProtocolName[7:14]: NetProtocolTcpTls, @@ -225,7 +239,8 @@ func (x QueryLogField) String() string { return string(x) } -// String implements the Stringer interface. +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values func (x QueryLogField) IsValid() bool { _, err := ParseQueryLogField(string(x)) return err == nil @@ -333,6 +348,13 @@ func (x QueryLogType) String() string { return fmt.Sprintf("QueryLogType(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x QueryLogType) IsValid() bool { + _, ok := _QueryLogTypeMap[x] + return ok +} + var _QueryLogTypeValue = map[string]QueryLogType{ _QueryLogTypeName[0:7]: QueryLogTypeConsole, _QueryLogTypeName[7:11]: QueryLogTypeNone, @@ -418,6 +440,13 @@ func (x StartStrategyType) String() string { return fmt.Sprintf("StartStrategyType(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x StartStrategyType) IsValid() bool { + _, ok := _StartStrategyTypeMap[x] + return ok +} + var _StartStrategyTypeValue = map[string]StartStrategyType{ _StartStrategyTypeName[0:8]: StartStrategyTypeBlocking, _StartStrategyTypeName[8:19]: StartStrategyTypeFailOnError, diff --git a/config/config_test.go b/config/config_test.go index ccef7a31d..5e2039c72 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -1,11 +1,15 @@ package config import ( + "context" + "errors" "net" + "sync/atomic" "time" "github.com/creasty/defaults" "github.com/miekg/dns" + "github.com/sirupsen/logrus" "github.com/0xERR0R/blocky/helpertest" "github.com/0xERR0R/blocky/log" @@ -48,15 +52,17 @@ var _ = Describe("Config", func() { BeforeEach(func() { c.Blocking.Deprecated.FailStartOnListError = ptrOf(true) }) - It("should change StartStrategy blocking to failOnError", func() { - c.Blocking.StartStrategy = StartStrategyTypeBlocking + It("should change loading.strategy blocking to failOnError", func() { + c.Blocking.Loading.Strategy = StartStrategyTypeBlocking c.migrate(logger) - Expect(c.Blocking.StartStrategy).Should(Equal(StartStrategyTypeFailOnError)) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("blocking.loading.strategy"))) + Expect(c.Blocking.Loading.Strategy).Should(Equal(StartStrategyTypeFailOnError)) }) - It("shouldn't change StartStrategy if set to fast", func() { - c.Blocking.StartStrategy = StartStrategyTypeFast + It("shouldn't change loading.strategy if set to fast", func() { + c.Blocking.Loading.Strategy = StartStrategyTypeFast c.migrate(logger) - Expect(c.Blocking.StartStrategy).Should(Equal(StartStrategyTypeFast)) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("blocking.loading.strategy"))) + Expect(c.Blocking.Loading.Strategy).Should(Equal(StartStrategyTypeFast)) }) }) @@ -206,8 +212,10 @@ var _ = Describe("Config", func() { When("duration is in wrong format", func() { It("should return error", func() { cfg := Config{} - data := `blocking: - refreshPeriod: wrongduration` + data := ` +blocking: + loading: + refreshPeriod: wrongduration` err := unmarshalConfig([]byte(data), &cfg) Expect(err).Should(HaveOccurred()) Expect(err.Error()).Should(ContainSubstring("invalid duration \"wrongduration\"")) @@ -534,6 +542,222 @@ bootstrapDns: "tcp-tls:[fd00::6cd4:d7e0:d99d:2952]", ), ) + + Describe("SourceLoadingConfig", func() { + var cfg SourceLoadingConfig + + BeforeEach(func() { + cfg = SourceLoadingConfig{ + Concurrency: 12, + RefreshPeriod: Duration(time.Hour), + } + }) + + Describe("LogConfig", func() { + It("should log configuration", func() { + cfg.LogConfig(logger) + + Expect(hook.Calls).ShouldNot(BeEmpty()) + Expect(hook.Messages[0]).Should(Equal("concurrency = 12")) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("refresh = every 1 hour"))) + }) + When("refresh is disabled", func() { + BeforeEach(func() { + cfg.RefreshPeriod = Duration(-1) + }) + + It("should reflect that", func() { + logger.Logger.Level = logrus.InfoLevel + + cfg.LogConfig(logger) + + Expect(hook.Calls).ShouldNot(BeEmpty()) + Expect(hook.Messages).ShouldNot(ContainElement(ContainSubstring("refresh = disabled"))) + + logger.Logger.Level = logrus.TraceLevel + + cfg.LogConfig(logger) + + Expect(hook.Calls).ShouldNot(BeEmpty()) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("refresh = disabled"))) + }) + }) + }) + }) + + Describe("StartStrategyType", func() { + Describe("StartStrategyTypeBlocking", func() { + It("runs in the current goroutine", func() { + sut := StartStrategyTypeBlocking + panicVal := new(int) + + defer func() { + // recover will catch the panic if it happened in the same goroutine + Expect(recover()).Should(BeIdenticalTo(panicVal)) + }() + + _ = sut.do(func() error { + panic(panicVal) + }, nil) + + Fail("unreachable") + }) + + It("logs errors and doesn't return them", func() { + sut := StartStrategyTypeBlocking + expectedErr := errors.New("test") + + err := sut.do(func() error { + return expectedErr + }, func(err error) { + Expect(err).Should(MatchError(expectedErr)) + }) + + Expect(err).Should(Succeed()) + }) + }) + + Describe("StartStrategyTypeFailOnError", func() { + It("runs in the current goroutine", func() { + sut := StartStrategyTypeBlocking + panicVal := new(int) + + defer func() { + // recover will catch the panic if it happened in the same goroutine + Expect(recover()).Should(BeIdenticalTo(panicVal)) + }() + + _ = sut.do(func() error { + panic(panicVal) + }, nil) + + Fail("unreachable") + }) + + It("logs errors and returns them", func() { + sut := StartStrategyTypeFailOnError + expectedErr := errors.New("test") + + err := sut.do(func() error { + return expectedErr + }, func(err error) { + Expect(err).Should(MatchError(expectedErr)) + }) + + Expect(err).Should(MatchError(expectedErr)) + }) + }) + + Describe("StartStrategyTypeFast", func() { + It("runs in a new goroutine", func() { + sut := StartStrategyTypeFast + events := make(chan string) + wait := make(chan struct{}) + + err := sut.do(func() error { + events <- "start" + <-wait + events <- "done" + + return nil + }, nil) + + Eventually(events, "50ms").Should(Receive(Equal("start"))) + Expect(err).Should(Succeed()) + Consistently(events).ShouldNot(Receive()) + close(wait) + Eventually(events, "50ms").Should(Receive(Equal("done"))) + }) + + It("logs errors", func() { + sut := StartStrategyTypeFast + expectedErr := errors.New("test") + wait := make(chan struct{}) + + err := sut.do(func() error { + return expectedErr + }, func(err error) { + Expect(err).Should(MatchError(expectedErr)) + close(wait) + }) + + Expect(err).Should(Succeed()) + Eventually(wait, "50ms").Should(BeClosed()) + }) + }) + }) + + Describe("SourceLoadingConfig", func() { + It("handles panics", func() { + sut := SourceLoadingConfig{ + Strategy: StartStrategyTypeFailOnError, + } + + panicMsg := "panic value" + + err := sut.StartPeriodicRefresh(func(context.Context) error { + panic(panicMsg) + }, func(err error) { + Expect(err).Should(MatchError(ContainSubstring(panicMsg))) + }) + + Expect(err).Should(MatchError(ContainSubstring(panicMsg))) + }) + + It("periodically calls refresh", func() { + sut := SourceLoadingConfig{ + Strategy: StartStrategyTypeFast, + RefreshPeriod: Duration(5 * time.Millisecond), + } + + panicMsg := "panic value" + calls := make(chan int32) + + var call atomic.Int32 + + err := sut.StartPeriodicRefresh(func(context.Context) error { + call := call.Add(1) + calls <- call + + if call == 3 { + panic(panicMsg) + } + + return nil + }, func(err error) { + defer GinkgoRecover() + + Expect(err).Should(MatchError(ContainSubstring(panicMsg))) + Expect(call.Load()).Should(Equal(int32(3))) + }) + + Expect(err).Should(Succeed()) + Eventually(calls, "50ms").Should(Receive(Equal(int32(1)))) + Eventually(calls, "50ms").Should(Receive(Equal(int32(2)))) + Eventually(calls, "50ms").Should(Receive(Equal(int32(3)))) + }) + }) + + Describe("WithDefaults", func() { + It("use valid defaults", func() { + type T struct { + X int `default:"1"` + } + + t, err := WithDefaults[T]() + Expect(err).Should(Succeed()) + Expect(t.X).Should(Equal(1)) + }) + + It("return an error if the tag is invalid", func() { + type T struct { + X struct{} `default:"fail"` + } + + _, err := WithDefaults[T]() + Expect(err).ShouldNot(Succeed()) + }) + }) }) func defaultTestFileConfig() { @@ -557,7 +781,7 @@ func defaultTestFileConfig() { Expect(config.Blocking.WhiteLists).Should(HaveLen(1)) Expect(config.Blocking.ClientGroupsBlock).Should(HaveLen(2)) Expect(config.Blocking.BlockTTL).Should(Equal(Duration(time.Minute))) - Expect(config.Blocking.RefreshPeriod).Should(Equal(Duration(2 * time.Hour))) + Expect(config.Blocking.Loading.RefreshPeriod).Should(Equal(Duration(2 * time.Hour))) Expect(config.Filtering.QueryTypes).Should(HaveLen(2)) Expect(config.FqdnOnly.Enable).Should(BeTrue()) @@ -613,7 +837,8 @@ func writeConfigYml(tmpDir *helpertest.TmpFolder) *helpertest.TmpFile { " Laptop-D.fritz.box:", " - ads", " blockTTL: 1m", - " refreshPeriod: 120", + " loading:", + " refreshPeriod: 120", "clientLookup:", " upstream: 192.168.178.1", " singleNameOrder:", @@ -629,7 +854,6 @@ func writeConfigYml(tmpDir *helpertest.TmpFolder) *helpertest.TmpFile { "startVerifyUpstream: false") } -//nolint:funlen func writeConfigDir(tmpDir *helpertest.TmpFolder) error { f1 := tmpDir.CreateStringFile("config1.yaml", "upstream:", @@ -675,7 +899,8 @@ func writeConfigDir(tmpDir *helpertest.TmpFolder) error { " Laptop-D.fritz.box:", " - ads", " blockTTL: 1m", - " refreshPeriod: 120", + " loading:", + " refreshPeriod: 120", "clientLookup:", " upstream: 192.168.178.1", " singleNameOrder:", diff --git a/config/hosts_file.go b/config/hosts_file.go index 967b735d8..b3402941f 100644 --- a/config/hosts_file.go +++ b/config/hosts_file.go @@ -1,25 +1,49 @@ package config import ( + . "github.com/0xERR0R/blocky/config/migration" //nolint:revive,stylecheck + "github.com/0xERR0R/blocky/log" "github.com/sirupsen/logrus" ) type HostsFileConfig struct { - Filepath string `yaml:"filePath"` - HostsTTL Duration `yaml:"hostsTTL" default:"1h"` - RefreshPeriod Duration `yaml:"refreshPeriod" default:"1h"` - FilterLoopback bool `yaml:"filterLoopback"` + Sources []BytesSource `yaml:"sources"` + HostsTTL Duration `yaml:"hostsTTL" default:"1h"` + FilterLoopback bool `yaml:"filterLoopback"` + Loading SourceLoadingConfig `yaml:"loading"` + + // Deprecated options + Deprecated struct { + RefreshPeriod *Duration `yaml:"refreshPeriod"` + Filepath *BytesSource `yaml:"filePath"` + } `yaml:",inline"` +} + +func (c *HostsFileConfig) migrate(logger *logrus.Entry) bool { + return Migrate(logger, "hostsFile", c.Deprecated, map[string]Migrator{ + "refreshPeriod": Move(To("loading.refreshPeriod", &c.Loading)), + "filePath": Apply(To("sources", c), func(value BytesSource) { + c.Sources = append(c.Sources, value) + }), + }) } // IsEnabled implements `config.Configurable`. func (c *HostsFileConfig) IsEnabled() bool { - return len(c.Filepath) != 0 + return len(c.Sources) != 0 } // LogConfig implements `config.Configurable`. func (c *HostsFileConfig) LogConfig(logger *logrus.Entry) { - logger.Infof("file path: %s", c.Filepath) logger.Infof("TTL: %s", c.HostsTTL) - logger.Infof("refresh period: %s", c.RefreshPeriod) logger.Infof("filter loopback addresses: %t", c.FilterLoopback) + + logger.Info("loading:") + log.WithIndent(logger, " ", c.Loading.LogConfig) + + logger.Info("sources:") + + for _, source := range c.Sources { + logger.Infof(" - %s", source) + } } diff --git a/config/hosts_file_test.go b/config/hosts_file_test.go index 5f67feb81..4ff5d9c15 100644 --- a/config/hosts_file_test.go +++ b/config/hosts_file_test.go @@ -15,9 +15,12 @@ var _ = Describe("HostsFileConfig", func() { BeforeEach(func() { cfg = HostsFileConfig{ - Filepath: "/dev/null", + Sources: append( + NewBytesSources("/a/file/path"), + TextBytesSource("127.0.0.1 localhost"), + ), HostsTTL: Duration(29 * time.Minute), - RefreshPeriod: Duration(30 * time.Minute), + Loading: SourceLoadingConfig{RefreshPeriod: Duration(30 * time.Minute)}, FilterLoopback: true, } }) @@ -50,7 +53,28 @@ var _ = Describe("HostsFileConfig", func() { cfg.LogConfig(logger) Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("file path: /dev/null"))) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("- file:///a/file/path"))) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("- 127.0.0.1 lo..."))) + }) + }) + + Describe("migrate", func() { + It("should", func() { + cfg, err := WithDefaults[HostsFileConfig]() + Expect(err).Should(Succeed()) + + cfg.Deprecated.Filepath = ptrOf(newBytesSource("/a/file/path")) + cfg.Deprecated.RefreshPeriod = ptrOf(Duration(time.Hour)) + + migrated := cfg.migrate(logger) + Expect(migrated).Should(BeTrue()) + + Expect(hook.Calls).ShouldNot(BeEmpty()) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("hostsFile.loading.refreshPeriod"))) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("hostsFile.sources"))) + + Expect(cfg.Sources).Should(Equal([]BytesSource{*cfg.Deprecated.Filepath})) + Expect(cfg.Loading.RefreshPeriod).Should(Equal(*cfg.Deprecated.RefreshPeriod)) }) }) }) diff --git a/docs/config.yml b/docs/config.yml index 89bb67513..4d290d5a4 100644 --- a/docs/config.yml +++ b/docs/config.yml @@ -1,3 +1,5 @@ +# REVIEW: manual changelog entry + upstream: # these external DNS resolvers will be used. Blocky picks 2 random resolvers from the list for each query # format for resolver: [net:]host:[port][/path]. net could be empty (default, shortcut for tcp+udp), tcp+udp, tcp, udp, tcp-tls or https (DoH). If port is empty, default port will be used (53 for udp and tcp, 853 for tcp-tls, 443 for https (Doh)) @@ -99,22 +101,33 @@ blocking: # optional: TTL for answers to blocked domains # default: 6h blockTTL: 1m - # optional: automatically list refresh period (in duration format). Default: 4h. - # Negative value -> deactivate automatically refresh. - # 0 value -> use default - refreshPeriod: 4h - # optional: timeout for list download (each url). Default: 60s. Use large values for big lists or slow internet connections - downloadTimeout: 4m - # optional: Download attempt timeout. Default: 60s - downloadAttempts: 5 - # optional: Time between the download attempts. Default: 1s - downloadCooldown: 10s - # optional: if failOnError, application startup will fail if at least one list can't be downloaded / opened. Default: blocking - startStrategy: failOnError - # Number of errors allowed in a list before it is considered invalid. - # A value of -1 disables the limit. - # Default: 5 - maxErrorsPerFile: 5 + # optional: Configure how lists, AKA sources, are loaded + loading: + # optional: list refresh period in duration format. + # Set to a value <= 0 to disable. + # default: 4h + refreshPeriod: 24h + # optional: Applies only to lists that are downloaded (HTTP URLs). + downloads: + # optional: timeout for list download (each url). Use large values for big lists or slow internet connections + # default: 5s + timeout: 60s + # optional: Maximum download attempts + # default: 3 + attempts: 5 + # optional: Time between the download attempts + # default: 500ms + cooldown: 10s + # optional: Maximum number of lists to process in parallel. + # default: 4 + concurrency: 16 + # optional: if failOnError, application startup will fail if at least one list can't be downloaded/opened + # default: blocking + strategy: failOnError + # Number of errors allowed in a list before it is considered invalid. + # A value of -1 disables the limit. + # default: 5 + maxErrorsPerSource: 5 # optional: configuration for caching of DNS responses caching: @@ -161,6 +174,7 @@ clientLookup: clients: laptop: - 192.168.178.29 + # optional: configuration for prometheus metrics endpoint prometheus: # enabled if true @@ -214,6 +228,7 @@ redis: # optional: Mininal TLS version that the DoH and DoT server will use minTlsServeVersion: 1.3 + # if https port > 0: path to cert and key file for SSL encryption. if not set, self-signed certificate will be generated #certFile: server.crt #keyFile: server.key @@ -238,14 +253,45 @@ fqdnOnly: # optional: if path defined, use this file for query resolution (A, AAAA and rDNS). Default: empty hostsFile: - # optional: Path to hosts file (e.g. /etc/hosts on Linux) - filePath: /etc/hosts + # optional: Hosts files to parse + sources: + - /etc/hosts + - https://example.com/hosts + - | + # inline hosts + 127.0.0.1 example.com # optional: TTL, default: 1h - hostsTTL: 60m - # optional: Time between hosts file refresh, default: 1h - refreshPeriod: 30m - # optional: Whether loopback hosts addresses (127.0.0.0/8 and ::1) should be filtered or not, default: false + hostsTTL: 30m + # optional: Whether loopback hosts addresses (127.0.0.0/8 and ::1) should be filtered or not + # default: false filterLoopback: true + # optional: Configure how sources are loaded + loading: + # optional: file refresh period in duration format. + # Set to a value <= 0 to disable. + # default: 4h + refreshPeriod: 24h + # optional: Applies only to files that are downloaded (HTTP URLs). + downloads: + # optional: timeout for file download (each url). Use large values for big files or slow internet connections + # default: 5s + timeout: 60s + # optional: Maximum download attempts + # default: 3 + attempts: 5 + # optional: Time between the download attempts + # default: 500ms + cooldown: 10s + # optional: Maximum number of files to process in parallel. + # default: 4 + concurrency: 16 + # optional: if failOnError, application startup will fail if at least one file can't be downloaded/opened + # default: blocking + strategy: failOnError + # Number of errors allowed in a file before it is considered invalid. + # A value of -1 disables the limit. + # default: 5 + maxErrorsPerSource: 5 # optional: ports configuration ports: @@ -272,4 +318,4 @@ log: # optional: add EDE error codes to dns response ede: # enabled if true, Default: false - enable: true \ No newline at end of file + enable: true diff --git a/docs/configuration.md b/docs/configuration.md index 37ab1682e..fc33bc523 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -330,20 +330,24 @@ contains a map of client name and multiple IP addresses. ## Blocking and whitelisting -Blocky can download and use external lists with domains or IP addresses to block DNS query (e.g. advertisement, malware, +Blocky can use lists of domains and IPs to block (e.g. advertisement, malware, trackers, adult sites). You can group several list sources together and define the blocking behavior per client. -External blacklists must be either in the well-known [Hosts format](https://en.wikipedia.org/wiki/Hosts_(file)) or just -a plain domain list (one domain per line). Blocky also supports regex as more powerful tool to define patterns to block. +Blocking uses the [DNS sinkhole](https://en.wikipedia.org/wiki/DNS_sinkhole) approach. For each DNS query, the domain name from +the request, IP address from the response, and any CNAME records will be checked to determine whether to block the query or not. -Blocky uses [DNS sinkhole](https://en.wikipedia.org/wiki/DNS_sinkhole) approach to block a DNS query. Domain name from -the request, IP address from the response, and the CNAME record will be checked against configured blacklists. - -To avoid over-blocking, you can define or use already existing whitelists. +To avoid over-blocking, you can use whitelists. ### Definition black and whitelists -Each black or whitelist can be either a path to the local file, a URL to download or inline list definition of a domains -in hosts format (YAML literal block scalar style). All Urls must be grouped to a group name. +Lists are defined in groups. This allows using different sets of lists for different clients. + +Each list in a group is a "source" and can be downloaded, read from a file, or inlined in the config. See [Sources](#sources) for details and configuring how those are loaded and reloaded/refreshed. + +The supported list formats are: + +1. the well-known [Hosts format](https://en.wikipedia.org/wiki/Hosts_(file)) +2. one domain per line (plain domain list) +3. one regex per line !!! example @@ -354,35 +358,38 @@ in hosts format (YAML literal block scalar style). All Urls must be grouped to a - https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt - https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts - | - # inline definition with YAML literal block scalar style + # inline definition using YAML literal block scalar style + # content is in plain domain list format someadsdomain.com anotheradsdomain.com - # this is a regex + - | + # inline definition with a regex /^banners?[_.-]/ special: - https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews/hosts whiteLists: ads: - whitelist.txt + - /path/to/file.txt - | # inline definition with YAML literal block scalar style whitelistdomain.com ``` - In this example you can see 2 groups: **ads** with 2 lists and **special** with one list. One local whitelist was defined for the **ads** group. + In this example you can see 2 groups: **ads** and **special** with one list. The **ads** group includes 2 inline lists. !!! warning If the same group has black and whitelists, whitelists will be used to disable particular blacklist entries. If a group has **only** whitelist entries -> this means only domains from this list are allowed, all other domains will - be blocked + be blocked. -!!! note - Please define also client group mapping, otherwise you black and whitelist definition will have no effect +!!! warning + You must also define client group mapping, otherwise you black and whitelist definition will have no effect. #### Regex support -You can use regex to define patterns to block. A regex entry must start and end with the slash character (/). Some +You can use regex to define patterns to block. A regex entry must start and end with the slash character (`/`). Some Examples: - `/baddomain/` will block `www.baddomain.com`, `baddomain.com`, but also `mybaddomain-sometext.com` @@ -395,7 +402,7 @@ In this configuration section, you can define, which blocking group(s) should be Example: All clients should use the **ads** group, which blocks advertisement and kids devices should use the **adult** group, which blocky adult sites. -Clients without a group assignment will use automatically the **default** group. +Clients without an explicit group assignment will use the **default** group. You can use the client name (see [Client name lookup](#client-name-lookup)), client's IP address, client's full-qualified domain name or a client subnet as CIDR notation. @@ -460,82 +467,9 @@ after receiving the custom value. blockTTL: 10s ``` -### List refresh period - -To keep the list cache up-to-date, blocky will periodically download and reload all external lists. Default period is ** -4 hours**. You can configure this by setting the `blocking.refreshPeriod` parameter to a value in **duration format**. -Negative value will deactivate automatically refresh. - -!!! example - - ```yaml - blocking: - refreshPeriod: 60m - ``` - -Refresh every hour. - -### Download - -You can configure the list download attempts according to your internet connection: - -| Parameter | Type | Mandatory | Default value | Description | -|------------------|-----------------|-----------|---------------|------------------------------------------------| -| downloadTimeout | duration format | no | 60s | Download attempt timeout | -| downloadAttempts | int | no | 3 | How many download attempts should be performed | -| downloadCooldown | duration format | no | 1s | Time between the download attempts | - -!!! example - - ```yaml - blocking: - downloadTimeout: 4m - downloadAttempts: 5 - downloadCooldown: 10s - ``` - -### Start strategy - -You can configure the blocking behavior during application start of blocky. -If no strategy is selected blocking will be used. - -| startStrategy | Description | -|---------------|-------------------------------------------------------------------------------------------------------| -| blocking | all blocking lists will be loaded before DNS resolution starts | -| failOnError | like blocking but blocky will shut down if any download fails | -| fast | DNS resolution starts immediately without blocking which will be enabled after list load is completed | - -!!! example - - ```yaml - blocking: - startStrategy: failOnError - ``` - -### Max Errors per file - -Number of errors allowed in a list before it is considered invalid and parsing stops. -A value of -1 disables the limit. +### Lists Loading -!!! example - - ```yaml - blocking: - maxErrorsPerFile: 10 - ``` - -### Concurrency - -Blocky downloads and processes links in a single group concurrently. With parameter `processingConcurrency` you can adjust -how many links can be processed in the same time. Higher value can reduce the overall list refresh time, but more parallel - download and processing jobs need more RAM. Please consider to reduce this value on systems with limited memory. Default value is 4. - -!!! example - - ```yaml - blocking: - processingConcurrency: 10 - ``` +See [Sources Loading](#sources-loading). ## Caching @@ -716,7 +650,7 @@ Configuration parameters: ```yaml hostsFile: filePath: /etc/hosts - hostsTTL: 60m + hostsTTL: 1h refreshPeriod: 30m ``` @@ -745,3 +679,127 @@ for detailed information, how to create and configure SSL certificates. DoH url: `https://host:port/dns-query` --8<-- "docs/includes/abbreviations.md" + +## Sources + +Sources are a concept shared by the blocking and hosts file resolvers. They represent where to load the files for each resolver. + +The supported source types are: + +- HTTP(S) URL (any source starting with `http`) +- inline configuration (any source containing a newline) +- local file path (any source not matching the above rules) + +!!! note + + The format/content of the sources depends on the context: lists and hosts files have different, but overlapping, supported formats. + +!!! example + + ```yaml + - https://example.com/a/source # blocky will download and parse the file + - /a/file/path # blocky will read the local file + - | # blocky will parse the content of this multi-line string + # inline configuration + ``` + +### Sources Loading + +This sections covers `loading` configuration that applies to both the blocking and hosts file resolvers. +These settings apply only to the resolver under which they are nested. + +!!! example + + ```yaml + blocking: + loading: + # only applies to white/blacklists + + hostsFile: + loading: + # only applies to hostsFile sources + ``` + +#### Refresh / Reload + +To keep source contents up-to-date, blocky can periodically refresh and reparse them. Default period is ** +4 hours**. You can configure this by setting the `refreshPeriod` parameter to a value in **duration format**. +A value of zero or less will disable this feature. + +!!! example + + ```yaml + loading: + refreshPeriod: 1h + ``` + + Refresh every hour. + +### Downloads + +Configures how HTTP(S) sources are downloaded: + +| Parameter | Type | Mandatory | Default value | Description | +|-----------|----------|-----------|---------------|------------------------------------------------| +| timeout | duration | no | 5s | Download attempt timeout | +| attempts | int | no | 3 | How many download attempts should be performed | +| cooldown | duration | no | 500ms | Time between the download attempts | + +!!! example + + ```yaml + loading: + downloads: + timeout: 4m + attempts: 5 + cooldown: 10s + ``` + +### Strategy + +This configures how Blocky startup works. +The default strategy is blocking. + +| strategy | Description | +|-------------|------------------------------------------------------------------------------------------------------------------------------------------| +| blocking | all sources are loaded before DNS resolution starts | +| failOnError | like blocking but blocky will shut down if any source fails to load | +| fast | blocky starts serving DNS immediately and sources are loaded asynchronously. The features requiring the sources should enable soon after | + +!!! example + + ```yaml + loading: + strategy: failOnError + ``` + +### Max Errors per Source + +Number of errors allowed when parsing a source before it is considered invalid and parsing stops. +A value of -1 disables the limit. + +!!! example + + ```yaml + loading: + maxErrorsPerSource: 10 + ``` + +### Concurrency + +Blocky downloads and processes sources concurrently. This allows limiting how many can be processed in the same time. +Larger values can reduce the overall list refresh time at the cost of using more RAM. Please consider reducing this value on systems with limited memory. +Default value is 4. + +!!! example + + ```yaml + loading: + concurrency: 10 + ``` + +!!! note + + As with other settings under `loading`, the limit applies to the blocking and hosts file resolvers separately. + The total number of concurrent sources concurrently processed can reach the sum of both values. + For example if blocking has a limit set to 8 and hosts file's is 4, there could be up to 12 concurrent jobs. diff --git a/e2e/blocking_test.go b/e2e/blocking_test.go index 9b3a86b1d..087aa515d 100644 --- a/e2e/blocking_test.go +++ b/e2e/blocking_test.go @@ -19,7 +19,7 @@ var _ = Describe("External lists and query blocking", func() { }) Describe("List download on startup", func() { When("external blacklist ist not available", func() { - Context("startStrategy = blocking", func() { + Context("loading.strategy = blocking", func() { BeforeEach(func() { blocky, err = createBlockyContainer(tmpDir, "log:", @@ -28,7 +28,8 @@ var _ = Describe("External lists and query blocking", func() { " default:", " - moka", "blocking:", - " startStrategy: blocking", + " loading:", + " strategy: blocking", " blackLists:", " ads:", " - http://wrong.domain.url/list.txt", @@ -54,7 +55,7 @@ var _ = Describe("External lists and query blocking", func() { Expect(getContainerLogs(blocky)).Should(ContainElement(ContainSubstring("cannot open source: "))) }) }) - Context("startStrategy = failOnError", func() { + Context("loading.strategy = failOnError", func() { BeforeEach(func() { blocky, err = createBlockyContainer(tmpDir, "log:", @@ -63,7 +64,8 @@ var _ = Describe("External lists and query blocking", func() { " default:", " - moka", "blocking:", - " startStrategy: failOnError", + " loading:", + " strategy: failOnError", " blackLists:", " ads:", " - http://wrong.domain.url/list.txt", diff --git a/evt/events.go b/evt/events.go index 7d67f4532..9fcc91368 100644 --- a/evt/events.go +++ b/evt/events.go @@ -29,7 +29,7 @@ const ( // CachingDomainsToPrefetchCountChanged fires, if a number of domains being prefetched changed, Parameter: new count CachingDomainsToPrefetchCountChanged = "caching:domainsToPrefetchCountChanged" - // CachingFailedDownloadChanged fires, if a download of a blocking list fails + // CachingFailedDownloadChanged fires, if a download of a blocking list or hosts file fails CachingFailedDownloadChanged = "caching:failedDownload" // ApplicationStarted fires on start of the application. Parameter: version number, build time diff --git a/go.mod b/go.mod index 7db51cb09..aec27928a 100644 --- a/go.mod +++ b/go.mod @@ -37,6 +37,7 @@ require ( require ( github.com/DATA-DOG/go-sqlmock v1.5.0 + github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5 github.com/docker/go-connections v0.4.0 github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198 github.com/testcontainers/testcontainers-go v0.21.0 @@ -56,7 +57,7 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect + github.com/google/pprof v0.0.0-20230309165930-d61513b1440d // indirect github.com/jackc/pgx/v5 v5.3.1 // indirect github.com/klauspost/compress v1.11.13 // indirect github.com/magiconair/properties v1.8.7 // indirect diff --git a/go.sum b/go.sum index f83b8bbd3..80e94c2c4 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBa github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/hcsshim v0.9.7 h1:mKNHW/Xvv1aFH87Jb6ERDzXTJTLPlmzfZ28VBFD/bfg= +github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5 h1:3ubNg+3q/Y3lqxga0G90jste3i+HGDgrlPXK/feKUEI= +github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5/go.mod h1:hkcYs23P9zbezt09v8168B4lt69PGuoxRPQ6IJHKpHo= github.com/abice/go-enum v0.5.6 h1:Ury51IQXUppbIl56MqRU/++A8SSeLG4plePphPjxW1s= github.com/abice/go-enum v0.5.6/go.mod h1:X2GpCT8VkCXLkVm48hebWx3cVgFJ8zM5nY5iUrJZO1Q= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= @@ -108,8 +110,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20230309165930-d61513b1440d h1:um9/pc7tKMINFfP1eE7Wv6PRGXlcCSJkVajF7KJw3uQ= +github.com/google/pprof v0.0.0-20230309165930-d61513b1440d/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -124,7 +126,6 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= @@ -319,7 +320,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/lists/downloader.go b/lists/downloader.go index c86bf3250..1536f79ad 100644 --- a/lists/downloader.go +++ b/lists/downloader.go @@ -6,18 +6,12 @@ import ( "io" "net" "net/http" - "time" + "github.com/0xERR0R/blocky/config" "github.com/0xERR0R/blocky/evt" "github.com/avast/retry-go/v4" ) -const ( - defaultDownloadTimeout = time.Second - defaultDownloadAttempts = uint(1) - defaultDownloadCooldown = 500 * time.Millisecond -) - // TransientError represents a temporary error like timeout, network errors... type TransientError struct { inner error @@ -36,74 +30,35 @@ type FileDownloader interface { DownloadFile(link string) (io.ReadCloser, error) } -// HTTPDownloader downloads files via HTTP protocol -type HTTPDownloader struct { - downloadTimeout time.Duration - downloadAttempts uint - downloadCooldown time.Duration - httpTransport *http.Transport -} - -type DownloaderOption func(c *HTTPDownloader) - -func NewDownloader(options ...DownloaderOption) *HTTPDownloader { - d := &HTTPDownloader{ - downloadTimeout: defaultDownloadTimeout, - downloadAttempts: defaultDownloadAttempts, - downloadCooldown: defaultDownloadCooldown, - httpTransport: &http.Transport{}, - } - - for _, opt := range options { - opt(d) - } - - return d -} +// httpDownloader downloads files via HTTP protocol +type httpDownloader struct { + cfg config.DownloaderConfig -// WithTimeout sets the download timeout -func WithTimeout(timeout time.Duration) DownloaderOption { - return func(d *HTTPDownloader) { - d.downloadTimeout = timeout - } + client http.Client } -// WithTimeout sets the pause between 2 download attempts -func WithCooldown(cooldown time.Duration) DownloaderOption { - return func(d *HTTPDownloader) { - d.downloadCooldown = cooldown - } +func NewDownloader(cfg config.DownloaderConfig, transport http.RoundTripper) FileDownloader { + return newDownloader(cfg, transport) } -// WithTimeout sets the attempt number for retry -func WithAttempts(downloadAttempts uint) DownloaderOption { - return func(d *HTTPDownloader) { - d.downloadAttempts = downloadAttempts - } -} +func newDownloader(cfg config.DownloaderConfig, transport http.RoundTripper) *httpDownloader { + return &httpDownloader{ + cfg: cfg, -// WithTimeout sets the HTTP transport -func WithTransport(httpTransport *http.Transport) DownloaderOption { - return func(d *HTTPDownloader) { - d.httpTransport = httpTransport + client: http.Client{ + Transport: transport, + Timeout: cfg.Timeout.ToDuration(), + }, } } -func (d *HTTPDownloader) DownloadFile(link string) (io.ReadCloser, error) { - client := http.Client{ - Timeout: d.downloadTimeout, - Transport: d.httpTransport, - } - - logger().WithField("link", link).Info("starting download") - +func (d *httpDownloader) DownloadFile(link string) (io.ReadCloser, error) { var body io.ReadCloser err := retry.Do( func() error { - var resp *http.Response - var httpErr error - if resp, httpErr = client.Get(link); httpErr == nil { + resp, httpErr := d.client.Get(link) + if httpErr == nil { if resp.StatusCode == http.StatusOK { body = resp.Body @@ -121,17 +76,18 @@ func (d *HTTPDownloader) DownloadFile(link string) (io.ReadCloser, error) { return httpErr }, - retry.Attempts(d.downloadAttempts), + retry.Attempts(d.cfg.Attempts), retry.DelayType(retry.FixedDelay), - retry.Delay(d.downloadCooldown), + retry.Delay(d.cfg.Cooldown.ToDuration()), retry.LastErrorOnly(true), retry.OnRetry(func(n uint, err error) { var transientErr *TransientError var dnsErr *net.DNSError - logger := logger().WithField("link", link).WithField("attempt", - fmt.Sprintf("%d/%d", n+1, d.downloadAttempts)) + logger := logger(). + WithField("link", link). + WithField("attempt", fmt.Sprintf("%d/%d", n+1, d.cfg.Attempts)) switch { case errors.As(err, &transientErr): diff --git a/lists/downloader_test.go b/lists/downloader_test.go index 27106a29c..5387c8638 100644 --- a/lists/downloader_test.go +++ b/lists/downloader_test.go @@ -10,6 +10,7 @@ import ( "sync/atomic" "time" + "github.com/0xERR0R/blocky/config" . "github.com/0xERR0R/blocky/evt" . "github.com/0xERR0R/blocky/helpertest" "github.com/0xERR0R/blocky/log" @@ -20,11 +21,17 @@ import ( var _ = Describe("Downloader", func() { var ( - sut *HTTPDownloader + sutConfig config.DownloaderConfig + sut *httpDownloader failedDownloadCountEvtChannel chan string loggerHook *test.Hook ) BeforeEach(func() { + var err error + + sutConfig, err = config.WithDefaults[config.DownloaderConfig]() + Expect(err).Should(Succeed()) + failedDownloadCountEvtChannel = make(chan string, 5) // collect received events in the channel fn := func(url string) { @@ -40,33 +47,27 @@ var _ = Describe("Downloader", func() { DeferCleanup(loggerHook.Reset) }) - Describe("Construct downloader", func() { - When("No options are provided", func() { - BeforeEach(func() { - sut = NewDownloader() - }) - It("Should provide default valus", func() { - Expect(sut.downloadAttempts).Should(BeNumerically("==", defaultDownloadAttempts)) - Expect(sut.downloadTimeout).Should(BeNumerically("==", defaultDownloadTimeout)) - Expect(sut.downloadCooldown).Should(BeNumerically("==", defaultDownloadCooldown)) - }) - }) - When("Options are provided", func() { + JustBeforeEach(func() { + sut = newDownloader(sutConfig, nil) + }) + + Describe("NewDownloader", func() { + It("Should use provided parameters", func() { transport := &http.Transport{} - BeforeEach(func() { - sut = NewDownloader( - WithAttempts(5), - WithCooldown(2*time.Second), - WithTimeout(5*time.Second), - WithTransport(transport), - ) - }) - It("Should use provided parameters", func() { - Expect(sut.downloadAttempts).Should(BeNumerically("==", 5)) - Expect(sut.downloadTimeout).Should(BeNumerically("==", 5*time.Second)) - Expect(sut.downloadCooldown).Should(BeNumerically("==", 2*time.Second)) - Expect(sut.httpTransport).Should(BeIdenticalTo(transport)) - }) + + sut = NewDownloader( + config.DownloaderConfig{ + Attempts: 5, + Cooldown: config.Duration(2 * time.Second), + Timeout: config.Duration(5 * time.Second), + }, + transport, + ).(*httpDownloader) + + Expect(sut.cfg.Attempts).Should(BeNumerically("==", 5)) + Expect(sut.cfg.Timeout).Should(BeNumerically("==", 5*time.Second)) + Expect(sut.cfg.Cooldown).Should(BeNumerically("==", 2*time.Second)) + Expect(sut.client.Transport).Should(BeIdenticalTo(transport)) }) }) @@ -77,7 +78,7 @@ var _ = Describe("Downloader", func() { server = TestServer("line.one\nline.two") DeferCleanup(server.Close) - sut = NewDownloader() + sut = newDownloader(sutConfig, nil) }) It("Should return all lines from the file", func() { reader, err := sut.DownloadFile(server.URL) @@ -98,7 +99,7 @@ var _ = Describe("Downloader", func() { })) DeferCleanup(server.Close) - sut = NewDownloader(WithAttempts(3)) + sutConfig.Attempts = 3 }) It("Should return error", func() { reader, err := sut.DownloadFile(server.URL) @@ -112,7 +113,7 @@ var _ = Describe("Downloader", func() { }) When("Wrong URL is defined", func() { BeforeEach(func() { - sut = NewDownloader() + sutConfig.Attempts = 1 }) It("Should return error", func() { _, err := sut.DownloadFile("somewrongurl") @@ -129,10 +130,11 @@ var _ = Describe("Downloader", func() { var attempt uint64 = 1 BeforeEach(func() { - sut = NewDownloader( - WithTimeout(20*time.Millisecond), - WithAttempts(3), - WithCooldown(time.Millisecond)) + sutConfig = config.DownloaderConfig{ + Timeout: config.Duration(20 * time.Millisecond), + Attempts: 3, + Cooldown: config.Duration(time.Millisecond), + } // should produce a timeout on first attempt server = httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { @@ -166,24 +168,23 @@ var _ = Describe("Downloader", func() { }) When("If timeout occurs on all request", func() { BeforeEach(func() { - sut = NewDownloader( - WithTimeout(100*time.Millisecond), - WithAttempts(3), - WithCooldown(time.Millisecond)) + sutConfig = config.DownloaderConfig{ + Timeout: config.Duration(10 * time.Millisecond), + Attempts: 3, + Cooldown: config.Duration(time.Millisecond), + } // should always produce a timeout server = httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { - time.Sleep(200 * time.Millisecond) + time.Sleep(20 * time.Millisecond) })) DeferCleanup(server.Close) }) It("Should perform a retry until max retry attempt count is reached and return TransientError", func() { reader, err := sut.DownloadFile(server.URL) Expect(err).Should(HaveOccurred()) - - err2 := unwrapTransientErr(err) - - Expect(err2.Error()).Should(ContainSubstring("Timeout")) + Expect(errors.As(err, new(*TransientError))).Should(BeTrue()) + Expect(err.Error()).Should(ContainSubstring("Timeout")) Expect(reader).Should(BeNil()) // failed download event was emitted 3 times @@ -193,19 +194,18 @@ var _ = Describe("Downloader", func() { }) When("DNS resolution of passed URL fails", func() { BeforeEach(func() { - sut = NewDownloader( - WithTimeout(500*time.Millisecond), - WithAttempts(3), - WithCooldown(200*time.Millisecond)) + sutConfig = config.DownloaderConfig{ + Timeout: config.Duration(500 * time.Millisecond), + Attempts: 3, + Cooldown: 200 * config.Duration(time.Millisecond), + } }) It("Should perform a retry until max retry attempt count is reached and return DNSError", func() { reader, err := sut.DownloadFile("http://some.domain.which.does.not.exist") Expect(err).Should(HaveOccurred()) - err2 := unwrapTransientErr(err) - var dnsError *net.DNSError - Expect(errors.As(err2, &dnsError)).To(BeTrue(), "received error %w", err) + Expect(errors.As(err, &dnsError)).Should(BeTrue(), "received error %w", err) Expect(reader).Should(BeNil()) // failed download event was emitted 3 times @@ -216,12 +216,3 @@ var _ = Describe("Downloader", func() { }) }) }) - -func unwrapTransientErr(origErr error) error { - var transientErr *TransientError - if errors.As(origErr, &transientErr) { - return transientErr.Unwrap() - } - - return origErr -} diff --git a/lists/list_cache.go b/lists/list_cache.go index 8e17ae760..ba17c4ca3 100644 --- a/lists/list_cache.go +++ b/lists/list_cache.go @@ -5,25 +5,20 @@ import ( "context" "errors" "fmt" - "io" "net" - "os" - "strings" - "time" - "github.com/hashicorp/go-multierror" "github.com/sirupsen/logrus" "github.com/0xERR0R/blocky/cache/stringcache" + "github.com/0xERR0R/blocky/config" "github.com/0xERR0R/blocky/evt" "github.com/0xERR0R/blocky/lists/parsers" "github.com/0xERR0R/blocky/log" + "github.com/ThinkChaos/parcour" + "github.com/ThinkChaos/parcour/jobgroup" ) -const ( - defaultProcessingConcurrency = 4 - chanCap = 1000 -) +const groupProducersBufferCap = 1000 // ListCacheType represents the type of cached list ENUM( // blacklist // is a list with blocked domains @@ -41,19 +36,17 @@ type Matcher interface { type ListCache struct { groupedCache stringcache.GroupedStringCache - groupToLinks map[string][]string - refreshPeriod time.Duration - downloader FileDownloader - listType ListCacheType - processingConcurrency uint - maxErrorsPerFile int + cfg config.SourceLoadingConfig + listType ListCacheType + groupSources map[string][]config.BytesSource + downloader FileDownloader } // LogConfig implements `config.Configurable`. func (b *ListCache) LogConfig(logger *logrus.Entry) { var total int - for group := range b.groupToLinks { + for group := range b.groupSources { count := b.groupedCache.ElementCount(group) logger.Infof("%s: %d entries", group, count) total += count @@ -63,198 +56,160 @@ func (b *ListCache) LogConfig(logger *logrus.Entry) { } // NewListCache creates new list instance -func NewListCache(t ListCacheType, groupToLinks map[string][]string, refreshPeriod time.Duration, - downloader FileDownloader, processingConcurrency uint, async bool, maxErrorsPerFile int, +func NewListCache( + t ListCacheType, cfg config.SourceLoadingConfig, + groupSources map[string][]config.BytesSource, downloader FileDownloader, ) (*ListCache, error) { - if processingConcurrency == 0 { - processingConcurrency = defaultProcessingConcurrency - } - - b := &ListCache{ + c := &ListCache{ groupedCache: stringcache.NewChainedGroupedCache( stringcache.NewInMemoryGroupedStringCache(), stringcache.NewInMemoryGroupedRegexCache(), ), - groupToLinks: groupToLinks, - refreshPeriod: refreshPeriod, - downloader: downloader, - listType: t, - processingConcurrency: processingConcurrency, - maxErrorsPerFile: maxErrorsPerFile, - } - - var initError error - if async { - initError = nil - // start list refresh in the background - go b.Refresh() - } else { - initError = b.refresh(true) + cfg: cfg, + listType: t, + groupSources: groupSources, + downloader: downloader, } - if initError == nil { - go periodicUpdate(b) + err := cfg.StartPeriodicRefresh(c.refresh, func(err error) { + logger().WithError(err).Errorf("could not init %s", t) + }) + if err != nil { + return nil, err } - return b, initError -} - -// periodicUpdate triggers periodical refresh (and download) of list entries -func periodicUpdate(cache *ListCache) { - if cache.refreshPeriod > 0 { - ticker := time.NewTicker(cache.refreshPeriod) - defer ticker.Stop() - - for { - <-ticker.C - cache.Refresh() - } - } + return c, nil } func logger() *logrus.Entry { return log.PrefixedLog("list_cache") } -// downloads and reads files with domain names and creates cache for them -// -//nolint:funlen // will refactor in a later commit -func (b *ListCache) createCacheForGroup(group string, links []string) (created bool, err error) { - groupFactory := b.groupedCache.Refresh(group) - - fileLinesChan := make(chan string, chanCap) - errChan := make(chan error, chanCap) +// Match matches passed domain name against cached list entries +func (b *ListCache) Match(domain string, groupsToCheck []string) (groups []string) { + return b.groupedCache.Contains(domain, groupsToCheck) +} - workerDoneChan := make(chan bool, len(links)) +// Refresh triggers the refresh of a list +func (b *ListCache) Refresh() { + _ = b.refresh(context.Background()) +} - // guard channel is used to limit the number of concurrent executions of the function - guard := make(chan struct{}, b.processingConcurrency) +func (b *ListCache) refresh(ctx context.Context) error { + unlimitedGrp, _ := jobgroup.WithContext(ctx) + defer unlimitedGrp.Close() - processingLinkJobs := len(links) + producersGrp := jobgroup.WithMaxConcurrency(unlimitedGrp, b.cfg.Concurrency) + defer producersGrp.Close() - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() + for group, sources := range b.groupSources { + group, sources := group, sources - // loop over links (http/local) or inline definitions - // start a new goroutine for each link, but limit to max. number (see processingConcurrency) - for idx, link := range links { - go func(idx int, link string) { - // try to write in this channel -> this will block if max amount of goroutines are being executed - guard <- struct{}{} + unlimitedGrp.Go(func(ctx context.Context) error { + err := b.createCacheForGroup(producersGrp, unlimitedGrp, group, sources) + if err != nil { + count := b.groupedCache.ElementCount(group) - defer func() { - // remove from guard channel to allow other blocked goroutines to continue - <-guard - workerDoneChan <- true - }() + logger := logger().WithFields(logrus.Fields{ + "group": group, + "total_count": count, + }) - name := linkName(idx, link) + if count == 0 { + logger.Warn("Populating of group cache failed, cache will be empty until refresh succeeds") + } else { + logger.Warn("Populating of group cache failed, using existing cache, if any") + } - err := b.parseFile(ctx, name, link, fileLinesChan) - if err != nil { - errChan <- err + return err } - }(idx, link) - } -Loop: - for { - select { - case line := <-fileLinesChan: - groupFactory.AddEntry(line) - case e := <-errChan: - var transientErr *TransientError + count := b.groupedCache.ElementCount(group) - if errors.As(e, &transientErr) { - return false, e - } - err = multierror.Append(err, e) - case <-workerDoneChan: - processingLinkJobs-- + evt.Bus().Publish(evt.BlockingCacheGroupChanged, b.listType, group, count) - default: - if processingLinkJobs == 0 { - break Loop - } - } - } + logger().WithFields(logrus.Fields{ + "group": group, + "total_count": count, + }).Info("group import finished") - if groupFactory.Count() == 0 && err != nil { - return false, err + return nil + }) } - groupFactory.Finish() - - return true, err + return unlimitedGrp.Wait() } -// Match matches passed domain name against cached list entries -func (b *ListCache) Match(domain string, groupsToCheck []string) (groups []string) { - return b.groupedCache.Contains(domain, groupsToCheck) -} +func (b *ListCache) createCacheForGroup( + producersGrp, consumersGrp jobgroup.JobGroup, group string, sources []config.BytesSource, +) error { + groupFactory := b.groupedCache.Refresh(group) -// Refresh triggers the refresh of a list -func (b *ListCache) Refresh() { - _ = b.refresh(false) -} + producers := parcour.NewProducersWithBuffer[string](producersGrp, consumersGrp, groupProducersBufferCap) + defer producers.Close() -func (b *ListCache) refresh(isInit bool) error { - var err error + for i, source := range sources { + i, source := i, source - for group, links := range b.groupToLinks { - created, e := b.createCacheForGroup(group, links) - if e != nil { - err = multierror.Append(err, multierror.Prefix(e, fmt.Sprintf("can't create cache group '%s':", group))) - } + producers.GoProduce(func(ctx context.Context, hostsChan chan<- string) error { + locInfo := fmt.Sprintf("item #%d of group %s", i, group) - count := b.groupedCache.ElementCount(group) + opener, err := NewSourceOpener(locInfo, source, b.downloader) + if err != nil { + return err + } - if !created { - logger := logger().WithFields(logrus.Fields{ - "group": group, - "total_count": count, - }) + return b.parseFile(ctx, opener, hostsChan) + }) + } - if count == 0 || isInit { - logger.Warn("Populating of group cache failed, cache will be empty until refresh succeeds") - } else { - logger.Warn("Populating of group cache failed, using existing cache, if any") - } + hasEntries := false + + producers.GoConsume(func(ctx context.Context, ch <-chan string) error { + for host := range ch { + hasEntries = true - continue + groupFactory.AddEntry(host) } - evt.Bus().Publish(evt.BlockingCacheGroupChanged, b.listType, group, count) + return nil + }) - logger().WithFields(logrus.Fields{ - "group": group, - "total_count": count, - }).Info("group import finished") - } + err := producers.Wait() + if err != nil { + if !hasEntries { + // Always fail the group if no entries were parsed + return err + } - return err -} + var transientErr *TransientError -func readFile(file string) (io.ReadCloser, error) { - logger().WithField("file", file).Info("starting processing of file") - file = strings.TrimPrefix(file, "file://") + if errors.As(err, &transientErr) { + // Temporary error: fail the whole group to retry later + return err + } + } + + groupFactory.Finish() - return os.Open(file) + return nil } // downloads file (or reads local file) and writes each line in the file to the result channel -func (b *ListCache) parseFile(ctx context.Context, name, link string, resultCh chan<- string) error { +func (b *ListCache) parseFile(ctx context.Context, opener SourceOpener, resultCh chan<- string) error { count := 0 logger := func() *logrus.Entry { return logger().WithFields(logrus.Fields{ - "source": name, + "source": opener.String(), "count": count, }) } - r, err := b.newLinkReader(link) + logger().Debug("starting processing of source") + + r, err := opener.Open() if err != nil { logger().Error("cannot open source: ", err) @@ -262,7 +217,7 @@ func (b *ListCache) parseFile(ctx context.Context, name, link string, resultCh c } defer r.Close() - p := parsers.AllowErrors(parsers.Hosts(r), b.maxErrorsPerFile) + p := parsers.AllowErrors(parsers.Hosts(r), b.cfg.MaxErrorsPerSource) p.OnErr(func(err error) { logger().Warnf("parse error: %s, trying to continue", err) }) @@ -303,27 +258,3 @@ func (b *ListCache) parseFile(ctx context.Context, name, link string, resultCh c return nil } - -func linkName(linkIdx int, link string) string { - if strings.ContainsAny(link, "\n") { - return fmt.Sprintf("inline block (item #%d in group)", linkIdx) - } - - return link -} - -func (b *ListCache) newLinkReader(link string) (r io.ReadCloser, err error) { - switch { - // link contains a line break -> this is inline list definition in YAML (with literal style Block Scalar) - case strings.ContainsAny(link, "\n"): - r = io.NopCloser(strings.NewReader(link)) - // link is http(s) -> download it - case strings.HasPrefix(link, "http"): - r, err = b.downloader.DownloadFile(link) - // probably path to a local file - default: - r, err = readFile(link) - } - - return -} diff --git a/lists/list_cache_benchmark_test.go b/lists/list_cache_benchmark_test.go index 565da927c..fedf2fd86 100644 --- a/lists/list_cache_benchmark_test.go +++ b/lists/list_cache_benchmark_test.go @@ -2,17 +2,24 @@ package lists import ( "testing" + + "github.com/0xERR0R/blocky/config" ) func BenchmarkRefresh(b *testing.B) { file1, _ := createTestListFile(b.TempDir(), 100000) file2, _ := createTestListFile(b.TempDir(), 150000) file3, _ := createTestListFile(b.TempDir(), 130000) - lists := map[string][]string{ - "gr1": {file1, file2, file3}, + lists := map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(file1, file2, file3), } - cache, _ := NewListCache(ListCacheTypeBlacklist, lists, -1, NewDownloader(), 5, false, 5) + cfg := config.SourceLoadingConfig{ + Concurrency: 5, + RefreshPeriod: config.Duration(-1), + } + downloader := NewDownloader(config.DownloaderConfig{}, nil) + cache, _ := NewListCache(ListCacheTypeBlacklist, cfg, lists, downloader) b.ReportAllocs() diff --git a/lists/list_cache_test.go b/lists/list_cache_test.go index 73ef39538..2d08cfb1f 100644 --- a/lists/list_cache_test.go +++ b/lists/list_cache_test.go @@ -2,6 +2,7 @@ package lists import ( "bufio" + "context" "errors" "fmt" "io" @@ -9,8 +10,8 @@ import ( "net/http/httptest" "os" "strings" - "time" + "github.com/0xERR0R/blocky/config" . "github.com/0xERR0R/blocky/evt" "github.com/0xERR0R/blocky/lists/parsers" "github.com/0xERR0R/blocky/log" @@ -27,13 +28,28 @@ var _ = Describe("ListCache", func() { tmpDir *TmpFolder emptyFile, file1, file2, file3 *TmpFile server1, server2, server3 *httptest.Server - maxErrorsPerFile int + + sut *ListCache + sutConfig config.SourceLoadingConfig + + listCacheType ListCacheType + lists map[string][]config.BytesSource + downloader FileDownloader + mockDownloader *MockDownloader ) + BeforeEach(func() { - maxErrorsPerFile = 5 - tmpDir = NewTmpFolder("ListCache") - Expect(tmpDir.Error).Should(Succeed()) - DeferCleanup(tmpDir.Clean) + var err error + + listCacheType = ListCacheTypeBlacklist + + sutConfig, err = config.WithDefaults[config.SourceLoadingConfig]() + Expect(err).Should(Succeed()) + + sutConfig.RefreshPeriod = -1 + + downloader = NewDownloader(config.DownloaderConfig{}, nil) + mockDownloader = nil server1 = TestServer("blocked1.com\nblocked1a.com\n192.168.178.55") DeferCleanup(server1.Close) @@ -42,6 +58,13 @@ var _ = Describe("ListCache", func() { server3 = TestServer("blocked3.com\nblocked1a.com") DeferCleanup(server3.Close) + tmpDir = NewTmpFolder("ListCache") + Expect(tmpDir.Error).Should(Succeed()) + DeferCleanup(tmpDir.Clean) + + emptyFile = tmpDir.CreateStringFile("empty", "#empty file") + Expect(emptyFile.Error).Should(Succeed()) + emptyFile = tmpDir.CreateStringFile("empty", "#empty file") Expect(emptyFile.Error).Should(Succeed()) file1 = tmpDir.CreateStringFile("file1", "blocked1.com", "blocked1a.com") @@ -52,61 +75,56 @@ var _ = Describe("ListCache", func() { Expect(file3.Error).Should(Succeed()) }) + JustBeforeEach(func() { + var err error + + Expect(lists).ShouldNot(BeNil(), "bad test: forgot to set `lists`") + + if mockDownloader != nil { + downloader = mockDownloader + } + + sut, err = NewListCache(listCacheType, sutConfig, lists, downloader) + Expect(err).Should(Succeed()) + }) + Describe("List cache and matching", func() { - When("Query with empty", func() { - It("should not panic", func() { - lists := map[string][]string{ - "gr0": {emptyFile.Path}, + When("List is empty", func() { + BeforeEach(func() { + lists = map[string][]config.BytesSource{ + "gr0": config.NewBytesSources(emptyFile.Path), } - sut, err := NewListCache( - ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, - ) - Expect(err).Should(Succeed()) + }) - group := sut.Match("", []string{"gr0"}) - Expect(group).Should(BeEmpty()) + When("Query with empty", func() { + It("should not panic", func() { + group := sut.Match("", []string{"gr0"}) + Expect(group).Should(BeEmpty()) + }) }) - }) - When("List is empty", func() { It("should not match anything", func() { - lists := map[string][]string{ - "gr1": {emptyFile.Path}, - } - sut, err := NewListCache( - ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, - ) - Expect(err).Should(Succeed()) - group := sut.Match("google.com", []string{"gr1"}) Expect(group).Should(BeEmpty()) }) }) When("List becomes empty on refresh", func() { - It("should delete existing elements from group cache", func() { - mockDownloader := newMockDownloader(func(res chan<- string, err chan<- error) { + BeforeEach(func() { + mockDownloader = newMockDownloader(func(res chan<- string, err chan<- error) { res <- "blocked1.com" res <- "# nothing" }) - lists := map[string][]string{ + lists = map[string][]config.BytesSource{ "gr1": {mockDownloader.ListSource()}, } + }) - sut, err := NewListCache( - ListCacheTypeBlacklist, lists, - 4*time.Hour, - mockDownloader, - defaultProcessingConcurrency, - false, - maxErrorsPerFile, - ) - Expect(err).Should(Succeed()) - + It("should delete existing elements from group cache", func(ctx context.Context) { group := sut.Match("blocked1.com", []string{"gr1"}) Expect(group).Should(ContainElement("gr1")) - err = sut.refresh(false) + err := sut.refresh(ctx) Expect(err).Should(Succeed()) group = sut.Match("blocked1.com", []string{"gr1"}) @@ -114,21 +132,19 @@ var _ = Describe("ListCache", func() { }) }) When("List has invalid lines", func() { - It("should still other domains", func() { - lists := map[string][]string{ + BeforeEach(func() { + lists = map[string][]config.BytesSource{ "gr1": { - inlineList( + config.TextBytesSource( "inlinedomain1.com", "invaliddomain!", "inlinedomain2.com", ), }, } + }) - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false, maxErrorsPerFile) - Expect(err).Should(Succeed()) - + It("should still other domains", func() { group := sut.Match("inlinedomain1.com", []string{"gr1"}) Expect(group).Should(ContainElement("gr1")) @@ -137,28 +153,20 @@ var _ = Describe("ListCache", func() { }) }) When("a temporary/transient err occurs on download", func() { - It("should not delete existing elements from group cache", func() { + BeforeEach(func() { // should produce a transient error on second and third attempt - mockDownloader := newMockDownloader(func(res chan<- string, err chan<- error) { - res <- "blocked1.com" + mockDownloader = newMockDownloader(func(res chan<- string, err chan<- error) { + res <- "blocked1.com\nblocked2.com\n" err <- &TransientError{inner: errors.New("boom")} err <- &TransientError{inner: errors.New("boom")} }) - lists := map[string][]string{ + lists = map[string][]config.BytesSource{ "gr1": {mockDownloader.ListSource()}, } + }) - sut, err := NewListCache( - ListCacheTypeBlacklist, lists, - 4*time.Hour, - mockDownloader, - defaultProcessingConcurrency, - false, - maxErrorsPerFile, - ) - Expect(err).Should(Succeed()) - + It("should not delete existing elements from group cache", func(ctx context.Context) { By("Lists loaded without timeout", func() { Eventually(func(g Gomega) { group := sut.Match("blocked1.com", []string{"gr1"}) @@ -166,7 +174,7 @@ var _ = Describe("ListCache", func() { }, "1s").Should(Succeed()) }) - Expect(sut.refresh(false)).Should(HaveOccurred()) + Expect(sut.refresh(ctx)).Should(HaveOccurred()) By("List couldn't be loaded due to timeout", func() { group := sut.Match("blocked1.com", []string{"gr1"}) @@ -182,27 +190,25 @@ var _ = Describe("ListCache", func() { }) }) When("non transient err occurs on download", func() { - It("should keep existing elements from group cache", func() { + BeforeEach(func() { // should produce a non transient error on second attempt - mockDownloader := newMockDownloader(func(res chan<- string, err chan<- error) { + mockDownloader = newMockDownloader(func(res chan<- string, err chan<- error) { res <- "blocked1.com" err <- errors.New("boom") }) - lists := map[string][]string{ + lists = map[string][]config.BytesSource{ "gr1": {mockDownloader.ListSource()}, } + }) - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, mockDownloader, - defaultProcessingConcurrency, false, maxErrorsPerFile) - Expect(err).Should(Succeed()) - + It("should keep existing elements from group cache", func(ctx context.Context) { By("Lists loaded without err", func() { group := sut.Match("blocked1.com", []string{"gr1"}) Expect(group).Should(ContainElement("gr1")) }) - Expect(sut.refresh(false)).Should(HaveOccurred()) + Expect(sut.refresh(ctx)).Should(HaveOccurred()) By("Lists from first load is kept", func() { group := sut.Match("blocked1.com", []string{"gr1"}) @@ -211,16 +217,14 @@ var _ = Describe("ListCache", func() { }) }) When("Configuration has 3 external working urls", func() { - It("should download the list and match against", func() { - lists := map[string][]string{ - "gr1": {server1.URL, server2.URL}, - "gr2": {server3.URL}, + BeforeEach(func() { + lists = map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(server1.URL, server2.URL), + "gr2": config.NewBytesSources(server3.URL), } + }) - sut, _ := NewListCache( - ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, - ) - + It("should download the list and match against", func() { group := sut.Match("blocked1.com", []string{"gr1", "gr2"}) Expect(group).Should(ContainElement("gr1")) @@ -232,16 +236,14 @@ var _ = Describe("ListCache", func() { }) }) When("Configuration has some faulty urls", func() { - It("should download the list and match against", func() { - lists := map[string][]string{ - "gr1": {server1.URL, server2.URL, "doesnotexist"}, - "gr2": {server3.URL, "someotherfile"}, + BeforeEach(func() { + lists = map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(server1.URL, server2.URL, "doesnotexist"), + "gr2": config.NewBytesSources(server3.URL, "someotherfile"), } + }) - sut, _ := NewListCache( - ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, - ) - + It("should download the list and match against", func() { group := sut.Match("blocked1.com", []string{"gr1", "gr2"}) Expect(group).Should(ContainElement("gr1")) @@ -253,39 +255,33 @@ var _ = Describe("ListCache", func() { }) }) When("List will be updated", func() { - It("event should be fired and contain count of elements in downloaded lists", func() { - lists := map[string][]string{ - "gr1": {server1.URL}, - } + resultCnt := 0 - resultCnt := 0 + BeforeEach(func() { + lists = map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(server1.URL), + } _ = Bus().SubscribeOnce(BlockingCacheGroupChanged, func(listType ListCacheType, group string, cnt int) { resultCnt = cnt }) + }) - sut, err := NewListCache( - ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, - ) - Expect(err).Should(Succeed()) - + It("event should be fired and contain count of elements in downloaded lists", func() { group := sut.Match("blocked1.com", []string{}) Expect(group).Should(BeEmpty()) Expect(resultCnt).Should(Equal(3)) }) }) When("multiple groups are passed", func() { - It("should match", func() { - lists := map[string][]string{ - "gr1": {file1.Path, file2.Path}, - "gr2": {"file://" + file3.Path}, + BeforeEach(func() { + lists = map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(file1.Path, file2.Path), + "gr2": config.NewBytesSources("file://" + file3.Path), } + }) - sut, err := NewListCache( - ListCacheTypeBlacklist, lists, 0, NewDownloader(), defaultProcessingConcurrency, false, maxErrorsPerFile, - ) - Expect(err).Should(Succeed()) - + It("should match", func() { Expect(sut.groupedCache.ElementCount("gr1")).Should(Equal(3)) Expect(sut.groupedCache.ElementCount("gr2")).Should(Equal(2)) @@ -304,31 +300,28 @@ var _ = Describe("ListCache", func() { file1, lines1 := createTestListFile(GinkgoT().TempDir(), 10000) file2, lines2 := createTestListFile(GinkgoT().TempDir(), 15000) file3, lines3 := createTestListFile(GinkgoT().TempDir(), 13000) - lists := map[string][]string{ - "gr1": {file1, file2, file3}, + lists := map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(file1, file2, file3), } - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false, maxErrorsPerFile) + sut, err := NewListCache(ListCacheTypeBlacklist, sutConfig, lists, downloader) Expect(err).Should(Succeed()) Expect(sut.groupedCache.ElementCount("gr1")).Should(Equal(lines1 + lines2 + lines3)) }) }) When("inline list content is defined", func() { - It("should match", func() { - lists := map[string][]string{ - "gr1": {inlineList( + BeforeEach(func() { + lists = map[string][]config.BytesSource{ + "gr1": {config.TextBytesSource( "inlinedomain1.com", "#some comment", "inlinedomain2.com", )}, } + }) - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false, maxErrorsPerFile) - Expect(err).Should(Succeed()) - + It("should match", func() { Expect(sut.groupedCache.ElementCount("gr1")).Should(Equal(2)) group := sut.Match("inlinedomain1.com", []string{"gr1"}) Expect(group).Should(ContainElement("gr1")) @@ -338,65 +331,59 @@ var _ = Describe("ListCache", func() { }) }) When("Text file can't be parsed", func() { - It("should still match already imported strings", func() { - lists := map[string][]string{ + BeforeEach(func() { + lists = map[string][]config.BytesSource{ "gr1": { - inlineList( + config.TextBytesSource( "inlinedomain1.com", "lineTooLong"+strings.Repeat("x", bufio.MaxScanTokenSize), // too long ), }, } + }) - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false, maxErrorsPerFile) - Expect(err).Should(Succeed()) - + It("should still match already imported strings", func() { group := sut.Match("inlinedomain1.com", []string{"gr1"}) Expect(group).Should(ContainElement("gr1")) }) }) When("Text file has too many errors", func() { BeforeEach(func() { - maxErrorsPerFile = 0 + sutConfig.MaxErrorsPerSource = 0 + sutConfig.Strategy = config.StartStrategyTypeFailOnError }) It("should fail parsing", func() { - lists := map[string][]string{ + lists := map[string][]config.BytesSource{ "gr1": { - inlineList("invaliddomain!"), // too many errors since `maxErrorsPerFile` is 0 + config.TextBytesSource("invaliddomain!"), // too many errors since `maxErrorsPerSource` is 0 }, } - _, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false, maxErrorsPerFile) + _, err := NewListCache(ListCacheTypeBlacklist, sutConfig, lists, downloader) Expect(err).ShouldNot(Succeed()) Expect(err).Should(MatchError(parsers.ErrTooManyErrors)) }) }) When("file has end of line comment", func() { - It("should still parse the domain", func() { - lists := map[string][]string{ - "gr1": {inlineList("inlinedomain1.com#a comment")}, + BeforeEach(func() { + lists = map[string][]config.BytesSource{ + "gr1": {config.TextBytesSource("inlinedomain1.com#a comment")}, } + }) - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false, maxErrorsPerFile) - Expect(err).Should(Succeed()) - + It("should still parse the domain", func() { group := sut.Match("inlinedomain1.com", []string{"gr1"}) Expect(group).Should(ContainElement("gr1")) }) }) When("inline regex content is defined", func() { - It("should match", func() { - lists := map[string][]string{ - "gr1": {inlineList("/^apple\\.(de|com)$/")}, + BeforeEach(func() { + lists = map[string][]config.BytesSource{ + "gr1": {config.TextBytesSource("/^apple\\.(de|com)$/")}, } + }) - sut, err := NewListCache(ListCacheTypeBlacklist, lists, 0, NewDownloader(), - defaultProcessingConcurrency, false, maxErrorsPerFile) - Expect(err).Should(Succeed()) - + It("should match", func() { group := sut.Match("apple.com", []string{"gr1"}) Expect(group).Should(ContainElement("gr1")) @@ -416,13 +403,12 @@ var _ = Describe("ListCache", func() { }) It("should print list configuration", func() { - lists := map[string][]string{ - "gr1": {server1.URL, server2.URL}, - "gr2": {inlineList("inline", "definition")}, + lists := map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(server1.URL, server2.URL), + "gr2": {config.TextBytesSource("inline", "definition")}, } - sut, err := NewListCache(ListCacheTypeBlacklist, lists, time.Hour, NewDownloader(), - defaultProcessingConcurrency, false, maxErrorsPerFile) + sut, err := NewListCache(ListCacheTypeBlacklist, sutConfig, lists, downloader) Expect(err).Should(Succeed()) sut.LogConfig(logger) @@ -435,13 +421,16 @@ var _ = Describe("ListCache", func() { Describe("StartStrategy", func() { When("async load is enabled", func() { + BeforeEach(func() { + sutConfig.Strategy = config.StartStrategyTypeFast + }) + It("should never return an error", func() { - lists := map[string][]string{ - "gr1": {"doesnotexist"}, + lists := map[string][]config.BytesSource{ + "gr1": config.NewBytesSources("doesnotexist"), } - _, err := NewListCache(ListCacheTypeBlacklist, lists, -1, NewDownloader(), - defaultProcessingConcurrency, true, maxErrorsPerFile) + _, err := NewListCache(ListCacheTypeBlacklist, sutConfig, lists, downloader) Expect(err).Should(Succeed()) }) }) @@ -465,8 +454,11 @@ func (m *MockDownloader) DownloadFile(_ string) (io.ReadCloser, error) { return io.NopCloser(strings.NewReader(str)), nil } -func (m *MockDownloader) ListSource() string { - return "http://mock" +func (m *MockDownloader) ListSource() config.BytesSource { + return config.BytesSource{ + Type: config.BytesSourceTypeHttp, + From: "http://mock-downloader", + } } func createTestListFile(dir string, totalLines int) (string, int) { @@ -502,12 +494,3 @@ func RandStringBytes(n int) string { return string(b) } - -func inlineList(lines ...string) string { - res := strings.Join(lines, "\n") - - // ensure at least one line ending so it's parsed as an inline block - res += "\n" - - return res -} diff --git a/lists/sourcereader.go b/lists/sourcereader.go new file mode 100644 index 000000000..8e6541c8d --- /dev/null +++ b/lists/sourcereader.go @@ -0,0 +1,69 @@ +package lists + +import ( + "fmt" + "io" + "os" + "strings" + + "github.com/0xERR0R/blocky/config" +) + +type SourceOpener interface { + fmt.Stringer + + Open() (io.ReadCloser, error) +} + +func NewSourceOpener(txtLocInfo string, source config.BytesSource, downloader FileDownloader) (SourceOpener, error) { + switch source.Type { + case config.BytesSourceTypeText: + return &textOpener{source: source, locInfo: txtLocInfo}, nil + + case config.BytesSourceTypeHttp: + return &httpOpener{source: source, downloader: downloader}, nil + + case config.BytesSourceTypeFile: + return &fileOpener{source: source}, nil + } + + return nil, fmt.Errorf("cannot open %s", source) +} + +type textOpener struct { + source config.BytesSource + locInfo string +} + +func (o *textOpener) Open() (io.ReadCloser, error) { + return io.NopCloser(strings.NewReader(o.source.From)), nil +} + +func (o *textOpener) String() string { + return fmt.Sprintf("%s: %s", o.locInfo, o.source) +} + +type httpOpener struct { + source config.BytesSource + downloader FileDownloader +} + +func (o *httpOpener) Open() (io.ReadCloser, error) { + return o.downloader.DownloadFile(o.source.From) +} + +func (o *httpOpener) String() string { + return o.source.String() +} + +type fileOpener struct { + source config.BytesSource +} + +func (o *fileOpener) Open() (io.ReadCloser, error) { + return os.Open(o.source.From) +} + +func (o *fileOpener) String() string { + return o.source.String() +} diff --git a/resolver/blocking_resolver.go b/resolver/blocking_resolver.go index 24285a7ea..a501e0c14 100644 --- a/resolver/blocking_resolver.go +++ b/resolver/blocking_resolver.go @@ -101,18 +101,14 @@ func NewBlockingResolver( return nil, err } - refreshPeriod := cfg.RefreshPeriod.ToDuration() - downloader := createDownloader(cfg, bootstrap) - blacklistMatcher, blErr := lists.NewListCache(lists.ListCacheTypeBlacklist, cfg.BlackLists, - refreshPeriod, downloader, cfg.ProcessingConcurrency, - (cfg.StartStrategy == config.StartStrategyTypeFast), cfg.MaxErrorsPerFile) - whitelistMatcher, wlErr := lists.NewListCache(lists.ListCacheTypeWhitelist, cfg.WhiteLists, - refreshPeriod, downloader, cfg.ProcessingConcurrency, - (cfg.StartStrategy == config.StartStrategyTypeFast), cfg.MaxErrorsPerFile) + downloader := lists.NewDownloader(cfg.Loading.Downloads, bootstrap.NewHTTPTransport()) + + blacklistMatcher, blErr := lists.NewListCache(lists.ListCacheTypeBlacklist, cfg.Loading, cfg.BlackLists, downloader) + whitelistMatcher, wlErr := lists.NewListCache(lists.ListCacheTypeWhitelist, cfg.Loading, cfg.WhiteLists, downloader) whitelistOnlyGroups := determineWhitelistOnlyGroups(&cfg) err = multierror.Append(err, blErr, wlErr).ErrorOrNil() - if err != nil && cfg.StartStrategy == config.StartStrategyTypeFailOnError { + if err != nil { return nil, err } @@ -156,15 +152,6 @@ func NewBlockingResolver( return res, nil } -func createDownloader(cfg config.BlockingConfig, bootstrap *Bootstrap) *lists.HTTPDownloader { - return lists.NewDownloader( - lists.WithTimeout(cfg.DownloadTimeout.ToDuration()), - lists.WithAttempts(cfg.DownloadAttempts), - lists.WithCooldown(cfg.DownloadCooldown.ToDuration()), - lists.WithTransport(bootstrap.NewHTTPTransport()), - ) -} - func setupRedisEnabledSubscriber(c *BlockingResolver) { go func() { for em := range c.redisClient.EnabledChannel { diff --git a/resolver/blocking_resolver_test.go b/resolver/blocking_resolver_test.go index b6203b098..c80883ff1 100644 --- a/resolver/blocking_resolver_test.go +++ b/resolver/blocking_resolver_test.go @@ -97,9 +97,9 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { sutConfig = config.BlockingConfig{ BlockType: "ZEROIP", BlockTTL: config.Duration(time.Minute), - BlackLists: map[string][]string{ - "gr1": {group1File.Path}, - "gr2": {group2File.Path}, + BlackLists: map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(group1File.Path), + "gr2": config.NewBytesSources(group2File.Path), }, } }) @@ -125,9 +125,9 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { sutConfig = config.BlockingConfig{ BlockType: "ZEROIP", BlockTTL: config.Duration(time.Minute), - BlackLists: map[string][]string{ - "gr1": {group1File.Path}, - "gr2": {group2File.Path}, + BlackLists: map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(group1File.Path), + "gr2": config.NewBytesSources(group2File.Path), }, ClientGroupsBlock: map[string][]string{ "default": {"gr1"}, @@ -164,13 +164,13 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { sutConfig = config.BlockingConfig{ BlockType: "ZEROIP", BlockTTL: config.Duration(time.Minute), - BlackLists: map[string][]string{ - "gr1": {"\n/regex/"}, + BlackLists: map[string][]config.BytesSource{ + "gr1": {config.TextBytesSource("/regex/")}, }, ClientGroupsBlock: map[string][]string{ "default": {"gr1"}, }, - StartStrategy: config.StartStrategyTypeFast, + Loading: config.SourceLoadingConfig{Strategy: config.StartStrategyTypeFast}, } }) @@ -193,10 +193,10 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { BeforeEach(func() { sutConfig = config.BlockingConfig{ BlockTTL: config.Duration(6 * time.Hour), - BlackLists: map[string][]string{ - "gr1": {group1File.Path}, - "gr2": {group2File.Path}, - "defaultGroup": {defaultGroupFile.Path}, + BlackLists: map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(group1File.Path), + "gr2": config.NewBytesSources(group2File.Path), + "defaultGroup": config.NewBytesSources(defaultGroupFile.Path), }, ClientGroupsBlock: map[string][]string{ "Client1": {"gr1"}, @@ -399,8 +399,8 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { BeforeEach(func() { sutConfig = config.BlockingConfig{ BlockTTL: config.Duration(time.Minute), - BlackLists: map[string][]string{ - "defaultGroup": {defaultGroupFile.Path}, + BlackLists: map[string][]config.BytesSource{ + "defaultGroup": config.NewBytesSources(defaultGroupFile.Path), }, ClientGroupsBlock: map[string][]string{ "default": {"defaultGroup"}, @@ -425,8 +425,8 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { BeforeEach(func() { sutConfig = config.BlockingConfig{ BlockType: "ZEROIP", - BlackLists: map[string][]string{ - "defaultGroup": {defaultGroupFile.Path}, + BlackLists: map[string][]config.BytesSource{ + "defaultGroup": config.NewBytesSources(defaultGroupFile.Path), }, ClientGroupsBlock: map[string][]string{ "default": {"defaultGroup"}, @@ -470,8 +470,8 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { BeforeEach(func() { sutConfig = config.BlockingConfig{ BlockTTL: config.Duration(6 * time.Hour), - BlackLists: map[string][]string{ - "defaultGroup": {defaultGroupFile.Path}, + BlackLists: map[string][]config.BytesSource{ + "defaultGroup": config.NewBytesSources(defaultGroupFile.Path), }, ClientGroupsBlock: map[string][]string{ "default": {"defaultGroup"}, @@ -508,8 +508,8 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { When("BlockType is custom IP only for ipv4", func() { BeforeEach(func() { sutConfig = config.BlockingConfig{ - BlackLists: map[string][]string{ - "defaultGroup": {defaultGroupFile.Path}, + BlackLists: map[string][]config.BytesSource{ + "defaultGroup": config.NewBytesSources(defaultGroupFile.Path), }, ClientGroupsBlock: map[string][]string{ "default": {"defaultGroup"}, @@ -601,8 +601,8 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { sutConfig = config.BlockingConfig{ BlockType: "ZEROIP", BlockTTL: config.Duration(time.Minute), - BlackLists: map[string][]string{"gr1": {group1File.Path}}, - WhiteLists: map[string][]string{"gr1": {group1File.Path}}, + BlackLists: map[string][]config.BytesSource{"gr1": config.NewBytesSources(group1File.Path)}, + WhiteLists: map[string][]config.BytesSource{"gr1": config.NewBytesSources(group1File.Path)}, ClientGroupsBlock: map[string][]string{ "default": {"gr1"}, }, @@ -627,9 +627,9 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { sutConfig = config.BlockingConfig{ BlockType: "zeroIP", BlockTTL: config.Duration(60 * time.Second), - WhiteLists: map[string][]string{ - "gr1": {group1File.Path}, - "gr2": {group2File.Path}, + WhiteLists: map[string][]config.BytesSource{ + "gr1": config.NewBytesSources(group1File.Path), + "gr2": config.NewBytesSources(group2File.Path), }, ClientGroupsBlock: map[string][]string{ "default": {"gr1"}, @@ -728,8 +728,8 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { sutConfig = config.BlockingConfig{ BlockType: "ZEROIP", BlockTTL: config.Duration(time.Minute), - BlackLists: map[string][]string{"gr1": {group1File.Path}}, - WhiteLists: map[string][]string{"gr1": {defaultGroupFile.Path}}, + BlackLists: map[string][]config.BytesSource{"gr1": config.NewBytesSources(group1File.Path)}, + WhiteLists: map[string][]config.BytesSource{"gr1": config.NewBytesSources(defaultGroupFile.Path)}, ClientGroupsBlock: map[string][]string{ "default": {"gr1"}, }, @@ -755,7 +755,7 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { sutConfig = config.BlockingConfig{ BlockType: "ZEROIP", BlockTTL: config.Duration(time.Minute), - BlackLists: map[string][]string{"gr1": {group1File.Path}}, + BlackLists: map[string][]config.BytesSource{"gr1": config.NewBytesSources(group1File.Path)}, ClientGroupsBlock: map[string][]string{ "default": {"gr1"}, }, @@ -798,9 +798,9 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { Describe("Control status via API", func() { BeforeEach(func() { sutConfig = config.BlockingConfig{ - BlackLists: map[string][]string{ - "defaultGroup": {defaultGroupFile.Path}, - "group1": {group1File.Path}, + BlackLists: map[string][]config.BytesSource{ + "defaultGroup": config.NewBytesSources(defaultGroupFile.Path), + "group1": config.NewBytesSources(group1File.Path), }, ClientGroupsBlock: map[string][]string{ "default": {"defaultGroup", "group1"}, @@ -1118,13 +1118,13 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { MatchError("unknown blockType 'wrong', please use one of: ZeroIP, NxDomain or specify destination IP address(es)")) }) }) - When("startStrategy is failOnError", func() { + When("strategy is failOnError", func() { It("should fail if lists can't be downloaded", func() { _, err := NewBlockingResolver(config.BlockingConfig{ - BlackLists: map[string][]string{"gr1": {"wrongPath"}}, - WhiteLists: map[string][]string{"whitelist": {"wrongPath"}}, - StartStrategy: config.StartStrategyTypeFailOnError, - BlockType: "zeroIp", + BlackLists: map[string][]config.BytesSource{"gr1": config.NewBytesSources("wrongPath")}, + WhiteLists: map[string][]config.BytesSource{"whitelist": config.NewBytesSources("wrongPath")}, + Loading: config.SourceLoadingConfig{Strategy: config.StartStrategyTypeFailOnError}, + BlockType: "zeroIp", }, nil, systemResolverBootstrap) Expect(err).Should(HaveOccurred()) }) diff --git a/resolver/hosts_file_resolver.go b/resolver/hosts_file_resolver.go index f3518e416..3fc29151d 100644 --- a/resolver/hosts_file_resolver.go +++ b/resolver/hosts_file_resolver.go @@ -4,13 +4,14 @@ import ( "context" "fmt" "net" - "os" - "time" "github.com/0xERR0R/blocky/config" + "github.com/0xERR0R/blocky/lists" "github.com/0xERR0R/blocky/lists/parsers" "github.com/0xERR0R/blocky/model" "github.com/0xERR0R/blocky/util" + "github.com/ThinkChaos/parcour" + "github.com/ThinkChaos/parcour/jobgroup" "github.com/miekg/dns" "github.com/sirupsen/logrus" ) @@ -18,33 +19,37 @@ import ( const ( // reduce initial capacity so we don't waste memory if there are less entries than before memReleaseFactor = 2 + + producersBuffCap = 1000 ) +type HostsFileEntry = parsers.HostsFileEntry + type HostsFileResolver struct { configurable[*config.HostsFileConfig] NextResolver typed - hosts splitHostsFileData + hosts splitHostsFileData + downloader lists.FileDownloader } -type HostsFileEntry = parsers.HostsFileEntry - -func NewHostsFileResolver(cfg config.HostsFileConfig) *HostsFileResolver { +func NewHostsFileResolver(cfg config.HostsFileConfig, bootstrap *Bootstrap) (*HostsFileResolver, error) { r := HostsFileResolver{ configurable: withConfig(&cfg), typed: withType("hosts_file"), - } - if err := r.parseHostsFile(context.Background()); err != nil { - r.log().Errorf("disabling hosts file resolving due to error: %s", err) + downloader: lists.NewDownloader(cfg.Loading.Downloads, bootstrap.NewHTTPTransport()), + } - r.cfg.Filepath = "" // don't try parsing the file again - } else { - go r.periodicUpdate() + err := cfg.Loading.StartPeriodicRefresh(r.loadSources, func(err error) { + r.log().WithError(err).Errorf("could not load hosts files") + }) + if err != nil { + return nil, err } - return &r + return &r, nil } // LogConfig implements `config.Configurable`. @@ -102,7 +107,7 @@ func (r *HostsFileResolver) handleReverseDNS(request *model.Request) *model.Resp } func (r *HostsFileResolver) Resolve(request *model.Request) (*model.Response, error) { - if r.cfg.Filepath == "" { + if !r.IsEnabled() { return r.next.Resolve(request) } @@ -144,27 +149,78 @@ func (r *HostsFileResolver) resolve(req *dns.Msg, question dns.Question, domain return response } -func (r *HostsFileResolver) parseHostsFile(ctx context.Context) error { - const maxErrorsPerFile = 5 - - if r.cfg.Filepath == "" { +func (r *HostsFileResolver) loadSources(ctx context.Context) error { + if !r.IsEnabled() { return nil } - f, err := os.Open(r.cfg.Filepath) + r.log().Debug("loading hosts files") + + //nolint:ineffassign,staticcheck // keep `ctx :=` so if we use ctx in the future, we use the correct one + consumersGrp, ctx := jobgroup.WithContext(ctx) + defer consumersGrp.Close() + + producersGrp := jobgroup.WithMaxConcurrency(consumersGrp, r.cfg.Loading.Concurrency) + defer producersGrp.Close() + + producers := parcour.NewProducersWithBuffer[*HostsFileEntry](producersGrp, consumersGrp, producersBuffCap) + defer producers.Close() + + for i, source := range r.cfg.Sources { + i, source := i, source + + producers.GoProduce(func(ctx context.Context, hostsChan chan<- *HostsFileEntry) error { + locInfo := fmt.Sprintf("item #%d", i) + + opener, err := lists.NewSourceOpener(locInfo, source, r.downloader) + if err != nil { + return err + } + + err = r.parseFile(ctx, opener, hostsChan) + if err != nil { + return fmt.Errorf("error parsing %s: %w", opener, err) // err is parsers.ErrTooManyErrors + } + + return nil + }) + } + + newHosts := newSplitHostsDataWithSameCapacity(r.hosts) + + producers.GoConsume(func(ctx context.Context, ch <-chan *HostsFileEntry) error { + for entry := range ch { + newHosts.add(entry) + } + + return nil + }) + + err := producers.Wait() if err != nil { return err } - defer f.Close() - newHosts := newSplitHostsDataWithSameCapacity(r.hosts) + r.hosts = newHosts + + return nil +} + +func (r *HostsFileResolver) parseFile( + ctx context.Context, opener lists.SourceOpener, hostsChan chan<- *HostsFileEntry, +) error { + reader, err := opener.Open() + if err != nil { + return err + } + defer reader.Close() - p := parsers.AllowErrors(parsers.HostsFile(f), maxErrorsPerFile) + p := parsers.AllowErrors(parsers.HostsFile(reader), r.cfg.Loading.MaxErrorsPerSource) p.OnErr(func(err error) { - r.log().Warnf("error parsing %s: %s, trying to continue", r.cfg.Filepath, err) + r.log().Warnf("error parsing %s: %s, trying to continue", opener, err) }) - err = parsers.ForEach[*HostsFileEntry](ctx, p, func(entry *HostsFileEntry) error { + return parsers.ForEach[*HostsFileEntry](ctx, p, func(entry *HostsFileEntry) error { if len(entry.Interface) != 0 { // Ignore entries with a specific interface: we don't restrict what clients/interfaces we serve entries to, // so this avoids returning entries that can't be accessed by the client. @@ -176,32 +232,10 @@ func (r *HostsFileResolver) parseHostsFile(ctx context.Context) error { return nil } - newHosts.add(entry) + hostsChan <- entry return nil }) - if err != nil { - return fmt.Errorf("error parsing %s: %w", r.cfg.Filepath, err) // err is parsers.ErrTooManyErrors - } - - r.hosts = newHosts - - return nil -} - -func (r *HostsFileResolver) periodicUpdate() { - if r.cfg.RefreshPeriod.ToDuration() > 0 { - ticker := time.NewTicker(r.cfg.RefreshPeriod.ToDuration()) - defer ticker.Stop() - - for { - <-ticker.C - - r.log().WithField("file", r.cfg.Filepath).Debug("refreshing hosts file") - - util.LogOnError("can't refresh hosts file: ", r.parseHostsFile(context.Background())) - } - } } // stores hosts file data for IP versions separately diff --git a/resolver/hosts_file_resolver_test.go b/resolver/hosts_file_resolver_test.go index 2851ccdd9..eef4591d4 100644 --- a/resolver/hosts_file_resolver_test.go +++ b/resolver/hosts_file_resolver_test.go @@ -40,15 +40,22 @@ var _ = Describe("HostsFileResolver", func() { Expect(tmpFile.Error).Should(Succeed()) sutConfig = config.HostsFileConfig{ - Filepath: tmpFile.Path, + Sources: config.NewBytesSources(tmpFile.Path), HostsTTL: config.Duration(time.Duration(TTL) * time.Second), - RefreshPeriod: config.Duration(30 * time.Minute), FilterLoopback: true, + Loading: config.SourceLoadingConfig{ + RefreshPeriod: -1, + MaxErrorsPerSource: 5, + }, } }) JustBeforeEach(func() { - sut = NewHostsFileResolver(sutConfig) + var err error + + sut, err = NewHostsFileResolver(sutConfig, systemResolverBootstrap) + Expect(err).Should(Succeed()) + m = &mockResolver{} m.On("Resolve", mock.Anything).Return(&Response{Res: new(dns.Msg)}, nil) sut.Next(m) @@ -74,12 +81,12 @@ var _ = Describe("HostsFileResolver", func() { When("Hosts file cannot be located", func() { BeforeEach(func() { sutConfig = config.HostsFileConfig{ - Filepath: "/this/file/does/not/exist", + Sources: config.NewBytesSources("/this/file/does/not/exist"), HostsTTL: config.Duration(time.Duration(TTL) * time.Second), } }) It("should not parse any hosts", func() { - Expect(sut.cfg.Filepath).Should(BeEmpty()) + Expect(sut.cfg.Sources).ShouldNot(BeEmpty()) Expect(sut.hosts.v4.hosts).Should(BeEmpty()) Expect(sut.hosts.v6.hosts).Should(BeEmpty()) Expect(sut.hosts.v4.aliases).Should(BeEmpty()) @@ -99,13 +106,15 @@ var _ = Describe("HostsFileResolver", func() { When("Hosts file is not set", func() { BeforeEach(func() { - sut = NewHostsFileResolver(config.HostsFileConfig{}) + sutConfig.Deprecated.Filepath = new(config.BytesSource) + sutConfig.Sources = nil + m = &mockResolver{} m.On("Resolve", mock.Anything).Return(&Response{Res: new(dns.Msg)}, nil) sut.Next(m) }) It("should not return an error", func() { - err := sut.parseHostsFile(context.Background()) + err := sut.loadSources(context.Background()) Expect(err).Should(Succeed()) }) It("should go to next resolver on query", func() { @@ -156,12 +165,12 @@ var _ = Describe("HostsFileResolver", func() { ) Expect(tmpFile.Error).Should(Succeed()) - sutConfig.Filepath = tmpFile.Path + sutConfig.Sources = config.NewBytesSources(tmpFile.Path) }) It("should not be used", func() { Expect(sut).ShouldNot(BeNil()) - Expect(sut.cfg.Filepath).Should(BeEmpty()) + Expect(sut.cfg.Sources).ShouldNot(BeEmpty()) Expect(sut.hosts.v4.hosts).Should(BeEmpty()) Expect(sut.hosts.v6.hosts).Should(BeEmpty()) Expect(sut.hosts.v4.aliases).Should(BeEmpty()) diff --git a/server/server.go b/server/server.go index 2d36101bf..8f949b7f5 100644 --- a/server/server.go +++ b/server/server.go @@ -400,15 +400,17 @@ func createQueryResolver( parallel, pErr := resolver.NewParallelBestResolver(cfg.Upstream, bootstrap, cfg.StartVerifyUpstream) clientNames, cnErr := resolver.NewClientNamesResolver(cfg.ClientLookup, bootstrap, cfg.StartVerifyUpstream) condUpstream, cuErr := resolver.NewConditionalUpstreamResolver(cfg.Conditional, bootstrap, cfg.StartVerifyUpstream) + hostsFile, hfErr := resolver.NewHostsFileResolver(cfg.HostsFile, bootstrap) - mErr := multierror.Append( + err = multierror.Append( multierror.Prefix(blErr, "blocking resolver: "), multierror.Prefix(pErr, "parallel resolver: "), multierror.Prefix(cnErr, "client names resolver: "), multierror.Prefix(cuErr, "conditional upstream resolver: "), - ) - if mErr.ErrorOrNil() != nil { - return nil, mErr + multierror.Prefix(hfErr, "hosts file resolver: "), + ).ErrorOrNil() + if err != nil { + return nil, err } r = resolver.Chain( @@ -419,7 +421,7 @@ func createQueryResolver( resolver.NewQueryLoggingResolver(cfg.QueryLog), resolver.NewMetricsResolver(cfg.Prometheus), resolver.NewRewriterResolver(cfg.CustomDNS.RewriterConfig, resolver.NewCustomDNSResolver(cfg.CustomDNS)), - resolver.NewHostsFileResolver(cfg.HostsFile), + hostsFile, blocking, resolver.NewCachingResolver(cfg.Caching, redisClient), resolver.NewRewriterResolver(cfg.Conditional.RewriterConfig, condUpstream), diff --git a/server/server_test.go b/server/server_test.go index 72bc8418f..5d3a4ab36 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -122,17 +122,17 @@ var _ = BeforeSuite(func() { }, }, Blocking: config.BlockingConfig{ - BlackLists: map[string][]string{ - "ads": { + BlackLists: map[string][]config.BytesSource{ + "ads": config.NewBytesSources( doubleclickFile.Path, bildFile.Path, heiseFile.Path, - }, - "youtube": {youtubeFile.Path}, + ), + "youtube": config.NewBytesSources(youtubeFile.Path), }, - WhiteLists: map[string][]string{ - "ads": {heiseFile.Path}, - "whitelist": {heiseFile.Path}, + WhiteLists: map[string][]config.BytesSource{ + "ads": config.NewBytesSources(heiseFile.Path), + "whitelist": config.NewBytesSources(heiseFile.Path), }, ClientGroupsBlock: map[string][]string{ "default": {"ads"}, From f22e310501b8894a6f8a0b9eee434ad0cf8c05a7 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Wed, 19 Apr 2023 21:14:29 -0400 Subject: [PATCH 58/92] fix: duration checks to take into account values can be negative Replace `IsZero` with `IsAboveZero` to help us avoid this mistake again. --- config/caching.go | 4 ++-- config/config.go | 2 +- config/config_test.go | 4 ++-- config/duration.go | 4 ++-- config/duration_test.go | 23 +++++++++++++++++------ resolver/bootstrap.go | 4 ++-- resolver/caching_resolver.go | 6 +++--- 7 files changed, 29 insertions(+), 18 deletions(-) diff --git a/config/caching.go b/config/caching.go index 0393d34f8..c942398cd 100644 --- a/config/caching.go +++ b/config/caching.go @@ -20,7 +20,7 @@ type CachingConfig struct { // IsEnabled implements `config.Configurable`. func (c *CachingConfig) IsEnabled() bool { - return c.MaxCachingTime > 0 + return c.MaxCachingTime.IsAboveZero() } // LogConfig implements `config.Configurable`. @@ -42,7 +42,7 @@ func (c *CachingConfig) LogConfig(logger *logrus.Entry) { func (c *CachingConfig) EnablePrefetch() { const day = Duration(24 * time.Hour) - if c.MaxCachingTime.IsZero() { + if !c.IsEnabled() { // make sure resolver gets enabled c.MaxCachingTime = day } diff --git a/config/config.go b/config/config.go index 1580352fc..d6d5af725 100644 --- a/config/config.go +++ b/config/config.go @@ -298,7 +298,7 @@ func (c *SourceLoadingConfig) LogConfig(logger *logrus.Entry) { logger.Debugf("maxErrorsPerSource = %d", c.MaxErrorsPerSource) logger.Debugf("strategy = %s", c.Strategy) - if c.RefreshPeriod > 0 { + if c.RefreshPeriod.IsAboveZero() { logger.Infof("refresh = every %s", c.RefreshPeriod) } else { logger.Debug("refresh = disabled") diff --git a/config/config_test.go b/config/config_test.go index 5e2039c72..15851f963 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -785,8 +785,8 @@ func defaultTestFileConfig() { Expect(config.Filtering.QueryTypes).Should(HaveLen(2)) Expect(config.FqdnOnly.Enable).Should(BeTrue()) - Expect(config.Caching.MaxCachingTime.IsZero()).Should(BeTrue()) - Expect(config.Caching.MinCachingTime.IsZero()).Should(BeTrue()) + Expect(config.Caching.MaxCachingTime).Should(BeZero()) + Expect(config.Caching.MinCachingTime).Should(BeZero()) Expect(config.DoHUserAgent).Should(Equal("testBlocky")) Expect(config.MinTLSServeVer).Should(Equal("1.3")) diff --git a/config/duration.go b/config/duration.go index 5ca316acc..c8ef09a76 100644 --- a/config/duration.go +++ b/config/duration.go @@ -14,8 +14,8 @@ func (c Duration) ToDuration() time.Duration { return time.Duration(c) } -func (c Duration) IsZero() bool { - return c.ToDuration() == 0 +func (c Duration) IsAboveZero() bool { + return c.ToDuration() > 0 } func (c Duration) Seconds() float64 { diff --git a/config/duration_test.go b/config/duration_test.go index 882f038f1..047337ac9 100644 --- a/config/duration_test.go +++ b/config/duration_test.go @@ -31,14 +31,25 @@ var _ = Describe("Duration", func() { }) }) - Describe("IsZero", func() { - It("should be true for zero", func() { - Expect(d.IsZero()).Should(BeTrue()) - Expect(Duration(0).IsZero()).Should(BeTrue()) + Describe("IsAboveZero", func() { + It("should be false for zero", func() { + Expect(d.IsAboveZero()).Should(BeFalse()) + Expect(Duration(0).IsAboveZero()).Should(BeFalse()) }) - It("should be false for non-zero", func() { - Expect(Duration(time.Second).IsZero()).Should(BeFalse()) + It("should be false for negative", func() { + Expect(Duration(-1).IsAboveZero()).Should(BeFalse()) + }) + + It("should be true for positive", func() { + Expect(Duration(1).IsAboveZero()).Should(BeTrue()) + }) + }) + + Describe("SecondsU32", func() { + It("should return the seconds", func() { + Expect(Duration(time.Minute).SecondsU32()).Should(Equal(uint32(60))) + Expect(Duration(time.Hour).SecondsU32()).Should(Equal(uint32(3600))) }) }) }) diff --git a/resolver/bootstrap.go b/resolver/bootstrap.go index d8d956920..27e2fa8ca 100644 --- a/resolver/bootstrap.go +++ b/resolver/bootstrap.go @@ -78,7 +78,7 @@ func NewBootstrap(cfg *config.Config) (b *Bootstrap, err error) { cachingCfg := cfg.Caching cachingCfg.EnablePrefetch() - if cachingCfg.MinCachingTime.IsZero() { + if !cachingCfg.MinCachingTime.IsAboveZero() { // Set a min time in case the user didn't to avoid prefetching too often cachingCfg.MinCachingTime = config.Duration(time.Hour) } @@ -116,7 +116,7 @@ func (b *Bootstrap) resolveUpstream(r Resolver, host string) ([]net.IP, error) { ctx := context.Background() timeout := cfg.UpstreamTimeout - if timeout.IsZero() { + if timeout.IsAboveZero() { var cancel context.CancelFunc ctx, cancel = context.WithTimeout(ctx, timeout.ToDuration()) diff --git a/resolver/caching_resolver.go b/resolver/caching_resolver.go index 08091b9da..d0e2a2496 100644 --- a/resolver/caching_resolver.go +++ b/resolver/caching_resolver.go @@ -217,7 +217,7 @@ func (r *CachingResolver) putInCache(cacheKey string, response *model.Response, // put value into cache r.resultCache.Put(cacheKey, &cacheValue{response.Res, prefetch}, r.adjustTTLs(response.Res.Answer)) } else if response.Res.Rcode == dns.RcodeNameError { - if r.cfg.CacheTimeNegative > 0 { + if r.cfg.CacheTimeNegative.IsAboveZero() { // put negative cache if result code is NXDOMAIN r.resultCache.Put(cacheKey, &cacheValue{response.Res, prefetch}, r.cfg.CacheTimeNegative.ToDuration()) } @@ -244,13 +244,13 @@ func (r *CachingResolver) adjustTTLs(answer []dns.RR) (maxTTL time.Duration) { for _, a := range answer { // if TTL < mitTTL -> adjust the value, set minTTL - if r.cfg.MinCachingTime > 0 { + if r.cfg.MinCachingTime.IsAboveZero() { if atomic.LoadUint32(&a.Header().Ttl) < r.cfg.MinCachingTime.SecondsU32() { atomic.StoreUint32(&a.Header().Ttl, r.cfg.MinCachingTime.SecondsU32()) } } - if r.cfg.MaxCachingTime > 0 { + if r.cfg.MaxCachingTime.IsAboveZero() { if atomic.LoadUint32(&a.Header().Ttl) > r.cfg.MaxCachingTime.SecondsU32() { atomic.StoreUint32(&a.Header().Ttl, r.cfg.MaxCachingTime.SecondsU32()) } From 8a93e4500c0de0110fdeae66e9c19eabaf7f3a0a Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Mon, 8 May 2023 12:09:53 -0400 Subject: [PATCH 59/92] style: fix all existing lint errors --- api/api_endpoints_test.go | 2 +- cmd/healthcheck.go | 1 + querylog/none_writer.go | 2 +- redis/redis_suite_test.go | 2 +- resolver/mocks_test.go | 12 ++++++------ 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/api/api_endpoints_test.go b/api/api_endpoints_test.go index 8acb22483..a6445b953 100644 --- a/api/api_endpoints_test.go +++ b/api/api_endpoints_test.go @@ -29,7 +29,7 @@ func (b *BlockingControlMock) EnableBlocking() { b.enabled = true } -func (b *BlockingControlMock) DisableBlocking(_ time.Duration, disableGroups []string) error { +func (b *BlockingControlMock) DisableBlocking(time.Duration, []string) error { b.enabled = false return nil diff --git a/cmd/healthcheck.go b/cmd/healthcheck.go index 37358e087..f772b9688 100644 --- a/cmd/healthcheck.go +++ b/cmd/healthcheck.go @@ -25,6 +25,7 @@ func NewHealthcheckCommand() *cobra.Command { } func healthcheck(cmd *cobra.Command, args []string) error { + _ = args port, _ := cmd.Flags().GetUint16("port") c := new(dns.Client) diff --git a/querylog/none_writer.go b/querylog/none_writer.go index cad5f8b97..856b95510 100644 --- a/querylog/none_writer.go +++ b/querylog/none_writer.go @@ -6,7 +6,7 @@ func NewNoneWriter() *NoneWriter { return &NoneWriter{} } -func (d *NoneWriter) Write(entry *LogEntry) { +func (d *NoneWriter) Write(*LogEntry) { // Nothing to do } diff --git a/redis/redis_suite_test.go b/redis/redis_suite_test.go index 44b1e08e4..34ee9133a 100644 --- a/redis/redis_suite_test.go +++ b/redis/redis_suite_test.go @@ -19,4 +19,4 @@ func TestRedisClient(t *testing.T) { type NoLogs struct{} -func (l NoLogs) Printf(ctx context.Context, format string, v ...interface{}) {} +func (l NoLogs) Printf(context.Context, string, ...interface{}) {} diff --git a/resolver/mocks_test.go b/resolver/mocks_test.go index 567e0600a..6769aafaf 100644 --- a/resolver/mocks_test.go +++ b/resolver/mocks_test.go @@ -41,7 +41,7 @@ func (r *mockResolver) IsEnabled() bool { } // LogConfig implements `config.Configurable`. -func (r *mockResolver) LogConfig(logger *logrus.Entry) { +func (r *mockResolver) LogConfig(*logrus.Entry) { r.Called() } @@ -193,11 +193,11 @@ var aMockConn = &mockConn{} type mockConn struct{} -func (c *mockConn) Read(b []byte) (n int, err error) { +func (c *mockConn) Read([]byte) (n int, err error) { panic("not implemented") } -func (c *mockConn) Write(b []byte) (n int, err error) { +func (c *mockConn) Write([]byte) (n int, err error) { panic("not implemented") } @@ -213,14 +213,14 @@ func (c *mockConn) RemoteAddr() net.Addr { panic("not implemented") } -func (c *mockConn) SetDeadline(t time.Time) error { +func (c *mockConn) SetDeadline(time.Time) error { panic("not implemented") } -func (c *mockConn) SetReadDeadline(t time.Time) error { +func (c *mockConn) SetReadDeadline(time.Time) error { panic("not implemented") } -func (c *mockConn) SetWriteDeadline(t time.Time) error { +func (c *mockConn) SetWriteDeadline(time.Time) error { panic("not implemented") } From 2bd59484c0f9b9b1f274049fe06a0df9e602e9b2 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Thu, 11 May 2023 21:34:10 -0400 Subject: [PATCH 60/92] ci: deploy docs on forks if they have pages enabled --- .github/workflows/docs.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e22cee890..17818e337 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,32 +2,34 @@ name: docs on: push: branches: - - main + - '**' tags: - v* jobs: deploy: runs-on: ubuntu-latest - if: github.repository_owner == '0xERR0R' + if: ${{ github.event.repository.has_pages && (github.repository_owner != '0xERR0R' || github.ref_type == 'tag' || github.ref_name == 'main') }} steps: - uses: actions/checkout@v3 with: fetch-depth: 0 + - uses: actions/setup-python@v4 with: python-version: 3.x - + - name: install tools run: pip install mkdocs-material mike - + - name: Setup doc deploy run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" - - name: Deploy version for tag/branch - run: mike deploy --push --update-aliases ${GITHUB_REF_NAME} - - name: Deploy latest version for tag only - if: ${{ github.ref != 'refs/heads/main' }} - run: mike deploy --push --update-aliases ${GITHUB_REF_NAME} latest - - run: mike set-default --push latest + - name: Deploy version for branch + if: ${{ startsWith(github.ref, 'refs/heads/') }} + run: mike deploy --push --update-aliases "$(sed 's:/:-:g' <<< "${GITHUB_REF_NAME}")" + + - name: Deploy version for tag and update latest + if: ${{ startsWith(github.ref, 'refs/tags/') }} + run: mike deploy --push --update-aliases "${GITHUB_REF_NAME}" latest From 702442d43eaa295daf3b9189a02e106d8993c0fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jul 2023 06:14:26 +0000 Subject: [PATCH 61/92] build(deps): bump golang.org/x/net from 0.11.0 to 0.12.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.11.0 to 0.12.0. - [Commits](https://github.com/golang/net/compare/v0.11.0...v0.12.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index aec27928a..5680c5a69 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/swaggo/swag v1.16.1 github.com/x-cray/logrus-prefixed-formatter v0.5.2 - golang.org/x/net v0.11.0 + golang.org/x/net v0.12.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.0 gorm.io/driver/postgres v1.5.2 @@ -124,12 +124,12 @@ require ( github.com/urfave/cli/v2 v2.25.1 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect - golang.org/x/crypto v0.10.0 // indirect + golang.org/x/crypto v0.11.0 // indirect golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea golang.org/x/mod v0.11.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/term v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/term v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect golang.org/x/tools v0.10.0 google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 80e94c2c4..c83520111 100644 --- a/go.sum +++ b/go.sum @@ -285,8 +285,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4= golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -304,8 +304,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= 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= @@ -338,19 +338,19 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= From 64eee04c37db5c2d46b86f03c6ce48f3596b9afb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 18:13:52 +0000 Subject: [PATCH 62/92] build(deps): bump golang.org/x/tools from 0.10.0 to 0.11.0 Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.10.0 to 0.11.0. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.10.0...v0.11.0) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 5680c5a69..bdc8489ae 100644 --- a/go.mod +++ b/go.mod @@ -126,11 +126,11 @@ require ( github.com/yuin/gopher-lua v1.1.0 // indirect golang.org/x/crypto v0.11.0 // indirect golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea - golang.org/x/mod v0.11.0 // indirect + golang.org/x/mod v0.12.0 // indirect golang.org/x/sys v0.10.0 // indirect golang.org/x/term v0.10.0 // indirect golang.org/x/text v0.11.0 // indirect - golang.org/x/tools v0.10.0 + golang.org/x/tools v0.11.0 google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index c83520111..4a59b9a97 100644 --- a/go.sum +++ b/go.sum @@ -293,8 +293,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -358,8 +358,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= -golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= +golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8= +golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= golang.org/x/tools/cmd/cover v0.1.0-deprecated h1:Rwy+mWYz6loAF+LnG1jHG/JWMHRMMC2/1XX3Ejkx9lA= golang.org/x/tools/cmd/cover v0.1.0-deprecated/go.mod h1:hMDiIvlpN1NoVgmjLjUJE9tMHyxHjFX7RuQ+rW12mSA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From eb5f666e5a85d7528c3e47301375b192fb9a0901 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jul 2023 04:59:47 +0000 Subject: [PATCH 63/92] build(deps): bump github.com/go-chi/chi/v5 from 5.0.8 to 5.0.10 Bumps [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) from 5.0.8 to 5.0.10. - [Release notes](https://github.com/go-chi/chi/releases) - [Changelog](https://github.com/go-chi/chi/blob/master/CHANGELOG.md) - [Commits](https://github.com/go-chi/chi/compare/v5.0.8...v5.0.10) --- updated-dependencies: - dependency-name: github.com/go-chi/chi/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index bdc8489ae..e99d11f42 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef github.com/avast/retry-go/v4 v4.3.4 github.com/creasty/defaults v1.7.0 - github.com/go-chi/chi/v5 v5.0.8 + github.com/go-chi/chi/v5 v5.0.10 github.com/go-chi/cors v1.2.1 github.com/go-redis/redis/v8 v8.11.5 github.com/google/uuid v1.3.0 diff --git a/go.sum b/go.sum index 4a59b9a97..880795384 100644 --- a/go.sum +++ b/go.sum @@ -72,8 +72,8 @@ github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198/go.mod h1:NUrh34aXXg github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= -github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= +github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= From 6028a64aa9b1154b5cb9c65c3c2a8ead23fdd173 Mon Sep 17 00:00:00 2001 From: anonion Date: Thu, 6 Jul 2023 13:06:46 -0600 Subject: [PATCH 64/92] Update prometheus_grafana.md with correct grafana config --- docs/prometheus_grafana.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/prometheus_grafana.md b/docs/prometheus_grafana.md index 9d05468c0..0463ca20f 100644 --- a/docs/prometheus_grafana.md +++ b/docs/prometheus_grafana.md @@ -34,7 +34,7 @@ This dashboard shows all relevant statistics and allows enabling and disabling t ### Grafana configuration Please install `grafana-piechart-panel` and -set [disable-sanitize-html](https://grafana.com/docs/grafana/latest/installation/configuration/#disable-sanitize-html) +set [disable_sanitize_html](https://grafana.com/docs/grafana/latest/installation/configuration/#disable_sanitize_html) in config or as env to use control buttons to enable/disable the blocking status. ### Grafana and Prometheus example project From 56633da0a7bc5b342744c8eb754c79134bf31a19 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Fri, 19 May 2023 23:10:40 -0400 Subject: [PATCH 65/92] feat(sudn): refactor and expand supported special use domains RFCs --- config/config.go | 1 + config/sudn.go | 25 ++++ config/sudn_test.go | 34 +++++ docs/config.yml | 6 + docs/configuration.md | 18 +++ helpertest/helper.go | 29 ++-- log/mock_entry.go | 1 + resolver/resolver.go | 12 +- resolver/sudn_resolver.go | 254 ++++++++++++++++++--------------- resolver/sudn_resolver_test.go | 216 +++++++++++++++------------- server/server.go | 2 +- 11 files changed, 364 insertions(+), 234 deletions(-) create mode 100644 config/sudn.go create mode 100644 config/sudn_test.go diff --git a/config/config.go b/config/config.go index d6d5af725..852364938 100644 --- a/config/config.go +++ b/config/config.go @@ -208,6 +208,7 @@ type Config struct { FqdnOnly FqdnOnlyConfig `yaml:"fqdnOnly"` Filtering FilteringConfig `yaml:"filtering"` Ede EdeConfig `yaml:"ede"` + SUDN SUDNConfig `yaml:"specialUseDomains"` // Deprecated options Deprecated struct { diff --git a/config/sudn.go b/config/sudn.go new file mode 100644 index 000000000..bf18a05c4 --- /dev/null +++ b/config/sudn.go @@ -0,0 +1,25 @@ +package config + +import ( + "github.com/sirupsen/logrus" +) + +// SUDNConfig configuration for Special Use Domain Names +type SUDNConfig struct { + // These are "recommended for private use" but not mandatory. + // If a user wishes to use one, it will most likely be via conditional + // upstream or custom DNS, which come before SUDN in the resolver chain. + // Thus defaulting to `true` and returning NXDOMAIN here should not conflict. + RFC6762AppendixG bool `yaml:"rfc6762-appendixG" default:"true"` +} + +// IsEnabled implements `config.Configurable`. +func (c *SUDNConfig) IsEnabled() bool { + // The Special Use RFCs are always active + return true +} + +// LogConfig implements `config.Configurable`. +func (c *SUDNConfig) LogConfig(logger *logrus.Entry) { + logger.Debugf("rfc6762-appendixG = %v", c.RFC6762AppendixG) +} diff --git a/config/sudn_test.go b/config/sudn_test.go new file mode 100644 index 000000000..350efa12f --- /dev/null +++ b/config/sudn_test.go @@ -0,0 +1,34 @@ +package config + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("SUDNConfig", func() { + var cfg SUDNConfig + + suiteBeforeEach() + + BeforeEach(func() { + var err error + + cfg, err = WithDefaults[SUDNConfig]() + Expect(err).Should(Succeed()) + }) + + Describe("IsEnabled", func() { + It("is true", func() { + Expect(cfg.IsEnabled()).Should(BeTrue()) + }) + }) + + Describe("LogConfig", func() { + It("should log configuration", func() { + cfg.LogConfig(logger) + + Expect(hook.Calls).ShouldNot(BeEmpty()) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("rfc6762-appendixG = true"))) + }) + }) +}) diff --git a/docs/config.yml b/docs/config.yml index 4d290d5a4..98a21c2d6 100644 --- a/docs/config.yml +++ b/docs/config.yml @@ -319,3 +319,9 @@ log: ede: # enabled if true, Default: false enable: true + +# optional: configure optional Special Use Domain Names (SUDN) +specialUseDomains: + # optional: block recomended private TLDs + # default: true + rfc6762-appendixG: true diff --git a/docs/configuration.md b/docs/configuration.md index fc33bc523..3cf357718 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -671,6 +671,24 @@ Configuration parameters: enable: true ``` +## Special Use Domain Names + +SUDN (Special Use Domain Names) are always enabled as they are required by various RFCs. +Some RFCs have optional recommendations, which are configurable as described below. + +Configuration parameters: + +| Parameter | Type | Mandatory | Default value | Description | +|-------------------------------------|------|-----------|---------------|-----------------------------------------------------------------------------------------------| +| specialUseDomains.rfc6762-appendixG | bool | no | true | Block TLDs listed in [RFC 6762 Appendix G](https://www.rfc-editor.org/rfc/rfc6762#appendix-G) | + +!!! example + + ```yaml + specialUseDomains: + rfc6762-appendixG: true + ``` + ## SSL certificate configuration (DoH / TLS listener) See [Wiki - Configuration of HTTPS](https://github.com/0xERR0R/blocky/wiki/Configuration-of-HTTPS-for-DoH-and-Rest-API) diff --git a/helpertest/helper.go b/helpertest/helper.go index ce614ad37..6ea513f02 100644 --- a/helpertest/helper.go +++ b/helpertest/helper.go @@ -12,6 +12,7 @@ import ( "github.com/miekg/dns" "github.com/onsi/gomega" + "github.com/onsi/gomega/gcustom" "github.com/onsi/gomega/types" ) @@ -22,6 +23,7 @@ const ( MX = dns.Type(dns.TypeMX) PTR = dns.Type(dns.TypePTR) TXT = dns.Type(dns.TypeTXT) + DS = dns.Type(dns.TypeDS) ) // TempFile creates temp file with passed data @@ -76,21 +78,30 @@ func HaveNoAnswer() types.GomegaMatcher { } func HaveReason(reason string) types.GomegaMatcher { - return gomega.WithTransform(func(m *model.Response) string { - return m.Reason - }, gomega.Equal(reason)) + return gcustom.MakeMatcher(func(m *model.Response) (bool, error) { + return m.Reason == reason, nil + }).WithTemplate( + "Expected:\n{{.Actual}}\n{{.To}} have reason:\n{{format .Data 1}}", + reason, + ) } func HaveResponseType(c model.ResponseType) types.GomegaMatcher { - return gomega.WithTransform(func(m *model.Response) model.ResponseType { - return m.RType - }, gomega.Equal(c)) + return gcustom.MakeMatcher(func(m *model.Response) (bool, error) { + return m.RType == c, nil + }).WithTemplate( + "Expected:\n{{.Actual}}\n{{.To}} have ResponseType:\n{{format .Data 1}}", + c.String(), + ) } func HaveReturnCode(code int) types.GomegaMatcher { - return gomega.WithTransform(func(m *model.Response) int { - return m.Res.Rcode - }, gomega.Equal(code)) + return gcustom.MakeMatcher(func(m *model.Response) (bool, error) { + return m.Res.Rcode == code, nil + }).WithTemplate( + "Expected:\n{{.Actual}}\n{{.To}} have RCode:\n{{format .Data 1}}", + fmt.Sprintf("%d (%s)", code, dns.RcodeToString[code]), + ) } func toFirstRR(actual interface{}) (dns.RR, error) { diff --git a/log/mock_entry.go b/log/mock_entry.go index 0415a5ef3..b79ba4e76 100644 --- a/log/mock_entry.go +++ b/log/mock_entry.go @@ -10,6 +10,7 @@ import ( func NewMockEntry() (*logrus.Entry, *MockLoggerHook) { logger := logrus.New() logger.Out = io.Discard + logger.Level = logrus.TraceLevel entry := logrus.Entry{Logger: logger} hook := MockLoggerHook{} diff --git a/resolver/resolver.go b/resolver/resolver.go index e1e9c83eb..9b6e1c7e5 100644 --- a/resolver/resolver.go +++ b/resolver/resolver.go @@ -39,21 +39,17 @@ func newRequestWithClient(question string, rType dns.Type, ip string, clientName } } -// newResponseMsg creates a new dns.Msg as response for a request -func newResponseMsg(request *model.Request) *dns.Msg { +// newResponse creates a response to the given request +func newResponse(request *model.Request, rcode int, rtype model.ResponseType, reason string) *model.Response { response := new(dns.Msg) response.SetReply(request.Req) + response.Rcode = rcode - return response -} - -// returnResponseModel wrapps a dns.Msg into a model.Response -func returnResponseModel(response *dns.Msg, rtype model.ResponseType, reason string) (*model.Response, error) { return &model.Response{ Res: response, RType: rtype, Reason: reason, - }, nil + } } func newRequestWithClientID(question string, rType dns.Type, ip, requestClientID string) *model.Request { diff --git a/resolver/sudn_resolver.go b/resolver/sudn_resolver.go index 772f81a17..44508a2da 100644 --- a/resolver/sudn_resolver.go +++ b/resolver/sudn_resolver.go @@ -1,167 +1,183 @@ package resolver import ( - "fmt" "net" "strings" + "github.com/0xERR0R/blocky/config" "github.com/0xERR0R/blocky/model" "github.com/miekg/dns" - "github.com/sirupsen/logrus" ) -const ( - sudnTest = "test." - sudnInvalid = "invalid." - sudnLocalhost = "localhost." - mdnsLocal = "local." -) - -func sudnArpaSlice() []string { - return []string{ - "10.in-addr.arpa.", - "21.172.in-addr.arpa.", - "26.172.in-addr.arpa.", - "16.172.in-addr.arpa.", - "22.172.in-addr.arpa.", - "27.172.in-addr.arpa.", - "17.172.in-addr.arpa.", - "30.172.in-addr.arpa.", - "28.172.in-addr.arpa.", - "18.172.in-addr.arpa.", - "23.172.in-addr.arpa.", - "29.172.in-addr.arpa.", - "19.172.in-addr.arpa.", - "24.172.in-addr.arpa.", - "31.172.in-addr.arpa.", - "20.172.in-addr.arpa.", - "25.172.in-addr.arpa.", - "168.192.in-addr.arpa.", +type sudnHandler = func(request *model.Request, cfg *config.SUDNConfig) *model.Response + +//nolint:gochecknoglobals +var ( + loopbackV4 = net.ParseIP("127.0.0.1") + loopbackV6 = net.IPv6loopback + + // See Wikipedia for an up-to-date reference: + // https://en.wikipedia.org/wiki/Special-use_domain_name + sudnHandlers = map[string]sudnHandler{ + // RFC 6761 + // https://www.rfc-editor.org/rfc/rfc6761 + // + // Section 6.1 + "10.in-addr.arpa.": sudnNXDomain, + "21.172.in-addr.arpa.": sudnNXDomain, + "26.172.in-addr.arpa.": sudnNXDomain, + "16.172.in-addr.arpa.": sudnNXDomain, + "22.172.in-addr.arpa.": sudnNXDomain, + "27.172.in-addr.arpa.": sudnNXDomain, + "17.172.in-addr.arpa.": sudnNXDomain, + "30.172.in-addr.arpa.": sudnNXDomain, + "28.172.in-addr.arpa.": sudnNXDomain, + "18.172.in-addr.arpa.": sudnNXDomain, + "23.172.in-addr.arpa.": sudnNXDomain, + "29.172.in-addr.arpa.": sudnNXDomain, + "19.172.in-addr.arpa.": sudnNXDomain, + "24.172.in-addr.arpa.": sudnNXDomain, + "31.172.in-addr.arpa.": sudnNXDomain, + "20.172.in-addr.arpa.": sudnNXDomain, + "25.172.in-addr.arpa.": sudnNXDomain, + "168.192.in-addr.arpa.": sudnNXDomain, + // Section 6.2 + "test.": sudnNXDomain, + // Section 6.3 + "localhost.": sudnLocalhost, + // Section 6.4 + "invalid.": sudnNXDomain, + // Section 6.5 + "example.": nil, + "example.com.": nil, + "example.net.": nil, + "example.org.": nil, + + // RFC 6762 + // https://www.rfc-editor.org/rfc/rfc6762 + // + // mDNS is not implemented, so just return NXDOMAIN + // + // Section 3 + "local.": sudnNXDomain, + // Section 12 + "254.169.in-addr.arpa.": sudnNXDomain, // also section 4 + "8.e.f.ip6.arpa.": sudnNXDomain, + "9.e.f.ip6.arpa.": sudnNXDomain, + "a.e.f.ip6.arpa.": sudnNXDomain, + "b.e.f.ip6.arpa.": sudnNXDomain, + // Appendix G + "intranet.": sudnRFC6762AppendixG, + "internal.": sudnRFC6762AppendixG, + "private.": sudnRFC6762AppendixG, + "corp.": sudnRFC6762AppendixG, + "home.": sudnRFC6762AppendixG, + "lan.": sudnRFC6762AppendixG, + + // RFC 7686 + // https://www.rfc-editor.org/rfc/rfc7686 + "onion.": sudnNXDomain, + + // RFC 8375 + // https://www.rfc-editor.org/rfc/rfc8375 + // + // Section 4 + "home.arpa.": sudnHomeArpa, } -} - -type defaultIPs struct { - loopbackV4 net.IP - loopbackV6 net.IP -} +) type SpecialUseDomainNamesResolver struct { NextResolver typed - - defaults *defaultIPs + configurable[*config.SUDNConfig] } -func NewSpecialUseDomainNamesResolver() ChainedResolver { +func NewSpecialUseDomainNamesResolver(cfg config.SUDNConfig) ChainedResolver { return &SpecialUseDomainNamesResolver{ - typed: withType("special_use_domains"), - - defaults: &defaultIPs{ - loopbackV4: net.ParseIP("127.0.0.1"), - loopbackV6: net.IPv6loopback, - }, + typed: withType("special_use_domains"), + configurable: withConfig(&cfg), } } -// IsEnabled implements `config.Configurable`. -func (r *SpecialUseDomainNamesResolver) IsEnabled() bool { - // RFC 6761 & 6762 are always active - return true -} - -// LogConfig implements `config.Configurable`. -func (r *SpecialUseDomainNamesResolver) LogConfig(logger *logrus.Entry) { - logger.Info("enabled") -} - func (r *SpecialUseDomainNamesResolver) Resolve(request *model.Request) (*model.Response, error) { - // RFC 6761 - negative - if r.isSpecial(request, sudnArpaSlice()...) || - r.isSpecial(request, sudnInvalid) || - r.isSpecial(request, sudnTest) { - return r.negativeResponse(request) - } - // RFC 6761 - switched - if r.isSpecial(request, sudnLocalhost) { - return r.responseSwitch(request, sudnLocalhost, r.defaults.loopbackV4, r.defaults.loopbackV6) - } - - // RFC 6762 - negative - if r.isSpecial(request, mdnsLocal) { - return r.negativeResponse(request) + handler := r.handler(request) + if handler != nil { + resp := handler(request, r.cfg) + if resp != nil { + return resp, nil + } } return r.next.Resolve(request) } -func (r *SpecialUseDomainNamesResolver) isSpecial(request *model.Request, names ...string) bool { - domainFromQuestion := request.Req.Question[0].Name - for _, n := range names { - if domainFromQuestion == n || - strings.HasSuffix(domainFromQuestion, fmt.Sprintf(".%s", n)) { - return true +func (r *SpecialUseDomainNamesResolver) handler(request *model.Request) sudnHandler { + q := request.Req.Question[0] + domain := q.Name + + for { + handler, ok := sudnHandlers[domain] + if ok { + return handler + } + + _, after, ok := strings.Cut(domain, ".") + if !ok { + return nil } + + domain = after } +} - return false +func newSUDNResponse(response *model.Request, rcode int) *model.Response { + return newResponse(response, rcode, model.ResponseTypeSPECIAL, "Special-Use Domain Name") } -func (r *SpecialUseDomainNamesResolver) responseSwitch(request *model.Request, - name string, ipV4, ipV6 net.IP, -) (*model.Response, error) { - qtype := request.Req.Question[0].Qtype - switch qtype { +func sudnNXDomain(request *model.Request, _ *config.SUDNConfig) *model.Response { + return newSUDNResponse(request, dns.RcodeNameError) +} + +func sudnLocalhost(request *model.Request, cfg *config.SUDNConfig) *model.Response { + q := request.Req.Question[0] + + var rr dns.RR + + switch q.Qtype { case dns.TypeA: - return r.positiveResponse(request, name, dns.TypeA, ipV4) + rr = &dns.A{A: loopbackV4} case dns.TypeAAAA: - return r.positiveResponse(request, name, dns.TypeAAAA, ipV6) + rr = &dns.AAAA{AAAA: loopbackV6} default: - return r.negativeResponse(request) + return sudnNXDomain(request, cfg) } -} -func (r *SpecialUseDomainNamesResolver) positiveResponse(request *model.Request, - name string, rtype uint16, ip net.IP, -) (*model.Response, error) { - response := newResponseMsg(request) - response.Rcode = dns.RcodeSuccess - - hdr := dns.RR_Header{ - Name: name, - Rrtype: rtype, + *rr.Header() = dns.RR_Header{ + Name: q.Name, + Rrtype: q.Qtype, Class: dns.ClassINET, Ttl: 0, } - if rtype != dns.TypeA && rtype != dns.TypeAAAA { - return nil, fmt.Errorf("invalid response type") - } + response := newSUDNResponse(request, dns.RcodeSuccess) + response.Res.Answer = []dns.RR{rr} - var rr dns.RR - if rtype == dns.TypeA { - rr = &dns.A{ - A: ip, - Hdr: hdr, - } - } else { - rr = &dns.AAAA{ - AAAA: ip, - Hdr: hdr, - } - } - - response.Answer = []dns.RR{rr} - - return r.returnResponseModel(response) + return response } -func (r *SpecialUseDomainNamesResolver) negativeResponse(request *model.Request) (*model.Response, error) { - response := newResponseMsg(request) - response.Rcode = dns.RcodeNameError +func sudnRFC6762AppendixG(request *model.Request, cfg *config.SUDNConfig) *model.Response { + if !cfg.RFC6762AppendixG { + return nil + } - return r.returnResponseModel(response) + return sudnNXDomain(request, cfg) } -func (r *SpecialUseDomainNamesResolver) returnResponseModel(response *dns.Msg) (*model.Response, error) { - return returnResponseModel(response, model.ResponseTypeSPECIAL, "Special-Use Domain Name") +func sudnHomeArpa(request *model.Request, cfg *config.SUDNConfig) *model.Response { + if request.Req.Question[0].Qtype == dns.TypeDS { + // DS queries must be forwarded + return nil + } + + return sudnNXDomain(request, cfg) } diff --git a/resolver/sudn_resolver_test.go b/resolver/sudn_resolver_test.go index ff5af9bf9..5cf9ed006 100644 --- a/resolver/sudn_resolver_test.go +++ b/resolver/sudn_resolver_test.go @@ -1,20 +1,24 @@ package resolver import ( + "fmt" + + "github.com/0xERR0R/blocky/config" . "github.com/0xERR0R/blocky/helpertest" - "github.com/0xERR0R/blocky/log" . "github.com/0xERR0R/blocky/model" "github.com/0xERR0R/blocky/util" "github.com/miekg/dns" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/onsi/gomega/types" "github.com/stretchr/testify/mock" ) var _ = Describe("SudnResolver", Label("sudnResolver"), func() { var ( - sut *SpecialUseDomainNamesResolver - m *mockResolver + sut *SpecialUseDomainNamesResolver + sutConfig config.SUDNConfig + m *mockResolver ) Describe("Type", func() { @@ -24,136 +28,154 @@ var _ = Describe("SudnResolver", Label("sudnResolver"), func() { }) BeforeEach(func() { + var err error + + sutConfig, err = config.WithDefaults[config.SUDNConfig]() + Expect(err).Should(Succeed()) + }) + + JustBeforeEach(func() { mockAnswer, err := util.NewMsgWithAnswer("example.com.", 300, A, "123.145.123.145") Expect(err).Should(Succeed()) m = &mockResolver{} m.On("Resolve", mock.Anything).Return(&Response{Res: mockAnswer}, nil) - sut = NewSpecialUseDomainNamesResolver().(*SpecialUseDomainNamesResolver) + sut = NewSpecialUseDomainNamesResolver(sutConfig).(*SpecialUseDomainNamesResolver) sut.Next(m) }) - Describe("IsEnabled", func() { - It("is true", func() { - Expect(sut.IsEnabled()).Should(BeTrue()) - }) - }) + Describe("handlers", func() { + It("should have correct response type", func() { + for domain, handler := range sudnHandlers { + resp, err := sut.Resolve(newRequest(domain, A)) + Expect(err).Should(Succeed()) - Describe("LogConfig", func() { - It("should not log anything", func() { - logger, hook := log.NewMockEntry() + if handler == nil { + Expect(resp).ShouldNot(HaveResponseType(ResponseTypeSPECIAL)) - sut.LogConfig(logger) + continue + } - Expect(hook.Calls).ShouldNot(BeEmpty()) - }) - }) - - Describe("Blocking special names", func() { - It("should block arpa", func() { - for _, arpa := range sudnArpaSlice() { - Expect(sut.Resolve(newRequest(arpa, A))). + Expect(resp). Should( SatisfyAll( - HaveNoAnswer(), HaveResponseType(ResponseTypeSPECIAL), - HaveReturnCode(dns.RcodeNameError), HaveReason("Special-Use Domain Name"), )) } }) - - It("should block test", func() { - Expect(sut.Resolve(newRequest(sudnTest, A))). - Should( - SatisfyAll( - HaveNoAnswer(), - HaveResponseType(ResponseTypeSPECIAL), - HaveReturnCode(dns.RcodeNameError), - HaveReason("Special-Use Domain Name"), - )) - }) - - It("should block invalid", func() { - Expect(sut.Resolve(newRequest(sudnInvalid, A))). - Should( - SatisfyAll( - HaveNoAnswer(), - HaveResponseType(ResponseTypeSPECIAL), - HaveReturnCode(dns.RcodeNameError), - HaveReason("Special-Use Domain Name"), - )) - }) - - It("should block localhost none A", func() { - Expect(sut.Resolve(newRequest(sudnLocalhost, HTTPS))). - Should( - SatisfyAll( - HaveNoAnswer(), - HaveResponseType(ResponseTypeSPECIAL), - HaveReturnCode(dns.RcodeNameError), - HaveReason("Special-Use Domain Name"), - )) - }) - - It("should block local", func() { - Expect(sut.Resolve(newRequest(mdnsLocal, A))). - Should( - SatisfyAll( - HaveNoAnswer(), - HaveResponseType(ResponseTypeSPECIAL), - HaveReturnCode(dns.RcodeNameError), - HaveReason("Special-Use Domain Name"), - )) - }) - - It("should block localhost none A", func() { - Expect(sut.Resolve(newRequest(mdnsLocal, HTTPS))). - Should( - SatisfyAll( - HaveNoAnswer(), - HaveResponseType(ResponseTypeSPECIAL), - HaveReturnCode(dns.RcodeNameError), - HaveReason("Special-Use Domain Name"), - )) - }) }) - Describe("Resolve localhost", func() { - It("should resolve IPv4 loopback", func() { - Expect(sut.Resolve(newRequest(sudnLocalhost, A))). - Should( - SatisfyAll( - BeDNSRecord(sudnLocalhost, A, sut.defaults.loopbackV4.String()), - HaveTTL(BeNumerically("==", 0)), - HaveResponseType(ResponseTypeSPECIAL), - HaveReturnCode(dns.RcodeSuccess), - )) + Describe("Resolve", func() { + //nolint:unparam // linter thinks `qName` is always `A` because of "RFC 6762 Appendix G" table + entry := func(qType dns.Type, qName string, expectedRCode int, extraMatchers ...any) TableEntry { + GinkgoHelper() + + var verb string + switch expectedRCode { + case dns.RcodeSuccess: + verb = "resolve" + case dns.RcodeNameError: + verb = "block" + } + + description := fmt.Sprintf("should %s %s IN %s", verb, qName, qType) + + args := []any{qType, qName, expectedRCode} + args = append(args, extraMatchers...) + + return Entry(description, args...) + } + + DescribeTable("handled domains", + func(qType dns.Type, qName string, expectedRCode int, extraMatchers ...types.GomegaMatcher) { + resp, err := sut.Resolve(newRequest(qName, qType)) + Expect(err).Should(Succeed()) + Expect(resp).Should(SatisfyAll( + HaveResponseType(ResponseTypeSPECIAL), + HaveReason("Special-Use Domain Name"), + HaveReturnCode(expectedRCode), + )) + + switch expectedRCode { + case dns.RcodeSuccess: + Expect(resp).Should(HaveTTL(BeNumerically("==", 0))) + case dns.RcodeNameError: + Expect(resp).Should(HaveNoAnswer()) + } + + Expect(resp).Should(SatisfyAll(extraMatchers...)) + }, + + entry(A, "1.0.0.10.in-addr.arpa.", dns.RcodeNameError), + entry(A, "something.test.", dns.RcodeNameError), + entry(A, "something.localhost.", dns.RcodeSuccess, BeDNSRecord("something.localhost.", A, loopbackV4.String())), + entry(AAAA, "thing.localhost.", dns.RcodeSuccess, BeDNSRecord("thing.localhost.", AAAA, loopbackV6.String())), + entry(HTTPS, "something.localhost.", dns.RcodeNameError), + entry(A, "something.invalid.", dns.RcodeNameError), + entry(A, "something.local.", dns.RcodeNameError), + entry(HTTPS, "something.local.", dns.RcodeNameError), + entry(A, "1.0.254.169.in-addr.arpa.", dns.RcodeNameError), + entry(A, "something.intranet.", dns.RcodeNameError), + entry(A, "something.internal.", dns.RcodeNameError), + entry(A, "something.private.", dns.RcodeNameError), + entry(A, "something.corp.", dns.RcodeNameError), + entry(A, "something.home.", dns.RcodeNameError), + entry(A, "something.lan.", dns.RcodeNameError), + entry(A, "something.onion.", dns.RcodeNameError), + ) + + When("RFC 6762 Appendix G is disabled", func() { + BeforeEach(func() { + sutConfig.RFC6762AppendixG = false + }) + + DescribeTable("", + func(qType dns.Type, qName string, expectedRCode int) { + resp, err := sut.Resolve(newRequest(qName, qType)) + Expect(err).Should(Succeed()) + Expect(resp).Should(HaveReturnCode(expectedRCode)) + Expect(resp).ShouldNot(HaveResponseType(ResponseTypeSPECIAL)) + }, + + entry(A, "something.intranet.", dns.RcodeSuccess), + entry(A, "something.intranet.", dns.RcodeSuccess), + entry(A, "something.internal.", dns.RcodeSuccess), + entry(A, "something.private.", dns.RcodeSuccess), + entry(A, "something.corp.", dns.RcodeSuccess), + entry(A, "something.home.", dns.RcodeSuccess), + entry(A, "something.lan.", dns.RcodeSuccess), + ) }) - It("should resolve IPv6 loopback", func() { - Expect(sut.Resolve(newRequest(sudnLocalhost, AAAA))). + It("should forward example.com", func() { + Expect(sut.Resolve(newRequest("example.com", A))). Should( SatisfyAll( - BeDNSRecord(sudnLocalhost, AAAA, sut.defaults.loopbackV6.String()), - HaveTTL(BeNumerically("==", 0)), - HaveResponseType(ResponseTypeSPECIAL), + BeDNSRecord("example.com.", A, "123.145.123.145"), + HaveTTL(BeNumerically("==", 300)), + HaveResponseType(ResponseTypeRESOLVED), HaveReturnCode(dns.RcodeSuccess), )) }) - }) - Describe("Forward other", func() { - It("should forward example.com", func() { - Expect(sut.Resolve(newRequest("example.com", A))). + It("should forward home.arpa. IN DS", func() { + Expect(sut.Resolve(newRequest("something.home.arpa.", DS))). Should( SatisfyAll( + // setup code doesn't care about the question BeDNSRecord("example.com.", A, "123.145.123.145"), HaveTTL(BeNumerically("==", 300)), HaveResponseType(ResponseTypeRESOLVED), HaveReturnCode(dns.RcodeSuccess), )) }) + + It("should forward non special use domains", func() { + resp, err := sut.Resolve(newRequest("something.not-special.", AAAA)) + Expect(err).Should(Succeed()) + Expect(resp).ShouldNot(HaveResponseType(ResponseTypeSPECIAL)) + }) }) }) diff --git a/server/server.go b/server/server.go index 8f949b7f5..20e5a9ea9 100644 --- a/server/server.go +++ b/server/server.go @@ -425,7 +425,7 @@ func createQueryResolver( blocking, resolver.NewCachingResolver(cfg.Caching, redisClient), resolver.NewRewriterResolver(cfg.Conditional.RewriterConfig, condUpstream), - resolver.NewSpecialUseDomainNamesResolver(), + resolver.NewSpecialUseDomainNamesResolver(cfg.SUDN), parallel, ) From 1f2f87557546eff0d9f2834872b1a62e7e47e4c9 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Sun, 9 Jul 2023 12:03:42 -0400 Subject: [PATCH 66/92] ci(docs): show pages URL in step summary --- .github/workflows/docs.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 17818e337..a8112339b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,10 +26,11 @@ jobs: git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" - - name: Deploy version for branch - if: ${{ startsWith(github.ref, 'refs/heads/') }} - run: mike deploy --push --update-aliases "$(sed 's:/:-:g' <<< "${GITHUB_REF_NAME}")" - - - name: Deploy version for tag and update latest - if: ${{ startsWith(github.ref, 'refs/tags/') }} - run: mike deploy --push --update-aliases "${GITHUB_REF_NAME}" latest + - name: Deploy version + run: | + VERSION="$(sed 's:/:-:g' <<< "$GITHUB_REF_NAME")" + if [[ ${{github.ref}} =~ ^refs/tags/ ]]; then + EXTRA_ALIAS=latest + fi + mike deploy --push --update-aliases "$VERSION" $EXTRA_ALIAS + tr '[:upper:]' '[:lower:]' <<< "https://${{github.repository_owner}}.github.io/${{github.event.repository.name}}/$VERSION/" >> "$GITHUB_STEP_SUMMARY" From 2902c6ffe3d558e671ba323b342640d8f408f489 Mon Sep 17 00:00:00 2001 From: Dimitri Herzog Date: Thu, 27 Jul 2023 10:48:05 +0200 Subject: [PATCH 67/92] test: temporarily downgrade golang version pinning to 1.20.5 until https://github.com/testcontainers/testcontainers-go/issues/1359 is resolved --- .github/workflows/makefile.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index fa4809c21..813ef04ba 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -50,7 +50,9 @@ jobs: uses: actions/setup-go@v4 if: matrix.go == true with: - go-version-file: go.mod + #pinning to 1.20.5 until https://github.com/testcontainers/testcontainers-go/issues/1359 is resolved + go-version: "1.20.5" + #go-version-file: go.mod - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 From dc9bba59a111174f57270e8aeca182adcf7b9b7e Mon Sep 17 00:00:00 2001 From: DerRockWolf <50499906+DerRockWolf@users.noreply.github.com> Date: Thu, 27 Jul 2023 18:08:36 +0200 Subject: [PATCH 68/92] fix: use correct resolver in "using response from resolver" debug log (#1082) --- resolver/parallel_best_resolver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resolver/parallel_best_resolver.go b/resolver/parallel_best_resolver.go index f4d14584f..a77baec38 100644 --- a/resolver/parallel_best_resolver.go +++ b/resolver/parallel_best_resolver.go @@ -56,12 +56,14 @@ func (r *upstreamResolverStatus) resolve(req *model.Request, ch chan<- requestRe } ch <- requestResponse{ + resolver: &r.resolver, response: resp, err: err, } } type requestResponse struct { + resolver *Resolver response *model.Response err error } @@ -240,7 +242,7 @@ func (r *ParallelBestResolver) Resolve(request *model.Request) (*model.Response, collectedErrors = append(collectedErrors, result.err) } else { logger.WithFields(logrus.Fields{ - "resolver": r1.resolver, + "resolver": *result.resolver, "answer": util.AnswerToString(result.response.Res.Answer), }).Debug("using response from resolver") From 417a3538d854824aaf037928b1094c13ef853632 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jul 2023 19:32:19 +0000 Subject: [PATCH 69/92] build(deps): bump github.com/abice/go-enum from 0.5.6 to 0.5.7 Bumps [github.com/abice/go-enum](https://github.com/abice/go-enum) from 0.5.6 to 0.5.7. - [Release notes](https://github.com/abice/go-enum/releases) - [Changelog](https://github.com/abice/go-enum/blob/master/.goreleaser.yml) - [Commits](https://github.com/abice/go-enum/compare/v0.5.6...v0.5.7) --- updated-dependencies: - dependency-name: github.com/abice/go-enum dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 25 +++++++++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index e99d11f42..add4f7626 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/0xERR0R/blocky go 1.20 require ( - github.com/abice/go-enum v0.5.6 + github.com/abice/go-enum v0.5.7 github.com/alicebob/miniredis/v2 v2.30.4 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef github.com/avast/retry-go/v4 v4.3.4 @@ -108,7 +108,7 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.16 // indirect github.com/mattn/go-sqlite3 v1.14.16 // indirect - github.com/mattn/goveralls v0.0.11 // indirect + github.com/mattn/goveralls v0.0.12 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect @@ -121,7 +121,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect - github.com/urfave/cli/v2 v2.25.1 // indirect + github.com/urfave/cli/v2 v2.25.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect golang.org/x/crypto v0.11.0 // indirect diff --git a/go.sum b/go.sum index 880795384..7e76dbd7a 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,8 @@ github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v github.com/Microsoft/hcsshim v0.9.7 h1:mKNHW/Xvv1aFH87Jb6ERDzXTJTLPlmzfZ28VBFD/bfg= github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5 h1:3ubNg+3q/Y3lqxga0G90jste3i+HGDgrlPXK/feKUEI= github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5/go.mod h1:hkcYs23P9zbezt09v8168B4lt69PGuoxRPQ6IJHKpHo= -github.com/abice/go-enum v0.5.6 h1:Ury51IQXUppbIl56MqRU/++A8SSeLG4plePphPjxW1s= -github.com/abice/go-enum v0.5.6/go.mod h1:X2GpCT8VkCXLkVm48hebWx3cVgFJ8zM5nY5iUrJZO1Q= +github.com/abice/go-enum v0.5.7 h1:vOrobjpce5D/x5hYNqrWRkFUXFk7A6BlsJyVy4BS1jM= +github.com/abice/go-enum v0.5.7/go.mod h1:FBDp+2Ygv9ZZzgcd+Gx3XbyClH7xxFfw8ghMrOpwu+A= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOSchFS7Eo= @@ -171,8 +171,8 @@ github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peK github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/mattn/goveralls v0.0.11 h1:eJXea6R6IFlL1QMKNMzDvvHv/hwGrnvyig4N+0+XiMM= -github.com/mattn/goveralls v0.0.11/go.mod h1:gU8SyhNswsJKchEV93xRQxX6X3Ei4PJdQk/6ZHvrvRk= +github.com/mattn/goveralls v0.0.12 h1:PEEeF0k1SsTjOBQ8FOmrOAoCu4ytuMaWCnWe94zxbCg= +github.com/mattn/goveralls v0.0.12/go.mod h1:44ImGEUfmqH8bBtaMrYKsM65LXfNLWmwaxFGjZwgMSQ= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= @@ -264,8 +264,8 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG github.com/testcontainers/testcontainers-go v0.21.0 h1:syePAxdeTzfkap+RrJaQZpJQ/s/fsUgn11xIvHrOE9U= github.com/testcontainers/testcontainers-go v0.21.0/go.mod h1:c1ez3WVRHq7T/Aj+X3TIipFBwkBaNT5iNCY8+1b83Ng= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw= -github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= +github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= @@ -293,6 +293,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -304,6 +306,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -312,6 +316,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -338,17 +343,23 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= @@ -358,6 +369,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8= golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= golang.org/x/tools/cmd/cover v0.1.0-deprecated h1:Rwy+mWYz6loAF+LnG1jHG/JWMHRMMC2/1XX3Ejkx9lA= From d3fc1bc099d0992f37f9403f123c77a56b99121c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jul 2023 19:32:28 +0000 Subject: [PATCH 70/92] build(deps): bump github.com/onsi/gomega from 1.27.8 to 1.27.10 Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.8 to 1.27.10. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.27.8...v1.27.10) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index add4f7626..b2d4eb397 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/miekg/dns v1.1.55 github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.11.0 - github.com/onsi/gomega v1.27.8 + github.com/onsi/gomega v1.27.10 github.com/prometheus/client_golang v1.16.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 diff --git a/go.sum b/go.sum index 7e76dbd7a..85f6de874 100644 --- a/go.sum +++ b/go.sum @@ -202,8 +202,8 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= -github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= -github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= From 3a1310307b204e37fb592f07838ffd3e041284c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 04:58:35 +0000 Subject: [PATCH 71/92] build(deps): bump golang.org/x/tools from 0.11.0 to 0.11.1 Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.11.0 to 0.11.1. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.11.0...v0.11.1) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b2d4eb397..39f6a73ed 100644 --- a/go.mod +++ b/go.mod @@ -130,7 +130,7 @@ require ( golang.org/x/sys v0.10.0 // indirect golang.org/x/term v0.10.0 // indirect golang.org/x/text v0.11.0 // indirect - golang.org/x/tools v0.11.0 + golang.org/x/tools v0.11.1 google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 85f6de874..bdebf7e55 100644 --- a/go.sum +++ b/go.sum @@ -371,8 +371,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= -golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8= -golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= +golang.org/x/tools v0.11.1 h1:ojD5zOW8+7dOGzdnNgersm8aPfcDjhMp12UfG93NIMc= +golang.org/x/tools v0.11.1/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= golang.org/x/tools/cmd/cover v0.1.0-deprecated h1:Rwy+mWYz6loAF+LnG1jHG/JWMHRMMC2/1XX3Ejkx9lA= golang.org/x/tools/cmd/cover v0.1.0-deprecated/go.mod h1:hMDiIvlpN1NoVgmjLjUJE9tMHyxHjFX7RuQ+rW12mSA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 639fba53232054fcb12f36347a555f072264d671 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Fri, 28 Jul 2023 17:55:47 -0400 Subject: [PATCH 72/92] refactor(config): allow more configuration for `upstreams` Rename the `upstream` option to `upstreams.groups` so we can have more `upstreams` options. --- cmd/root_test.go | 7 ++-- config/config.go | 25 ++++++----- config/config_test.go | 30 +++++++------- config/migration/migration.go | 4 ++ config/parallel_best.go | 32 --------------- config/upstreams.go | 35 ++++++++++++++++ ...arallel_best_test.go => upstreams_test.go} | 16 +++++--- docs/config.yml | 40 +++++++++--------- docs/configuration.md | 38 +++++++++-------- e2e/basic_test.go | 21 ++++++---- e2e/blocking_test.go | 21 ++++++---- e2e/metrics_test.go | 7 ++-- e2e/querylog_test.go | 14 ++++--- e2e/redis_test.go | 28 +++++++------ e2e/upstream_test.go | 41 +++++++++++-------- resolver/bootstrap.go | 4 +- resolver/conditional_upstream_resolver.go | 4 +- resolver/parallel_best_resolver.go | 8 ++-- resolver/parallel_best_resolver_test.go | 39 +++++++++--------- resolver/upstream_resolver.go | 2 +- server/server.go | 2 +- server/server_test.go | 16 ++++---- 22 files changed, 236 insertions(+), 198 deletions(-) delete mode 100644 config/parallel_best.go create mode 100644 config/upstreams.go rename config/{parallel_best_test.go => upstreams_test.go} (78%) diff --git a/cmd/root_test.go b/cmd/root_test.go index d2a7d42f0..73c065897 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -37,9 +37,10 @@ var _ = Describe("root command", func() { DeferCleanup(tmpDir.Clean) tmpFile = tmpDir.CreateStringFile("config", - "upstream:", - " default:", - " - 1.1.1.1", + "upstreams:", + " groups:", + " default:", + " - 1.1.1.1", "blocking:", " blackLists:", " ads:", diff --git a/config/config.go b/config/config.go index 852364938..54be72bdd 100644 --- a/config/config.go +++ b/config/config.go @@ -185,8 +185,7 @@ func (b *BootstrappedUpstreamConfig) UnmarshalYAML(unmarshal func(interface{}) e // //nolint:maligned type Config struct { - Upstream ParallelBestConfig `yaml:"upstream"` - UpstreamTimeout Duration `yaml:"upstreamTimeout" default:"2s"` + Upstreams UpstreamsConfig `yaml:"upstreams"` ConnectIPVersion IPVersion `yaml:"connectIPVersion"` CustomDNS CustomDNSConfig `yaml:"customDNS"` Conditional ConditionalUpstreamConfig `yaml:"conditional"` @@ -212,15 +211,17 @@ type Config struct { // Deprecated options Deprecated struct { - DisableIPv6 *bool `yaml:"disableIPv6"` - LogLevel *log.Level `yaml:"logLevel"` - LogFormat *log.FormatType `yaml:"logFormat"` - LogPrivacy *bool `yaml:"logPrivacy"` - LogTimestamp *bool `yaml:"logTimestamp"` - DNSPorts *ListenConfig `yaml:"port"` - HTTPPorts *ListenConfig `yaml:"httpPort"` - HTTPSPorts *ListenConfig `yaml:"httpsPort"` - TLSPorts *ListenConfig `yaml:"tlsPort"` + Upstream *UpstreamGroups `yaml:"upstream"` + UpstreamTimeout *Duration `yaml:"upstreamTimeout"` + DisableIPv6 *bool `yaml:"disableIPv6"` + LogLevel *log.Level `yaml:"logLevel"` + LogFormat *log.FormatType `yaml:"logFormat"` + LogPrivacy *bool `yaml:"logPrivacy"` + LogTimestamp *bool `yaml:"logTimestamp"` + DNSPorts *ListenConfig `yaml:"port"` + HTTPPorts *ListenConfig `yaml:"httpPort"` + HTTPSPorts *ListenConfig `yaml:"httpsPort"` + TLSPorts *ListenConfig `yaml:"tlsPort"` } `yaml:",inline"` } @@ -489,6 +490,8 @@ func unmarshalConfig(data []byte, cfg *Config) error { func (cfg *Config) migrate(logger *logrus.Entry) bool { usesDepredOpts := Migrate(logger, "", cfg.Deprecated, map[string]Migrator{ + "upstream": Move(To("upstreams.groups", &cfg.Upstreams)), + "upstreamTimeout": Move(To("upstreams.timeout", &cfg.Upstreams)), "disableIPv6": Apply(To("filtering.queryTypes", &cfg.Filtering), func(oldValue bool) { if oldValue { cfg.Filtering.QueryTypes.Insert(dns.Type(dns.TypeAAAA)) diff --git a/config/config_test.go b/config/config_test.go index 15851f963..02f27b803 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -762,10 +762,10 @@ bootstrapDns: func defaultTestFileConfig() { Expect(config.Ports.DNS).Should(Equal(ListenConfig{"55553", ":55554", "[::1]:55555"})) - Expect(config.Upstream.ExternalResolvers["default"]).Should(HaveLen(3)) - Expect(config.Upstream.ExternalResolvers["default"][0].Host).Should(Equal("8.8.8.8")) - Expect(config.Upstream.ExternalResolvers["default"][1].Host).Should(Equal("8.8.4.4")) - Expect(config.Upstream.ExternalResolvers["default"][2].Host).Should(Equal("1.1.1.1")) + Expect(config.Upstreams.Groups["default"]).Should(HaveLen(3)) + Expect(config.Upstreams.Groups["default"][0].Host).Should(Equal("8.8.8.8")) + Expect(config.Upstreams.Groups["default"][1].Host).Should(Equal("8.8.4.4")) + Expect(config.Upstreams.Groups["default"][2].Host).Should(Equal("1.1.1.1")) Expect(config.CustomDNS.Mapping.HostIPs).Should(HaveLen(2)) Expect(config.CustomDNS.Mapping.HostIPs["my.duckdns.org"][0]).Should(Equal(net.ParseIP("192.168.178.3"))) Expect(config.CustomDNS.Mapping.HostIPs["multiple.ips"][0]).Should(Equal(net.ParseIP("192.168.178.3"))) @@ -797,11 +797,12 @@ func defaultTestFileConfig() { func writeConfigYml(tmpDir *helpertest.TmpFolder) *helpertest.TmpFile { return tmpDir.CreateStringFile("config.yml", - "upstream:", - " default:", - " - tcp+udp:8.8.8.8", - " - tcp+udp:8.8.4.4", - " - 1.1.1.1", + "upstreams:", + " groups:", + " default:", + " - tcp+udp:8.8.8.8", + " - tcp+udp:8.8.4.4", + " - 1.1.1.1", "customDNS:", " mapping:", " my.duckdns.org: 192.168.178.3", @@ -856,11 +857,12 @@ func writeConfigYml(tmpDir *helpertest.TmpFolder) *helpertest.TmpFile { func writeConfigDir(tmpDir *helpertest.TmpFolder) error { f1 := tmpDir.CreateStringFile("config1.yaml", - "upstream:", - " default:", - " - tcp+udp:8.8.8.8", - " - tcp+udp:8.8.4.4", - " - 1.1.1.1", + "upstreams:", + " groups:", + " default:", + " - tcp+udp:8.8.8.8", + " - tcp+udp:8.8.4.4", + " - 1.1.1.1", "customDNS:", " mapping:", " my.duckdns.org: 192.168.178.3", diff --git a/config/migration/migration.go b/config/migration/migration.go index 66a394e8c..af4b89855 100644 --- a/config/migration/migration.go +++ b/config/migration/migration.go @@ -41,6 +41,10 @@ func Migrate(logger *logrus.Entry, optPrefix string, deprecated any, newOptions panic(fmt.Errorf("deprecated option %s must be a pointer", oldName)) } + if field.Tag.Get("default") != "" { + panic(fmt.Errorf("deprecated option %s must not have a default", oldName)) + } + if val.IsNil() { // Deprecated option is not defined in the user's config continue diff --git a/config/parallel_best.go b/config/parallel_best.go deleted file mode 100644 index 6ce735430..000000000 --- a/config/parallel_best.go +++ /dev/null @@ -1,32 +0,0 @@ -package config - -import ( - "github.com/sirupsen/logrus" -) - -const UpstreamDefaultCfgName = "default" - -// ParallelBestConfig upstream server configuration -type ParallelBestConfig struct { - ExternalResolvers ParallelBestMapping `yaml:",inline"` -} - -type ParallelBestMapping map[string][]Upstream - -// IsEnabled implements `config.Configurable`. -func (c *ParallelBestConfig) IsEnabled() bool { - return len(c.ExternalResolvers) != 0 -} - -// LogConfig implements `config.Configurable`. -func (c *ParallelBestConfig) LogConfig(logger *logrus.Entry) { - logger.Info("upstream resolvers:") - - for name, upstreams := range c.ExternalResolvers { - logger.Infof(" %s:", name) - - for _, upstream := range upstreams { - logger.Infof(" - %s", upstream) - } - } -} diff --git a/config/upstreams.go b/config/upstreams.go new file mode 100644 index 000000000..7343f5c36 --- /dev/null +++ b/config/upstreams.go @@ -0,0 +1,35 @@ +package config + +import ( + "github.com/sirupsen/logrus" +) + +const UpstreamDefaultCfgName = "default" + +// UpstreamsConfig upstream servers configuration +type UpstreamsConfig struct { + Timeout Duration `yaml:"timeout" default:"2s"` + Groups UpstreamGroups `yaml:"groups"` +} + +type UpstreamGroups map[string][]Upstream + +// IsEnabled implements `config.Configurable`. +func (c *UpstreamsConfig) IsEnabled() bool { + return len(c.Groups) != 0 +} + +// LogConfig implements `config.Configurable`. +func (c *UpstreamsConfig) LogConfig(logger *logrus.Entry) { + logger.Info("timeout: ", c.Timeout) + + logger.Info("groups:") + + for name, upstreams := range c.Groups { + logger.Infof(" %s:", name) + + for _, upstream := range upstreams { + logger.Infof(" - %s", upstream) + } + } +} diff --git a/config/parallel_best_test.go b/config/upstreams_test.go similarity index 78% rename from config/parallel_best_test.go rename to config/upstreams_test.go index 9acef009e..07b2653e1 100644 --- a/config/parallel_best_test.go +++ b/config/upstreams_test.go @@ -1,19 +1,22 @@ package config import ( + "time" + "github.com/creasty/defaults" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) var _ = Describe("ParallelBestConfig", func() { - var cfg ParallelBestConfig + var cfg UpstreamsConfig suiteBeforeEach() BeforeEach(func() { - cfg = ParallelBestConfig{ - ExternalResolvers: ParallelBestMapping{ + cfg = UpstreamsConfig{ + Timeout: Duration(5 * time.Second), + Groups: UpstreamGroups{ UpstreamDefaultCfgName: { {Host: "host1"}, {Host: "host2"}, @@ -24,7 +27,7 @@ var _ = Describe("ParallelBestConfig", func() { Describe("IsEnabled", func() { It("should be false by default", func() { - cfg := ParallelBestConfig{} + cfg := UpstreamsConfig{} Expect(defaults.Set(&cfg)).Should(Succeed()) Expect(cfg.IsEnabled()).Should(BeFalse()) @@ -38,7 +41,7 @@ var _ = Describe("ParallelBestConfig", func() { When("disabled", func() { It("should be false", func() { - cfg := ParallelBestConfig{} + cfg := UpstreamsConfig{} Expect(cfg.IsEnabled()).Should(BeFalse()) }) @@ -50,7 +53,8 @@ var _ = Describe("ParallelBestConfig", func() { cfg.LogConfig(logger) Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("upstream resolvers:"))) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("timeout:"))) + Expect(hook.Messages).Should(ContainElement(ContainSubstring("groups:"))) Expect(hook.Messages).Should(ContainElement(ContainSubstring(":host2:"))) }) }) diff --git a/docs/config.yml b/docs/config.yml index 98a21c2d6..2acd36b43 100644 --- a/docs/config.yml +++ b/docs/config.yml @@ -1,25 +1,25 @@ # REVIEW: manual changelog entry -upstream: - # these external DNS resolvers will be used. Blocky picks 2 random resolvers from the list for each query - # format for resolver: [net:]host:[port][/path]. net could be empty (default, shortcut for tcp+udp), tcp+udp, tcp, udp, tcp-tls or https (DoH). If port is empty, default port will be used (53 for udp and tcp, 853 for tcp-tls, 443 for https (Doh)) - # this configuration is mandatory, please define at least one external DNS resolver - default: - # example for tcp+udp IPv4 server (https://digitalcourage.de/) - - 5.9.164.112 - # Cloudflare - - 1.1.1.1 - # example for DNS-over-TLS server (DoT) - - tcp-tls:fdns1.dismail.de:853 - # example for DNS-over-HTTPS (DoH) - - https://dns.digitale-gesellschaft.ch/dns-query - # optional: use client name (with wildcard support: * - sequence of any characters, [0-9] - range) - # or single ip address / client subnet as CIDR notation - laptop*: - - 123.123.123.123 - -# optional: timeout to query the upstream resolver. Default: 2s -upstreamTimeout: 2s +upstreams: + groups: + # these external DNS resolvers will be used. Blocky picks 2 random resolvers from the list for each query + # format for resolver: [net:]host:[port][/path]. net could be empty (default, shortcut for tcp+udp), tcp+udp, tcp, udp, tcp-tls or https (DoH). If port is empty, default port will be used (53 for udp and tcp, 853 for tcp-tls, 443 for https (Doh)) + # this configuration is mandatory, please define at least one external DNS resolver + default: + # example for tcp+udp IPv4 server (https://digitalcourage.de/) + - 5.9.164.112 + # Cloudflare + - 1.1.1.1 + # example for DNS-over-TLS server (DoT) + - tcp-tls:fdns1.dismail.de:853 + # example for DNS-over-HTTPS (DoH) + - https://dns.digitale-gesellschaft.ch/dns-query + # optional: use client name (with wildcard support: * - sequence of any characters, [0-9] - range) + # or single ip address / client subnet as CIDR notation + laptop*: + - 123.123.123.123 + # optional: timeout to query the upstream resolver. Default: 2s + timeout: 2s # optional: If true, blocky will fail to start unless at least one upstream server per group is reachable. Default: false startVerifyUpstream: true diff --git a/docs/configuration.md b/docs/configuration.md index 3cf357718..6cb85163a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -68,7 +68,7 @@ All logging options are optional. privacy: true ``` -## Upstream configuration +## Upstreams configuration To resolve a DNS query, blocky needs external public or private DNS resolvers. Blocky supports DNS resolvers with following network protocols (net part of the resolver URL): @@ -107,17 +107,18 @@ CIDR notation. !!! example ```yaml - upstream: - default: - - 5.9.164.112 - - 1.1.1.1 - - tcp-tls:fdns1.dismail.de:853 - - https://dns.digitale-gesellschaft.ch/dns-query - laptop*: - - 123.123.123.123 - 10.43.8.67/28: - - 1.1.1.1 - - 9.9.9.9 + upstreams: + groups: + default: + - 5.9.164.112 + - 1.1.1.1 + - tcp-tls:fdns1.dismail.de:853 + - https://dns.digitale-gesellschaft.ch/dns-query + laptop*: + - 123.123.123.123 + 10.43.8.67/28: + - 1.1.1.1 + - 9.9.9.9 ``` Use `123.123.123.123` as single upstream DNS resolver for client laptop-home, @@ -133,16 +134,17 @@ public free DNS server you could use. ### Upstream lookup timeout Blocky will wait 2 seconds (default value) for the response from the external upstream DNS server. You can change this -value by setting the `upstreamTimeout` configuration parameter (in **duration format**). +value by setting the `timeout` configuration parameter (in **duration format**). !!! example ```yaml - upstream: - default: - - 46.182.19.48 - - 80.241.218.68 - upstreamTimeout: 5s + upstreams: + timeout: 5s + groups: + default: + - 46.182.19.48 + - 80.241.218.68 ``` ## Bootstrap DNS configuration diff --git a/e2e/basic_test.go b/e2e/basic_test.go index 8f689b2bc..5bf40dd01 100644 --- a/e2e/basic_test.go +++ b/e2e/basic_test.go @@ -27,9 +27,10 @@ var _ = Describe("Basic functional tests", func() { When("Minimal configuration is provided", func() { BeforeEach(func() { blocky, err = createBlockyContainer(tmpDir, - "upstream:", - " default:", - " - moka1", + "upstreams:", + " groups:", + " default:", + " - moka1", ) Expect(err).Should(Succeed()) @@ -58,9 +59,10 @@ var _ = Describe("Basic functional tests", func() { When("'httpPort' is not defined", func() { BeforeEach(func() { blocky, err = createBlockyContainer(tmpDir, - "upstream:", - " default:", - " - moka1", + "upstreams:", + " groups:", + " default:", + " - moka1", ) Expect(err).Should(Succeed()) @@ -78,9 +80,10 @@ var _ = Describe("Basic functional tests", func() { When("'httpPort' is defined", func() { BeforeEach(func() { blocky, err = createBlockyContainer(tmpDir, - "upstream:", - " default:", - " - moka1", + "upstreams:", + " groups:", + " default:", + " - moka1", "ports:", " http: 4000", ) diff --git a/e2e/blocking_test.go b/e2e/blocking_test.go index 087aa515d..49cc5c538 100644 --- a/e2e/blocking_test.go +++ b/e2e/blocking_test.go @@ -24,9 +24,10 @@ var _ = Describe("External lists and query blocking", func() { blocky, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - moka", + "upstreams:", + " groups:", + " default:", + " - moka", "blocking:", " loading:", " strategy: blocking", @@ -60,9 +61,10 @@ var _ = Describe("External lists and query blocking", func() { blocky, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - moka", + "upstreams:", + " groups:", + " default:", + " - moka", "blocking:", " loading:", " strategy: failOnError", @@ -98,9 +100,10 @@ var _ = Describe("External lists and query blocking", func() { blocky, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - moka", + "upstreams:", + " groups:", + " default:", + " - moka", "blocking:", " blackLists:", " ads:", diff --git a/e2e/metrics_test.go b/e2e/metrics_test.go index a5f2631ae..7194697be 100644 --- a/e2e/metrics_test.go +++ b/e2e/metrics_test.go @@ -37,9 +37,10 @@ var _ = Describe("Metrics functional tests", func() { DeferCleanup(httpServer2.Terminate) blocky, err = createBlockyContainer(tmpDir, - "upstream:", - " default:", - " - moka1", + "upstreams:", + " groups:", + " default:", + " - moka1", "blocking:", " blackLists:", " group1:", diff --git a/e2e/querylog_test.go b/e2e/querylog_test.go index cc4c19196..82dff9ade 100644 --- a/e2e/querylog_test.go +++ b/e2e/querylog_test.go @@ -35,9 +35,10 @@ var _ = Describe("Query logs functional tests", func() { blocky, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - moka1", + "upstreams:", + " groups:", + " default:", + " - moka1", "queryLog:", " type: mysql", " target: user:user@tcp(mariaDB:3306)/user?charset=utf8mb4&parseTime=True&loc=Local", @@ -111,9 +112,10 @@ var _ = Describe("Query logs functional tests", func() { blocky, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - moka1", + "upstreams:", + " groups:", + " default:", + " - moka1", "queryLog:", " type: postgresql", " target: postgres://user:user@postgres:5432/user", diff --git a/e2e/redis_test.go b/e2e/redis_test.go index 0aaa58f38..038cb3eea 100644 --- a/e2e/redis_test.go +++ b/e2e/redis_test.go @@ -46,9 +46,10 @@ var _ = Describe("Redis configuration tests", func() { blocky1, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - moka1", + "upstreams:", + " groups:", + " default:", + " - moka1", "redis:", " address: redis:6379", ) @@ -59,9 +60,10 @@ var _ = Describe("Redis configuration tests", func() { blocky2, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - moka1", + "upstreams:", + " groups:", + " default:", + " - moka1", "redis:", " address: redis:6379", ) @@ -111,9 +113,10 @@ var _ = Describe("Redis configuration tests", func() { blocky1, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - moka1", + "upstreams:", + " groups:", + " default:", + " - moka1", "redis:", " address: redis:6379", ) @@ -140,9 +143,10 @@ var _ = Describe("Redis configuration tests", func() { blocky2, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - moka1", + "upstreams:", + " groups:", + " default:", + " - moka1", "redis:", " address: redis:6379", ) diff --git a/e2e/upstream_test.go b/e2e/upstream_test.go index 1c8e9b766..d2743661d 100644 --- a/e2e/upstream_test.go +++ b/e2e/upstream_test.go @@ -19,9 +19,10 @@ var _ = Describe("Upstream resolver configuration tests", func() { blocky, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - 192.192.192.192", + "upstreams:", + " groups:", + " default:", + " - 192.192.192.192", "startVerifyUpstream: false", ) @@ -38,9 +39,10 @@ var _ = Describe("Upstream resolver configuration tests", func() { blocky, err = createBlockyContainer(tmpDir, "log:", " level: warn", - "upstream:", - " default:", - " - some.wrong.host", + "upstreams:", + " groups:", + " default:", + " - some.wrong.host", "startVerifyUpstream: false", ) @@ -55,9 +57,10 @@ var _ = Describe("Upstream resolver configuration tests", func() { When("'startVerifyUpstream' is true and upstream as IP address server is not reachable", func() { BeforeEach(func() { blocky, err = createBlockyContainer(tmpDir, - "upstream:", - " default:", - " - 192.192.192.192", + "upstreams:", + " groups:", + " default:", + " - 192.192.192.192", "startVerifyUpstream: true", ) @@ -73,9 +76,10 @@ var _ = Describe("Upstream resolver configuration tests", func() { When("'startVerifyUpstream' is true and upstream server as host name is not reachable", func() { BeforeEach(func() { blocky, err = createBlockyContainer(tmpDir, - "upstream:", - " default:", - " - some.wrong.host", + "upstreams:", + " groups:", + " default:", + " - some.wrong.host", "startVerifyUpstream: true", ) @@ -89,7 +93,7 @@ var _ = Describe("Upstream resolver configuration tests", func() { }) }) }) - Describe("'upstreamTimeout' parameter handling", func() { + Describe("'upstreams.timeout' parameter handling", func() { var moka testcontainers.Container BeforeEach(func() { moka, err = createDNSMokkaContainer("moka1", @@ -100,10 +104,11 @@ var _ = Describe("Upstream resolver configuration tests", func() { DeferCleanup(moka.Terminate) blocky, err = createBlockyContainer(tmpDir, - "upstream:", - " default:", - " - moka1", - "upstreamTimeout: 200ms", + "upstreams:", + " groups:", + " default:", + " - moka1", + " timeout: 200ms", ) Expect(err).Should(Succeed()) @@ -121,7 +126,7 @@ var _ = Describe("Upstream resolver configuration tests", func() { }) By("query with timeout", func() { - msg := util.NewMsgWithQuestion("delay.com/.", A) + msg := util.NewMsgWithQuestion("delay.com.", A) resp, err := doDNSRequest(blocky, msg) Expect(err).Should(Succeed()) diff --git a/resolver/bootstrap.go b/resolver/bootstrap.go index 27e2fa8ca..bcf593a41 100644 --- a/resolver/bootstrap.go +++ b/resolver/bootstrap.go @@ -64,7 +64,7 @@ func NewBootstrap(cfg *config.Config) (b *Bootstrap, err error) { // Bootstrap doesn't have a `LogConfig` method, and since that's the only place // where `ParallelBestResolver` uses its config, we can just use an empty one. - pbCfg := config.ParallelBestConfig{} + var pbCfg config.UpstreamsConfig parallelResolver, err := newParallelBestResolver(pbCfg, bootstraped.ResolverGroups()) if err != nil { @@ -115,7 +115,7 @@ func (b *Bootstrap) resolveUpstream(r Resolver, host string) ([]net.IP, error) { cfg := config.GetConfig() ctx := context.Background() - timeout := cfg.UpstreamTimeout + timeout := cfg.Upstreams.Timeout if timeout.IsAboveZero() { var cancel context.CancelFunc diff --git a/resolver/conditional_upstream_resolver.go b/resolver/conditional_upstream_resolver.go index 3173fc47c..1a0b2bb03 100644 --- a/resolver/conditional_upstream_resolver.go +++ b/resolver/conditional_upstream_resolver.go @@ -28,8 +28,8 @@ func NewConditionalUpstreamResolver( m := make(map[string]Resolver, len(cfg.Mapping.Upstreams)) for domain, upstream := range cfg.Mapping.Upstreams { - pbCfg := config.ParallelBestConfig{ - ExternalResolvers: config.ParallelBestMapping{ + pbCfg := config.UpstreamsConfig{ + Groups: config.UpstreamGroups{ upstreamDefaultCfgName: upstream, }, } diff --git a/resolver/parallel_best_resolver.go b/resolver/parallel_best_resolver.go index a77baec38..d3d87f022 100644 --- a/resolver/parallel_best_resolver.go +++ b/resolver/parallel_best_resolver.go @@ -27,7 +27,7 @@ const ( // ParallelBestResolver delegates the DNS message to 2 upstream resolvers and returns the fastest answer type ParallelBestResolver struct { - configurable[*config.ParallelBestConfig] + configurable[*config.UpstreamsConfig] typed resolversPerClient map[string][]*upstreamResolverStatus @@ -82,11 +82,11 @@ func testResolver(r *UpstreamResolver) error { // NewParallelBestResolver creates new resolver instance func NewParallelBestResolver( - cfg config.ParallelBestConfig, bootstrap *Bootstrap, shouldVerifyUpstreams bool, + cfg config.UpstreamsConfig, bootstrap *Bootstrap, shouldVerifyUpstreams bool, ) (*ParallelBestResolver, error) { logger := log.PrefixedLog(parallelResolverType) - upstreamResolvers := cfg.ExternalResolvers + upstreamResolvers := cfg.Groups resolverGroups := make(map[string][]Resolver, len(upstreamResolvers)) for name, upstreamCfgs := range upstreamResolvers { @@ -124,7 +124,7 @@ func NewParallelBestResolver( } func newParallelBestResolver( - cfg config.ParallelBestConfig, resolverGroups map[string][]Resolver, + cfg config.UpstreamsConfig, resolverGroups map[string][]Resolver, ) (*ParallelBestResolver, error) { resolversPerClient := make(map[string][]*upstreamResolverStatus, len(resolverGroups)) diff --git a/resolver/parallel_best_resolver_test.go b/resolver/parallel_best_resolver_test.go index b09159342..5544e6c5b 100644 --- a/resolver/parallel_best_resolver_test.go +++ b/resolver/parallel_best_resolver_test.go @@ -22,7 +22,7 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { var ( sut *ParallelBestResolver - sutMapping config.ParallelBestMapping + sutMapping config.UpstreamGroups sutVerify bool err error @@ -37,7 +37,7 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { }) BeforeEach(func() { - sutMapping = config.ParallelBestMapping{ + sutMapping = config.UpstreamGroups{ upstreamDefaultCfgName: { config.Upstream{ Host: "wrong", @@ -54,13 +54,14 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { }) JustBeforeEach(func() { - sutConfig := config.ParallelBestConfig{ExternalResolvers: sutMapping} + sutConfig := config.UpstreamsConfig{ + Timeout: config.Duration(1000 * time.Millisecond), + Groups: sutMapping, + } sut, err = NewParallelBestResolver(sutConfig, bootstrap, sutVerify) }) - config.GetConfig().UpstreamTimeout = config.Duration(1000 * time.Millisecond) - Describe("IsEnabled", func() { It("is true", func() { Expect(sut.IsEnabled()).Should(BeTrue()) @@ -85,8 +86,8 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { When("default upstream resolvers are not defined", func() { It("should fail on startup", func() { - _, err := NewParallelBestResolver(config.ParallelBestConfig{ - ExternalResolvers: config.ParallelBestMapping{}, + _, err := NewParallelBestResolver(config.UpstreamsConfig{ + Groups: config.UpstreamGroups{}, }, nil, noVerifyUpstreams) Expect(err).Should(HaveOccurred()) Expect(err.Error()).Should(ContainSubstring("no external DNS resolvers configured")) @@ -102,7 +103,7 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { }) defer mockUpstream.Close() - upstream := config.ParallelBestMapping{ + upstream := config.UpstreamGroups{ upstreamDefaultCfgName: { config.Upstream{ Host: "wrong", @@ -111,8 +112,8 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { }, } - _, err := NewParallelBestResolver(config.ParallelBestConfig{ - ExternalResolvers: upstream, + _, err := NewParallelBestResolver(config.UpstreamsConfig{ + Groups: upstream, }, systemResolverBootstrap, verifyUpstreams) Expect(err).Should(Not(HaveOccurred())) }) @@ -122,7 +123,7 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { BeforeEach(func() { bootstrap = newTestBootstrap(&dns.Msg{MsgHdr: dns.MsgHdr{Rcode: dns.RcodeServerFailure}}) - sutMapping = config.ParallelBestMapping{ + sutMapping = config.UpstreamGroups{ upstreamDefaultCfgName: { config.Upstream{ Host: "wrong", @@ -170,7 +171,7 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { }) DeferCleanup(slowTestUpstream.Close) - sutMapping = config.ParallelBestMapping{ + sutMapping = config.UpstreamGroups{ upstreamDefaultCfgName: {fastTestUpstream.Start(), slowTestUpstream.Start()}, } }) @@ -198,7 +199,7 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { return response }) DeferCleanup(slowTestUpstream.Close) - sutMapping = config.ParallelBestMapping{ + sutMapping = config.UpstreamGroups{ upstreamDefaultCfgName: {withErrorUpstream, slowTestUpstream.Start()}, } Expect(err).Should(Succeed()) @@ -220,7 +221,7 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { withError1 := config.Upstream{Host: "wrong"} withError2 := config.Upstream{Host: "wrong"} - sutMapping = config.ParallelBestMapping{ + sutMapping = config.UpstreamGroups{ upstreamDefaultCfgName: {withError1, withError2}, } Expect(err).Should(Succeed()) @@ -256,7 +257,7 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { WithAnswerRR("example.com 123 IN A 123.124.122.126") DeferCleanup(clientSpecificCIRDMockUpstream.Close) - sutMapping = config.ParallelBestMapping{ + sutMapping = config.UpstreamGroups{ upstreamDefaultCfgName: {defaultMockUpstream.Start()}, "laptop": {clientSpecificExactMockUpstream.Start()}, "client-*-m": {clientSpecificWildcardMockUpstream.Start()}, @@ -356,7 +357,7 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { mockUpstream := NewMockUDPUpstreamServer().WithAnswerRR("example.com 123 IN A 123.124.122.122") DeferCleanup(mockUpstream.Close) - sutMapping = config.ParallelBestMapping{ + sutMapping = config.UpstreamGroups{ upstreamDefaultCfgName: { mockUpstream.Start(), }, @@ -389,7 +390,7 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { mockUpstream2 := NewMockUDPUpstreamServer().WithAnswerRR("example.com 123 IN A 123.124.122.122") DeferCleanup(mockUpstream2.Close) - sut, _ := NewParallelBestResolver(config.ParallelBestConfig{ExternalResolvers: config.ParallelBestMapping{ + sut, _ := NewParallelBestResolver(config.UpstreamsConfig{Groups: config.UpstreamGroups{ upstreamDefaultCfgName: {withError1, mockUpstream1.Start(), mockUpstream2.Start(), withError2}, }}, systemResolverBootstrap, noVerifyUpstreams) @@ -452,8 +453,8 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { It("errors during construction", func() { b := newTestBootstrap(&dns.Msg{MsgHdr: dns.MsgHdr{Rcode: dns.RcodeServerFailure}}) - r, err := NewParallelBestResolver(config.ParallelBestConfig{ - ExternalResolvers: config.ParallelBestMapping{"test": {{Host: "example.com"}}}, + r, err := NewParallelBestResolver(config.UpstreamsConfig{ + Groups: config.UpstreamGroups{"test": {{Host: "example.com"}}}, }, b, verifyUpstreams) Expect(err).ShouldNot(Succeed()) diff --git a/resolver/upstream_resolver.go b/resolver/upstream_resolver.go index e42926d4a..85f2b71d1 100644 --- a/resolver/upstream_resolver.go +++ b/resolver/upstream_resolver.go @@ -53,7 +53,7 @@ type httpUpstreamClient struct { } func createUpstreamClient(cfg config.Upstream) upstreamClient { - timeout := config.GetConfig().UpstreamTimeout.ToDuration() + timeout := config.GetConfig().Upstreams.Timeout.ToDuration() tlsConfig := tls.Config{ ServerName: cfg.Host, diff --git a/server/server.go b/server/server.go index 20e5a9ea9..415a7e36a 100644 --- a/server/server.go +++ b/server/server.go @@ -397,7 +397,7 @@ func createQueryResolver( redisClient *redis.Client, ) (r resolver.Resolver, err error) { blocking, blErr := resolver.NewBlockingResolver(cfg.Blocking, redisClient, bootstrap) - parallel, pErr := resolver.NewParallelBestResolver(cfg.Upstream, bootstrap, cfg.StartVerifyUpstream) + parallel, pErr := resolver.NewParallelBestResolver(cfg.Upstreams, bootstrap, cfg.StartVerifyUpstream) clientNames, cnErr := resolver.NewClientNamesResolver(cfg.ClientLookup, bootstrap, cfg.StartVerifyUpstream) condUpstream, cuErr := resolver.NewConditionalUpstreamResolver(cfg.Conditional, bootstrap, cfg.StartVerifyUpstream) hostsFile, hfErr := resolver.NewHostsFileResolver(cfg.HostsFile, bootstrap) diff --git a/server/server_test.go b/server/server_test.go index 5d3a4ab36..1e5533344 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -143,8 +143,8 @@ var _ = BeforeSuite(func() { BlockType: "zeroIp", BlockTTL: config.Duration(6 * time.Hour), }, - Upstream: config.ParallelBestConfig{ - ExternalResolvers: map[string][]config.Upstream{"default": {upstreamGoogle}}, + Upstreams: config.UpstreamsConfig{ + Groups: map[string][]config.Upstream{"default": {upstreamGoogle}}, }, ClientLookup: config.ClientLookupConfig{ Upstream: upstreamClient, @@ -616,7 +616,7 @@ var _ = Describe("Running DNS server", func() { Expect(cErr).Should(Succeed()) - cfg.Upstream.ExternalResolvers = map[string][]config.Upstream{ + cfg.Upstreams.Groups = map[string][]config.Upstream{ "default": {config.Upstream{Net: config.NetProtocolTcpUdp, Host: "1.1.1.1", Port: 53}}, } @@ -643,8 +643,8 @@ var _ = Describe("Running DNS server", func() { It("start was called 2 times, start should fail", func() { // create server server, err := NewServer(&config.Config{ - Upstream: config.ParallelBestConfig{ - ExternalResolvers: map[string][]config.Upstream{ + Upstreams: config.UpstreamsConfig{ + Groups: map[string][]config.Upstream{ "default": {config.Upstream{Net: config.NetProtocolTcpUdp, Host: "4.4.4.4", Port: 53}}, }, }, @@ -685,8 +685,8 @@ var _ = Describe("Running DNS server", func() { It("stop was called 2 times, start should fail", func() { // create server server, err := NewServer(&config.Config{ - Upstream: config.ParallelBestConfig{ - ExternalResolvers: map[string][]config.Upstream{ + Upstreams: config.UpstreamsConfig{ + Groups: map[string][]config.Upstream{ "default": {config.Upstream{Net: config.NetProtocolTcpUdp, Host: "4.4.4.4", Port: 53}}, }, }, @@ -755,7 +755,7 @@ var _ = Describe("Running DNS server", func() { Expect(cErr).Should(Succeed()) - cfg.Upstream.ExternalResolvers = map[string][]config.Upstream{ + cfg.Upstreams.Groups = map[string][]config.Upstream{ "default": {config.Upstream{Net: config.NetProtocolTcpUdp, Host: "1.1.1.1", Port: 53}}, } }) From 2523165bc88f5f8b1d6ca6db61519de522ba26a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 04:50:01 +0000 Subject: [PATCH 73/92] build(deps): bump golang.org/x/net from 0.12.0 to 0.14.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.12.0 to 0.14.0. - [Commits](https://github.com/golang/net/compare/v0.12.0...v0.14.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 39f6a73ed..4bffc0ce9 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/swaggo/swag v1.16.1 github.com/x-cray/logrus-prefixed-formatter v0.5.2 - golang.org/x/net v0.12.0 + golang.org/x/net v0.14.0 gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.0 gorm.io/driver/postgres v1.5.2 @@ -124,12 +124,12 @@ require ( github.com/urfave/cli/v2 v2.25.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect - golang.org/x/crypto v0.11.0 // indirect + golang.org/x/crypto v0.12.0 // indirect golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea golang.org/x/mod v0.12.0 // indirect - golang.org/x/sys v0.10.0 // indirect - golang.org/x/term v0.10.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/term v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect golang.org/x/tools v0.11.1 google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index bdebf7e55..c2c412790 100644 --- a/go.sum +++ b/go.sum @@ -285,8 +285,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4= golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -308,8 +308,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= 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= @@ -345,23 +345,23 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= From 2dfef13a7997191d445ed17e44d20c3e4ccd79be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 04:44:55 +0000 Subject: [PATCH 74/92] build(deps): bump github.com/mroth/weightedrand/v2 from 2.0.1 to 2.0.2 Bumps [github.com/mroth/weightedrand/v2](https://github.com/mroth/weightedrand) from 2.0.1 to 2.0.2. - [Release notes](https://github.com/mroth/weightedrand/releases) - [Commits](https://github.com/mroth/weightedrand/compare/v2.0.1...v2.0.2) --- updated-dependencies: - dependency-name: github.com/mroth/weightedrand/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4bffc0ce9..9aff9b4f4 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/miekg/dns v1.1.55 - github.com/mroth/weightedrand/v2 v2.0.1 + github.com/mroth/weightedrand/v2 v2.0.2 github.com/onsi/ginkgo/v2 v2.11.0 github.com/onsi/gomega v1.27.10 github.com/prometheus/client_golang v1.16.0 diff --git a/go.sum b/go.sum index c2c412790..72bc7e72c 100644 --- a/go.sum +++ b/go.sum @@ -194,8 +194,8 @@ github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mroth/weightedrand/v2 v2.0.1 h1:zrEVDIaau/E4QLOKu02kpg8T8myweFlMGikIgbIdrRA= -github.com/mroth/weightedrand/v2 v2.0.1/go.mod h1:f2faGsfOGOwc1p94wzHKKZyTpcJUW7OJ/9U4yfiNAOU= +github.com/mroth/weightedrand/v2 v2.0.2 h1:A8wJRUBcfguGl6oOQHI8fy5P4ViGRT9hdQdlG/7RiXo= +github.com/mroth/weightedrand/v2 v2.0.2/go.mod h1:f2faGsfOGOwc1p94wzHKKZyTpcJUW7OJ/9U4yfiNAOU= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= From baf3cdbcb41bd34322c255103a8c380488e3f78b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 04:51:10 +0000 Subject: [PATCH 75/92] build(deps): bump github.com/testcontainers/testcontainers-go Bumps [github.com/testcontainers/testcontainers-go](https://github.com/testcontainers/testcontainers-go) from 0.21.0 to 0.22.0. - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](https://github.com/testcontainers/testcontainers-go/compare/v0.21.0...v0.22.0) --- updated-dependencies: - dependency-name: github.com/testcontainers/testcontainers-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 17 +++++++++-------- go.sum | 44 +++++++++++++++++++++++--------------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/go.mod b/go.mod index 9aff9b4f4..1ba27f719 100644 --- a/go.mod +++ b/go.mod @@ -40,40 +40,41 @@ require ( github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5 github.com/docker/go-connections v0.4.0 github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198 - github.com/testcontainers/testcontainers-go v0.21.0 + github.com/testcontainers/testcontainers-go v0.22.0 mvdan.cc/gofumpt v0.5.0 ) require ( + dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect - github.com/Microsoft/go-winio v0.5.2 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect github.com/cenkalti/backoff/v4 v4.2.0 // indirect - github.com/containerd/containerd v1.6.19 // indirect + github.com/containerd/containerd v1.7.3 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker v23.0.5+incompatible // indirect + github.com/docker/docker v24.0.5+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/pprof v0.0.0-20230309165930-d61513b1440d // indirect github.com/jackc/pgx/v5 v5.3.1 // indirect - github.com/klauspost/compress v1.11.13 // indirect + github.com/klauspost/compress v1.16.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/moby/patternmatcher v0.5.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect github.com/moby/term v0.5.0 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc2 // indirect + github.com/opencontainers/image-spec v1.1.0-rc4 // indirect github.com/opencontainers/runc v1.1.5 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/cast v1.3.1 // indirect golang.org/x/sync v0.3.0 // indirect golang.org/x/tools/cmd/cover v0.1.0-deprecated // indirect - google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect - google.golang.org/grpc v1.53.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect + google.golang.org/grpc v1.57.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 72bc7e72c..98738b5ca 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,6 @@ +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 h1:EKPd1INOIyr5hWOWhvpmQpY6tKjeG0hT1s3AMC/9fic= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -11,9 +14,9 @@ github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7Y github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/hcsshim v0.9.7 h1:mKNHW/Xvv1aFH87Jb6ERDzXTJTLPlmzfZ28VBFD/bfg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/hcsshim v0.10.0-rc.8 h1:YSZVvlIIDD1UxQpJp0h+dnpLUw+TrY0cx8obKsp3bek= github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5 h1:3ubNg+3q/Y3lqxga0G90jste3i+HGDgrlPXK/feKUEI= github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5/go.mod h1:hkcYs23P9zbezt09v8168B4lt69PGuoxRPQ6IJHKpHo= github.com/abice/go-enum v0.5.7 h1:vOrobjpce5D/x5hYNqrWRkFUXFk7A6BlsJyVy4BS1jM= @@ -39,9 +42,8 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.6.19 h1:F0qgQPrG0P2JPgwpxWxYavrVeXAG0ezUIB9Z/4FTUAU= -github.com/containerd/containerd v1.6.19/go.mod h1:HZCDMn4v/Xl2579/MvtOC2M206i+JJ6VxFWU/NetrGY= -github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/containerd v1.7.3 h1:cKwYKkP1eTj54bP3wCdXXBymmKRQMrWjkLSWZZJDa8o= +github.com/containerd/containerd v1.7.3/go.mod h1:32FOM4/O0RkNg7AjQj3hDzN9cUGtu+HMvaKUNiqCZB8= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= @@ -52,6 +54,7 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creasty/defaults v1.7.0 h1:eNdqZvc5B509z18lD8yc212CAqJNvfT1Jq6L8WowdBA= github.com/creasty/defaults v1.7.0/go.mod h1:iGzKe6pbEHnpMPtfDXZEr0NVxWnPTjb1bbDy08fPzYM= +github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= 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= @@ -60,8 +63,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v23.0.5+incompatible h1:DaxtlTJjFSnLOXVNUBU1+6kXGz2lpDoEAH6QoxaSg8k= -github.com/docker/docker v23.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v24.0.5+incompatible h1:WmgcE4fxyI6EEXxBRxsHnZXrO1pQ3smi0k/jho4HLeY= +github.com/docker/docker v24.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -71,7 +74,7 @@ github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198 h1:3b37D/Oxs95GmDsGK github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198/go.mod h1:NUrh34aXXgbs4C2HkTmRmkzsKhtrFPRitYkbZMDDONo= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= @@ -145,8 +148,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.11.13 h1:eSvu8Tmq6j2psUJqJrLcWH6K3w5Dwc+qipbaA6eVEN4= -github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -206,8 +209,8 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYBTS5Y4x/Cgeo1E0= +github.com/opencontainers/image-spec v1.1.0-rc4/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -234,7 +237,6 @@ github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -261,8 +263,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/testcontainers/testcontainers-go v0.21.0 h1:syePAxdeTzfkap+RrJaQZpJQ/s/fsUgn11xIvHrOE9U= -github.com/testcontainers/testcontainers-go v0.21.0/go.mod h1:c1ez3WVRHq7T/Aj+X3TIipFBwkBaNT5iNCY8+1b83Ng= +github.com/testcontainers/testcontainers-go v0.22.0 h1:hOK4NzNu82VZcKEB1aP9LO1xYssVFMvlfeuDW9JMmV0= +github.com/testcontainers/testcontainers-go v0.22.0/go.mod h1:k0YiPa26xJCRUbUkYqy5rY6NGvSbVCeUBXCvucscBR4= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= @@ -379,10 +381,10 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= @@ -411,7 +413,7 @@ gorm.io/driver/sqlite v1.5.1/go.mod h1:7MZZ2Z8bqyfSQA1gYEV6MagQWj3cpUkJj9Z+d1HEM gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho= gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= +gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= From 8957e405051af80022336c01ee4e54cb4eea2836 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Aug 2023 21:10:07 +0000 Subject: [PATCH 76/92] build(deps): bump github.com/avast/retry-go/v4 from 4.3.4 to 4.5.0 Bumps [github.com/avast/retry-go/v4](https://github.com/avast/retry-go) from 4.3.4 to 4.5.0. - [Release notes](https://github.com/avast/retry-go/releases) - [Commits](https://github.com/avast/retry-go/compare/4.3.4...4.5.0) --- updated-dependencies: - dependency-name: github.com/avast/retry-go/v4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 1ba27f719..9a36859ae 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/abice/go-enum v0.5.7 github.com/alicebob/miniredis/v2 v2.30.4 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef - github.com/avast/retry-go/v4 v4.3.4 + github.com/avast/retry-go/v4 v4.5.0 github.com/creasty/defaults v1.7.0 github.com/go-chi/chi/v5 v5.0.10 github.com/go-chi/cors v1.2.1 diff --git a/go.sum b/go.sum index 98738b5ca..7e54c45b6 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,8 @@ github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOS github.com/alicebob/miniredis/v2 v2.30.4/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= -github.com/avast/retry-go/v4 v4.3.4 h1:pHLkL7jvCvP317I8Ge+Km2Yhntv3SdkJm7uekkqbKhM= -github.com/avast/retry-go/v4 v4.3.4/go.mod h1:rv+Nla6Vk3/ilU0H51VHddWHiwimzX66yZ0JT6T+UvE= +github.com/avast/retry-go/v4 v4.5.0 h1:QoRAZZ90cj5oni2Lsgl2GW8mNTnUCnmpx/iKpwVisHg= +github.com/avast/retry-go/v4 v4.5.0/go.mod h1:7hLEXp0oku2Nir2xBAsg0PTphp9z71bN5Aq1fboC3+I= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= @@ -257,7 +257,6 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= From ed89f62f1bdd3b328561b75da68ef9f82940c912 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Aug 2023 21:10:37 +0000 Subject: [PATCH 77/92] build(deps): bump github.com/hashicorp/golang-lru from 0.5.4 to 1.0.2 Bumps [github.com/hashicorp/golang-lru](https://github.com/hashicorp/golang-lru) from 0.5.4 to 1.0.2. - [Release notes](https://github.com/hashicorp/golang-lru/releases) - [Commits](https://github.com/hashicorp/golang-lru/compare/v0.5.4...v1.0.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/golang-lru dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9a36859ae..eda493aba 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/google/uuid v1.3.0 github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b github.com/hashicorp/go-multierror v1.1.1 - github.com/hashicorp/golang-lru v0.5.4 + github.com/hashicorp/golang-lru v1.0.2 github.com/mattn/go-colorable v0.1.13 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/miekg/dns v1.1.55 diff --git a/go.sum b/go.sum index 7e54c45b6..860b91d75 100644 --- a/go.sum +++ b/go.sum @@ -125,8 +125,8 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= From 39208d860e0c1bd8f90f7782fe7125dbd94e5ce3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Aug 2023 20:24:27 +0000 Subject: [PATCH 78/92] build(deps): bump github.com/mroth/weightedrand/v2 from 2.0.2 to 2.1.0 Bumps [github.com/mroth/weightedrand/v2](https://github.com/mroth/weightedrand) from 2.0.2 to 2.1.0. - [Release notes](https://github.com/mroth/weightedrand/releases) - [Commits](https://github.com/mroth/weightedrand/compare/v2.0.2...v2.1.0) --- updated-dependencies: - dependency-name: github.com/mroth/weightedrand/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index eda493aba..cb943815c 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/miekg/dns v1.1.55 - github.com/mroth/weightedrand/v2 v2.0.2 + github.com/mroth/weightedrand/v2 v2.1.0 github.com/onsi/ginkgo/v2 v2.11.0 github.com/onsi/gomega v1.27.10 github.com/prometheus/client_golang v1.16.0 diff --git a/go.sum b/go.sum index 860b91d75..76786cd6b 100644 --- a/go.sum +++ b/go.sum @@ -197,8 +197,8 @@ github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mroth/weightedrand/v2 v2.0.2 h1:A8wJRUBcfguGl6oOQHI8fy5P4ViGRT9hdQdlG/7RiXo= -github.com/mroth/weightedrand/v2 v2.0.2/go.mod h1:f2faGsfOGOwc1p94wzHKKZyTpcJUW7OJ/9U4yfiNAOU= +github.com/mroth/weightedrand/v2 v2.1.0 h1:o1ascnB1CIVzsqlfArQQjeMy1U0NcIbBO5rfd5E/OeU= +github.com/mroth/weightedrand/v2 v2.1.0/go.mod h1:f2faGsfOGOwc1p94wzHKKZyTpcJUW7OJ/9U4yfiNAOU= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= From c112e867403566db6ef9bdc2fa0496b669e73c60 Mon Sep 17 00:00:00 2001 From: DerRockWolf <50499906+DerRockWolf@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:50:23 +0200 Subject: [PATCH 79/92] feat: add upstream strategy `strict` (#1093) --- config/config.go | 4 + config/config_enum.go | 80 +++++ config/upstreams.go | 7 +- docs/config.yml | 4 + docs/configuration.md | 53 ++- e2e/upstream_test.go | 8 +- go.mod | 2 +- go.sum | 4 +- lists/list_cache_enum.go | 7 + log/logger_enum.go | 14 + model/models_enum.go | 14 + resolver/blocking_resolver_test.go | 1 + resolver/bootstrap.go | 5 +- resolver/client_names_resolver_test.go | 5 +- resolver/conditional_upstream_resolver.go | 2 +- .../conditional_upstream_resolver_test.go | 2 +- resolver/custom_dns_resolver.go | 2 +- resolver/custom_dns_resolver_test.go | 2 +- resolver/ede_resolver.go | 2 +- resolver/ede_resolver_test.go | 2 +- resolver/filtering_resolver.go | 2 +- resolver/filtering_resolver_test.go | 2 +- resolver/metrics_resolver.go | 2 +- resolver/metrics_resolver_test.go | 2 +- resolver/noop_resolver.go | 4 +- resolver/noop_resolver_test.go | 4 +- resolver/parallel_best_resolver.go | 88 ++--- resolver/parallel_best_resolver_test.go | 149 +------- resolver/query_logging_resolver.go | 2 +- resolver/query_logging_resolver_test.go | 2 +- resolver/rewriter_resolver.go | 1 + resolver/strict_resolver.go | 165 +++++++++ resolver/strict_resolver_test.go | 306 ++++++++++++++++ resolver/sudn_resolver.go | 2 +- resolver/sudn_resolver_test.go | 2 +- resolver/upstream_tree_resolver.go | 118 +++++++ resolver/upstream_tree_resolver_test.go | 328 ++++++++++++++++++ server/server.go | 42 ++- server/server_test.go | 39 +++ 39 files changed, 1234 insertions(+), 246 deletions(-) create mode 100644 resolver/strict_resolver.go create mode 100644 resolver/strict_resolver_test.go create mode 100644 resolver/upstream_tree_resolver.go create mode 100644 resolver/upstream_tree_resolver_test.go diff --git a/config/config.go b/config/config.go index 54be72bdd..44853b40e 100644 --- a/config/config.go +++ b/config/config.go @@ -123,6 +123,10 @@ func (s *StartStrategyType) do(setup func() error, logErr func(error)) error { // ENUM(clientIP,clientName,responseReason,responseAnswer,question,duration) type QueryLogField string +// UpstreamStrategy data field to be logged +// ENUM(parallel_best,strict) +type UpstreamStrategy uint8 + //nolint:gochecknoglobals var netDefaultPort = map[NetProtocol]uint16{ NetProtocolTcpUdp: udpPort, diff --git a/config/config_enum.go b/config/config_enum.go index e445ac5d7..9bc7574b8 100644 --- a/config/config_enum.go +++ b/config/config_enum.go @@ -476,3 +476,83 @@ func (x *StartStrategyType) UnmarshalText(text []byte) error { *x = tmp return nil } + +const ( + // UpstreamStrategyParallelBest is a UpstreamStrategy of type Parallel_best. + UpstreamStrategyParallelBest UpstreamStrategy = iota + // UpstreamStrategyStrict is a UpstreamStrategy of type Strict. + UpstreamStrategyStrict +) + +var ErrInvalidUpstreamStrategy = fmt.Errorf("not a valid UpstreamStrategy, try [%s]", strings.Join(_UpstreamStrategyNames, ", ")) + +const _UpstreamStrategyName = "parallel_beststrict" + +var _UpstreamStrategyNames = []string{ + _UpstreamStrategyName[0:13], + _UpstreamStrategyName[13:19], +} + +// UpstreamStrategyNames returns a list of possible string values of UpstreamStrategy. +func UpstreamStrategyNames() []string { + tmp := make([]string, len(_UpstreamStrategyNames)) + copy(tmp, _UpstreamStrategyNames) + return tmp +} + +// UpstreamStrategyValues returns a list of the values for UpstreamStrategy +func UpstreamStrategyValues() []UpstreamStrategy { + return []UpstreamStrategy{ + UpstreamStrategyParallelBest, + UpstreamStrategyStrict, + } +} + +var _UpstreamStrategyMap = map[UpstreamStrategy]string{ + UpstreamStrategyParallelBest: _UpstreamStrategyName[0:13], + UpstreamStrategyStrict: _UpstreamStrategyName[13:19], +} + +// String implements the Stringer interface. +func (x UpstreamStrategy) String() string { + if str, ok := _UpstreamStrategyMap[x]; ok { + return str + } + return fmt.Sprintf("UpstreamStrategy(%d)", x) +} + +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x UpstreamStrategy) IsValid() bool { + _, ok := _UpstreamStrategyMap[x] + return ok +} + +var _UpstreamStrategyValue = map[string]UpstreamStrategy{ + _UpstreamStrategyName[0:13]: UpstreamStrategyParallelBest, + _UpstreamStrategyName[13:19]: UpstreamStrategyStrict, +} + +// ParseUpstreamStrategy attempts to convert a string to a UpstreamStrategy. +func ParseUpstreamStrategy(name string) (UpstreamStrategy, error) { + if x, ok := _UpstreamStrategyValue[name]; ok { + return x, nil + } + return UpstreamStrategy(0), fmt.Errorf("%s is %w", name, ErrInvalidUpstreamStrategy) +} + +// MarshalText implements the text marshaller method. +func (x UpstreamStrategy) MarshalText() ([]byte, error) { + return []byte(x.String()), nil +} + +// UnmarshalText implements the text unmarshaller method. +func (x *UpstreamStrategy) UnmarshalText(text []byte) error { + name := string(text) + tmp, err := ParseUpstreamStrategy(name) + if err != nil { + return err + } + *x = tmp + return nil +} diff --git a/config/upstreams.go b/config/upstreams.go index 7343f5c36..536e8a872 100644 --- a/config/upstreams.go +++ b/config/upstreams.go @@ -8,8 +8,9 @@ const UpstreamDefaultCfgName = "default" // UpstreamsConfig upstream servers configuration type UpstreamsConfig struct { - Timeout Duration `yaml:"timeout" default:"2s"` - Groups UpstreamGroups `yaml:"groups"` + Timeout Duration `yaml:"timeout" default:"2s"` + Groups UpstreamGroups `yaml:"groups"` + Strategy UpstreamStrategy `yaml:"strategy" default:"parallel_best"` } type UpstreamGroups map[string][]Upstream @@ -22,7 +23,7 @@ func (c *UpstreamsConfig) IsEnabled() bool { // LogConfig implements `config.Configurable`. func (c *UpstreamsConfig) LogConfig(logger *logrus.Entry) { logger.Info("timeout: ", c.Timeout) - + logger.Info("strategy: ", c.Strategy) logger.Info("groups:") for name, upstreams := range c.Groups { diff --git a/docs/config.yml b/docs/config.yml index 2acd36b43..de4a8d600 100644 --- a/docs/config.yml +++ b/docs/config.yml @@ -18,6 +18,10 @@ upstreams: # or single ip address / client subnet as CIDR notation laptop*: - 123.123.123.123 + # optional: Determines what strategy blocky uses to choose the upstream servers. + # accepted: parallel_best, strict + # default: parallel_best + strategy: parallel_best # optional: timeout to query the upstream resolver. Default: 2s timeout: 2s diff --git a/docs/configuration.md b/docs/configuration.md index 6cb85163a..0be20351f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -79,9 +79,9 @@ following network protocols (net part of the resolver URL): !!! hint - You can (and should!) configure multiple DNS resolvers. Blocky picks 2 random resolvers from the list for each query and - returns the answer from the fastest one. This improves your network speed and increases your privacy - your DNS traffic - will be distributed over multiple providers. + You can (and should!) configure multiple DNS resolvers. + Per default blocky uses the `parallel_best` upstream strategy where blocky picks 2 random resolvers from the list for each query and + returns the answer from the fastest one. Each resolver must be defined as a string in following format: `[net:]host:[port][/path][#commonName]`. @@ -92,13 +92,15 @@ Each resolver must be defined as a string in following format: `[net:]host:[port | port | int (1 - 65535) | no | 53 for udp/tcp, 853 for tcp-tls and 443 for https | | commonName | string | no | the host value | -The commonName parameter overrides the expected certificate common name value used for verification. +The `commonName` parameter overrides the expected certificate common name value used for verification. -Blocky needs at least the configuration of the **default** group. This group will be used as a fallback, if no client -specific resolver configuration is available. +!!! note + Blocky needs at least the configuration of the **default** group with at least one upstream DNS server. This group will be used as a fallback, if no client + specific resolver configuration is available. + + See [List of public DNS servers](additional_information.md#list-of-public-dns-servers) if you need some ideas, which public free DNS server you could use. -You can use the client name (see [Client name lookup](#client-name-lookup)), client's IP address or a client subnet as -CIDR notation. +You can specify multiple upstream groups (additional to the `default` group) to use different upstream servers for different clients, based on client name (see [Client name lookup](#client-name-lookup)), client IP address or client subnet (as CIDR). !!! tip @@ -121,15 +123,38 @@ CIDR notation. - 9.9.9.9 ``` -Use `123.123.123.123` as single upstream DNS resolver for client laptop-home, -`1.1.1.1` and `9.9.9.9` for all clients in the sub-net `10.43.8.67/28` and 4 resolvers (default) for all others clients. +The above example results in: -!!! note +- `123.123.123.123` as the only upstream DNS resolver for clients with a name starting with "laptop" +- `1.1.1.1` and `9.9.9.9` for all clients in the subnet `10.43.8.67/28` +- 4 resolvers (default) for all others clients. + +The logic determining what group a client belongs to follows a strict order: IP, client name, CIDR + +If a client matches multiple client name or CIDR groups, a warning is logged and the first found group is used. + +### Upstream strategy + +Blocky supports different upstream strategies (default `parallel_best`) that determine how and to which upstream DNS servers requests are forwarded. + +Currently available strategies: - ** Blocky needs at least one upstream DNS server ** +- `parallel_best`: blocky picks 2 random (weighted) resolvers from the upstream group for each query and returns the answer from the fastest one. + If an upstream failed to answer within the last hour, it is less likely to be chosen for the race. + This improves your network speed and increases your privacy - your DNS traffic will be distributed over multiple providers + (When using 10 upstream servers, each upstream will get on average 20% of the DNS requests) +- `strict`: blocky forwards the request in a strict order. If the first upstream does not respond, the second is asked, and so on. -See [List of public DNS servers](additional_information.md#list-of-public-dns-servers) if you need some ideas, which -public free DNS server you could use. +!!! example + + ```yaml + upstreams: + strategy: strict + groups: + default: + - 1.2.3.4 + - 9.8.7.6 + ``` ### Upstream lookup timeout diff --git a/e2e/upstream_test.go b/e2e/upstream_test.go index d2743661d..b454abd51 100644 --- a/e2e/upstream_test.go +++ b/e2e/upstream_test.go @@ -70,7 +70,9 @@ var _ = Describe("Upstream resolver configuration tests", func() { It("should not start", func() { Expect(blocky.IsRunning()).Should(BeFalse()) Expect(getContainerLogs(blocky)). - Should(ContainElement(ContainSubstring("no valid upstream for group default"))) + Should(ContainElements( + ContainSubstring("creation of upstream branches failed: "), + ContainSubstring("no valid upstream for group default"))) }) }) When("'startVerifyUpstream' is true and upstream server as host name is not reachable", func() { @@ -89,7 +91,9 @@ var _ = Describe("Upstream resolver configuration tests", func() { It("should not start", func() { Expect(blocky.IsRunning()).Should(BeFalse()) Expect(getContainerLogs(blocky)). - Should(ContainElement(ContainSubstring("no valid upstream for group default"))) + Should(ContainElements( + ContainSubstring("creation of upstream branches failed: "), + ContainSubstring("no valid upstream for group default"))) }) }) }) diff --git a/go.mod b/go.mod index cb943815c..20844c4c0 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( require ( github.com/DATA-DOG/go-sqlmock v1.5.0 - github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5 + github.com/ThinkChaos/parcour v0.0.0-20230710171753-fbf917c9eaef github.com/docker/go-connections v0.4.0 github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198 github.com/testcontainers/testcontainers-go v0.22.0 diff --git a/go.sum b/go.sum index 76786cd6b..c2030a4cd 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,8 @@ github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBa github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.10.0-rc.8 h1:YSZVvlIIDD1UxQpJp0h+dnpLUw+TrY0cx8obKsp3bek= -github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5 h1:3ubNg+3q/Y3lqxga0G90jste3i+HGDgrlPXK/feKUEI= -github.com/ThinkChaos/parcour v0.0.0-20230418015731-5c82efbe68f5/go.mod h1:hkcYs23P9zbezt09v8168B4lt69PGuoxRPQ6IJHKpHo= +github.com/ThinkChaos/parcour v0.0.0-20230710171753-fbf917c9eaef h1:lg6zRor4+PZN1Pxqtieo/NMhd61ZdV1Z/+bFURWIVfU= +github.com/ThinkChaos/parcour v0.0.0-20230710171753-fbf917c9eaef/go.mod h1:hkcYs23P9zbezt09v8168B4lt69PGuoxRPQ6IJHKpHo= github.com/abice/go-enum v0.5.7 h1:vOrobjpce5D/x5hYNqrWRkFUXFk7A6BlsJyVy4BS1jM= github.com/abice/go-enum v0.5.7/go.mod h1:FBDp+2Ygv9ZZzgcd+Gx3XbyClH7xxFfw8ghMrOpwu+A= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= diff --git a/lists/list_cache_enum.go b/lists/list_cache_enum.go index c1fdf38ed..39f41e520 100644 --- a/lists/list_cache_enum.go +++ b/lists/list_cache_enum.go @@ -49,6 +49,13 @@ func (x ListCacheType) String() string { return fmt.Sprintf("ListCacheType(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x ListCacheType) IsValid() bool { + _, ok := _ListCacheTypeMap[x] + return ok +} + var _ListCacheTypeValue = map[string]ListCacheType{ _ListCacheTypeName[0:9]: ListCacheTypeBlacklist, _ListCacheTypeName[9:18]: ListCacheTypeWhitelist, diff --git a/log/logger_enum.go b/log/logger_enum.go index 70da43db6..d4bc69c2b 100644 --- a/log/logger_enum.go +++ b/log/logger_enum.go @@ -49,6 +49,13 @@ func (x FormatType) String() string { return fmt.Sprintf("FormatType(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x FormatType) IsValid() bool { + _, ok := _FormatTypeMap[x] + return ok +} + var _FormatTypeValue = map[string]FormatType{ _FormatTypeName[0:4]: FormatTypeText, _FormatTypeName[4:8]: FormatTypeJson, @@ -130,6 +137,13 @@ func (x Level) String() string { return fmt.Sprintf("Level(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x Level) IsValid() bool { + _, ok := _LevelMap[x] + return ok +} + var _LevelValue = map[string]Level{ _LevelName[0:4]: LevelInfo, _LevelName[4:9]: LevelTrace, diff --git a/model/models_enum.go b/model/models_enum.go index ad6f939ce..f6ac755dd 100644 --- a/model/models_enum.go +++ b/model/models_enum.go @@ -49,6 +49,13 @@ func (x RequestProtocol) String() string { return fmt.Sprintf("RequestProtocol(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x RequestProtocol) IsValid() bool { + _, ok := _RequestProtocolMap[x] + return ok +} + var _RequestProtocolValue = map[string]RequestProtocol{ _RequestProtocolName[0:3]: RequestProtocolTCP, _RequestProtocolName[3:6]: RequestProtocolUDP, @@ -151,6 +158,13 @@ func (x ResponseType) String() string { return fmt.Sprintf("ResponseType(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x ResponseType) IsValid() bool { + _, ok := _ResponseTypeMap[x] + return ok +} + var _ResponseTypeValue = map[string]ResponseType{ _ResponseTypeName[0:8]: ResponseTypeRESOLVED, _ResponseTypeName[8:14]: ResponseTypeCACHED, diff --git a/resolver/blocking_resolver_test.go b/resolver/blocking_resolver_test.go index c80883ff1..899fc972a 100644 --- a/resolver/blocking_resolver_test.go +++ b/resolver/blocking_resolver_test.go @@ -69,6 +69,7 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { JustBeforeEach(func() { var err error + m = &mockResolver{} m.On("Resolve", mock.Anything).Return(&Response{Res: mockAnswer}, nil) sut, err = NewBlockingResolver(sutConfig, nil, systemResolverBootstrap) diff --git a/resolver/bootstrap.go b/resolver/bootstrap.go index bcf593a41..f100c4da2 100644 --- a/resolver/bootstrap.go +++ b/resolver/bootstrap.go @@ -66,10 +66,7 @@ func NewBootstrap(cfg *config.Config) (b *Bootstrap, err error) { // where `ParallelBestResolver` uses its config, we can just use an empty one. var pbCfg config.UpstreamsConfig - parallelResolver, err := newParallelBestResolver(pbCfg, bootstraped.ResolverGroups()) - if err != nil { - return nil, fmt.Errorf("could not create bootstrap ParallelBestResolver: %w", err) - } + parallelResolver := newParallelBestResolver(pbCfg, bootstraped.ResolverGroups()) // Always enable prefetching to avoid stalling user requests // Otherwise, a request to blocky could end up waiting for 2 DNS requests: diff --git a/resolver/client_names_resolver_test.go b/resolver/client_names_resolver_test.go index eff18f44e..75374f594 100644 --- a/resolver/client_names_resolver_test.go +++ b/resolver/client_names_resolver_test.go @@ -30,9 +30,10 @@ var _ = Describe("ClientResolver", Label("clientNamesResolver"), func() { }) JustBeforeEach(func() { - res, err := NewClientNamesResolver(sutConfig, nil, false) + var err error + + sut, err = NewClientNamesResolver(sutConfig, nil, false) Expect(err).Should(Succeed()) - sut = res m = &mockResolver{} m.On("Resolve", mock.Anything).Return(&Response{Res: new(dns.Msg)}, nil) sut.Next(m) diff --git a/resolver/conditional_upstream_resolver.go b/resolver/conditional_upstream_resolver.go index 1a0b2bb03..f3553d8c3 100644 --- a/resolver/conditional_upstream_resolver.go +++ b/resolver/conditional_upstream_resolver.go @@ -24,7 +24,7 @@ type ConditionalUpstreamResolver struct { // NewConditionalUpstreamResolver returns new resolver instance func NewConditionalUpstreamResolver( cfg config.ConditionalUpstreamConfig, bootstrap *Bootstrap, shouldVerifyUpstreams bool, -) (ChainedResolver, error) { +) (*ConditionalUpstreamResolver, error) { m := make(map[string]Resolver, len(cfg.Mapping.Upstreams)) for domain, upstream := range cfg.Mapping.Upstreams { diff --git a/resolver/conditional_upstream_resolver_test.go b/resolver/conditional_upstream_resolver_test.go index d134d127a..8bc6ccd93 100644 --- a/resolver/conditional_upstream_resolver_test.go +++ b/resolver/conditional_upstream_resolver_test.go @@ -15,7 +15,7 @@ import ( var _ = Describe("ConditionalUpstreamResolver", Label("conditionalResolver"), func() { var ( - sut ChainedResolver + sut *ConditionalUpstreamResolver m *mockResolver ) diff --git a/resolver/custom_dns_resolver.go b/resolver/custom_dns_resolver.go index 56ff2b50e..389300667 100644 --- a/resolver/custom_dns_resolver.go +++ b/resolver/custom_dns_resolver.go @@ -24,7 +24,7 @@ type CustomDNSResolver struct { } // NewCustomDNSResolver creates new resolver instance -func NewCustomDNSResolver(cfg config.CustomDNSConfig) ChainedResolver { +func NewCustomDNSResolver(cfg config.CustomDNSConfig) *CustomDNSResolver { m := make(map[string][]net.IP, len(cfg.Mapping.HostIPs)) reverse := make(map[string][]string, len(cfg.Mapping.HostIPs)) diff --git a/resolver/custom_dns_resolver_test.go b/resolver/custom_dns_resolver_test.go index 854f342fe..9ad65f170 100644 --- a/resolver/custom_dns_resolver_test.go +++ b/resolver/custom_dns_resolver_test.go @@ -18,7 +18,7 @@ var _ = Describe("CustomDNSResolver", func() { var ( TTL = uint32(time.Now().Second()) - sut ChainedResolver + sut *CustomDNSResolver m *mockResolver cfg config.CustomDNSConfig ) diff --git a/resolver/ede_resolver.go b/resolver/ede_resolver.go index e924a892a..5e458d91a 100644 --- a/resolver/ede_resolver.go +++ b/resolver/ede_resolver.go @@ -12,7 +12,7 @@ type EdeResolver struct { typed } -func NewEdeResolver(cfg config.EdeConfig) ChainedResolver { +func NewEdeResolver(cfg config.EdeConfig) *EdeResolver { return &EdeResolver{ configurable: withConfig(&cfg), typed: withType("extended_error_code"), diff --git a/resolver/ede_resolver_test.go b/resolver/ede_resolver_test.go index 5038db799..fc7e7ad5b 100644 --- a/resolver/ede_resolver_test.go +++ b/resolver/ede_resolver_test.go @@ -43,7 +43,7 @@ var _ = Describe("EdeResolver", func() { }, nil) } - sut = NewEdeResolver(sutConfig).(*EdeResolver) + sut = NewEdeResolver(sutConfig) sut.Next(m) }) diff --git a/resolver/filtering_resolver.go b/resolver/filtering_resolver.go index 738c970f1..8ff689091 100644 --- a/resolver/filtering_resolver.go +++ b/resolver/filtering_resolver.go @@ -14,7 +14,7 @@ type FilteringResolver struct { typed } -func NewFilteringResolver(cfg config.FilteringConfig) ChainedResolver { +func NewFilteringResolver(cfg config.FilteringConfig) *FilteringResolver { return &FilteringResolver{ configurable: withConfig(&cfg), typed: withType("filtering"), diff --git a/resolver/filtering_resolver_test.go b/resolver/filtering_resolver_test.go index 2c0a02b11..aeaf56008 100644 --- a/resolver/filtering_resolver_test.go +++ b/resolver/filtering_resolver_test.go @@ -31,7 +31,7 @@ var _ = Describe("FilteringResolver", func() { }) JustBeforeEach(func() { - sut = NewFilteringResolver(sutConfig).(*FilteringResolver) + sut = NewFilteringResolver(sutConfig) m = &mockResolver{} m.On("Resolve", mock.Anything).Return(&Response{Res: mockAnswer}, nil) sut.Next(m) diff --git a/resolver/metrics_resolver.go b/resolver/metrics_resolver.go index 0c15c00f5..96459d7a9 100644 --- a/resolver/metrics_resolver.go +++ b/resolver/metrics_resolver.go @@ -58,7 +58,7 @@ func (r *MetricsResolver) Resolve(request *model.Request) (*model.Response, erro } // NewMetricsResolver creates a new intance of the MetricsResolver type -func NewMetricsResolver(cfg config.MetricsConfig) ChainedResolver { +func NewMetricsResolver(cfg config.MetricsConfig) *MetricsResolver { m := MetricsResolver{ configurable: withConfig(&cfg), typed: withType("metrics"), diff --git a/resolver/metrics_resolver_test.go b/resolver/metrics_resolver_test.go index eca8ab691..a686e5377 100644 --- a/resolver/metrics_resolver_test.go +++ b/resolver/metrics_resolver_test.go @@ -30,7 +30,7 @@ var _ = Describe("MetricResolver", func() { }) BeforeEach(func() { - sut = NewMetricsResolver(config.MetricsConfig{Enable: true}).(*MetricsResolver) + sut = NewMetricsResolver(config.MetricsConfig{Enable: true}) m = &mockResolver{} m.On("Resolve", mock.Anything).Return(&Response{Res: new(dns.Msg)}, nil) sut.Next(m) diff --git a/resolver/noop_resolver.go b/resolver/noop_resolver.go index 9b3f68854..6cd12f6c5 100644 --- a/resolver/noop_resolver.go +++ b/resolver/noop_resolver.go @@ -10,8 +10,8 @@ var NoResponse = &model.Response{} //nolint:gochecknoglobals // NoOpResolver is used to finish a resolver branch as created in RewriterResolver type NoOpResolver struct{} -func NewNoOpResolver() Resolver { - return NoOpResolver{} +func NewNoOpResolver() *NoOpResolver { + return &NoOpResolver{} } // Type implements `Resolver`. diff --git a/resolver/noop_resolver_test.go b/resolver/noop_resolver_test.go index 6493fef10..b9f470966 100644 --- a/resolver/noop_resolver_test.go +++ b/resolver/noop_resolver_test.go @@ -8,7 +8,7 @@ import ( ) var _ = Describe("NoOpResolver", func() { - var sut NoOpResolver + var sut *NoOpResolver Describe("Type", func() { It("follows conventions", func() { @@ -17,7 +17,7 @@ var _ = Describe("NoOpResolver", func() { }) BeforeEach(func() { - sut = NewNoOpResolver().(NoOpResolver) + sut = NewNoOpResolver() }) Describe("Resolving", func() { diff --git a/resolver/parallel_best_resolver.go b/resolver/parallel_best_resolver.go index d3d87f022..cd7b02cf3 100644 --- a/resolver/parallel_best_resolver.go +++ b/resolver/parallel_best_resolver.go @@ -120,12 +120,12 @@ func NewParallelBestResolver( resolverGroups[name] = group } - return newParallelBestResolver(cfg, resolverGroups) + return newParallelBestResolver(cfg, resolverGroups), nil } func newParallelBestResolver( cfg config.UpstreamsConfig, resolverGroups map[string][]Resolver, -) (*ParallelBestResolver, error) { +) *ParallelBestResolver { resolversPerClient := make(map[string][]*upstreamResolverStatus, len(resolverGroups)) for groupName, resolvers := range resolverGroups { @@ -138,11 +138,6 @@ func newParallelBestResolver( resolversPerClient[groupName] = resolverStatuses } - if len(resolversPerClient[upstreamDefaultCfgName]) == 0 { - return nil, fmt.Errorf("no external DNS resolvers configured as default upstream resolvers. "+ - "Please configure at least one under '%s' configuration name", upstreamDefaultCfgName) - } - r := ParallelBestResolver{ configurable: withConfig(&cfg), typed: withType(parallelResolverType), @@ -150,7 +145,7 @@ func newParallelBestResolver( resolversPerClient: resolversPerClient, } - return &r, nil + return &r } func (r *ParallelBestResolver) Name() string { @@ -172,45 +167,16 @@ func (r *ParallelBestResolver) String() string { return fmt.Sprintf("parallel upstreams '%s'", strings.Join(result, "; ")) } -func (r *ParallelBestResolver) resolversForClient(request *model.Request) (result []*upstreamResolverStatus) { - clientIP := request.ClientIP.String() - - // try client names - for _, cName := range request.ClientNames { - for clientDefinition, upstreams := range r.resolversPerClient { - if cName != clientIP && util.ClientNameMatchesGroupName(clientDefinition, cName) { - result = append(result, upstreams...) - } - } - } - - // try IP - upstreams, found := r.resolversPerClient[clientIP] - - if found { - result = append(result, upstreams...) - } - - // try CIDR - for cidr, upstreams := range r.resolversPerClient { - if util.CidrContainsIP(cidr, request.ClientIP) { - result = append(result, upstreams...) - } - } - - if len(result) == 0 { - // return default - result = r.resolversPerClient[upstreamDefaultCfgName] - } - - return result -} - // Resolve sends the query request to multiple upstream resolvers and returns the fastest result func (r *ParallelBestResolver) Resolve(request *model.Request) (*model.Response, error) { logger := log.WithPrefix(request.Log, parallelResolverType) - resolvers := r.resolversForClient(request) + var resolvers []*upstreamResolverStatus + for _, r := range r.resolversPerClient { + resolvers = r + + break + } if len(resolvers) == 1 { logger.WithField("resolver", resolvers[0].resolver).Debug("delegating to resolver") @@ -233,21 +199,19 @@ func (r *ParallelBestResolver) Resolve(request *model.Request) (*model.Response, go r2.resolve(request, ch) - //nolint: gosimple for len(collectedErrors) < resolverCount { - select { - case result := <-ch: - if result.err != nil { - logger.Debug("resolution failed from resolver, cause: ", result.err) - collectedErrors = append(collectedErrors, result.err) - } else { - logger.WithFields(logrus.Fields{ - "resolver": *result.resolver, - "answer": util.AnswerToString(result.response.Res.Answer), - }).Debug("using response from resolver") - - return result.response, nil - } + result := <-ch + + if result.err != nil { + logger.Debug("resolution failed from resolver, cause: ", result.err) + collectedErrors = append(collectedErrors, result.err) + } else { + logger.WithFields(logrus.Fields{ + "resolver": *result.resolver, + "answer": util.AnswerToString(result.response.Res.Answer), + }).Debug("using response from resolver") + + return result.response, nil } } @@ -266,9 +230,13 @@ func pickRandom(resolvers []*upstreamResolverStatus) (resolver1, resolver2 *upst func weightedRandom(in []*upstreamResolverStatus, exclude Resolver) *upstreamResolverStatus { const errorWindowInSec = 60 - var choices []weightedrand.Choice[*upstreamResolverStatus, uint] + choices := make([]weightedrand.Choice[*upstreamResolverStatus, uint], 0, len(in)) for _, res := range in { + if exclude == res.resolver { + continue + } + var weight float64 = errorWindowInSec if time.Since(res.lastErrorTime.Load().(time.Time)) < time.Hour { @@ -277,9 +245,7 @@ func weightedRandom(in []*upstreamResolverStatus, exclude Resolver) *upstreamRes weight = math.Max(1, weight-(errorWindowInSec-time.Since(lastErrorTime).Minutes())) } - if exclude != res.resolver { - choices = append(choices, weightedrand.NewChoice(res, uint(weight))) - } + choices = append(choices, weightedrand.NewChoice(res, uint(weight))) } c, err := weightedrand.NewChooser(choices...) diff --git a/resolver/parallel_best_resolver_test.go b/resolver/parallel_best_resolver_test.go index 5544e6c5b..0278be84d 100644 --- a/resolver/parallel_best_resolver_test.go +++ b/resolver/parallel_best_resolver_test.go @@ -84,16 +84,6 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { }) }) - When("default upstream resolvers are not defined", func() { - It("should fail on startup", func() { - _, err := NewParallelBestResolver(config.UpstreamsConfig{ - Groups: config.UpstreamGroups{}, - }, nil, noVerifyUpstreams) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("no external DNS resolvers configured")) - }) - }) - When("some default upstream resolvers cannot be reached", func() { It("should start normally", func() { mockUpstream := NewMockUDPUpstreamServer().WithAnswerFn(func(request *dns.Msg) (response *dns.Msg) { @@ -234,124 +224,6 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { }) }) }) - When("client specific resolvers are defined", func() { - When("client name matches", func() { - BeforeEach(func() { - defaultMockUpstream := NewMockUDPUpstreamServer(). - WithAnswerRR("example.com 123 IN A 123.124.122.122") - DeferCleanup(defaultMockUpstream.Close) - - clientSpecificExactMockUpstream := NewMockUDPUpstreamServer(). - WithAnswerRR("example.com 123 IN A 123.124.122.123") - DeferCleanup(clientSpecificExactMockUpstream.Close) - - clientSpecificWildcardMockUpstream := NewMockUDPUpstreamServer(). - WithAnswerRR("example.com 123 IN A 123.124.122.124") - DeferCleanup(clientSpecificWildcardMockUpstream.Close) - - clientSpecificIPMockUpstream := NewMockUDPUpstreamServer(). - WithAnswerRR("example.com 123 IN A 123.124.122.125") - DeferCleanup(clientSpecificIPMockUpstream.Close) - - clientSpecificCIRDMockUpstream := NewMockUDPUpstreamServer(). - WithAnswerRR("example.com 123 IN A 123.124.122.126") - DeferCleanup(clientSpecificCIRDMockUpstream.Close) - - sutMapping = config.UpstreamGroups{ - upstreamDefaultCfgName: {defaultMockUpstream.Start()}, - "laptop": {clientSpecificExactMockUpstream.Start()}, - "client-*-m": {clientSpecificWildcardMockUpstream.Start()}, - "client[0-9]": {clientSpecificWildcardMockUpstream.Start()}, - "192.168.178.33": {clientSpecificIPMockUpstream.Start()}, - "10.43.8.67/28": {clientSpecificCIRDMockUpstream.Start()}, - } - }) - It("Should use default if client name or IP don't match", func() { - request := newRequestWithClient("example.com.", A, "192.168.178.55", "test") - - Expect(sut.Resolve(request)). - Should( - SatisfyAll( - BeDNSRecord("example.com.", A, "123.124.122.122"), - HaveTTL(BeNumerically("==", 123)), - HaveResponseType(ResponseTypeRESOLVED), - HaveReturnCode(dns.RcodeSuccess), - )) - }) - It("Should use client specific resolver if client name matches exact", func() { - request := newRequestWithClient("example.com.", A, "192.168.178.55", "laptop") - - Expect(sut.Resolve(request)). - Should( - SatisfyAll( - BeDNSRecord("example.com.", A, "123.124.122.123"), - HaveTTL(BeNumerically("==", 123)), - HaveResponseType(ResponseTypeRESOLVED), - HaveReturnCode(dns.RcodeSuccess), - )) - }) - It("Should use client specific resolver if client name matches with wildcard", func() { - request := newRequestWithClient("example.com.", A, "192.168.178.55", "client-test-m") - - Expect(sut.Resolve(request)). - Should( - SatisfyAll( - BeDNSRecord("example.com.", A, "123.124.122.124"), - HaveTTL(BeNumerically("==", 123)), - HaveResponseType(ResponseTypeRESOLVED), - HaveReturnCode(dns.RcodeSuccess), - )) - }) - It("Should use client specific resolver if client name matches with range wildcard", func() { - request := newRequestWithClient("example.com.", A, "192.168.178.55", "client7") - - Expect(sut.Resolve(request)). - Should( - SatisfyAll( - BeDNSRecord("example.com.", A, "123.124.122.124"), - HaveTTL(BeNumerically("==", 123)), - HaveResponseType(ResponseTypeRESOLVED), - HaveReturnCode(dns.RcodeSuccess), - )) - }) - It("Should use client specific resolver if client IP matches", func() { - request := newRequestWithClient("example.com.", A, "192.168.178.33", "cl") - - Expect(sut.Resolve(request)). - Should( - SatisfyAll( - BeDNSRecord("example.com.", A, "123.124.122.125"), - HaveTTL(BeNumerically("==", 123)), - HaveResponseType(ResponseTypeRESOLVED), - HaveReturnCode(dns.RcodeSuccess), - )) - }) - It("Should use client specific resolver if client IP/name matches", func() { - request := newRequestWithClient("example.com.", A, "192.168.178.33", "192.168.178.33") - - Expect(sut.Resolve(request)). - Should( - SatisfyAll( - BeDNSRecord("example.com.", A, "123.124.122.125"), - HaveTTL(BeNumerically("==", 123)), - HaveResponseType(ResponseTypeRESOLVED), - HaveReturnCode(dns.RcodeSuccess), - )) - }) - It("Should use client specific resolver if client's CIDR (10.43.8.64 - 10.43.8.79) matches", func() { - request := newRequestWithClient("example.com.", A, "10.43.8.64", "cl") - - Expect(sut.Resolve(request)). - Should( - SatisfyAll( - BeDNSRecord("example.com.", A, "123.124.122.126"), - HaveTTL(BeNumerically("==", 123)), - HaveResponseType(ResponseTypeRESOLVED), - HaveReturnCode(dns.RcodeSuccess), - )) - }) - }) - }) When("only 1 upstream resolvers is defined", func() { BeforeEach(func() { mockUpstream := NewMockUDPUpstreamServer().WithAnswerRR("example.com 123 IN A 123.124.122.122") @@ -390,17 +262,20 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { mockUpstream2 := NewMockUDPUpstreamServer().WithAnswerRR("example.com 123 IN A 123.124.122.122") DeferCleanup(mockUpstream2.Close) - sut, _ := NewParallelBestResolver(config.UpstreamsConfig{Groups: config.UpstreamGroups{ + sut, _ = NewParallelBestResolver(config.UpstreamsConfig{Groups: config.UpstreamGroups{ upstreamDefaultCfgName: {withError1, mockUpstream1.Start(), mockUpstream2.Start(), withError2}, - }}, systemResolverBootstrap, noVerifyUpstreams) + }}, + systemResolverBootstrap, noVerifyUpstreams) By("all resolvers have same weight for random -> equal distribution", func() { resolverCount := make(map[Resolver]int) for i := 0; i < 1000; i++ { - r1, r2 := pickRandom(sut.resolversForClient(newRequestWithClient( - "example.com", A, "123.123.100.100", - ))) + var resolvers []*upstreamResolverStatus + for _, r := range sut.resolversPerClient { + resolvers = r + } + r1, r2 := pickRandom(resolvers) res1 := r1.resolver res2 := r2.resolver Expect(res1).ShouldNot(Equal(res2)) @@ -425,9 +300,11 @@ var _ = Describe("ParallelBestResolver", Label("parallelBestResolver"), func() { resolverCount := make(map[*UpstreamResolver]int) for i := 0; i < 100; i++ { - r1, r2 := pickRandom(sut.resolversForClient(newRequestWithClient( - "example.com", A, "123.123.100.100", - ))) + var resolvers []*upstreamResolverStatus + for _, r := range sut.resolversPerClient { + resolvers = r + } + r1, r2 := pickRandom(resolvers) res1 := r1.resolver.(*UpstreamResolver) res2 := r2.resolver.(*UpstreamResolver) Expect(res1).ShouldNot(Equal(res2)) diff --git a/resolver/query_logging_resolver.go b/resolver/query_logging_resolver.go index 1b80a6f82..b21bf3041 100644 --- a/resolver/query_logging_resolver.go +++ b/resolver/query_logging_resolver.go @@ -30,7 +30,7 @@ type QueryLoggingResolver struct { } // NewQueryLoggingResolver returns a new resolver instance -func NewQueryLoggingResolver(cfg config.QueryLogConfig) ChainedResolver { +func NewQueryLoggingResolver(cfg config.QueryLogConfig) *QueryLoggingResolver { logger := log.PrefixedLog(queryLoggingResolverType) var writer querylog.Writer diff --git a/resolver/query_logging_resolver_test.go b/resolver/query_logging_resolver_test.go index 1a4d02ff5..7386654d5 100644 --- a/resolver/query_logging_resolver_test.go +++ b/resolver/query_logging_resolver_test.go @@ -63,7 +63,7 @@ var _ = Describe("QueryLoggingResolver", func() { sutConfig.SetDefaults() // not called when using a struct literal } - sut = NewQueryLoggingResolver(sutConfig).(*QueryLoggingResolver) + sut = NewQueryLoggingResolver(sutConfig) DeferCleanup(func() { close(sut.logChan) }) m = &mockResolver{} m.On("Resolve", mock.Anything).Return(&Response{Res: mockAnswer, Reason: "reason"}, nil) diff --git a/resolver/rewriter_resolver.go b/resolver/rewriter_resolver.go index 8024b5468..320c94d44 100644 --- a/resolver/rewriter_resolver.go +++ b/resolver/rewriter_resolver.go @@ -30,6 +30,7 @@ func NewRewriterResolver(cfg config.RewriterConfig, inner ChainedResolver) Chain return inner } + // ensures that the rewrites map contains all rewrites in lower case for k, v := range cfg.Rewrite { cfg.Rewrite[strings.ToLower(k)] = strings.ToLower(v) } diff --git a/resolver/strict_resolver.go b/resolver/strict_resolver.go new file mode 100644 index 000000000..2fd6c4600 --- /dev/null +++ b/resolver/strict_resolver.go @@ -0,0 +1,165 @@ +package resolver + +import ( + "context" + "errors" + "fmt" + "strings" + + "github.com/0xERR0R/blocky/config" + "github.com/0xERR0R/blocky/log" + "github.com/0xERR0R/blocky/model" + "github.com/0xERR0R/blocky/util" + + "github.com/sirupsen/logrus" +) + +const ( + strictResolverType = "strict" +) + +// StrictResolver delegates the DNS message strictly to the first configured upstream resolver +// if it can't provide the answer in time the next resolver is used +type StrictResolver struct { + configurable[*config.UpstreamsConfig] + typed + + resolversPerClient map[string][]*upstreamResolverStatus +} + +// NewStrictResolver creates new resolver instance +func NewStrictResolver( + cfg config.UpstreamsConfig, bootstrap *Bootstrap, shouldVerifyUpstreams bool, +) (*StrictResolver, error) { + logger := log.PrefixedLog(strictResolverType) + + upstreamResolvers := cfg.Groups + resolverGroups := make(map[string][]Resolver, len(upstreamResolvers)) + + for name, upstreamCfgs := range upstreamResolvers { + group := make([]Resolver, 0, len(upstreamCfgs)) + hasValidResolver := false + + for _, u := range upstreamCfgs { + resolver, err := NewUpstreamResolver(u, bootstrap, shouldVerifyUpstreams) + if err != nil { + logger.Warnf("upstream group %s: %v", name, err) + + continue + } + + if shouldVerifyUpstreams { + err = testResolver(resolver) + if err != nil { + logger.Warn(err) + } else { + hasValidResolver = true + } + } + + group = append(group, resolver) + } + + if shouldVerifyUpstreams && !hasValidResolver { + return nil, fmt.Errorf("no valid upstream for group %s", name) + } + + resolverGroups[name] = group + } + + return newStrictResolver(cfg, resolverGroups), nil +} + +func newStrictResolver( + cfg config.UpstreamsConfig, resolverGroups map[string][]Resolver, +) *StrictResolver { + resolversPerClient := make(map[string][]*upstreamResolverStatus, len(resolverGroups)) + + for groupName, resolvers := range resolverGroups { + resolverStatuses := make([]*upstreamResolverStatus, 0, len(resolvers)) + + for _, r := range resolvers { + resolverStatuses = append(resolverStatuses, newUpstreamResolverStatus(r)) + } + + resolversPerClient[groupName] = resolverStatuses + } + + r := StrictResolver{ + configurable: withConfig(&cfg), + typed: withType(strictResolverType), + + resolversPerClient: resolversPerClient, + } + + return &r +} + +func (r *StrictResolver) Name() string { + return r.String() +} + +func (r *StrictResolver) String() string { + result := make([]string, 0, len(r.resolversPerClient)) + + for name, res := range r.resolversPerClient { + tmp := make([]string, len(res)) + for i, s := range res { + tmp[i] = fmt.Sprintf("%s", s.resolver) + } + + result = append(result, fmt.Sprintf("%s (%s)", name, strings.Join(tmp, ","))) + } + + return fmt.Sprintf("%s upstreams %q", strictResolverType, strings.Join(result, "; ")) +} + +// Resolve sends the query request to multiple upstream resolvers and returns the fastest result +func (r *StrictResolver) Resolve(request *model.Request) (*model.Response, error) { + logger := log.WithPrefix(request.Log, strictResolverType) + + var resolvers []*upstreamResolverStatus + for _, r := range r.resolversPerClient { + resolvers = r + + break + } + + // start with first resolver + for i := range resolvers { + timeout := config.GetConfig().Upstreams.Timeout.ToDuration() + + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + // start in new go routine and cancel if + + resolver := resolvers[i] + ch := make(chan requestResponse, resolverCount) + + go resolver.resolve(request, ch) + + select { + case <-ctx.Done(): + // log debug/info that timeout exceeded, call `continue` to try next upstream + logger.WithField("resolver", resolvers[i].resolver).Debug("upstream exceeded timeout, trying next upstream") + + continue + case result := <-ch: + if result.err != nil { + // log error & call `continue` to try next upstream + logger.Debug("resolution failed from resolver, cause: ", result.err) + + continue + } + + logger.WithFields(logrus.Fields{ + "resolver": *result.resolver, + "answer": util.AnswerToString(result.response.Res.Answer), + }).Debug("using response from resolver") + + return result.response, nil + } + } + + return nil, errors.New("resolution was not successful, no resolver returned an answer in time") +} diff --git a/resolver/strict_resolver_test.go b/resolver/strict_resolver_test.go new file mode 100644 index 000000000..84719c806 --- /dev/null +++ b/resolver/strict_resolver_test.go @@ -0,0 +1,306 @@ +package resolver + +import ( + "time" + + "github.com/0xERR0R/blocky/config" + . "github.com/0xERR0R/blocky/helpertest" + "github.com/0xERR0R/blocky/log" + . "github.com/0xERR0R/blocky/model" + "github.com/0xERR0R/blocky/util" + "github.com/miekg/dns" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("StrictResolver", Label("strictResolver"), func() { + const ( + verifyUpstreams = true + noVerifyUpstreams = false + ) + + var ( + sut *StrictResolver + sutMapping config.UpstreamGroups + sutVerify bool + + err error + + bootstrap *Bootstrap + ) + + Describe("Type", func() { + It("follows conventions", func() { + expectValidResolverType(sut) + }) + }) + + BeforeEach(func() { + sutMapping = config.UpstreamGroups{ + upstreamDefaultCfgName: { + config.Upstream{ + Host: "wrong", + }, + config.Upstream{ + Host: "127.0.0.2", + }, + }, + } + + sutVerify = noVerifyUpstreams + + bootstrap = systemResolverBootstrap + }) + + JustBeforeEach(func() { + sutConfig := config.UpstreamsConfig{Groups: sutMapping} + + sut, err = NewStrictResolver(sutConfig, bootstrap, sutVerify) + }) + + config.GetConfig().Upstreams.Timeout = config.Duration(1000 * time.Millisecond) + + Describe("IsEnabled", func() { + It("is true", func() { + Expect(sut.IsEnabled()).Should(BeTrue()) + }) + }) + + Describe("LogConfig", func() { + It("should log something", func() { + logger, hook := log.NewMockEntry() + + sut.LogConfig(logger) + + Expect(hook.Calls).ShouldNot(BeEmpty()) + }) + }) + + Describe("Type", func() { + It("should be correct", func() { + Expect(sut.Type()).ShouldNot(BeEmpty()) + Expect(sut.Type()).Should(Equal(strictResolverType)) + }) + }) + + Describe("Name", func() { + It("should contain correct resolver", func() { + Expect(sut.Name()).ShouldNot(BeEmpty()) + Expect(sut.Name()).Should(ContainSubstring(strictResolverType)) + }) + }) + + When("some default upstream resolvers cannot be reached", func() { + It("should start normally", func() { + mockUpstream := NewMockUDPUpstreamServer().WithAnswerFn(func(request *dns.Msg) (response *dns.Msg) { + response, _ = util.NewMsgWithAnswer(request.Question[0].Name, 123, A, "123.124.122.122") + + return + }) + defer mockUpstream.Close() + + upstream := config.UpstreamGroups{ + upstreamDefaultCfgName: { + config.Upstream{ + Host: "wrong", + }, + mockUpstream.Start(), + }, + } + + _, err := NewStrictResolver(config.UpstreamsConfig{ + Groups: upstream, + }, systemResolverBootstrap, verifyUpstreams) + Expect(err).Should(Not(HaveOccurred())) + }) + }) + + When("no upstream resolvers can be reached", func() { + BeforeEach(func() { + sutMapping = config.UpstreamGroups{ + upstreamDefaultCfgName: { + config.Upstream{ + Host: "wrong", + }, + config.Upstream{ + Host: "127.0.0.2", + }, + }, + } + }) + + When("strict checking is enabled", func() { + BeforeEach(func() { + sutVerify = verifyUpstreams + }) + It("should fail to start", func() { + Expect(err).Should(HaveOccurred()) + }) + }) + + When("strict checking is disabled", func() { + BeforeEach(func() { + sutVerify = noVerifyUpstreams + }) + It("should start", func() { + Expect(err).Should(Not(HaveOccurred())) + }) + }) + }) + + Describe("Resolving request in strict order", func() { + When("2 Upstream resolvers are defined", func() { + When("Both are responding", func() { + When("they respond in time", func() { + BeforeEach(func() { + testUpstream1 := NewMockUDPUpstreamServer().WithAnswerRR("example.com 123 IN A 123.124.122.122") + DeferCleanup(testUpstream1.Close) + + testUpstream2 := NewMockUDPUpstreamServer().WithAnswerRR("example.com 123 IN A 123.124.122.123") + DeferCleanup(testUpstream2.Close) + + sutMapping = config.UpstreamGroups{ + upstreamDefaultCfgName: {testUpstream1.Start(), testUpstream2.Start()}, + } + }) + It("Should use result from first one", func() { + request := newRequest("example.com.", A) + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "123.124.122.122"), + HaveTTL(BeNumerically("==", 123)), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + }) + When("first upstream exceeds upstreamTimeout", func() { + BeforeEach(func() { + testUpstream1 := NewMockUDPUpstreamServer().WithAnswerFn(func(request *dns.Msg) (response *dns.Msg) { + response, err := util.NewMsgWithAnswer("example.com", 123, A, "123.124.122.1") + time.Sleep(time.Duration(config.GetConfig().Upstreams.Timeout) + 2*time.Second) + + Expect(err).To(Succeed()) + + return response + }) + DeferCleanup(testUpstream1.Close) + + testUpstream2 := NewMockUDPUpstreamServer().WithAnswerRR("example.com 123 IN A 123.124.122.2") + DeferCleanup(testUpstream2.Close) + + sutMapping = config.UpstreamGroups{ + upstreamDefaultCfgName: {testUpstream1.Start(), testUpstream2.Start()}, + } + }) + It("should return response from next upstream", func() { + request := newRequest("example.com", A) + Expect(sut.Resolve(request)).Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "123.124.122.2"), + HaveTTL(BeNumerically("==", 123)), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + }) + When("all upstreams exceed upsteamTimeout", func() { + BeforeEach(func() { + testUpstream1 := NewMockUDPUpstreamServer().WithAnswerFn(func(request *dns.Msg) (response *dns.Msg) { + response, err := util.NewMsgWithAnswer("example.com", 123, A, "123.124.122.1") + time.Sleep(config.GetConfig().Upstreams.Timeout.ToDuration() + 2*time.Second) + + Expect(err).To(Succeed()) + + return response + }) + DeferCleanup(testUpstream1.Close) + + testUpstream2 := NewMockUDPUpstreamServer().WithAnswerFn(func(request *dns.Msg) (response *dns.Msg) { + response, err := util.NewMsgWithAnswer("example.com", 123, A, "123.124.122.2") + time.Sleep(config.GetConfig().Upstreams.Timeout.ToDuration() + 2*time.Second) + + Expect(err).To(Succeed()) + + return response + }) + DeferCleanup(testUpstream2.Close) + + sutMapping = config.UpstreamGroups{ + upstreamDefaultCfgName: {testUpstream1.Start(), testUpstream2.Start()}, + } + }) + It("should return error", func() { + request := newRequest("example.com", A) + _, err := sut.Resolve(request) + Expect(err).To(HaveOccurred()) + }) + }) + }) + When("Only second is working", func() { + BeforeEach(func() { + testUpstream1 := config.Upstream{Host: "wrong"} + + testUpstream2 := NewMockUDPUpstreamServer().WithAnswerRR("example.com 123 IN A 123.124.122.123") + DeferCleanup(testUpstream2.Close) + + sutMapping = config.UpstreamGroups{ + upstreamDefaultCfgName: {testUpstream1, testUpstream2.Start()}, + } + }) + It("Should use result from second one", func() { + request := newRequest("example.com.", A) + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "123.124.122.123"), + HaveTTL(BeNumerically("==", 123)), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + }) + When("None are working", func() { + BeforeEach(func() { + testUpstream1 := config.Upstream{Host: "wrong"} + testUpstream2 := config.Upstream{Host: "wrong"} + + sutMapping = config.UpstreamGroups{ + upstreamDefaultCfgName: {testUpstream1, testUpstream2}, + } + Expect(err).Should(Succeed()) + }) + It("Should return error", func() { + request := newRequest("example.com.", A) + _, err := sut.Resolve(request) + Expect(err).Should(HaveOccurred()) + }) + }) + }) + When("only 1 upstream resolvers is defined", func() { + BeforeEach(func() { + mockUpstream := NewMockUDPUpstreamServer().WithAnswerRR("example.com 123 IN A 123.124.122.122") + DeferCleanup(mockUpstream.Close) + + sutMapping = config.UpstreamGroups{ + upstreamDefaultCfgName: { + mockUpstream.Start(), + }, + } + }) + It("Should use result from defined resolver", func() { + request := newRequest("example.com.", A) + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "123.124.122.122"), + HaveTTL(BeNumerically("==", 123)), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + }) + }) +}) diff --git a/resolver/sudn_resolver.go b/resolver/sudn_resolver.go index 44508a2da..f70c51a5f 100644 --- a/resolver/sudn_resolver.go +++ b/resolver/sudn_resolver.go @@ -92,7 +92,7 @@ type SpecialUseDomainNamesResolver struct { configurable[*config.SUDNConfig] } -func NewSpecialUseDomainNamesResolver(cfg config.SUDNConfig) ChainedResolver { +func NewSpecialUseDomainNamesResolver(cfg config.SUDNConfig) *SpecialUseDomainNamesResolver { return &SpecialUseDomainNamesResolver{ typed: withType("special_use_domains"), configurable: withConfig(&cfg), diff --git a/resolver/sudn_resolver_test.go b/resolver/sudn_resolver_test.go index 5cf9ed006..1c004b203 100644 --- a/resolver/sudn_resolver_test.go +++ b/resolver/sudn_resolver_test.go @@ -41,7 +41,7 @@ var _ = Describe("SudnResolver", Label("sudnResolver"), func() { m = &mockResolver{} m.On("Resolve", mock.Anything).Return(&Response{Res: mockAnswer}, nil) - sut = NewSpecialUseDomainNamesResolver(sutConfig).(*SpecialUseDomainNamesResolver) + sut = NewSpecialUseDomainNamesResolver(sutConfig) sut.Next(m) }) diff --git a/resolver/upstream_tree_resolver.go b/resolver/upstream_tree_resolver.go new file mode 100644 index 000000000..72a137956 --- /dev/null +++ b/resolver/upstream_tree_resolver.go @@ -0,0 +1,118 @@ +package resolver + +import ( + "fmt" + "strings" + + "github.com/0xERR0R/blocky/config" + "github.com/0xERR0R/blocky/log" + "github.com/0xERR0R/blocky/model" + "github.com/0xERR0R/blocky/util" + "github.com/sirupsen/logrus" +) + +const ( + upstreamTreeResolverType = "upstream_tree" +) + +type UpstreamTreeResolver struct { + configurable[*config.UpstreamsConfig] + typed + + branches map[string]Resolver +} + +func NewUpstreamTreeResolver(cfg config.UpstreamsConfig, branches map[string]Resolver) (Resolver, error) { + if len(cfg.Groups[upstreamDefaultCfgName]) == 0 { + return nil, fmt.Errorf("no external DNS resolvers configured as default upstream resolvers. "+ + "Please configure at least one under '%s' configuration name", upstreamDefaultCfgName) + } + + if len(branches) != len(cfg.Groups) { + return nil, fmt.Errorf("amount of passed in branches (%d) does not match amount of configured upstream groups (%d)", + len(branches), len(cfg.Groups)) + } + + if len(branches) == 1 { + for _, r := range branches { + return r, nil + } + } + + // return resolver that forwards request to specific resolver branch depending on the client + r := UpstreamTreeResolver{ + configurable: withConfig(&cfg), + typed: withType(upstreamTreeResolverType), + + branches: branches, + } + + return &r, nil +} + +func (r *UpstreamTreeResolver) Name() string { + return r.String() +} + +func (r *UpstreamTreeResolver) String() string { + result := make([]string, 0, len(r.branches)) + + for group, res := range r.branches { + result = append(result, fmt.Sprintf("%s (%s)", group, res.Type())) + } + + return fmt.Sprintf("%s upstreams %q", upstreamTreeResolverType, strings.Join(result, ", ")) +} + +func (r *UpstreamTreeResolver) Resolve(request *model.Request) (*model.Response, error) { + logger := log.WithPrefix(request.Log, upstreamTreeResolverType) + + group := r.upstreamGroupByClient(request) + + // delegate request to group resolver + logger.WithField("resolver", fmt.Sprintf("%s (%s)", group, r.branches[group].Type())).Debug("delegating to resolver") + + return r.branches[group].Resolve(request) +} + +func (r *UpstreamTreeResolver) upstreamGroupByClient(request *model.Request) string { + groups := []string{} + clientIP := request.ClientIP.String() + + // try IP + if _, exists := r.branches[clientIP]; exists { + return clientIP + } + + // try client names + for _, name := range request.ClientNames { + for group := range r.branches { + if util.ClientNameMatchesGroupName(group, name) { + groups = append(groups, group) + } + } + } + + // try CIDR (only if no client name matched) + if len(groups) == 0 { + for cidr := range r.branches { + if util.CidrContainsIP(cidr, request.ClientIP) { + groups = append(groups, cidr) + } + } + } + + if len(groups) > 0 { + if len(groups) > 1 { + r.log().WithFields(logrus.Fields{ + "clientNames": request.ClientNames, + "clientIP": clientIP, + "groups": groups, + }).Warn("client matches multiple groups") + } + + return groups[0] + } + + return upstreamDefaultCfgName +} diff --git a/resolver/upstream_tree_resolver_test.go b/resolver/upstream_tree_resolver_test.go new file mode 100644 index 000000000..11faab425 --- /dev/null +++ b/resolver/upstream_tree_resolver_test.go @@ -0,0 +1,328 @@ +package resolver + +import ( + "github.com/0xERR0R/blocky/config" + . "github.com/0xERR0R/blocky/helpertest" + "github.com/0xERR0R/blocky/log" + . "github.com/0xERR0R/blocky/model" + "github.com/0xERR0R/blocky/util" + "github.com/miekg/dns" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "github.com/sirupsen/logrus/hooks/test" + "github.com/stretchr/testify/mock" +) + +var mockRes *mockResolver + +var _ = Describe("UpstreamTreeResolver", Label("upstreamTreeResolver"), func() { + var ( + sut Resolver + sutConfig config.UpstreamsConfig + branches map[string]Resolver + + loggerHook *test.Hook + + err error + ) + + BeforeEach(func() { + mockRes = &mockResolver{} + }) + + JustBeforeEach(func() { + sut, err = NewUpstreamTreeResolver(sutConfig, branches) + }) + + When("has no configuration", func() { + BeforeEach(func() { + sutConfig = config.UpstreamsConfig{} + }) + + It("should return error", func() { + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError(ContainSubstring("no external DNS resolvers configured"))) + Expect(sut).To(BeNil()) + }) + }) + + When("amount of passed in resolvers doesn't match amount of groups", func() { + BeforeEach(func() { + sutConfig = config.UpstreamsConfig{ + Groups: config.UpstreamGroups{ + upstreamDefaultCfgName: { + {Host: "wrong"}, + {Host: "127.0.0.1"}, + }, + }, + } + branches = map[string]Resolver{} + }) + + It("should return error", func() { + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError( + "amount of passed in branches (0) does not match amount of configured upstream groups (1)")) + Expect(sut).To(BeNil()) + }) + }) + + When("has only default group", func() { + BeforeEach(func() { + sutConfig = config.UpstreamsConfig{ + Groups: config.UpstreamGroups{ + upstreamDefaultCfgName: { + {Host: "wrong"}, + {Host: "127.0.0.1"}, + }, + }, + } + branches = createBranchesMock(sutConfig) + }) + Describe("Type", func() { + It("does not return error", func() { + Expect(err).ToNot(HaveOccurred()) + }) + It("follows conventions", func() { + expectValidResolverType(sut) + }) + It("returns mock", func() { + Expect(sut.Type()).To(Equal("mock")) + }) + }) + }) + + When("has multiple groups", func() { + BeforeEach(func() { + sutConfig = config.UpstreamsConfig{ + Groups: config.UpstreamGroups{ + upstreamDefaultCfgName: { + {Host: "wrong"}, + {Host: "127.0.0.1"}, + }, + "test": { + {Host: "some-resolver"}, + }, + }, + } + branches = createBranchesMock(sutConfig) + }) + Describe("Type", func() { + It("does not return error", func() { + Expect(err).ToNot(HaveOccurred()) + }) + It("follows conventions", func() { + expectValidResolverType(sut) + }) + It("returns upstream_tree", func() { + Expect(sut.Type()).To(Equal(upstreamTreeResolverType)) + }) + }) + Describe("Configuration output", func() { + It("should return configuration", func() { + Expect(sut.IsEnabled()).Should(BeTrue()) + + logger, hook := log.NewMockEntry() + sut.LogConfig(logger) + Expect(hook.Calls).ToNot(BeEmpty()) + }) + }) + + Describe("Name", func() { + var utrSut *UpstreamTreeResolver + JustBeforeEach(func() { + utrSut = sut.(*UpstreamTreeResolver) + }) + + It("should contain correct resolver", func() { + name := utrSut.Name() + Expect(name).ShouldNot(BeEmpty()) + Expect(name).Should(ContainSubstring(upstreamTreeResolverType)) + }) + }) + + When("client specific resolvers are defined", func() { + BeforeEach(func() { + loggerHook = test.NewGlobal() + log.Log().AddHook(loggerHook) + + sutConfig = config.UpstreamsConfig{Groups: config.UpstreamGroups{ + upstreamDefaultCfgName: {config.Upstream{}}, + "laptop": {config.Upstream{}}, + "client-*-m": {config.Upstream{}}, + "client[0-9]": {config.Upstream{}}, + "192.168.178.33": {config.Upstream{}}, + "10.43.8.67/28": {config.Upstream{}}, + "name-matches1": {config.Upstream{}}, + "name-matches*": {config.Upstream{}}, + }} + + createMockResolver := func(group string) *mockResolver { + resolver := &mockResolver{} + + resolver.On("Resolve", mock.Anything) + resolver.ResponseFn = func(req *dns.Msg) *dns.Msg { + res := new(dns.Msg) + res.SetReply(req) + + ptr := new(dns.PTR) + ptr.Ptr = group + ptr.Hdr = util.CreateHeader(req.Question[0], 1) + res.Answer = append(res.Answer, ptr) + + return res + } + + return resolver + } + + branches = map[string]Resolver{ + upstreamDefaultCfgName: nil, + "laptop": nil, + "client-*-m": nil, + "client[0-9]": nil, + "192.168.178.33": nil, + "10.43.8.67/28": nil, + "name-matches1": nil, + "name-matches*": nil, + } + + for group := range branches { + branches[group] = createMockResolver(group) + } + + Expect(branches).To(HaveLen(8)) + }) + + AfterEach(func() { + loggerHook.Reset() + }) + + It("Should use default if client name or IP don't match", func() { + request := newRequestWithClient("example.com.", A, "192.168.178.55", "test") + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "default"), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + It("Should use client specific resolver if client name matches exact", func() { + request := newRequestWithClient("example.com.", A, "192.168.178.55", "laptop") + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "laptop"), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + It("Should use client specific resolver if client name matches with wildcard", func() { + request := newRequestWithClient("example.com.", A, "192.168.178.55", "client-test-m") + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "client-*-m"), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + It("Should use client specific resolver if client name matches with range wildcard", func() { + request := newRequestWithClient("example.com.", A, "192.168.178.55", "client7") + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "client[0-9]"), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + It("Should use client specific resolver if client IP matches", func() { + request := newRequestWithClient("example.com.", A, "192.168.178.33", "noname") + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "192.168.178.33"), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + It("Should use client specific resolver if client name (containing IP) matches", func() { + request := newRequestWithClient("example.com.", A, "0.0.0.0", "192.168.178.33") + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "192.168.178.33"), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + It("Should use client specific resolver if client's CIDR (10.43.8.64 - 10.43.8.79) matches", func() { + request := newRequestWithClient("example.com.", A, "10.43.8.70", "noname") + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "10.43.8.67/28"), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + It("Should use exact IP match before client name match", func() { + request := newRequestWithClient("example.com.", A, "192.168.178.33", "laptop") + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "192.168.178.33"), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + It("Should use client name match before CIDR match", func() { + request := newRequestWithClient("example.com.", A, "10.43.8.70", "laptop") + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + BeDNSRecord("example.com.", A, "laptop"), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + }) + It("Should use one of the matching resolvers & log warning", func() { + request := newRequestWithClient("example.com.", A, "0.0.0.0", "name-matches1") + + Expect(sut.Resolve(request)). + Should( + SatisfyAll( + SatisfyAny( + BeDNSRecord("example.com.", A, "name-matches1"), + BeDNSRecord("example.com.", A, "name-matches*"), + ), + HaveResponseType(ResponseTypeRESOLVED), + HaveReturnCode(dns.RcodeSuccess), + )) + + Expect(loggerHook.LastEntry().Message).Should(ContainSubstring("client matches multiple groups")) + }) + }) + }) +}) + +func createBranchesMock(cfg config.UpstreamsConfig) map[string]Resolver { + branches := make(map[string]Resolver, len(cfg.Groups)) + + for name := range cfg.Groups { + branches[name] = mockRes + } + + return branches +} diff --git a/server/server.go b/server/server.go index 415a7e36a..1b5539959 100644 --- a/server/server.go +++ b/server/server.go @@ -396,15 +396,21 @@ func createQueryResolver( bootstrap *resolver.Bootstrap, redisClient *redis.Client, ) (r resolver.Resolver, err error) { + upstreamBranches, uErr := createUpstreamBranches(cfg, bootstrap) + if uErr != nil { + return nil, fmt.Errorf("creation of upstream branches failed: %w", uErr) + } + + upstreamTree, utErr := resolver.NewUpstreamTreeResolver(cfg.Upstreams, upstreamBranches) + blocking, blErr := resolver.NewBlockingResolver(cfg.Blocking, redisClient, bootstrap) - parallel, pErr := resolver.NewParallelBestResolver(cfg.Upstreams, bootstrap, cfg.StartVerifyUpstream) clientNames, cnErr := resolver.NewClientNamesResolver(cfg.ClientLookup, bootstrap, cfg.StartVerifyUpstream) condUpstream, cuErr := resolver.NewConditionalUpstreamResolver(cfg.Conditional, bootstrap, cfg.StartVerifyUpstream) hostsFile, hfErr := resolver.NewHostsFileResolver(cfg.HostsFile, bootstrap) err = multierror.Append( + multierror.Prefix(utErr, "upstream tree resolver: "), multierror.Prefix(blErr, "blocking resolver: "), - multierror.Prefix(pErr, "parallel resolver: "), multierror.Prefix(cnErr, "client names resolver: "), multierror.Prefix(cuErr, "conditional upstream resolver: "), multierror.Prefix(hfErr, "hosts file resolver: "), @@ -426,12 +432,42 @@ func createQueryResolver( resolver.NewCachingResolver(cfg.Caching, redisClient), resolver.NewRewriterResolver(cfg.Conditional.RewriterConfig, condUpstream), resolver.NewSpecialUseDomainNamesResolver(cfg.SUDN), - parallel, + upstreamTree, ) return r, nil } +func createUpstreamBranches( + cfg *config.Config, + bootstrap *resolver.Bootstrap, +) (map[string]resolver.Resolver, error) { + upstreamBranches := make(map[string]resolver.Resolver, len(cfg.Upstreams.Groups)) + + var uErr error + + for group, upstreams := range cfg.Upstreams.Groups { + var ( + upstream resolver.Resolver + err error + ) + + resolverCfg := config.UpstreamsConfig{Groups: config.UpstreamGroups{group: upstreams}} + + switch cfg.Upstreams.Strategy { + case config.UpstreamStrategyStrict: + upstream, err = resolver.NewStrictResolver(resolverCfg, bootstrap, cfg.StartVerifyUpstream) + case config.UpstreamStrategyParallelBest: + upstream, err = resolver.NewParallelBestResolver(resolverCfg, bootstrap, cfg.StartVerifyUpstream) + } + + upstreamBranches[group] = upstream + uErr = multierror.Append(multierror.Prefix(err, fmt.Sprintf("group %s: ", group))).ErrorOrNil() + } + + return upstreamBranches, uErr +} + func (s *Server) registerDNSHandlers() { for _, server := range s.dnsServers { handler := server.Handler.(*dns.ServeMux) diff --git a/server/server_test.go b/server/server_test.go index 1e5533344..65b30bc23 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -728,6 +728,45 @@ var _ = Describe("Running DNS server", func() { }) }) + Describe("NewServer with strict upstream strategy", func() { + It("successfully returns upstream branches", func() { + branches, err := createUpstreamBranches(&config.Config{ + Upstreams: config.UpstreamsConfig{ + Strategy: config.UpstreamStrategyStrict, + Groups: config.UpstreamGroups{ + "default": {{Host: "0.0.0.0"}}, + }, + }, + }, + nil) + + Expect(err).ToNot(HaveOccurred()) + Expect(branches).ToNot(BeNil()) + Expect(branches).To(HaveLen(1)) + _ = branches["default"].(*resolver.StrictResolver) + }) + }) + + Describe("create query resolver", func() { + When("some upstream returns error", func() { + It("create query resolver should return error", func() { + r, err := createQueryResolver(&config.Config{ + StartVerifyUpstream: true, + Upstreams: config.UpstreamsConfig{ + Groups: config.UpstreamGroups{ + "default": {{Host: "0.0.0.0"}}, + }, + }, + }, + nil, nil) + + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError(ContainSubstring("creation of upstream branches failed: "))) + Expect(r).To(BeNil()) + }) + }) + }) + Describe("resolve client IP", func() { Context("UDP address", func() { It("should correct resolve client IP", func() { From 5e49e7ab1015ecbc68dbce7a1f3b16952e95ce87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:51:04 +0200 Subject: [PATCH 80/92] build(deps): bump github.com/alicebob/miniredis/v2 from 2.30.4 to 2.30.5 (#1104) Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.30.4 to 2.30.5. - [Release notes](https://github.com/alicebob/miniredis/releases) - [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md) - [Commits](https://github.com/alicebob/miniredis/compare/v2.30.4...v2.30.5) --- updated-dependencies: - dependency-name: github.com/alicebob/miniredis/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 20844c4c0..c3d4a5398 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/abice/go-enum v0.5.7 - github.com/alicebob/miniredis/v2 v2.30.4 + github.com/alicebob/miniredis/v2 v2.30.5 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef github.com/avast/retry-go/v4 v4.5.0 github.com/creasty/defaults v1.7.0 diff --git a/go.sum b/go.sum index c2030a4cd..7af4c852c 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/abice/go-enum v0.5.7 h1:vOrobjpce5D/x5hYNqrWRkFUXFk7A6BlsJyVy4BS1jM= github.com/abice/go-enum v0.5.7/go.mod h1:FBDp+2Ygv9ZZzgcd+Gx3XbyClH7xxFfw8ghMrOpwu+A= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOSchFS7Eo= -github.com/alicebob/miniredis/v2 v2.30.4/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/alicebob/miniredis/v2 v2.30.5 h1:3r6kTHdKnuP4fkS8k2IrvSfxpxUTcW1SOL0wN7b7Dt0= +github.com/alicebob/miniredis/v2 v2.30.5/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= github.com/avast/retry-go/v4 v4.5.0 h1:QoRAZZ90cj5oni2Lsgl2GW8mNTnUCnmpx/iKpwVisHg= From 79300a4cc423c68f5f7d16f208a9a711c6e7e7d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 10:01:44 +0200 Subject: [PATCH 81/92] build(deps): bump github.com/testcontainers/testcontainers-go (#1108) Bumps [github.com/testcontainers/testcontainers-go](https://github.com/testcontainers/testcontainers-go) from 0.22.0 to 0.23.0. - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](https://github.com/testcontainers/testcontainers-go/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: github.com/testcontainers/testcontainers-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index c3d4a5398..c1bfe576d 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/ThinkChaos/parcour v0.0.0-20230710171753-fbf917c9eaef github.com/docker/go-connections v0.4.0 github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198 - github.com/testcontainers/testcontainers-go v0.22.0 + github.com/testcontainers/testcontainers-go v0.23.0 mvdan.cc/gofumpt v0.5.0 ) @@ -50,7 +50,7 @@ require ( github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/cenkalti/backoff/v4 v4.2.0 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/containerd/containerd v1.7.3 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect diff --git a/go.sum b/go.sum index 7af4c852c..8df60af2d 100644 --- a/go.sum +++ b/go.sum @@ -32,8 +32,8 @@ github.com/avast/retry-go/v4 v4.5.0/go.mod h1:7hLEXp0oku2Nir2xBAsg0PTphp9z71bN5A github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= -github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= -github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= @@ -262,8 +262,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/testcontainers/testcontainers-go v0.22.0 h1:hOK4NzNu82VZcKEB1aP9LO1xYssVFMvlfeuDW9JMmV0= -github.com/testcontainers/testcontainers-go v0.22.0/go.mod h1:k0YiPa26xJCRUbUkYqy5rY6NGvSbVCeUBXCvucscBR4= +github.com/testcontainers/testcontainers-go v0.23.0 h1:ERYTSikX01QczBLPZpqsETTBO7lInqEP349phDOVJVs= +github.com/testcontainers/testcontainers-go v0.23.0/go.mod h1:3gzuZfb7T9qfcH2pHpV4RLlWrPjeWNQah6XlYQ32c4I= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= From d4005675a99ff88e415cdd44b89f7755cc219f4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 10:02:30 +0200 Subject: [PATCH 82/92] build(deps): bump gorm.io/driver/sqlite from 1.5.1 to 1.5.3 (#1110) Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.5.1 to 1.5.3. - [Commits](https://github.com/go-gorm/sqlite/compare/v1.5.1...v1.5.3) --- updated-dependencies: - dependency-name: gorm.io/driver/sqlite dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index c1bfe576d..6916878b0 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.5.0 gorm.io/driver/postgres v1.5.2 - gorm.io/driver/sqlite v1.5.1 + gorm.io/driver/sqlite v1.5.3 gorm.io/gorm v1.25.2 ) @@ -108,7 +108,7 @@ require ( github.com/labstack/gommon v0.4.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.16 // indirect - github.com/mattn/go-sqlite3 v1.14.16 // indirect + github.com/mattn/go-sqlite3 v1.14.17 // indirect github.com/mattn/goveralls v0.0.12 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect diff --git a/go.sum b/go.sum index 8df60af2d..08950635d 100644 --- a/go.sum +++ b/go.sum @@ -172,8 +172,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= +github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/goveralls v0.0.12 h1:PEEeF0k1SsTjOBQ8FOmrOAoCu4ytuMaWCnWe94zxbCg= github.com/mattn/goveralls v0.0.12/go.mod h1:44ImGEUfmqH8bBtaMrYKsM65LXfNLWmwaxFGjZwgMSQ= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= @@ -407,8 +407,8 @@ gorm.io/driver/mysql v1.5.0 h1:6hSAT5QcyIaty0jfnff0z0CLDjyRgZ8mlMHLqSt7uXM= gorm.io/driver/mysql v1.5.0/go.mod h1:FFla/fJuCvyTi7rJQd27qlNX2v3L6deTR1GgTjSOLPo= gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0= gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8= -gorm.io/driver/sqlite v1.5.1 h1:hYyrLkAWE71bcarJDPdZNTLWtr8XrSjOWyjUYI6xdL4= -gorm.io/driver/sqlite v1.5.1/go.mod h1:7MZZ2Z8bqyfSQA1gYEV6MagQWj3cpUkJj9Z+d1HEMEQ= +gorm.io/driver/sqlite v1.5.3 h1:7/0dUgX28KAcopdfbRWWl68Rflh6osa4rDh+m51KL2g= +gorm.io/driver/sqlite v1.5.3/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho= gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= From 32ceb68daa8ab7091fd8018d30fea52ef501cb82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 08:03:56 +0000 Subject: [PATCH 83/92] build(deps): bump gorm.io/gorm from 1.25.2 to 1.25.4 (#1111) Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.25.2 to 1.25.4. - [Release notes](https://github.com/go-gorm/gorm/releases) - [Commits](https://github.com/go-gorm/gorm/compare/v1.25.2...v1.25.4) --- updated-dependencies: - dependency-name: gorm.io/gorm dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6916878b0..9287708ca 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( gorm.io/driver/mysql v1.5.0 gorm.io/driver/postgres v1.5.2 gorm.io/driver/sqlite v1.5.3 - gorm.io/gorm v1.25.2 + gorm.io/gorm v1.25.4 ) require ( diff --git a/go.sum b/go.sum index 08950635d..583cf1cea 100644 --- a/go.sum +++ b/go.sum @@ -410,8 +410,8 @@ gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBp gorm.io/driver/sqlite v1.5.3 h1:7/0dUgX28KAcopdfbRWWl68Rflh6osa4rDh+m51KL2g= gorm.io/driver/sqlite v1.5.3/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho= -gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.4 h1:iyNd8fNAe8W9dvtlgeRI5zSVZPsq3OpcTu37cYcpCmw= +gorm.io/gorm v1.25.4/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= From 34dd6eb49ecc70a3b3acdc400ac6589301796727 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 10:18:48 +0200 Subject: [PATCH 84/92] build(deps): bump golang.org/x/tools from 0.11.1 to 0.12.0 (#1098) Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.11.1 to 0.12.0. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.11.1...v0.12.0) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9287708ca..fab1ca8ac 100644 --- a/go.mod +++ b/go.mod @@ -131,7 +131,7 @@ require ( golang.org/x/sys v0.11.0 // indirect golang.org/x/term v0.11.0 // indirect golang.org/x/text v0.12.0 // indirect - golang.org/x/tools v0.11.1 + golang.org/x/tools v0.12.0 google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 583cf1cea..49682b490 100644 --- a/go.sum +++ b/go.sum @@ -372,8 +372,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= -golang.org/x/tools v0.11.1 h1:ojD5zOW8+7dOGzdnNgersm8aPfcDjhMp12UfG93NIMc= -golang.org/x/tools v0.11.1/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/tools/cmd/cover v0.1.0-deprecated h1:Rwy+mWYz6loAF+LnG1jHG/JWMHRMMC2/1XX3Ejkx9lA= golang.org/x/tools/cmd/cover v0.1.0-deprecated/go.mod h1:hMDiIvlpN1NoVgmjLjUJE9tMHyxHjFX7RuQ+rW12mSA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From faae4fcb3002c92491fb964dbc779a41f87522bc Mon Sep 17 00:00:00 2001 From: Dimitri Herzog Date: Tue, 22 Aug 2023 10:25:31 +0200 Subject: [PATCH 85/92] test: remove temporary fix (bug in testcontainers) (#1106) --- .github/workflows/makefile.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index 813ef04ba..fa4809c21 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -50,9 +50,7 @@ jobs: uses: actions/setup-go@v4 if: matrix.go == true with: - #pinning to 1.20.5 until https://github.com/testcontainers/testcontainers-go/issues/1359 is resolved - go-version: "1.20.5" - #go-version-file: go.mod + go-version-file: go.mod - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 From 420b4fd86b2d4dad9d4cb19d6e6c31089c3524ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:25:42 +0200 Subject: [PATCH 86/92] build(deps): bump github.com/google/uuid from 1.3.0 to 1.3.1 (#1112) Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.3.0 to 1.3.1. - [Release notes](https://github.com/google/uuid/releases) - [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/uuid/compare/v1.3.0...v1.3.1) --- updated-dependencies: - dependency-name: github.com/google/uuid dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fab1ca8ac..d370c0d99 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/go-chi/chi/v5 v5.0.10 github.com/go-chi/cors v1.2.1 github.com/go-redis/redis/v8 v8.11.5 - github.com/google/uuid v1.3.0 + github.com/google/uuid v1.3.1 github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/golang-lru v1.0.2 diff --git a/go.sum b/go.sum index 49682b490..21078c491 100644 --- a/go.sum +++ b/go.sum @@ -116,8 +116,8 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/pprof v0.0.0-20230309165930-d61513b1440d h1:um9/pc7tKMINFfP1eE7Wv6PRGXlcCSJkVajF7KJw3uQ= github.com/google/pprof v0.0.0-20230309165930-d61513b1440d/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b h1:wDUNC2eKiL35DbLvsDhiblTUXHxcOPwQSCzi7xpQUN4= github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b/go.mod h1:VzxiSdG6j1pi7rwGm/xYI5RbtpBgM8sARDXlvEvxlu0= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= From 405f3f71fbdd6e3a3ccb378ba8c9010559237d09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 08:36:07 +0200 Subject: [PATCH 87/92] build(deps): bump github.com/onsi/ginkgo/v2 from 2.11.0 to 2.12.0 (#1115) Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.11.0 to 2.12.0. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.11.0...v2.12.0) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d370c0d99..90fb33698 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/miekg/dns v1.1.55 github.com/mroth/weightedrand/v2 v2.1.0 - github.com/onsi/ginkgo/v2 v2.11.0 + github.com/onsi/ginkgo/v2 v2.12.0 github.com/onsi/gomega v1.27.10 github.com/prometheus/client_golang v1.16.0 github.com/sirupsen/logrus v1.9.3 diff --git a/go.sum b/go.sum index 21078c491..074883b0d 100644 --- a/go.sum +++ b/go.sum @@ -203,8 +203,8 @@ github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= +github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= +github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= From 1dcbf9023249f104a915bc533975ebd416aa7276 Mon Sep 17 00:00:00 2001 From: Dimitri Herzog Date: Thu, 31 Aug 2023 14:47:15 +0200 Subject: [PATCH 88/92] chore(build): update Golang to 1.21 (#1122) --- go.mod | 2 +- go.sum | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 90fb33698..bc6738f44 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/0xERR0R/blocky -go 1.20 +go 1.21 require ( github.com/abice/go-enum v0.5.7 diff --git a/go.sum b/go.sum index 074883b0d..fe0db646d 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,7 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 h1:EKPd1INOIyr5hWOWhvpmQpY6tKjeG0hT1s3AMC/9fic= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1/go.mod h1:VzwV+t+dZ9j/H867F1M2ziD+yLHtB46oM35FxxMJ4d0= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -17,6 +18,7 @@ github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBa github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.10.0-rc.8 h1:YSZVvlIIDD1UxQpJp0h+dnpLUw+TrY0cx8obKsp3bek= +github.com/Microsoft/hcsshim v0.10.0-rc.8/go.mod h1:OEthFdQv/AD2RAdzR6Mm1N1KPCztGKDurW1Z8b8VGMM= github.com/ThinkChaos/parcour v0.0.0-20230710171753-fbf917c9eaef h1:lg6zRor4+PZN1Pxqtieo/NMhd61ZdV1Z/+bFURWIVfU= github.com/ThinkChaos/parcour v0.0.0-20230710171753-fbf917c9eaef/go.mod h1:hkcYs23P9zbezt09v8168B4lt69PGuoxRPQ6IJHKpHo= github.com/abice/go-enum v0.5.7 h1:vOrobjpce5D/x5hYNqrWRkFUXFk7A6BlsJyVy4BS1jM= @@ -32,6 +34,7 @@ github.com/avast/retry-go/v4 v4.5.0/go.mod h1:7hLEXp0oku2Nir2xBAsg0PTphp9z71bN5A github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= +github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -52,6 +55,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHH github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/creasty/defaults v1.7.0 h1:eNdqZvc5B509z18lD8yc212CAqJNvfT1Jq6L8WowdBA= github.com/creasty/defaults v1.7.0/go.mod h1:iGzKe6pbEHnpMPtfDXZEr0NVxWnPTjb1bbDy08fPzYM= github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI= @@ -74,7 +78,9 @@ github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198 h1:3b37D/Oxs95GmDsGK github.com/dosgo/zigtool v0.0.0-20210923085854-9c6fc1d62198/go.mod h1:NUrh34aXXgbs4C2HkTmRmkzsKhtrFPRitYkbZMDDONo= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= @@ -153,6 +159,7 @@ github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQs github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -202,7 +209,9 @@ github.com/mroth/weightedrand/v2 v2.1.0/go.mod h1:f2faGsfOGOwc1p94wzHKKZyTpcJUW7 github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= 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.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= @@ -230,6 +239,7 @@ github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPH github.com/ramr/go-reaper v0.2.1 h1:zww+wlQOvTjBZuk1920R/e0GFEb6O7+B0WQLV6dM924= github.com/ramr/go-reaper v0.2.1/go.mod h1:AVypdzrcCXjSc/JYnlXl8TsB+z84WyFzxWE8Jh0MOJc= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 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= @@ -364,6 +374,7 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -393,7 +404,9 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= 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.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= @@ -413,6 +426,7 @@ gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqw gorm.io/gorm v1.25.4 h1:iyNd8fNAe8W9dvtlgeRI5zSVZPsq3OpcTu37cYcpCmw= gorm.io/gorm v1.25.4/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= From 7645ed35a358b1d66a2b664bf6776f3181788eae Mon Sep 17 00:00:00 2001 From: Dimitri Herzog Date: Thu, 31 Aug 2023 14:47:30 +0200 Subject: [PATCH 89/92] chore(build): update golangci-lint to 1.54.2 (#1121) --- .golangci.yml | 3 +-- Makefile | 2 +- resolver/client_names_resolver.go | 2 +- resolver/hosts_file_resolver.go | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 3572589d5..48e053566 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,7 +3,6 @@ linters: - asciicheck - bidichk - bodyclose - - depguard - dogsled - dupl - durationcheck @@ -63,7 +62,7 @@ linters: - deadcode - varcheck - forbidigo - + - gosmopolitan disable-all: false presets: - bugs diff --git a/Makefile b/Makefile index d318cd489..90fc91061 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ GO_BUILD_LD_FLAGS:=\ GO_BUILD_OUTPUT:=$(BIN_OUT_DIR)/$(BINARY_NAME)$(BINARY_SUFFIX) # define version of golangci-lint here. If defined in tools.go, go mod perfoms automatically downgrade to older version which doesn't work with golang >=1.18 -GOLANG_LINT_VERSION=v1.51.2 +GOLANG_LINT_VERSION=v1.54.2 export PATH=$(shell go env GOPATH)/bin:$(shell echo $$PATH) diff --git a/resolver/client_names_resolver.go b/resolver/client_names_resolver.go index c7838b212..37d30c8c1 100644 --- a/resolver/client_names_resolver.go +++ b/resolver/client_names_resolver.go @@ -112,7 +112,7 @@ func (r *ClientNamesResolver) resolveClientNames(ip net.IP, logger *logrus.Entry // try client mapping first result = r.getNameFromIPMapping(ip, result) if len(result) > 0 { - return + return result } if r.externalResolver == nil { diff --git a/resolver/hosts_file_resolver.go b/resolver/hosts_file_resolver.go index 3fc29151d..be4b0eb72 100644 --- a/resolver/hosts_file_resolver.go +++ b/resolver/hosts_file_resolver.go @@ -156,7 +156,7 @@ func (r *HostsFileResolver) loadSources(ctx context.Context) error { r.log().Debug("loading hosts files") - //nolint:ineffassign,staticcheck // keep `ctx :=` so if we use ctx in the future, we use the correct one + //nolint:ineffassign,staticcheck,wastedassign // keep `ctx :=` so if we use ctx in the future, we use the correct one consumersGrp, ctx := jobgroup.WithContext(ctx) defer consumersGrp.Close() From 7782818e8d49cc71d1e605608a049b5da75d8815 Mon Sep 17 00:00:00 2001 From: Dimitri Herzog Date: Fri, 1 Sep 2023 21:39:58 +0200 Subject: [PATCH 90/92] chore(build): change deprecated "rm-dist" flag to "clean" (#1120) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3bb4d2a13..72207ef11 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,6 +87,6 @@ jobs: uses: goreleaser/goreleaser-action@v4 with: version: latest - args: release --rm-dist + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From d8d7fa52d6551b0c13e199ede4d8056a559c801e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:50:17 +0200 Subject: [PATCH 91/92] build(deps): bump actions/checkout from 3 to 4 (#1127) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/development-docker.yml | 6 +++--- .github/workflows/docs.yml | 2 +- .github/workflows/goreleaser-test.yml | 2 +- .github/workflows/makefile.yml | 2 +- .github/workflows/mirror-repo.yml | 2 +- .github/workflows/release.yml | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1730412b0..ac4f47b1b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Use Golang cache - name: Setup Golang diff --git a/.github/workflows/development-docker.yml b/.github/workflows/development-docker.yml index 1d4bf7adf..e1cc1b0d2 100644 --- a/.github/workflows/development-docker.yml +++ b/.github/workflows/development-docker.yml @@ -59,7 +59,7 @@ jobs: branch: ${{ steps.get_vars.outputs.branch }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -148,7 +148,7 @@ jobs: if: needs.check.outputs.enabled == 1 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run Trivy vulnerability scanner in repo mode uses: aquasecurity/trivy-action@master @@ -170,7 +170,7 @@ jobs: needs: docker steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a8112339b..2295aa084 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event.repository.has_pages && (github.repository_owner != '0xERR0R' || github.ref_type == 'tag' || github.ref_name == 'main') }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/goreleaser-test.yml b/.github/workflows/goreleaser-test.yml index 4d265d631..5490ef8e4 100644 --- a/.github/workflows/goreleaser-test.yml +++ b/.github/workflows/goreleaser-test.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index fa4809c21..5523be751 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -44,7 +44,7 @@ jobs: steps: - name: Check out code into the Go module directory - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Golang uses: actions/setup-go@v4 diff --git a/.github/workflows/mirror-repo.yml b/.github/workflows/mirror-repo.yml index 7f6f1fd2b..026767ec6 100644 --- a/.github/workflows/mirror-repo.yml +++ b/.github/workflows/mirror-repo.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == '0xERR0R' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: yesolutions/mirror-action@master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72207ef11..8090b2edf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: if: github.repository_owner == '0xERR0R' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 From 51bb54b5959619955b84c5d49484a41caf294501 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:50:31 +0200 Subject: [PATCH 92/92] build(deps): bump github.com/swaggo/swag from 1.16.1 to 1.16.2 (#1123) Bumps [github.com/swaggo/swag](https://github.com/swaggo/swag) from 1.16.1 to 1.16.2. - [Release notes](https://github.com/swaggo/swag/releases) - [Changelog](https://github.com/swaggo/swag/blob/master/.goreleaser.yml) - [Commits](https://github.com/swaggo/swag/compare/v1.16.1...v1.16.2) --- updated-dependencies: - dependency-name: github.com/swaggo/swag dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index bc6738f44..1204f72b0 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 - github.com/swaggo/swag v1.16.1 + github.com/swaggo/swag v1.16.2 github.com/x-cray/logrus-prefixed-formatter v0.5.2 golang.org/x/net v0.14.0 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index fe0db646d..8f569e2df 100644 --- a/go.sum +++ b/go.sum @@ -269,8 +269,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= -github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= +github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04= +github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/testcontainers/testcontainers-go v0.23.0 h1:ERYTSikX01QczBLPZpqsETTBO7lInqEP349phDOVJVs= github.com/testcontainers/testcontainers-go v0.23.0/go.mod h1:3gzuZfb7T9qfcH2pHpV4RLlWrPjeWNQah6XlYQ32c4I=