You've already forked prometheus-fail2ban-exporter
							
							Compare commits
	
		
			1 Commits
		
	
	
		
			master
			...
			ba33ee3645
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ba33ee3645 | 
| @@ -1 +0,0 @@ | ||||
| prometheus-fail2ban-exporter | ||||
| @@ -1,13 +1,15 @@ | ||||
| # Editor configuration, see http://editorconfig.org | ||||
| # EditorConfig is awesome: https://EditorConfig.org | ||||
|  | ||||
| # top-most EditorConfig file | ||||
| root = true | ||||
|  | ||||
| [*] | ||||
| charset = utf-8 | ||||
| end_of_line = lf | ||||
| indent_size = 2 | ||||
| indent_style = space | ||||
| insert_final_newline = false | ||||
| indent_size = 2 | ||||
| end_of_line = lf | ||||
| charset = utf-8 | ||||
| trim_trailing_whitespace = true | ||||
| insert_final_newline = false | ||||
|  | ||||
| [{Makefile,*.go}] | ||||
| indent_style = tab | ||||
| [Makefile] | ||||
| indent_style = tab | ||||
| @@ -1,4 +1,4 @@ | ||||
| name: "Run Golang tests" | ||||
| name: Golang Tests | ||||
|  | ||||
| on: | ||||
|   pull_request: | ||||
| @@ -6,27 +6,9 @@ on: | ||||
|   push: | ||||
|     branches: [ '**' ] | ||||
|     tags-ignore: [ '**' ] | ||||
|   workflow_dispatch: {} | ||||
|  | ||||
| jobs: | ||||
|   # integration-test: | ||||
|   #   name: "Run integration tests" | ||||
|   #   runs-on: ${{ matrix.os }} | ||||
|   #   strategy: | ||||
|   #     matrix: | ||||
|   #       go: [ stable ] | ||||
|   #       os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ] | ||||
|   #   steps: | ||||
|   #   - uses: actions/checkout@v4.3.0 | ||||
|   #   - uses: actions/setup-go@v5.5.0 | ||||
|   #     with: | ||||
|   #       go-version: ${{ matrix.go }} | ||||
|   #   - env: | ||||
|   #       GOPROXY: ${{ vars.GOPROXY }} | ||||
|   #     run: make test/integration | ||||
|  | ||||
|   unit-test: | ||||
|     name: "Run unit tests" | ||||
|   unittest: | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       matrix: | ||||
| @@ -34,24 +16,9 @@ jobs: | ||||
|         os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ] | ||||
|     steps: | ||||
|     - uses: actions/checkout@v5.0.0 | ||||
|     - uses: actions/setup-go@v6.0.0 | ||||
|     - uses: actions/setup-go@v5.5.0 | ||||
|       with: | ||||
|         go-version: ${{ matrix.go }} | ||||
|     - env: | ||||
|         GOPROXY: ${{ vars.GOPROXY }} | ||||
|       run: make test/unit | ||||
|     - id: coverage | ||||
|       name: Check coverage | ||||
|       run: | | ||||
|         coverage="$(make test/coverage | grep total | awk '{ print substr($3, 1, length($3)-1); }')" | ||||
|         echo "total_coverage=$coverage" >> $GITHUB_OUTPUT | ||||
|         echo "Total coverage: ${coverage}%" | ||||
|     - name: Fail if coverage is to low | ||||
|       run: | | ||||
|         threshold=5 | ||||
|         total_coverage=${{ steps.coverage.outputs.total_coverage }} | ||||
|  | ||||
|         if (( ${total_coverage%.*} < ${threshold} )); then | ||||
|           echo "ERROR: Coverage (${total_coverage}%) is below the threshold (${threshold}%)." 1>&2 | ||||
|           exit 1 | ||||
|         fi | ||||
| @@ -1,4 +1,4 @@ | ||||
| name: "Lint Golang files" | ||||
| name: Golang CI lint | ||||
| 
 | ||||
| on: | ||||
|   pull_request: | ||||
| @@ -6,14 +6,12 @@ on: | ||||
|   push: | ||||
|     branches: [ '**' ] | ||||
|     tags-ignore: [ '**' ] | ||||
|   workflow_dispatch: {} | ||||
| 
 | ||||
| permissions: | ||||
|   contents: read | ||||
| 
 | ||||
