Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TLS support #16

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
44f5505
add tls support from node exporter
kostage Jul 6, 2022
33ad7fc
Merge pull request #1 from kostage/add-tls-support
kostage Jul 6, 2022
60d4b79
add tls support from node exporter
kostage Jul 6, 2022
1b606e4
Merge branch 'master' into add-tls-support
kostage Jul 8, 2022
428c9be
Merge pull request #2 from kostage/add-tls-support
kostage Jul 8, 2022
4497788
add tls support from node exporter
kostage Jul 6, 2022
64ad330
Merge branch 'master' into add-tls-support
kostage Jul 10, 2022
3a92790
Merge pull request #3 from kostage/add-tls-support
kostage Jul 10, 2022
a6b00fd
add tls support from node exporter
kostage Jul 6, 2022
e7cd2f0
Merge branch 'master' into add-tls-support
kostage Jul 10, 2022
c1e3355
Merge pull request #4 from kostage/add-tls-support
kostage Jul 10, 2022
49716e8
trying to make release artifacts
kostage Jul 16, 2022
0e1ddea
Merge pull request #5 from kostage/improve-release-process
kostage Jul 16, 2022
67a60e9
trying to make release artifacts 2
kostage Jul 16, 2022
37ee01f
Merge pull request #6 from kostage/improve-release-process
kostage Jul 16, 2022
49baf5d
trying to make release artifacts 3
kostage Jul 16, 2022
77915f4
trying to make release artifacts 4
kostage Jul 16, 2022
fdba839
Merge pull request #7 from kostage/improve-release-process
kostage Jul 16, 2022
52bf195
trying to make release artifacts 4
kostage Jul 16, 2022
4146ba1
Merge pull request #8 from kostage/improve-release-process
kostage Jul 16, 2022
6a5356f
trying to make release artifacts 4
kostage Jul 16, 2022
ab170e8
Merge branch 'master' into improve-release-process
kostage Jul 16, 2022
2298ea6
Merge pull request #9 from kostage/improve-release-process
kostage Jul 16, 2022
6f3693e
Merge pull request #10 from solarlabsteam/master
kostage Jul 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .github/workflows/actions.yaml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: build

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16.4
-
name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Tests
run: |
go mod tidy
go test -v ./...
30 changes: 25 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,38 @@ permissions:
contents: write

jobs:
goreleaser:
build-artifacts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.16.5'
go-version: 1.16.4
-
name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Tests
run: |
go mod tidy
go test -v ./...
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 3 additions & 24 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,10 @@
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
- env: [CGO_ENABLED=0]
goos:
- linux
- windows
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
goarch:
- amd64
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,26 @@ An example of the network where you have to specify all the prefixes manually is

Additionally, you can pass a `--config` flag with a path to your config file (I use `.toml`, but anything supported by [viper](https://github.com/spf13/viper) should work).

## TLS endpoint

** EXPERIMENTAL **

The exporter supports TLS via a new web configuration file.

```console
./cosmos-exporter --web-config=web-config.yml
```
### Web config example
```toml
tls_server_config:
cert_file: /path/to/server.crt
key_file: /path/to/server.key

basic_auth_users:
prometheus: "$2y$10$QOauhQNbBCuQDKes6eFzPeMqBSjb7Mr5DUmpZ/VcEd00UAV/LDeSi"
```
See the [exporter-toolkit https package](https://github.com/prometheus/exporter-toolkit/blob/v0.1.0/https/README.md) for more details.

## Which networks this is guaranteed to work?

In theory, it should work on a Cosmos-based blockchains with cosmos-sdk >= 0.40.0 (that's when they added gRPC and IBC support). If this doesn't work on some chains, please file and issue and let's see what's up.
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ replace google.golang.org/grpc => google.golang.org/grpc v1.33.2

require (
github.com/cosmos/cosmos-sdk v0.42.4
github.com/go-kit/log v0.2.1
github.com/google/uuid v1.2.0
github.com/prometheus/client_golang v1.8.0
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/exporter-toolkit v0.7.1
github.com/rs/zerolog v1.20.0
github.com/spf13/cobra v1.1.1
github.com/spf13/pflag v1.0.5
Expand Down
Loading