diff --git a/.github/scripts/updateTraefikMiddlewareVersions.sh b/.github/scripts/updateTraefikMiddlewareVersions.sh index 5b60b8aca3f..e3e95134b01 100755 --- a/.github/scripts/updateTraefikMiddlewareVersions.sh +++ b/.github/scripts/updateTraefikMiddlewareVersions.sh @@ -1,10 +1,10 @@ #! /bin/bash trainsPath="./charts" -traefikTrain="stable" +traefikTrain="enterprise" get_latest_release() { - # Get latest release from GitHub api + # Get latest release from GitHub api, NOTE: Remove the header when running locally (or add a valid token) curl --silent \ --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ --url "https://api.github.com/repos/$1/releases/latest" | diff --git a/charts/enterprise/traefik/templates/middlewares/geoblock.yaml b/charts/enterprise/traefik/templates/middlewares/geoblock.yaml index 1f0fb752769..be21bcf57b6 100644 --- a/charts/enterprise/traefik/templates/middlewares/geoblock.yaml +++ b/charts/enterprise/traefik/templates/middlewares/geoblock.yaml @@ -24,6 +24,7 @@ spec: forceMonthlyUpdate: {{ $middlewareData.forceMonthlyUpdate }} allowUnknownCountries: {{ $middlewareData.allowUnknownCountries }} unknownCountryApiResponse: {{ $middlewareData.unknownCountryApiResponse }} + blackListMode: {{ $middlewareData.blackListMode }} {{- if not $middlewareData.countries }} {{- fail "You have to define at least one country..." }} {{- end }} diff --git a/charts/enterprise/traefik/values.yaml b/charts/enterprise/traefik/values.yaml index bd211b479b5..1c0fa61a784 100644 --- a/charts/enterprise/traefik/values.yaml +++ b/charts/enterprise/traefik/values.yaml @@ -376,7 +376,7 @@ middlewares: addPrefix: [] # - name: addPrefixName # prefix: "/foo" - geoBlockVersion: v0.2.3 + geoBlockVersion: v0.2.4 geoBlock: [] # -- https://github.com/PascalMinder/geoblock # - name: geoBlockName @@ -390,6 +390,7 @@ middlewares: # forceMonthlyUpdate: true # allowUnknownCountries: false # unknownCountryApiResponse: nil + # blackListMode: false # countries: # - RU diff --git a/templates/questions/traefik/geoBlockMiddleware.yaml b/templates/questions/traefik/geoBlockMiddleware.yaml index 0a73307c918..d83cf79fca7 100644 --- a/templates/questions/traefik/geoBlockMiddleware.yaml +++ b/templates/questions/traefik/geoBlockMiddleware.yaml @@ -82,15 +82,22 @@ type: string required: true default: nil + - variable: blackListMode + label: Blacklist Mode + description: When set to true the filter logic is inverted, i.e. requests originating from countries listed in the countries list are blocked. + schema: + type: boolean + default: false - variable: countries - label: Blocked Countries + description: Country codes (2 characters) from which connections to the service should be allowed or blocked, based on the mode. + label: Countries schema: type: list default: [] items: - - variable: blockedCountryEntry - label: Blocked Country - description: Country codes (2 characters) from which connections to the service should be allowed. + - variable: countryEntry + label: Country + description: Country codes (2 characters) from which connections to the service should be allowed or blocked, based on the mode. schema: type: string required: true