| jobs: | ||||
|   golangci: | ||||
|     name: "Run golang CI linter" | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       matrix: | ||||
| @@ -21,9 +19,9 @@ jobs: | ||||
|         os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ] | ||||
|     steps: | ||||
|     - uses: actions/checkout@v5.0.0 | ||||
|     - uses: actions/setup-go@v6.0.0 | ||||
|     - uses: actions/setup-go@v5.5.0 | ||||
|       with: | ||||
|         go-version: ${{ matrix.go }} | ||||
|     - uses: golangci/golangci-lint-action@v8.0.0 | ||||
|       with: | ||||
|         version: v2.6.0 # renovate: datasource=github-releases depName=golangci/golangci-lint | ||||
|         version: v2.1 | ||||
| @@ -1,4 +1,4 @@ | ||||
| name: "Lint Markdown files" | ||||
| name: 'Lint Markdown files' | ||||
|  | ||||
| on: | ||||
|   pull_request: | ||||
| @@ -6,14 +6,13 @@ on: | ||||
|   push: | ||||
|     branches: [ '*' ] | ||||
|     tags-ignore: [ '*' ] | ||||
|   workflow_dispatch: {} | ||||
|  | ||||
| jobs: | ||||
|   markdown-lint: | ||||
|     name: "Run markdown linter" | ||||
|     runs-on: ubuntu-latest | ||||
|     runs-on: | ||||
|     - ubuntu-latest | ||||
|     steps: | ||||
|     - uses: actions/checkout@v5.0.0 | ||||
|     - uses: DavidAnson/markdownlint-cli2-action@v20.0.0 | ||||
|       with: | ||||
|         globs: '**/*.md' | ||||
|         globs: '**/*.md' | ||||
| @@ -1,4 +1,4 @@ | ||||
| name: "Release" | ||||
| name: Release | ||||
|  | ||||
| on: | ||||
|   push: | ||||
| @@ -9,15 +9,15 @@ permissions: | ||||
|  | ||||
| jobs: | ||||
|   release: | ||||
|     name: "Release application" | ||||
|     runs-on: ubuntu-latest | ||||
|     runs-on: | ||||
|     - ubuntu-latest | ||||
|     steps: | ||||
|     - uses: actions/checkout@v5.0.0 | ||||
|     - uses: docker/setup-qemu-action@v3.6.0 | ||||
|     - uses: actions/setup-go@v6.0.0 | ||||
|     - uses: actions/setup-go@v5.5.0 | ||||
|       with: | ||||
|         go-version: stable | ||||
|     - uses: docker/login-action@v3.6.0 | ||||
|     - uses: docker/login-action@v3.5.0 | ||||
|       with: | ||||
|         registry: git.cryptic.systems | ||||
|         username: ${{ github.repository_owner }} | ||||
| @@ -26,13 +26,12 @@ jobs: | ||||
|         GITEA_TOKEN: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} | ||||
|         GONOSUMDB: ${{ vars.GONOSUMDB }} | ||||
|         GOPROXY: ${{ vars.GOPROXY }} | ||||
|       uses: goreleaser/goreleaser-action@v6.4.0 | ||||
|       uses: goreleaser/goreleaser-action@v6.3.0 | ||||
|       with: | ||||
|         version: v2.12.7 # renovate: datasource=github-releases depName=goreleaser/goreleaser | ||||
|         version: "~> v2" | ||||
|         args: release --clean | ||||
|  | ||||
|   sync-to-hub-docker-io: | ||||
|     name: "Upload Images to docker.io" | ||||
|     needs: | ||||
|     - release | ||||
|     runs-on: ubuntu-latest | ||||
|   | ||||
| @@ -12,7 +12,7 @@ jobs: | ||||
|     - ubuntu-latest | ||||
|     steps: | ||||
|     - uses: actions/checkout@v5.0.0 | ||||
|     - uses: peter-evans/dockerhub-description@v5.0.0 | ||||
|     - uses: peter-evans/dockerhub-description@v4.0.2 | ||||
|       with: | ||||
|         username: ${{ secrets.DOCKER_IO_USERNAME }} | ||||
|         password: ${{ secrets.DOCKER_IO_PASSWORD }} | ||||
|   | ||||
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,3 +1,3 @@ | ||||
| prometheus-fail2ban-exporter | ||||
| coverage.* | ||||
| coverage.txt | ||||
| dist | ||||
| @@ -1,13 +0,0 @@ | ||||
| version: "2" | ||||
| linters: | ||||
|   default: standard | ||||
|   enable: | ||||
|   - errname | ||||
|   - gosec | ||||
|  | ||||
|   exclusions: | ||||
|     rules: [] | ||||
|     warn-unused: true | ||||
|  | ||||
| run: | ||||
|   tests: true | ||||
							
								
								
									
										6
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
									
									
									
									
								
							| @@ -40,7 +40,7 @@ PHONY+=test/unit | ||||
| test/unit: | ||||
| 	CGO_ENABLED=0 \ | ||||
| 	GOPROXY=$(shell go env GOPROXY) \ | ||||
| 		go test -v -p 1 -coverprofile=coverage.out -covermode=count -timeout 1200s ./... | ||||
| 		go test -v -p 1 -coverprofile=coverage.txt -covermode=count -timeout 1200s ./... | ||||
|  | ||||
| PHONY+=test/integration | ||||
| test/integration: | ||||
| @@ -49,10 +49,10 @@ test/integration: | ||||
| 		go test -v -p 1 -count=1 -timeout 1200s ./it/... | ||||
|  | ||||
| PHONY+=test/coverage | ||||
| test/coverage: | ||||
| test/coverage: test/unit | ||||
| 	CGO_ENABLED=0 \ | ||||
| 	GOPROXY=$(shell go env GOPROXY) \ | ||||
| 		go tool cover -func=coverage.out | ||||
| 		go tool cover -html=coverage.txt | ||||
|  | ||||
| # GOLANGCI-LINT | ||||
| # ============================================================================== | ||||
|   | ||||
| @@ -37,7 +37,6 @@ func (c *Collector) collectFileContents() { | ||||
| 		} | ||||
|  | ||||
| 		fullPath := filepath.Join(c.folderPath, fileName) | ||||
| 		// #nosec G304 | ||||
| 		content, err := os.ReadFile(fullPath) | ||||
| 		if err != nil { | ||||
| 			c.appendErrorForPath(fileName) | ||||
|   | ||||
							
								
								
									
										14
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								go.mod
									
									
									
									
									
								
							| @@ -2,26 +2,24 @@ module git.cryptic.systems/volker.raschek/prometheus-fail2ban-exporter | ||||
|  | ||||
| go 1.23.0 | ||||
|  | ||||
| toolchain go1.25.3 | ||||
| toolchain go1.24.6 | ||||
|  | ||||
| require ( | ||||
| 	github.com/alecthomas/kong v1.12.1 | ||||
| 	github.com/kisielk/og-rek v1.3.0 | ||||
| 	github.com/nlpodyssey/gopickle v0.3.0 | ||||
| 	github.com/prometheus/client_golang v1.23.2 | ||||
| 	github.com/prometheus/client_golang v1.23.0 | ||||
| ) | ||||
|  | ||||
| require ( | ||||
| 	github.com/aristanetworks/gomap v0.0.0-20240919214256-2b26376628e1 // indirect | ||||
| 	github.com/beorn7/perks v1.0.1 // indirect | ||||
| 	github.com/cespare/xxhash/v2 v2.3.0 // indirect | ||||
| 	github.com/kr/text v0.2.0 // indirect | ||||
| 	github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | ||||
| 	github.com/prometheus/client_model v0.6.2 // indirect | ||||
| 	github.com/prometheus/common v0.66.1 // indirect | ||||
| 	github.com/prometheus/common v0.65.0 // indirect | ||||
| 	github.com/prometheus/procfs v0.16.1 // indirect | ||||
| 	go.yaml.in/yaml/v2 v2.4.2 // indirect | ||||
| 	golang.org/x/sys v0.35.0 // indirect | ||||
| 	golang.org/x/text v0.28.0 // indirect | ||||
| 	google.golang.org/protobuf v1.36.8 // indirect | ||||
| 	golang.org/x/sys v0.33.0 // indirect | ||||
| 	golang.org/x/text v0.25.0 // indirect | ||||
| 	google.golang.org/protobuf v1.36.6 // indirect | ||||
| ) | ||||
|   | ||||
							
								
								
									
										36
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								go.sum
									
									
									
									
									
								
							| @@ -10,7 +10,6 @@ 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/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= | ||||
| github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= | ||||
| github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= | ||||
| 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/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= | ||||
| @@ -21,10 +20,6 @@ github.com/kisielk/og-rek v1.3.0 h1:lTXdQXqFETZKA//FWH4RBNAuiJ/dofxIwHAidoUZoMk= | ||||
| github.com/kisielk/og-rek v1.3.0/go.mod h1:4at7oxyfBTDilURhNCf7irHWtosJlJl9uyqUqAkrP4w= | ||||
| github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= | ||||
| github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= | ||||
| github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= | ||||
| github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= | ||||
| github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= | ||||
| github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= | ||||
| github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= | ||||
| github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= | ||||
| github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= | ||||
| @@ -33,30 +28,23 @@ github.com/nlpodyssey/gopickle v0.3.0 h1:BLUE5gxFLyyNOPzlXxt6GoHEMMxD0qhsE4p0CIQ | ||||
| github.com/nlpodyssey/gopickle v0.3.0/go.mod h1:f070HJ/yR+eLi5WmM1OXJEGaTpuJEUiib19olXgYha0= | ||||
| 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.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= | ||||
| github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= | ||||
| github.com/prometheus/client_golang v1.23.0 h1:ust4zpdl9r4trLY/gSjlm07PuiBq2ynaXXlptpfy8Uc= | ||||
| github.com/prometheus/client_golang v1.23.0/go.mod h1:i/o0R9ByOnHX0McrTMTyhYvKE4haaf2mW08I+jGAjEE= | ||||
| github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= | ||||
| github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= | ||||
| github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs= | ||||
| github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= | ||||
| github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE= | ||||
| github.com/prometheus/common v0.65.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8= | ||||
| github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= | ||||
| github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= | ||||
| 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/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= | ||||
| github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= | ||||
| github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= | ||||
| github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= | ||||
| go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= | ||||
| go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= | ||||
| go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= | ||||
| go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= | ||||
| golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= | ||||
| golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= | ||||
| golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= | ||||
| golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= | ||||
| google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= | ||||
| google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= | ||||
| gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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= | ||||
| golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= | ||||
| golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= | ||||
| golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= | ||||
| golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= | ||||
| google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= | ||||
| google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= | ||||
| gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||||
| gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||||
|   | ||||
		Reference in New Issue
	
	Block a user