304 Commits

Author SHA1 Message Date
Shizun Ge
5fadfc1cc3 Merge pull request #181 from firstred/proxy-protocol
Add PROXY protocol support
2025-09-11 17:33:32 -07:00
Michael Dekker
e1a2425ced Add PROXY protocol support 2025-09-12 00:00:26 +02:00
Shizun Ge
2470ee67d7 Merge pull request #180 from dataprolet/main
Remove obsolete "version" from compose files
2025-09-09 08:16:04 -07:00
dataprolet
5cf0b1fa3f Remove obsolete version 2025-09-09 16:33:56 +02:00
dataprolet
61483cde46 Remove obsolete version 2025-09-09 16:33:37 +02:00
Shizun Ge
37a5392166 Merge pull request #179 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.23.2
Bump github.com/prometheus/client_golang from 1.23.0 to 1.23.2
2025-09-08 11:37:58 -07:00
dependabot[bot]
02c896ba89 Bump github.com/prometheus/client_golang from 1.23.0 to 1.23.2
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.23.0 to 1.23.2.
- [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.23.0...v1.23.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.23.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 08:14:01 +00:00
Shizun Ge
e6070444c8 Merge pull request #178 from shizunge/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-08-25 09:58:11 -07:00
dependabot[bot]
0aa99ef83b Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [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/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-25 15:04:03 +00:00
Shizun Ge
1518c37fe7 Merge pull request #177 from shizunge/dependabot/github_actions/docker/login-action-3.5.0
Bump docker/login-action from 3.4.0 to 3.5.0
2025-08-12 00:40:08 -07:00
dependabot[bot]
7b30a30a37 Bump docker/login-action from 3.4.0 to 3.5.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 3.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 12:13:20 +00:00
Shizun Ge
c0db3758a8 Merge pull request #176 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.23.0
Bump github.com/prometheus/client_golang from 1.22.0 to 1.23.0
2025-08-04 08:54:34 -07:00
dependabot[bot]
0ef5dd1d16 Bump github.com/prometheus/client_golang from 1.22.0 to 1.23.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.22.0 to 1.23.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.22.0...v1.23.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 11:21:18 +00:00
Shizun Ge
644d2808f0 Add badges 2025-07-26 02:27:54 -07:00
Shizun Ge
35477d6c2b Merge pull request #175 from shizunge/dependabot/go_modules/github.com/oschwald/geoip2-golang-1.13.0
Bump github.com/oschwald/geoip2-golang from 1.11.0 to 1.13.0
2025-07-14 06:33:40 -07:00
dependabot[bot]
953a76b638 Bump github.com/oschwald/geoip2-golang from 1.11.0 to 1.13.0
Bumps [github.com/oschwald/geoip2-golang](https://github.com/oschwald/geoip2-golang) from 1.11.0 to 1.13.0.
- [Release notes](https://github.com/oschwald/geoip2-golang/releases)
- [Changelog](https://github.com/oschwald/geoip2-golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oschwald/geoip2-golang/compare/v1.11.0...v1.13.0)

---
updated-dependencies:
- dependency-name: github.com/oschwald/geoip2-golang
  dependency-version: 1.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-14 10:37:24 +00:00
Shizun Ge
97dd54bbb4 Merge pull request #174 from vst-name/main
Fixed type in error logs in metrics.go
2025-07-07 10:36:52 -07:00
Vladislav Stishenko
d5d671b74d Fixed type in error logs in metrics.go
Signed-off-by: Vladislav Stishenko <github@vst.name>
2025-06-29 20:19:15 +05:00
Shizun Ge
dbec0d7b36 Merge pull request #171 from agneum14/country-panel-title-case
Make the country connections panel title case
2025-06-25 10:15:38 -07:00
Shizun Ge
2ae998243b Merge pull request #173 from shizunge/dependabot/github_actions/docker/setup-buildx-action-3.11.1
Bump docker/setup-buildx-action from 3.10.0 to 3.11.1
2025-06-25 10:13:00 -07:00
Shizun Ge
22e7d84792 Merge pull request #172 from shizunge/dependabot/go_modules/github.com/pierrre/geohash-1.1.3
Bump github.com/pierrre/geohash from 1.1.2 to 1.1.3
2025-06-25 10:12:49 -07:00
Shizun Ge
3691c01bcf Merge pull request #167 from shizunge/dependabot/go_modules/github.com/golang/glog-1.2.5
Bump github.com/golang/glog from 1.2.4 to 1.2.5
2025-06-25 10:12:33 -07:00
Shizun Ge
cedc9b0598 Merge pull request #170 from shizunge/dependabot/github_actions/docker/build-push-action-6.18.0
Bump docker/build-push-action from 6.15.0 to 6.18.0
2025-06-25 10:12:16 -07:00
dependabot[bot]
4c98088fc6 Bump docker/setup-buildx-action from 3.10.0 to 3.11.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.10.0 to 3.11.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3.10.0...v3.11.1)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: 3.11.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-23 09:37:44 +00:00
dependabot[bot]
602e22b631 Bump github.com/pierrre/geohash from 1.1.2 to 1.1.3
Bumps [github.com/pierrre/geohash](https://github.com/pierrre/geohash) from 1.1.2 to 1.1.3.
- [Commits](https://github.com/pierrre/geohash/compare/v1.1.2...v1.1.3)

---
updated-dependencies:
- dependency-name: github.com/pierrre/geohash
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-16 09:10:27 +00:00
Andrew G. Neumann
b81117a9de Make the country connections panel title case 2025-06-04 21:16:49 -04:00
dependabot[bot]
502efbfcc2 Bump docker/build-push-action from 6.15.0 to 6.18.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.15.0 to 6.18.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.15.0...v6.18.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 6.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-02 09:27:37 +00:00
dependabot[bot]
2e39a6194f Bump github.com/golang/glog from 1.2.4 to 1.2.5
Bumps [github.com/golang/glog](https://github.com/golang/glog) from 1.2.4 to 1.2.5.
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.2.4...v1.2.5)

---
updated-dependencies:
- dependency-name: github.com/golang/glog
  dependency-version: 1.2.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 08:42:00 +00:00
Shizun Ge
93181ac5b3 [workflow] Ignore dependabot on push 2025-04-23 10:10:46 -07:00
Shizun Ge
cfa86895ea Merge pull request #158 from shizunge/dependabot/github_actions/docker/setup-buildx-action-3.10.0
Bump docker/setup-buildx-action from 3.8.0 to 3.10.0
2025-04-17 23:13:59 -07:00
Shizun Ge
c86d19a55f Merge pull request #159 from shizunge/dependabot/github_actions/docker/build-push-action-6.15.0
Bump docker/build-push-action from 6.11.0 to 6.15.0
2025-04-17 23:13:48 -07:00
Shizun Ge
4a02af0905 Merge pull request #161 from shizunge/dependabot/github_actions/docker/login-action-3.4.0
Bump docker/login-action from 3.3.0 to 3.4.0
2025-04-17 23:13:37 -07:00
Shizun Ge
9aa45d5151 Merge pull request #152 from shizunge/dependabot/go_modules/github.com/golang/glog-1.2.4
Bump github.com/golang/glog from 1.2.3 to 1.2.4
2025-04-17 23:09:04 -07:00
dependabot[bot]
c2a3afedbc Bump github.com/golang/glog from 1.2.3 to 1.2.4
Bumps [github.com/golang/glog](https://github.com/golang/glog) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.2.3...v1.2.4)

---
updated-dependencies:
- dependency-name: github.com/golang/glog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 06:07:35 +00:00
Shizun Ge
529a185781 Merge pull request #165 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.22.0
Bump github.com/prometheus/client_golang from 1.20.5 to 1.22.0
2025-04-17 23:06:20 -07:00
Shizun Ge
789c569d22 fix workflow names 2025-04-17 23:05:17 -07:00
dependabot[bot]
8c5f4b46d1 Bump docker/setup-buildx-action from 3.8.0 to 3.10.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.8.0 to 3.10.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3.8.0...v3.10.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 06:04:34 +00:00
dependabot[bot]
5c145553ff Bump docker/build-push-action from 6.11.0 to 6.15.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.11.0 to 6.15.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.11.0...v6.15.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 06:04:23 +00:00
dependabot[bot]
b960bb9f52 Bump docker/login-action from 3.3.0 to 3.4.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.3.0...v3.4.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 06:04:08 +00:00
dependabot[bot]
f196e91efd Bump github.com/prometheus/client_golang from 1.20.5 to 1.22.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.5 to 1.22.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.20.5...v1.22.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 05:57:18 +00:00
Shizun Ge
3893a6bd09 add on pull request workflow 2025-04-17 22:52:07 -07:00
Shizun Ge
2cb5d7ba9c update to go 1.24.2 2025-04-17 22:49:40 -07:00
Shizun Ge
79e128509d Merge pull request #150 from shizunge/dependabot/github_actions/docker/build-push-action-6.11.0
Bump docker/build-push-action from 6.10.0 to 6.11.0
2025-01-15 09:28:13 -08:00
dependabot[bot]
2384728729 Bump docker/build-push-action from 6.10.0 to 6.11.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.10.0 to 6.11.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.10.0...v6.11.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 08:50:04 +00:00
Shizun Ge
ea5a8c07c2 Merge pull request #149 from shizunge/dependabot/github_actions/docker/setup-buildx-action-3.8.0
Bump docker/setup-buildx-action from 3.7.1 to 3.8.0
2024-12-23 08:02:39 -06:00
dependabot[bot]
8f6b0989fe Bump docker/setup-buildx-action from 3.7.1 to 3.8.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.7.1 to 3.8.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3.7.1...v3.8.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 08:54:35 +00:00
Shizun Ge
a1de063f4e Merge pull request #146 from shizunge/dependabot/github_actions/docker/build-push-action-6.10.0
Bump docker/build-push-action from 6.9.0 to 6.10.0
2024-12-03 16:59:33 -08:00
dependabot[bot]
cd7d7f3958 Bump docker/build-push-action from 6.9.0 to 6.10.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.9.0 to 6.10.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.9.0...v6.10.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 08:15:51 +00:00
Shizun Ge
749be56be1 Merge pull request #144 from shizunge/dependabot/go_modules/github.com/golang/glog-1.2.3
Bump github.com/golang/glog from 1.2.2 to 1.2.3
2024-11-11 10:47:05 -08:00
dependabot[bot]
80c5a21de9 Bump github.com/golang/glog from 1.2.2 to 1.2.3
Bumps [github.com/golang/glog](https://github.com/golang/glog) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: github.com/golang/glog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 08:08:40 +00:00
Shizun Ge
258491b433 Merge pull request #128 from master-hax/unix-socket
add unix socket support for prometheus
2024-11-04 14:24:53 -08:00
Vivek
a6390a1433 fix log string 2024-11-04 13:02:59 -08:00
Vivek Revankar
c3ae83da33 nit 2024-10-30 19:17:32 -07:00
Vivek Revankar
aeb234fbbf refactor 2024-10-30 19:17:32 -07:00
Vivek Revankar
194abc817d address comment 2024-10-30 19:17:32 -07:00
Vivek Revankar
7e4883db8e add unix socket support for prometheus 2024-10-30 19:17:32 -07:00
Shizun Ge
fb853625d1 Merge pull request #141 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.20.5
Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5
2024-10-21 13:20:43 -07:00
dependabot[bot]
d88d47f023 Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.4 to 1.20.5.
- [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.20.4...v1.20.5)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 08:32:48 +00:00
Shizun Ge
72add4dec4 Merge pull request #139 from shizunge/dependabot/github_actions/docker/setup-buildx-action-3.7.1
Bump docker/setup-buildx-action from 3.6.1 to 3.7.1
2024-10-07 21:25:06 -07:00
Shizun Ge
628d323375 Merge pull request #138 from shizunge/dependabot/github_actions/docker/build-push-action-6.9.0
Bump docker/build-push-action from 6.7.0 to 6.9.0
2024-10-07 21:24:52 -07:00
dependabot[bot]
2dfe193e18 Bump docker/setup-buildx-action from 3.6.1 to 3.7.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.6.1 to 3.7.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3.6.1...v3.7.1)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 08:24:04 +00:00
dependabot[bot]
70b94370b8 Bump docker/build-push-action from 6.7.0 to 6.9.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.7.0 to 6.9.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.7.0...v6.9.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 08:24:02 +00:00
Shizun Ge
95d3735d43 Merge pull request #133 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.20.4
Bump github.com/prometheus/client_golang from 1.20.3 to 1.20.4
2024-09-23 08:17:00 -07:00
dependabot[bot]
38d3910c00 Bump github.com/prometheus/client_golang from 1.20.3 to 1.20.4
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.3 to 1.20.4.
- [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.20.3...v1.20.4)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 08:06:27 +00:00
Shizun Ge
092bd9ea66 Merge pull request #130 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.20.3
Bump github.com/prometheus/client_golang from 1.20.2 to 1.20.3
2024-09-10 15:15:14 -07:00
dependabot[bot]
ee4701bf79 Bump github.com/prometheus/client_golang from 1.20.2 to 1.20.3
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.2 to 1.20.3.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.20.3/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.2...v1.20.3)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 08:14:26 +00:00
Shizun Ge
7b8ab54f66 Merge pull request #124 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.20.2
Bump github.com/prometheus/client_golang from 1.20.0 to 1.20.2
2024-08-26 06:59:46 -07:00
dependabot[bot]
b9cb96f0ad Bump github.com/prometheus/client_golang from 1.20.0 to 1.20.2
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.0 to 1.20.2.
- [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.20.0...v1.20.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-26 08:51:37 +00:00
Shizun Ge
75a971d960 Merge pull request #122 from shizunge/dependabot/go_modules/github.com/pierrre/geohash-1.1.2
Bump github.com/pierrre/geohash from 1.1.1 to 1.1.2
2024-08-19 09:57:10 -07:00
Shizun Ge
67899f1247 Merge branch 'main' into dependabot/go_modules/github.com/pierrre/geohash-1.1.2 2024-08-19 09:56:54 -07:00
Shizun Ge
b1c0d15263 Merge pull request #123 from shizunge/dependabot/github_actions/docker/build-push-action-6.7.0
Bump docker/build-push-action from 6.6.1 to 6.7.0
2024-08-19 09:56:10 -07:00
Shizun Ge
f2cb5b53bd Merge pull request #121 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.20.0
Bump github.com/prometheus/client_golang from 1.19.1 to 1.20.0
2024-08-19 09:55:53 -07:00
Shizun Ge
4532125d37 Merge pull request #98 from shizunge/dependabot/go_modules/google.golang.org/protobuf-1.33.0
Bump google.golang.org/protobuf from 1.31.0 to 1.33.0
2024-08-19 09:55:27 -07:00
Shizun Ge
da95bd75d2 Merge branch 'main' into dependabot/go_modules/google.golang.org/protobuf-1.33.0 2024-08-19 09:47:36 -07:00
dependabot[bot]
4781e68d09 Bump docker/build-push-action from 6.6.1 to 6.7.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.6.1 to 6.7.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.6.1...v6.7.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 08:42:28 +00:00
dependabot[bot]
ae892e5dc3 Bump github.com/pierrre/geohash from 1.1.1 to 1.1.2
Bumps [github.com/pierrre/geohash](https://github.com/pierrre/geohash) from 1.1.1 to 1.1.2.
- [Commits](https://github.com/pierrre/geohash/compare/v1.1.1...v1.1.2)

---
updated-dependencies:
- dependency-name: github.com/pierrre/geohash
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 08:31:25 +00:00
dependabot[bot]
22ad7dfb84 Bump github.com/prometheus/client_golang from 1.19.1 to 1.20.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.19.1 to 1.20.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.19.1...v1.20.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] <support@github.com>
2024-08-19 08:31:17 +00:00
Shizun Ge
7af2d3b574 Merge pull request #117 from shizunge/dependabot/go_modules/github.com/golang/glog-1.2.2
Bump github.com/golang/glog from 1.2.0 to 1.2.2
2024-08-12 11:33:12 -07:00
dependabot[bot]
f281c40f71 Bump github.com/golang/glog from 1.2.0 to 1.2.2
Bumps [github.com/golang/glog](https://github.com/golang/glog) from 1.2.0 to 1.2.2.
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.2.0...v1.2.2)

---
updated-dependencies:
- dependency-name: github.com/golang/glog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 18:18:51 +00:00
Shizun Ge
d2905e810a Merge pull request #120 from shizunge/dependabot/github_actions/docker/build-push-action-6.6.1
Bump docker/build-push-action from 5.3.0 to 6.6.1
2024-08-12 11:18:25 -07:00
Shizun Ge
a537cc6f0f Merge pull request #119 from shizunge/dependabot/github_actions/docker/setup-buildx-action-3.6.1
Bump docker/setup-buildx-action from 3.3.0 to 3.6.1
2024-08-12 11:18:15 -07:00
Shizun Ge
bbc75ed999 Merge pull request #118 from shizunge/dependabot/github_actions/docker/login-action-3.3.0
Bump docker/login-action from 3.1.0 to 3.3.0
2024-08-12 11:18:05 -07:00
Shizun Ge
9ff475e1b6 Merge pull request #116 from shizunge/dependabot/go_modules/github.com/oschwald/geoip2-golang-1.11.0
Bump github.com/oschwald/geoip2-golang from 1.9.0 to 1.11.0
2024-08-12 11:17:44 -07:00
dependabot[bot]
3d806deff9 Bump docker/build-push-action from 5.3.0 to 6.6.1
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.3.0 to 6.6.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5.3.0...v6.6.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 08:56:20 +00:00
dependabot[bot]
38110c5f00 Bump docker/setup-buildx-action from 3.3.0 to 3.6.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.3.0 to 3.6.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3.3.0...v3.6.1)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 08:56:18 +00:00
dependabot[bot]
9fde49bd5a Bump docker/login-action from 3.1.0 to 3.3.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.1.0 to 3.3.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.1.0...v3.3.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 08:56:16 +00:00
dependabot[bot]
84b55e04b4 Bump github.com/oschwald/geoip2-golang from 1.9.0 to 1.11.0
Bumps [github.com/oschwald/geoip2-golang](https://github.com/oschwald/geoip2-golang) from 1.9.0 to 1.11.0.
- [Release notes](https://github.com/oschwald/geoip2-golang/releases)
- [Commits](https://github.com/oschwald/geoip2-golang/compare/v1.9.0...v1.11.0)

---
updated-dependencies:
- dependency-name: github.com/oschwald/geoip2-golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 08:09:46 +00:00
Shizun Ge
415eb05f61 Merge pull request #99 from shizunge/dependabot/github_actions/docker/build-push-action-5.3.0
Bump docker/build-push-action from 5.1.0 to 5.3.0
2024-08-11 20:24:21 -07:00
Shizun Ge
75e39ccb06 Merge pull request #104 from shizunge/dependabot/github_actions/docker/setup-buildx-action-3.3.0
Bump docker/setup-buildx-action from 3.0.0 to 3.3.0
2024-08-11 20:24:01 -07:00
Shizun Ge
6ab026bcd4 Merge pull request #101 from shizunge/dependabot/github_actions/docker/login-action-3.1.0
Bump docker/login-action from 3.0.0 to 3.1.0
2024-08-11 20:23:51 -07:00
Shizun Ge
b99ddbdb99 Merge pull request #110 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.19.1
Bump github.com/prometheus/client_golang from 1.18.0 to 1.19.1
2024-08-11 20:23:18 -07:00
dependabot[bot]
29e5975f5d Bump github.com/prometheus/client_golang from 1.18.0 to 1.19.1
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.18.0 to 1.19.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.18.0...v1.19.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 08:30:05 +00:00
dependabot[bot]
656d436756 Bump docker/setup-buildx-action from 3.0.0 to 3.3.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.0.0 to 3.3.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3.0.0...v3.3.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-08 08:12:53 +00:00
dependabot[bot]
fadf229e09 Bump docker/login-action from 3.0.0 to 3.1.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-18 08:25:51 +00:00
dependabot[bot]
220a8ce51d Bump docker/build-push-action from 5.1.0 to 5.3.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.1.0 to 5.3.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5.1.0...v5.3.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-18 08:25:45 +00:00
dependabot[bot]
d726b4673d Bump google.golang.org/protobuf from 1.31.0 to 1.33.0
Bumps google.golang.org/protobuf from 1.31.0 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-13 23:09:29 +00:00
Shizun Ge
7341b404af Merge pull request #91 from shizunge/dependabot/github_actions/peter-evans/dockerhub-description-4
Bump peter-evans/dockerhub-description from 3 to 4
2024-01-29 23:08:40 -08:00
Shizun Ge
890b9210c0 Merge pull request #92 from shizunge/prometheus
Prometheus roundup the trapped time to the interval
2024-01-29 23:08:30 -08:00
dependabot[bot]
50233633a5 Bump peter-evans/dockerhub-description from 3 to 4
Bumps [peter-evans/dockerhub-description](https://github.com/peter-evans/dockerhub-description) from 3 to 4.
- [Release notes](https://github.com/peter-evans/dockerhub-description/releases)
- [Commits](https://github.com/peter-evans/dockerhub-description/compare/v3...v4)

---
updated-dependencies:
- dependency-name: peter-evans/dockerhub-description
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 08:13:30 +00:00
Shizun Ge
c309a8fc58 [readme] remove sudo 2024-01-28 21:52:12 -08:00
Shizun Ge
0cc52eee46 Prometheus roundup the trapped time to the interval.
In the old way, if the connection is broken less than an interval, the trapped time won't be reported.
With this fix, the prometheus should report the same value as the log.
2024-01-27 23:26:39 -08:00
Shizun Ge
8131751045 [workflows] on-push publishes to the development package. 2024-01-27 23:20:54 -08:00
Shizun Ge
56076bc107 [workflows] stop removing dev- images.
I don't think it remove the associated untagged arch specific images.
Until we find a way to keep or drop the entire package, we keep all of them.
2024-01-20 13:48:04 -08:00
Shizun Ge
fbd60c320b remove endlessh-go binary 2024-01-20 00:11:10 -08:00
Shizun Ge
9a152ef3b3 Fix on-push.yml 2024-01-19 23:39:28 -08:00
Shizun Ge
11d0d8ac67 Do not delete untagged images.
These images could be the release images for different OS/Arch/
2024-01-19 23:38:29 -08:00
Shizun Ge
475b6b8ef8 Keep dev images for a week 2024-01-19 23:03:30 -08:00
Shizun Ge
44cd26db29 Merge pull request #86 from shizunge/prometheus
Multiple ports and clean metrics
2024-01-19 10:04:13 -08:00
Shizun Ge
6e7015b3eb [readme] update label of the metrics 2024-01-18 23:18:34 -08:00
Shizun Ge
54f5aa75e5 [dashboard] fix current connections 2024-01-18 22:58:35 -08:00
Shizun Ge
e395971cfd clean metrics, remove series if the ip is not seen for a while. 2024-01-18 22:58:35 -08:00
Shizun Ge
37d428cdf5 add local_port label to all metrics 2024-01-18 22:58:35 -08:00
Shizun Ge
7da8e5e9ab update documents about multiple ports 2024-01-18 22:58:35 -08:00
Shizun Ge
fee1f1a67d re-org files into packages. update copyright. accept multiple ports. 2024-01-18 22:58:35 -08:00
Shizun Ge
df4cd39c57 refactor: move prometheus outside client class 2024-01-18 22:58:35 -08:00
Shizun Ge
2c0ee146ee [workflow] exclude dashboard and examples from on-push trigger. 2024-01-18 22:58:00 -08:00
Shizun Ge
4eaab6b0e0 [workflows] build container image on other branches and workflow_dispatch. 2024-01-18 20:13:05 -08:00
Shizun Ge
c0e3512a23 [Dashboard] Load metrics at the first panel instead of the last panel 2024-01-14 15:00:07 -08:00
Shizun Ge
6ecc586aaa add 'provenance: false' to docker build as suggested in
https://github.com/orgs/community/discussions/45779#discussioncomment-6652717
2024-01-14 14:26:16 -08:00
Shizun Ge
b84d19d11f update README.md 2024-01-14 14:24:05 -08:00
Shizun Ge
d471db7f6c enable open matrics.
Let Prometheus decide which to keep.
2024-01-14 14:22:24 -08:00
Shizun Ge
c198541542 Merge pull request #85 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.18.0
Bump github.com/prometheus/client_golang from 1.17.0 to 1.18.0
2024-01-14 14:21:27 -08:00
Shizun Ge
f6d3341085 stop sending open metrics 2024-01-05 19:27:25 -08:00
dependabot[bot]
5274fd73f2 Bump github.com/prometheus/client_golang from 1.17.0 to 1.18.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.17.0 to 1.18.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.17.0...v1.18.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] <support@github.com>
2024-01-01 08:03:07 +00:00
Shizun Ge
01798bb978 Merge pull request #82 from shizunge/dependabot/go_modules/github.com/golang/glog-1.2.0
Bump github.com/golang/glog from 1.1.2 to 1.2.0
2023-11-27 10:36:54 -08:00
dependabot[bot]
70b6aed937 Bump github.com/golang/glog from 1.1.2 to 1.2.0
Bumps [github.com/golang/glog](https://github.com/golang/glog) from 1.1.2 to 1.2.0.
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.2...v1.2.0)

---
updated-dependencies:
- dependency-name: github.com/golang/glog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-27 08:18:09 +00:00
Shizun Ge
488f8e4aa2 Merge pull request #81 from shizunge/dependabot/github_actions/docker/build-push-action-5.1.0
Bump docker/build-push-action from 5.0.0 to 5.1.0
2023-11-22 22:41:31 -08:00
dependabot[bot]
a4634a63b2 Bump docker/build-push-action from 5.0.0 to 5.1.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 08:20:08 +00:00
Shizun Ge
8b327fdbab Merge pull request #80 from shizunge/dependabot/go_modules/github.com/pierrre/geohash-1.1.1
Bump github.com/pierrre/geohash from 1.1.0 to 1.1.1
2023-11-06 00:52:13 -08:00
dependabot[bot]
e849e933a0 Bump github.com/pierrre/geohash from 1.1.0 to 1.1.1
Bumps [github.com/pierrre/geohash](https://github.com/pierrre/geohash) from 1.1.0 to 1.1.1.
- [Commits](https://github.com/pierrre/geohash/compare/v1.1.0...v1.1.1)

---
updated-dependencies:
- dependency-name: github.com/pierrre/geohash
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 08:38:32 +00:00
Shizun Ge
bf9f639dce fix links to examples 2023-11-01 20:51:47 -07:00
Shizun Ge
c14ce15f5d add links to examples 2023-11-01 20:50:12 -07:00
Shizun Ge
0b504445ea Merge pull request #77 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.17.0
Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0
2023-11-01 20:26:44 -07:00
Shizun Ge
553324103e Merge pull request #79 from shizunge/dependabot/github_actions/docker/setup-qemu-action-3
Bump docker/setup-qemu-action from 2 to 3
2023-10-30 18:35:23 -07:00
dependabot[bot]
46dd8a04d2 Bump docker/setup-qemu-action from 2 to 3
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 08:16:07 +00:00
Shizun Ge
a0992a39e4 Merge pull request #72 from shizunge/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-10-29 20:31:00 -07:00
Shizun Ge
c27487330e Merge pull request #73 from shizunge/dependabot/github_actions/docker/login-action-3.0.0
Bump docker/login-action from 2.2.0 to 3.0.0
2023-10-29 20:30:51 -07:00
Shizun Ge
bacd610e7d Merge pull request #74 from shizunge/dependabot/github_actions/docker/build-push-action-5.0.0
Bump docker/build-push-action from 4.1.1 to 5.0.0
2023-10-29 20:30:43 -07:00
Shizun Ge
38fbd4ead9 Merge pull request #75 from shizunge/dependabot/github_actions/docker/setup-buildx-action-3.0.0
Bump docker/setup-buildx-action from 2.10.0 to 3.0.0
2023-10-29 20:30:35 -07:00
Shizun Ge
f3c55a99c2 Merge pull request #76 from shizunge/dependabot/github_actions/docker/metadata-action-5
Bump docker/metadata-action from 4 to 5
2023-10-29 20:30:20 -07:00
dependabot[bot]
1f725a816f Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.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.16.0...v1.17.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] <support@github.com>
2023-10-02 08:47:14 +00:00
dependabot[bot]
6e4e588bec Bump docker/metadata-action from 4 to 5
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4 to 5.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](https://github.com/docker/metadata-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 08:14:32 +00:00
dependabot[bot]
9aee12a948 Bump docker/setup-buildx-action from 2.10.0 to 3.0.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.10.0 to 3.0.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.10.0...v3.0.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 08:14:25 +00:00
dependabot[bot]
763d57d142 Bump docker/build-push-action from 4.1.1 to 5.0.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.1 to 5.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.1.1...v5.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 08:14:20 +00:00
dependabot[bot]
8c80934f70 Bump docker/login-action from 2.2.0 to 3.0.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2.2.0...v3.0.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 08:14:14 +00:00
dependabot[bot]
971f1cc9c4 Bump actions/checkout from 3 to 4
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] <support@github.com>
2023-09-11 08:48:00 +00:00
Shizun Ge
7b8a219237 Merge pull request #70 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.10.0
Bump docker/setup-buildx-action from 2.9.1 to 2.10.0
2023-08-28 14:32:15 -07:00
dependabot[bot]
0c155736b5 Bump docker/setup-buildx-action from 2.9.1 to 2.10.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.9.1 to 2.10.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.9.1...v2.10.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-28 08:23:22 +00:00
Shizun Ge
af349be575 Merge pull request #68 from shizunge/dependabot/go_modules/github.com/golang/glog-1.1.2
Bump github.com/golang/glog from 1.1.1 to 1.1.2
2023-08-17 09:52:32 -07:00
dependabot[bot]
439482cc04 Bump github.com/golang/glog from 1.1.1 to 1.1.2
Bumps [github.com/golang/glog](https://github.com/golang/glog) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.1...v1.1.2)

---
updated-dependencies:
- dependency-name: github.com/golang/glog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 08:43:18 +00:00
Shizun Ge
e6f0ad39db Merge pull request #67 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.9.1
Bump docker/setup-buildx-action from 2.9.0 to 2.9.1
2023-07-26 23:31:40 -07:00
dependabot[bot]
7c4d2eac3c Bump docker/setup-buildx-action from 2.9.0 to 2.9.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.9.0 to 2.9.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.9.0...v2.9.1)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-17 08:51:04 +00:00
Shizun Ge
e85b925581 Merge pull request #66 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.9.0
Bump docker/setup-buildx-action from 2.8.0 to 2.9.0
2023-07-10 12:16:09 -07:00
dependabot[bot]
0b5b6818ad Bump docker/setup-buildx-action from 2.8.0 to 2.9.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.8.0 to 2.9.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.8.0...v2.9.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-10 08:19:10 +00:00
Shizun Ge
07612794be Merge pull request #65 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.8.0
Bump docker/setup-buildx-action from 2.7.0 to 2.8.0
2023-07-09 23:47:10 -07:00
dependabot[bot]
e2c7a199d2 Bump docker/setup-buildx-action from 2.7.0 to 2.8.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.7.0...v2.8.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-03 08:16:27 +00:00
Shizun Ge
b2a0c3885c [workflow] use docker metadata action. move docker hub description to a separated flow. 2023-07-02 15:57:21 -07:00
Shizun Ge
7346a983e8 [clean-ghcr] update image-name for untagged 2023-06-30 22:16:30 -07:00
Shizun Ge
e2a643ddaf [clean-ghcr] update keep-at-least to 0 for untagged 2023-06-30 22:11:24 -07:00
Shizun Ge
bd349e28f8 [clean-ghcr] add a step to clean untagged images 2023-06-30 22:02:24 -07:00
Shizun Ge
1683280c45 [workflow] clean-ghcr goes to its own job 2023-06-30 21:53:07 -07:00
Shizun Ge
58c6aa5702 [workflow] add clean ghcr to remove old dev imsages 2023-06-30 21:39:24 -07:00
Shizun Ge
b362647ef3 fix CGO_ENABLE again 2023-06-25 23:32:15 -07:00
Shizun Ge
f1d4f43fc7 set CGO_ENABLED to 0 2023-06-25 22:58:30 -07:00
Shizun Ge
585e970906 Add CGO_ENABLED=1 to Dockerfile 2023-06-25 22:55:09 -07:00
Shizun Ge
88d068a452 rename workflow and deprecate ::set-output. 2023-06-24 23:40:55 -07:00
Shizun Ge
6cd395e190 Merge pull request #59 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.16.0
Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0
2023-06-19 17:51:58 -07:00
dependabot[bot]
4e710699f4 Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0
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] <support@github.com>
2023-06-20 00:50:25 +00:00
Shizun Ge
49f9422525 Merge pull request #60 from shizunge/dependabot/github_actions/docker/build-push-action-4.1.1
Bump docker/build-push-action from 4.1.0 to 4.1.1
2023-06-19 17:49:37 -07:00
Shizun Ge
4513b84ec9 Merge pull request #61 from shizunge/dependabot/go_modules/github.com/oschwald/geoip2-golang-1.9.0
Bump github.com/oschwald/geoip2-golang from 1.8.0 to 1.9.0
2023-06-19 17:49:23 -07:00
Shizun Ge
595761d045 Merge pull request #62 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.7.0
Bump docker/setup-buildx-action from 2.6.0 to 2.7.0
2023-06-19 17:49:13 -07:00
dependabot[bot]
7f0cb911a1 Bump docker/setup-buildx-action from 2.6.0 to 2.7.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.6.0...v2.7.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 08:58:24 +00:00
dependabot[bot]
5acaafb691 Bump github.com/oschwald/geoip2-golang from 1.8.0 to 1.9.0
Bumps [github.com/oschwald/geoip2-golang](https://github.com/oschwald/geoip2-golang) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/oschwald/geoip2-golang/releases)
- [Commits](https://github.com/oschwald/geoip2-golang/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/oschwald/geoip2-golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 08:58:22 +00:00
dependabot[bot]
613fbf8d61 Bump docker/build-push-action from 4.1.0 to 4.1.1
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 08:58:21 +00:00
Shizun Ge
ef8e1fc21b add faq section. describe how to bind to privileged ports in docker. 2023-06-15 23:28:18 -07:00
Shizun Ge
5c315eeffe Merge pull request #58 from shizunge/dependabot/github_actions/docker/build-push-action-4.1.0
Bump docker/build-push-action from 4.0.0 to 4.1.0
2023-06-12 08:23:53 -07:00
Shizun Ge
58d637d212 Merge pull request #57 from shizunge/dependabot/github_actions/docker/login-action-2.2.0
Bump docker/login-action from 2.1.0 to 2.2.0
2023-06-12 08:23:31 -07:00
Shizun Ge
216fd2d8f3 Merge pull request #56 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.6.0
Bump docker/setup-buildx-action from 2.5.0 to 2.6.0
2023-06-12 08:23:08 -07:00
dependabot[bot]
201a0192be Bump docker/build-push-action from 4.0.0 to 4.1.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 08:58:02 +00:00
dependabot[bot]
73fa1f317b Bump docker/login-action from 2.1.0 to 2.2.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 08:57:59 +00:00
dependabot[bot]
27f2a7ce76 Bump docker/setup-buildx-action from 2.5.0 to 2.6.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.5.0...v2.6.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 08:57:56 +00:00
Shizun Ge
35d96545fb Add sudo back to docker command 2023-05-13 00:53:37 -07:00
Shizun Ge
879b9be298 Merge pull request #55 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.15.1
Bump github.com/prometheus/client_golang from 1.15.0 to 1.15.1
2023-05-13 00:49:00 -07:00
dependabot[bot]
61bac85a3d Bump github.com/prometheus/client_golang from 1.15.0 to 1.15.1
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] <support@github.com>
2023-05-08 08:58:21 +00:00
Shizun Ge
ce689bf154 Merge pull request #54 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.15.0
Bump github.com/prometheus/client_golang from 1.14.0 to 1.15.0
2023-04-23 15:29:51 -07:00
Shizun Ge
27ad3fa481 Merge pull request #53 from olofvndrhr/main
Update Dockerfile, README and add maxmind example
2023-04-23 15:29:41 -07:00
Ivan Schaller
a112241c76 make wanted changes
Signed-off-by: Ivan Schaller <ivan@schaller.sh>
2023-04-17 17:06:42 +02:00
dependabot[bot]
555f4f8c5f Bump github.com/prometheus/client_golang from 1.14.0 to 1.15.0
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] <support@github.com>
2023-04-17 08:58:26 +00:00
Ivan Schaller
ff7fdf4350 update Dockerfile and README. And add maxmind example
Signed-off-by: Ivan Schaller <ivan@schaller.sh>
2023-04-13 19:42:09 +02:00
Shizun Ge
0ab8841cd1 Merge pull request #52 from shizunge/dependabot/go_modules/github.com/golang/glog-1.1.1
Bump github.com/golang/glog from 1.1.0 to 1.1.1
2023-03-31 01:29:08 -07:00
Shizun Ge
ae899e1ed0 Merge pull request #51 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.5.0
Bump docker/setup-buildx-action from 2.4.1 to 2.5.0
2023-03-29 20:16:29 -07:00
dependabot[bot]
10c8000e18 Bump github.com/golang/glog from 1.1.0 to 1.1.1
Bumps [github.com/golang/glog](https://github.com/golang/glog) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.0...v1.1.1)

---
updated-dependencies:
- dependency-name: github.com/golang/glog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 08:59:08 +00:00
dependabot[bot]
96ad176c96 Bump docker/setup-buildx-action from 2.4.1 to 2.5.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.4.1...v2.5.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 08:58:40 +00:00
Shizun Ge
18c231c469 Merge pull request #50 from shizunge/dependabot/go_modules/github.com/golang/glog-1.1.0
Bump github.com/golang/glog from 1.0.0 to 1.1.0
2023-03-06 11:00:30 -06:00
dependabot[bot]
6dbfa84fc3 Bump github.com/golang/glog from 1.0.0 to 1.1.0
Bumps [github.com/golang/glog](https://github.com/golang/glog) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.0.0...v1.1.0)

---
updated-dependencies:
- dependency-name: github.com/golang/glog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 08:59:50 +00:00
Shizun Ge
419deb34c1 Merge pull request #49 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.4.1
Bump docker/setup-buildx-action from 2.4.0 to 2.4.1
2023-02-14 21:37:59 -08:00
dependabot[bot]
a4f3fc6bd4 Bump docker/setup-buildx-action from 2.4.0 to 2.4.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.4.0...v2.4.1)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 09:00:29 +00:00
Shizun Ge
8e1251ab4f Merge pull request #47 from shizunge/dependabot/github_actions/docker/build-push-action-4.0.0
Bump docker/build-push-action from 3.3.0 to 4.0.0
2023-02-11 01:29:57 -08:00
Shizun Ge
193c34d325 Merge pull request #46 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.4.0
Bump docker/setup-buildx-action from 2.3.0 to 2.4.0
2023-02-11 01:29:47 -08:00
Shizun Ge
8aeed47955 cleanup unnecessary codes 2023-02-11 01:24:59 -08:00
Shizun Ge
374c2b74ad report unknow location for local ip 2023-02-11 01:06:16 -08:00
Shizun Ge
c50302622e hard coded country to coordinates. update copyright date. 2023-02-11 00:53:31 -08:00
Shizun Ge
144e58aa7a fix using country db. We cannot get coordinates from the country now. 2023-02-10 22:46:45 -08:00
Shizun Ge
81ab381551 use geohash of the country if city is not available. 2023-02-10 22:26:31 -08:00
Shizun Ge
d9202cfca6 remove freegeoip.live as a provider 2023-02-10 22:22:32 -08:00
Shizun Ge
7c55c713a0 update go version to 1.20 2023-02-10 22:10:02 -08:00
dependabot[bot]
5bb568e6e5 Bump docker/build-push-action from 3.3.0 to 4.0.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.3.0 to 4.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.3.0...v4.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 08:03:47 +00:00
dependabot[bot]
1ff33d19b7 Bump docker/setup-buildx-action from 2.3.0 to 2.4.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 08:03:42 +00:00
Shizun Ge
41d0618fa2 fix loading variables on time changes 2023-02-01 22:44:57 -08:00
Shizun Ge
0750caa4e9 Merge pull request #44 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.3.0
Bump docker/setup-buildx-action from 2.2.1 to 2.3.0
2023-01-31 23:37:24 -08:00
dependabot[bot]
ebabfd3790 Bump docker/setup-buildx-action from 2.2.1 to 2.3.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.2.1...v2.3.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 08:04:56 +00:00
Shizun Ge
fdf9842025 dashboard updates variables on time range change. 2023-01-29 20:59:43 -08:00
Shizun Ge
2773554b0a Merge pull request #43 from shizunge/dependabot/github_actions/docker/build-push-action-3.3.0
Bump docker/build-push-action from 3.2.0 to 3.3.0
2023-01-19 00:05:32 -08:00
dependabot[bot]
288c04f5e8 Bump docker/build-push-action from 3.2.0 to 3.3.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 08:04:23 +00:00
Shizun Ge
2fb8972eb3 Merge pull request #37 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.14.0
Bump github.com/prometheus/client_golang from 1.13.0 to 1.14.0
2022-12-21 00:43:52 -08:00
dependabot[bot]
43cf7695f1 Bump github.com/prometheus/client_golang from 1.13.0 to 1.14.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.13.0 to 1.14.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.13.0...v1.14.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] <support@github.com>
2022-11-14 08:05:26 +00:00
Shizun Ge
ae2f8c4baf update screen shot path 2022-10-29 21:36:12 -07:00
Shizun Ge
642ee0513e Merge pull request #35 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.2.1
Bump docker/setup-buildx-action from 2.1.0 to 2.2.1
2022-10-29 21:34:45 -07:00
dependabot[bot]
7f6b6718e1 Bump docker/setup-buildx-action from 2.1.0 to 2.2.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.1.0 to 2.2.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.1.0...v2.2.1)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-24 08:27:09 +00:00
Shizun Ge
7f0f69d7b5 fix the workflow name 2022-10-12 19:10:41 -07:00
Shizun Ge
b90cdfc2a1 change tag to development 2022-10-12 19:04:21 -07:00
Shizun Ge
e8f7a1b0bb keep only amd64, arm64 and armv7 builds 2022-10-12 18:57:42 -07:00
Shizun Ge
7d78f5161e do not update description on development builds 2022-10-12 18:50:11 -07:00
Shizun Ge
46e5a624be use distroless as base 2022-10-12 18:46:37 -07:00
Shizun Ge
5e4c3bb21a build docker image on push to main 2022-10-12 18:43:43 -07:00
Shizun Ge
75d7307134 Merge pull request #32 from shizunge/dependabot/github_actions/docker/login-action-2.1.0
Bump docker/login-action from 2.0.0 to 2.1.0
2022-10-12 17:41:28 -07:00
Shizun Ge
ece420b56b Merge pull request #33 from shizunge/dependabot/github_actions/docker/build-push-action-3.2.0
Bump docker/build-push-action from 3.1.1 to 3.2.0
2022-10-12 17:41:19 -07:00
Shizun Ge
c87861b4d6 Merge pull request #34 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.1.0
Bump docker/setup-buildx-action from 2.0.0 to 2.1.0
2022-10-12 17:41:08 -07:00
dependabot[bot]
69ea717d13 Bump docker/setup-buildx-action from 2.0.0 to 2.1.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-13 00:39:53 +00:00
dependabot[bot]
ff87416602 Bump docker/build-push-action from 3.1.1 to 3.2.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.1.1...v3.2.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-13 00:39:50 +00:00
dependabot[bot]
231518cb79 Bump docker/login-action from 2.0.0 to 2.1.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-13 00:39:44 +00:00
Shizun Ge
0950175e43 Merge pull request #31 from shizunge/prometheus
update Docker build base
2022-10-10 20:21:55 -07:00
Shizun Ge
d7c0c2ed79 Merge branch 'master' into prometheus 2022-10-10 20:08:58 -07:00
Shizun Ge
e8d7ae0889 update Docker build base 2022-10-10 20:06:59 -07:00
Shizun Ge
9aa7040976 Merge pull request #30 from shizunge/dependabot/go_modules/github.com/pierrre/geohash-1.1.0
Bump github.com/pierrre/geohash from 1.0.0 to 1.1.0
2022-09-24 13:44:46 -07:00
dependabot[bot]
5d6b1cdfe2 Bump github.com/pierrre/geohash from 1.0.0 to 1.1.0
Bumps [github.com/pierrre/geohash](https://github.com/pierrre/geohash) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/pierrre/geohash/releases)
- [Commits](https://github.com/pierrre/geohash/compare/v1.0.0...v1.1.0)

---
updated-dependencies:
- dependency-name: github.com/pierrre/geohash
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-22 08:23:14 +00:00
Shizun Ge
feadcf47e9 Merge pull request #29 from shizunge/dependabot/go_modules/github.com/oschwald/geoip2-golang-1.8.0
Bump github.com/oschwald/geoip2-golang from 1.7.0 to 1.8.0
2022-08-09 12:20:33 -07:00
dependabot[bot]
13a22dce68 Bump github.com/oschwald/geoip2-golang from 1.7.0 to 1.8.0
Bumps [github.com/oschwald/geoip2-golang](https://github.com/oschwald/geoip2-golang) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/oschwald/geoip2-golang/releases)
- [Commits](https://github.com/oschwald/geoip2-golang/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/oschwald/geoip2-golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-09 17:39:18 +00:00
Shizun Ge
b91fe8ab0c Merge pull request #28 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.13.0
Bump github.com/prometheus/client_golang from 1.12.2 to 1.13.0
2022-08-09 10:38:41 -07:00
Shizun Ge
1d868a27a8 Merge pull request #27 from shizunge/dependabot/github_actions/docker/build-push-action-3.1.1
Bump docker/build-push-action from 3.1.0 to 3.1.1
2022-08-09 10:38:33 -07:00
dependabot[bot]
17aa4a6a89 Bump github.com/prometheus/client_golang from 1.12.2 to 1.13.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.2 to 1.13.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.12.2...v1.13.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] <support@github.com>
2022-08-08 08:24:43 +00:00
dependabot[bot]
7a3b02b445 Bump docker/build-push-action from 3.1.0 to 3.1.1
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-08 08:24:37 +00:00
Shizun Ge
492db60e81 Merge pull request #25 from shizunge/dependabot/github_actions/docker/build-push-action-3.1.0
Bump docker/build-push-action from 3.0.0 to 3.1.0
2022-07-25 17:25:49 -07:00
Shizun Ge
5bc042c0a5 Merge pull request #26 from shizunge/prometheus
Prometheus
2022-07-25 17:25:30 -07:00
dependabot[bot]
32c599c3a5 Bump docker/build-push-action from 3.0.0 to 3.1.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 08:18:54 +00:00
Shizun Ge
5f597b596b move the example to docker-simple folder 2022-07-17 21:13:36 -07:00
Shizun Ge
09833807a8 Add GitHub and Grafana links to the dashboard 2022-07-17 21:07:47 -07:00
Shizun Ge
fad9a4cded allow bind prometheus to a different interface than the ssh one. 2022-07-11 18:41:57 -07:00
Shizun Ge
55c96bb2c7 Merge pull request #24 from shizunge/offline
set location to unknown when city is not available.
2022-07-10 22:47:53 -07:00
Shizun Ge
0bb4f046ca set location to unknown when city is not available. 2022-07-10 22:47:05 -07:00
Shizun Ge
33c78444a0 Merge pull request #23 from shizunge/offline
add support to read max mind db
2022-07-09 22:57:42 -07:00
Shizun Ge
0f9201e8c2 add support to read max mind db 2022-07-09 12:20:55 -07:00
Shizun Ge
83c285c50f Merge pull request #21 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.12.2
Bump github.com/prometheus/client_golang from 1.12.1 to 1.12.2
2022-06-15 18:00:58 -07:00
dependabot[bot]
618b56d4ad Bump github.com/prometheus/client_golang from 1.12.1 to 1.12.2
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.1 to 1.12.2.
- [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.12.1...v1.12.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-16 08:19:21 +00:00
Shizun Ge
0253c84d3d Merge pull request #17 from shizunge/dependabot/github_actions/docker/login-action-2.0.0
Bump docker/login-action from 1.14.1 to 2.0.0
2022-05-09 21:06:56 -07:00
dependabot[bot]
ba136c2da2 Bump docker/login-action from 1.14.1 to 2.0.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.14.1 to 2.0.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.14.1...v2.0.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-10 04:06:40 +00:00
Shizun Ge
bb0c49d980 Merge pull request #18 from shizunge/dependabot/github_actions/docker/build-push-action-3.0.0
Bump docker/build-push-action from 2.10.0 to 3.0.0
2022-05-09 21:06:32 -07:00
Shizun Ge
83f0b1b3b9 Merge pull request #19 from shizunge/dependabot/github_actions/docker/setup-qemu-action-2
Bump docker/setup-qemu-action from 1 to 2
2022-05-09 21:06:23 -07:00
Shizun Ge
e08a37694f Merge pull request #20 from shizunge/dependabot/github_actions/docker/setup-buildx-action-2.0.0
Bump docker/setup-buildx-action from 1.6.0 to 2.0.0
2022-05-09 21:05:59 -07:00
dependabot[bot]
9432d96e4d Bump docker/setup-buildx-action from 1.6.0 to 2.0.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1.6.0 to 2.0.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1.6.0...v2.0.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 08:18:42 +00:00
dependabot[bot]
522434b2d0 Bump docker/setup-qemu-action from 1 to 2
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 08:18:39 +00:00
dependabot[bot]
c303f3912d Bump docker/build-push-action from 2.10.0 to 3.0.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.10.0 to 3.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2.10.0...v3.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 08:18:35 +00:00
Shizun Ge
705922a619 Merge pull request #15 from shizunge/dependabot/github_actions/peter-evans/dockerhub-description-3
Bump peter-evans/dockerhub-description from 2.4.3 to 3
2022-03-29 19:51:40 -07:00
dependabot[bot]
c03c28d4e2 Bump peter-evans/dockerhub-description from 2.4.3 to 3
Bumps [peter-evans/dockerhub-description](https://github.com/peter-evans/dockerhub-description) from 2.4.3 to 3.
- [Release notes](https://github.com/peter-evans/dockerhub-description/releases)
- [Commits](https://github.com/peter-evans/dockerhub-description/compare/v2.4.3...v3)

---
updated-dependencies:
- dependency-name: peter-evans/dockerhub-description
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-28 08:24:35 +00:00
Shizun Ge
5c999d5fda Merge pull request #14 from shizunge/dependabot/github_actions/docker/build-push-action-2.10.0
Bump docker/build-push-action from 2.9.0 to 2.10.0
2022-03-21 10:58:02 -07:00
dependabot[bot]
9a0fa8eb42 Bump docker/build-push-action from 2.9.0 to 2.10.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.9.0 to 2.10.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2.9.0...v2.10.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-21 08:15:10 +00:00
Shizun Ge
db59b50993 remove linux/ppc64le
We saw the following error during `go mod tidy`
```
#52 60.57 endlessh-go imports
#52 60.57 	github.com/golang/glog: github.com/golang/glog@v1.0.0: Get "https://proxy.golang.org/github.com/golang/glog/@v/v1.0.0.zip": net/http: TLS handshake timeout
#52 60.57 endlessh-go imports
#52 60.57 	github.com/pierrre/geohash: github.com/pierrre/geohash@v1.0.0: Get "https://proxy.golang.org/github.com/pierrre/geohash/@v/v1.0.0.zip": net/http: TLS handshake timeout
```
2022-03-08 21:36:18 -08:00
Shizun Ge
26d3a80d97 Add linux/ppc64le linux/s390x 2022-03-08 20:51:35 -08:00
Shizun Ge
c36d5087d4 Merge pull request #12 from shizunge/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-03-07 09:00:45 -08:00
Shizun Ge
32d26e664d Merge pull request #11 from shizunge/dependabot/github_actions/docker/login-action-1.14.1
Bump docker/login-action from 1.14.0 to 1.14.1
2022-03-07 09:00:37 -08:00
dependabot[bot]
abe3248e2e Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [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/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 08:21:40 +00:00
dependabot[bot]
5dddbfce7b Bump docker/login-action from 1.14.0 to 1.14.1
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.14.0 to 1.14.1.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.14.0...v1.14.1)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 08:21:37 +00:00
Shizun Ge
f08ff9d409 Add GitHub Container Registry 2022-03-05 18:02:25 -08:00
Shizun Ge
5694be560d Merge pull request #10 from shizunge/dependabot/github_actions/docker/login-action-1.14.0
Bump docker/login-action from 1.13.0 to 1.14.0
2022-02-28 00:36:42 -08:00
dependabot[bot]
925addace2 Bump docker/login-action from 1.13.0 to 1.14.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 08:20:57 +00:00
Shizun Ge
5a7abc0ed6 Setup QEMU in the docker workflow. 2022-02-27 22:21:18 -08:00
Shizun Ge
3a741ec512 Support selecting multi-value and all of variables job and host. 2022-02-22 18:32:00 -08:00
Shizun Ge
8be1fd752e Merge pull request #9 from shizunge/dependabot/github_actions/docker/login-action-1.13.0
Bump docker/login-action from 1.12.0 to 1.13.0
2022-02-21 00:43:41 -08:00
dependabot[bot]
d09a38eca5 Bump docker/login-action from 1.12.0 to 1.13.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 08:18:44 +00:00
Shizun Ge
fa586b6b01 change section name to contacts 2022-02-19 09:00:39 -08:00
Shizun Ge
c60f91900b Update screenshot link and issues words. 2022-02-13 13:06:20 -08:00
Shizun Ge
f5307aef4b Push dockerhub description 2022-02-13 12:26:55 -08:00
Shizun Ge
015f50b5f7 Update and rename docker-hub-build-push.yml to docker-hub-build-push-on-release.yml 2022-02-13 12:14:43 -08:00
Shizun Ge
f91eed84db Update the link to github issues 2022-02-13 12:03:06 -08:00
Shizun Ge
970d1ca866 Add a link to github issues. 2022-02-13 12:02:35 -08:00
Shizun Ge
c0737a289d Merge pull request #8 from shizunge/dependabot/go_modules/github.com/prometheus/client_golang-1.12.1
Bump github.com/prometheus/client_golang from 1.11.0 to 1.12.1
2022-02-13 11:56:43 -08:00
Shizun Ge
34a0b876f7 Change GitHub Actions directory 2022-02-13 11:55:41 -08:00
Shizun Ge
1938f71181 Change github-actions directory 2022-02-13 11:55:02 -08:00
dependabot[bot]
de24030f6b Bump github.com/prometheus/client_golang from 1.11.0 to 1.12.1
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.11.0 to 1.12.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.11.0...v1.12.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 19:53:28 +00:00
Shizun Ge
a9fc78fad1 Create dependabot.yml 2022-02-13 11:52:56 -08:00
Shizun Ge
3138045c76 Try to fix the data source of the clients panel
Place the data source on the panel instead of the individual query.
2022-02-08 21:18:20 -08:00
Shizun Ge
ff985bb80e fix clients table
Fix the problem that some clients are missing from the table.
Also use filterByRefId instead merge to simplify transformations on some dashboards.
2022-01-26 23:10:41 -08:00
Shizun Ge
5bf122f623 Fix dashboard for Grafana 8.3.4 2022-01-22 00:11:23 -08:00
Shizun Ge
fcbf3b7daf update pluginVersion to 8.3.1 2021-12-12 14:23:45 -08:00
Shizun Ge
171b1b0c51 Add http to url of datasources 2021-10-31 00:25:44 -07:00
Shizun Ge
596c9312ec Move image of dashboard to the top of README 2021-10-30 19:52:09 -07:00
Shizun Ge
a0eaf9ec3a reword and format. bind ports to only localhost 2021-10-28 02:28:10 -07:00
Shizun Ge
a0d38582f8 rename examples.md to README.md 2021-10-28 01:21:03 -07:00
Shizun Ge
9354bf7c76 Aix dashboard data source. Add readme to example. 2021-10-28 01:08:18 -07:00
Shizun Ge
60ce18914d add example docker compose 2021-10-27 23:52:20 -07:00
Shizun Ge
daf09ba161 show how to pass CLI arguments via docker run 2021-10-27 09:34:10 -07:00
Shizun Ge
d0c6835db2 remove the binary from repo 2021-10-27 01:09:53 -07:00
Shizun Ge
0257de1195 Add multiple tags to the docker image, then push 2021-10-27 00:58:23 -07:00
Shizun Ge
1af3f66039 Add the release tag to the docker image 2021-10-27 00:48:47 -07:00
27 changed files with 1864 additions and 921 deletions

19
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

View File

@@ -1,25 +0,0 @@
name: build docker image and push to docker hub
on:
release:
types: # This configuration does not affect the page_build event above
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: build the image
run: |
docker buildx build --push \
--tag shizunge/endlessh-go:latest \
--platform linux/amd64,linux/arm/v7,linux/arm64 .

View File

@@ -0,0 +1,22 @@
name: Update Docker Hub description
on:
release:
types:
- created
workflow_dispatch:
jobs:
publish:
name: Update Docker Hub description
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v5
- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ github.repository }}
short-description: ${{ github.event.repository.description }}

48
.github/workflows/on-pull-request.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: On pull request
on:
pull_request:
branches:
- 'main'
paths-ignore:
- 'dashboard/*'
- 'examples/*'
- 'README.md'
- 'LICENSE'
workflow_dispatch:
env:
PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7"
jobs:
build_container_image:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}-development
tags: |
type=raw,value=dev-{{date 'X'}}
type=raw,value=latest
type=ref,event=branch
type=edge,branch=main
- name: Build
uses: docker/build-push-action@v6.18.0
with:
platforms: ${{ env.PLATFORMS }}
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false

62
.github/workflows/on-push.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
name: On push
on:
push:
branches-ignore:
- 'release'
- 'dependabot/**'
paths-ignore:
- 'dashboard/*'
- 'examples/*'
- 'README.md'
- 'LICENSE'
workflow_dispatch:
env:
PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7"
jobs:
build_and_push:
name: Build and push Docker image
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Login to Docker Hub
uses: docker/login-action@v3.5.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.5.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository }}-development
ghcr.io/${{ github.repository }}-development
tags: |
type=raw,value=dev-{{date 'X'}}
type=raw,value=latest
type=ref,event=branch
type=edge,branch=main
- name: Build and push ${{ github.repository }}:${{ steps.git.outputs.image_tag }}
uses: docker/build-push-action@v6.18.0
with:
platforms: ${{ env.PLATFORMS }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false

49
.github/workflows/on-release.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: On release
on:
release:
types: # This configuration does not affect the page_build event above
- created
env:
PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7"
jobs:
build_and_push:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Login to docker hub
uses: docker/login-action@v3.5.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.5.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=tag
- name: Build and push
uses: docker/build-push-action@v6.18.0
with:
platforms: ${{ env.PLATFORMS }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
endlessh-go

View File

@@ -1,19 +1,20 @@
FROM golang:alpine AS build
FROM golang AS build
ADD . /go/src/app
WORKDIR /go/src/app
RUN mkdir /endlessh
ADD . /endlessh
WORKDIR /endlessh
RUN go mod tidy
RUN go build -o endlessh .
RUN CGO_ENABLED=0 go build -o endlessh .
FROM alpine:latest
FROM gcr.io/distroless/base
LABEL org.opencontainers.image.title=endlessh-go
LABEL org.opencontainers.image.description="Endlessh: an SSH tarpit"
LABEL org.opencontainers.image.vendor="Shizun Ge"
LABEL org.opencontainers.image.licenses=GPLv3
COPY --from=build /go/src/app/endlessh /usr/bin/endlessh
COPY --from=build /endlessh/endlessh /endlessh
EXPOSE 2222 2112
USER nobody
ENTRYPOINT ["/usr/bin/endlessh"]
ENTRYPOINT ["/endlessh"]
CMD ["-logtostderr", "-v=1"]

122
README.md
View File

@@ -1,10 +1,19 @@
# endlessh-go
[![Release](https://img.shields.io/github/release/shizunge/endlessh-go.svg?label=Release)](https://github.com/shizunge/endlessh-go/releases/latest)
[![License](https://img.shields.io/badge/License-GPLv3-blue)](https://github.com/shizunge/endlessh-go/blob/main/LICENSE)
[![Image Size](https://img.shields.io/docker/image-size/shizunge/endlessh-go/latest.svg?label=Image%20Size)](https://hub.docker.com/r/shizunge/endlessh-go)
[![Docker Pulls](https://img.shields.io/docker/pulls/shizunge/endlessh-go.svg?label=Docker%20Pulls&logo=Docker)](https://hub.docker.com/r/shizunge/endlessh-go)
[![Build](https://img.shields.io/github/actions/workflow/status/shizunge/endlessh-go/on-push.yml?label=Build&branch=main&logo=GitHub)](https://github.com/shizunge/endlessh-go/actions/workflows/on-push.yml)
[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/shizunge/endlessh-go?label=CodeFactor&logo=CodeFactor)](https://www.codefactor.io/repository/github/shizunge/endlessh-go)
A golang implementation of [endlessh](https://nullprogram.com/blog/2019/03/22/) exporting Prometheus metrics, visualized by a Grafana dashboard.
![screenshot](https://github.com/shizunge/endlessh-go/raw/main/dashboard/screenshot.png)
## Introduction
Endlessh is a great idea that not only blocks the brute force SSH attacks, but also wastes attackers time as a kind of counter-attack. Besides trapping the attackers, I also want to visualize the Geolocations and other statistics of the sources of attacks. Unfortunately the wonderful original [C implementation of endlessh](https://github.com/skeeto/endlessh) only provides text based log, but I do not like the solution that writing extra scripts to parse the log outputs, then exporting the results to a dashboard, because it would introduce extra layers in my current setup and it would depend on the format of the text log file rather than some structured data. Thus I create this golang implementation of endlessh to export [Prometheus](https://prometheus.io/) metrics and a [Grafana](https://grafana.com/) dashboard to visualize them.
[Endlessh](https://nullprogram.com/blog/2019/03/22/) is a great idea that not only blocks the brute force SSH attacks, but also wastes attackers time as a kind of counter-attack. Besides trapping the attackers, I also want to visualize the Geolocations and other statistics of the sources of attacks. Unfortunately the wonderful original [C implementation of endlessh](https://github.com/skeeto/endlessh) only provides text based log, but I do not like the solution that writes extra scripts to parse the log outputs, then exports the results to a dashboard, because it would introduce extra layers in my current setup and it would depend on the format of the text log file rather than some structured data. Thus I create this golang implementation of endlessh to export [Prometheus](https://prometheus.io/) metrics and a [Grafana](https://grafana.com/) dashboard to visualize them.
If you want a dashboard of sources of attacks and do not mind the endlessh server, besides trapping the attackers, does extra things including: translating IP to Geohash, exporting Prometheus metrics, and using more memory (about 10MB), this is the solution for you.
@@ -20,7 +29,7 @@ go build .
Alternatively, you can use the [docker image](https://hub.docker.com/r/shizunge/endlessh-go):
```
sudo docker run -d -p 2222:2222 shizunge/endlessh-go
docker run -d -p 2222:2222 shizunge/endlessh-go -logtostderr -v=1
```
It listens to port `2222` by default.
@@ -31,50 +40,69 @@ Then you can try to connect to the endlessh server. Your SSH client should hang
ssh -p 2222 localhost
```
If you want log like the [C implementation](https://github.com/skeeto/endlessh), you need to set both CLI arguments `-logtostderr` and `-v=1`, then the log will go to the stderr. You can set different log destinations via CLI arguments.
If you want log like the [C implementation](https://github.com/skeeto/endlessh), you need to set both CLI arguments `-logtostderr` and `-v=1`, then the log will go to stderr. You can set different log destinations via CLI arguments.
Also check out [examples](./examples/README.md) for the setup of the full stack.
## Usage
Usage of `./endlessh-go`
`./endlessh-go --help`
* -alsologtostderr
* log to standard error as well as files
* -conn_type string
* Connection type. Possible values are tcp, tcp4, tcp6 (default "tcp")
* -enable_prometheus
* Enable prometheus
* -geoip_supplier string
* Supplier to obtain Geohash of IPs. Possible values are "off", "ip-api", "freegeoip" (default "off")
* -host string
* Listening address (default "0.0.0.0")
* -interval_ms int
* Message millisecond delay (default 1000)
* -line_length int
* Maximum banner line length (default 32)
* -log_backtrace_at value
* when logging hits line file:N, emit a stack trace
* -log_dir string
* If non-empty, write log files in this directory
* -logtostderr
* log to standard error instead of files
* -max_clients int
* Maximum number of clients (default 4096)
* -port string
* Listening port (default "2222")
* -prometheus_entry string
* Entry point for prometheus (default "metrics")
* -prometheus_port string
* The port for prometheus (default "2112")
* -stderrthreshold value
* logs at or above this threshold go to stderr
* -v value
* log level for V logs
* -vmodule value
* comma-separated list of pattern=N settings for file-filtered logging
```
Usage of ./endlessh-go
-alsologtostderr
log to standard error as well as files
-conn_type string
Connection type. Possible values are tcp, tcp4, tcp6 (default "tcp")
-enable_prometheus
Enable prometheus
-geoip_supplier string
Supplier to obtain Geohash of IPs. Possible values are "off", "ip-api", "max-mind-db" (default "off")
-host string
SSH listening address (default "0.0.0.0")
-interval_ms int
Message millisecond delay (default 1000)
-line_length int
Maximum banner line length (default 32)
-log_backtrace_at value
when logging hits line file:N, emit a stack trace
-log_dir string
If non-empty, write log files in this directory
-log_link string
If non-empty, add symbolic links in this directory to the log files
-logbuflevel int
Buffer log messages logged at this level or lower (-1 means don't buffer; 0 means buffer INFO only; ...). Has limited applicability on non-prod platforms.
-logtostderr
log to standard error instead of files
-max_clients int
Maximum number of clients (default 4096)
-max_mind_db string
Path to the MaxMind DB file.
-port value
SSH listening port. You may provide multiple -port flags to listen to multiple ports. (default "2222")
-prometheus_clean_unseen_seconds int
Remove series if the IP is not seen for the given time. Set to 0 to disable. (default 0)
-prometheus_entry string
Entry point for prometheus (default "metrics")
-prometheus_host string
The address for prometheus (default "0.0.0.0")
-prometheus_port string
The port for prometheus (default "2112")
-proxy_protocol_enabled
Enable PROXY protocol support. This causes the server to expect PROXY protocol headers on incoming connections.
-proxy_protocol_read_header_timeout_ms int
Timeout for reading the PROXY protocol header in milliseconds. If the connection does not send a valid PROXY protocol header in this time, the header is ignored. (default 200)
-stderrthreshold value
logs at or above this threshold go to stderr (default 2)
-v value
log level for V logs
-vmodule value
comma-separated list of pattern=N settings for file-filtered logging
```
## Metrics
This golang implementation exports the following Prometheus metrics.
Endlessh-go exports the following Prometheus metrics.
| Metric | Type | Description |
|--------------------------------------|-------|--------------|
@@ -82,21 +110,27 @@ This golang implementation exports the following Prometheus metrics.
| endlessh_client_closed_count_total | count | Total number of clients that stopped connecting to this host. |
| endlessh_sent_bytes_total | count | Total bytes sent to clients that tried to connect to this host. |
| endlessh_trapped_time_seconds_total | count | Total seconds clients spent on endlessh. |
| endlessh_client_open_count | count | Number of connections of clients. <br> Labels: <br> <ul><li> `ip`: IP of the client </li> <li> `country`: Country of the IP </li> <li> `location`: Country, Region, and City </li> <li> `geohash`: Geohash of the location </li></ul> |
| endlessh_client_trapped_time_seconds | count | Seconds a client spends on endlessh. <br> Labels: <br> <ul><li> `ip`: IP of the client </li></ul> |
| endlessh_client_open_count | count | Number of connections of clients. <br> Labels: <br> <ul><li> `ip`: Remote IP of the client </li> <li> `local_port`: Local port the program listens to </li> <li> `country`: Country of the IP </li> <li> `location`: Country, Region, and City </li> <li> `geohash`: Geohash of the location </li></ul> |
| endlessh_client_trapped_time_seconds | count | Seconds a client spends on endlessh. <br> Labels: <br> <ul><li> `ip`: Remote IP of the client </li> <li> `local_port`: Local port the program listens to </li></ul> |
The metrics is off by default, you can turn it via the CLI argument `-enable_prometheus`.
It listens to port `2112` and entry point is `/metrics` by default. The port and entry point can be changed via CLI arguments.
The endlessh-go server stores the geohash of attackers as a label on `endlessh_client_open_count`, which is also off by default. You can turn it on via the CLI argument `-geoip_supplier`. The endlessh-go uses service from either [ip-api](https://ip-api.com/) or [freegeoip](https://freegeoip.live/), which may enforce a query rate and limit commercial use. Visit their website for their terms and policies.
The endlessh-go server stores the geohash of attackers as a label on `endlessh_client_open_count`, which is also off by default. You can turn it on via the CLI argument `-geoip_supplier`. The endlessh-go uses service from [ip-api](https://ip-api.com/), which may enforce a query rate and limit commercial use. Visit their website for their terms and policies.
You could also use an offline GeoIP database from [MaxMind](https://www.maxmind.com) by setting `-geoip_supplier` to _max-mind-db_ and `-max_mind_db` to the path of the database file.
## Dashboard
![screenshot](dashboard/screenshot.png)
The dashboard requires Grafana 8.2.
You can import the dashboard from Grafana.com using ID [15156](https://grafana.com/grafana/dashboards/15156)
The dashboard visualizes data for the selected time range.
The IP addresses are clickable and link you to the [ARIN](https://www.arin.net/) database.
## Contacts
If you have any problems or questions, please contact me through a [GitHub issue](https://github.com/shizunge/endlessh-go/issues)

111
client.go
View File

@@ -1,111 +0,0 @@
// Copyright (C) 2021 Shizun Ge
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
package main
import (
"math/rand"
"net"
"sync/atomic"
"time"
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus"
)
var letterBytes = []byte(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890!@#$%^&*()-=_+[]{}|;:',./<>?")
func randStringBytes(n int64) []byte {
b := make([]byte, n+1)
for i := range b {
b[i] = letterBytes[rand.Intn(len(letterBytes))]
}
b[n] = '\n'
return b
}
type client struct {
conn net.Conn
last time.Time
next time.Time
start time.Time
interval time.Duration
geoipSupplier string
geohash string
country string
location string
bytesSent int
prometheusEnabled bool
}
func NewClient(conn net.Conn, interval time.Duration, maxClient int64, geoipSupplier string, prometheusEnabled bool) *client {
addr := conn.RemoteAddr().(*net.TCPAddr)
atomic.AddInt64(&numCurrentClients, 1)
atomic.AddInt64(&numTotalClients, 1)
geohash, country, location, err := geohashAndLocation(addr.IP.String(), geoipSupplier)
if err != nil {
glog.Warningf("Failed to obatin the geohash of %v: %v.", addr.IP, err)
}
if prometheusEnabled {
clientIP.With(prometheus.Labels{
"ip": addr.IP.String(),
"geohash": geohash,
"country": country,
"location": location}).Inc()
}
glog.V(1).Infof("ACCEPT host=%v port=%v n=%v/%v\n", addr.IP, addr.Port, numCurrentClients, maxClient)
return &client{
conn: conn,
last: time.Now(),
next: time.Now().Add(interval),
start: time.Now(),
interval: interval,
geohash: geohash,
country: country,
location: location,
bytesSent: 0,
prometheusEnabled: prometheusEnabled,
}
}
func (c *client) Send(bannerMaxLength int64) error {
defer func(c *client) {
addr := c.conn.RemoteAddr().(*net.TCPAddr)
millisecondsSpent := time.Now().Sub(c.last).Milliseconds()
c.last = time.Now()
c.next = time.Now().Add(c.interval)
atomic.AddInt64(&numTotalMilliseconds, millisecondsSpent)
if c.prometheusEnabled {
clientSeconds.With(prometheus.Labels{"ip": addr.IP.String()}).Add(float64(millisecondsSpent) / 1000)
}
}(c)
length := rand.Int63n(bannerMaxLength)
bytesSent, err := c.conn.Write(randStringBytes(length))
if err != nil {
return err
}
c.bytesSent += bytesSent
atomic.AddInt64(&numTotalBytes, int64(bytesSent))
return nil
}
func (c *client) Close() {
addr := c.conn.RemoteAddr().(*net.TCPAddr)
atomic.AddInt64(&numCurrentClients, -1)
atomic.AddInt64(&numTotalClientsClosed, 1)
glog.V(1).Infof("CLOSE host=%v port=%v time=%v bytes=%v\n", addr.IP, addr.Port, time.Now().Sub(c.start).Seconds(), c.bytesSent)
c.conn.Close()
}

102
client/client.go Normal file
View File

@@ -0,0 +1,102 @@
// Copyright (C) 2021-2024 Shizun Ge
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
package client
import (
"math/rand"
"net"
"strconv"
"sync/atomic"
"time"
"github.com/golang/glog"
)
var (
numCurrentClients int64
letterBytes = []byte(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890!@#$%^&*()-=_+[]{}|;:',./<>?")
)
func randStringBytes(n int64) []byte {
b := make([]byte, n+1)
for i := range b {
b[i] = letterBytes[rand.Intn(len(letterBytes))]
}
b[n] = '\n'
return b
}
type Client struct {
conn net.Conn
next time.Time
start time.Time
last time.Time
interval time.Duration
bytesSent int
}
func NewClient(conn net.Conn, interval time.Duration, maxClients int64) *Client {
for numCurrentClients >= maxClients {
time.Sleep(interval)
}
atomic.AddInt64(&numCurrentClients, 1)
addr := conn.RemoteAddr().(*net.TCPAddr)
glog.V(1).Infof("ACCEPT host=%v port=%v n=%v/%v\n", addr.IP, addr.Port, numCurrentClients, maxClients)
return &Client{
conn: conn,
next: time.Now().Add(interval),
start: time.Now(),
last: time.Now(),
interval: interval,
bytesSent: 0,
}
}
func (c *Client) RemoteIpAddr() string {
return c.conn.RemoteAddr().(*net.TCPAddr).IP.String()
}
func (c *Client) LocalPort() string {
return strconv.Itoa(c.conn.LocalAddr().(*net.TCPAddr).Port)
}
func (c *Client) Send(bannerMaxLength int64) (int, error) {
if time.Now().Before(c.next) {
time.Sleep(c.next.Sub(time.Now()))
}
c.next = time.Now().Add(c.interval)
length := rand.Int63n(bannerMaxLength)
bytesSent, err := c.conn.Write(randStringBytes(length))
if err != nil {
return 0, err
}
c.bytesSent += bytesSent
return bytesSent, nil
}
func (c *Client) MillisecondsSinceLast() int64 {
millisecondsSpent := time.Now().Sub(c.last).Milliseconds()
c.last = time.Now()
return millisecondsSpent
}
func (c *Client) Close() {
addr := c.conn.RemoteAddr().(*net.TCPAddr)
glog.V(1).Infof("CLOSE host=%v port=%v time=%v bytes=%v\n", addr.IP, addr.Port, time.Now().Sub(c.start).Seconds(), c.bytesSent)
c.conn.Close()
atomic.AddInt64(&numCurrentClients, -1)
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

18
examples/README.md Normal file
View File

@@ -0,0 +1,18 @@
# Examples
> The default container user has uid 65534.
## [docker-simple](./docker-simple)
An example how to setup endlessh-go, Prometheus, and Grafana using [docker compose](https://docs.docker.com/compose/).
## [docker-maxmind](./docker-maxmind)
An example how to setup endlessh-go with the Maxmind GeoIP Database.
## FAQ
### Bind to privileged ports (<1024) in a container
You need to add capability `NET_BIND_SERVICE` to the program.
If you are using docker, this can be done via cli argument [`--cap-add`](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) or [`cap_add`](https://docs.docker.com/compose/compose-file/compose-file-v3/#cap_add-cap_drop) in the docker compose file.

View File

@@ -0,0 +1,16 @@
## docker compose
This is an example how to setup endlessh-go with the Maxmind GeoIP Database using [docker compose](https://docs.docker.com/compose/). The reference of the compose file can be found [here](https://docs.docker.com/compose/compose-file/).
To start the stack, in the _examples_ folder, run:
```
docker-compose up -d
```
The GeoIP Database will be saved in a mounted volume in: `./geo-data`. And the endlessh-go container will use this database to do the location lookups.
This example exposes the following ports. Except the SSH port, you should not expose other ports to public without protections (not included in this example) in production.
- **2222**: The SSH port. You may test endlessh-go by running `ssh -p 2222 localhost`. Your SSH client should hang. View the log of endlessh-go by running `docker logs endlessh`.
- **2112**: The Prometheus metrics exported by endlessh-go. Go to [http://localhost:2112/metrics](http://localhost:2112/metrics) in your web browser to view the metrics.

View File

@@ -0,0 +1,35 @@
services:
endlessh:
container_name: endlessh
image: shizunge/endlessh-go:latest
restart: unless-stopped
#user: root
command:
- "-logtostderr"
- "-v=1"
- "-geoip_supplier=max-mind-db"
- "-max_mind_db=/geo-data/GeoLite2-City.mmdb"
networks:
- example_network
ports:
- 2222:2222 # SSH port
- 127.0.0.1:2112:2112 # Prometheus metrics port
volumes:
- ./geo-data/:/geo-data/:ro # geoip data
geoipupdate:
image: ghcr.io/maxmind/geoipupdate:v5
container_name: geoipupdate
restart: unless-stopped
security_opt: [ "no-new-privileges:true" ]
volumes:
- ./geo-data/:/usr/share/GeoIP/
environment:
- GEOIPUPDATE_EDITION_IDS=GeoLite2-City
- GEOIPUPDATE_FREQUENCY=72
- GEOIPUPDATE_ACCOUNT_ID=xxxxxx
- GEOIPUPDATE_LICENSE_KEY=xxxxxx
networks:
example_network:

View File

@@ -0,0 +1,22 @@
## docker compose
This is an example how to setup endlessh-go, Prometheus, and Grafana using [docker compose](https://docs.docker.com/compose/). The reference of the compose file can be found [here](https://docs.docker.com/compose/compose-file/).
*prometheus.yml* is used as a [Prometheus configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/).
*grafana-datasource.yml* is used to provision a data source for Grafana to ease the setup, though Grafana data source can also be setup manually.
To start the stack, in the *examples* folder, run:
```
docker-compose up -d
```
This example exposes the following ports. Except the SSH port, you should not expose other ports to public without protections (not included in this example) in production.
* **2222**: The SSH port. You may test endlessh-go by running `ssh -p 2222 localhost`. Your SSH client should hang. View the log of endlessh-go by running `docker logs endlessh`.
* **2112**: The Prometheus metrics exported by endlessh-go. Go to [http://localhost:2112/metrics](http://localhost:2112/metrics) in your web browser to view the metrics.
* **9090**: Prometheus web interface. Go to [http://localhost:9090](http://localhost:9090) in your web browser for Prometheus. You can check whether the target of endlessh-go is up (Click Status, then Targets).
* **3000**: Grafana. Go to [http://localhost:3000](http://localhost:3000) in your web browser for Grafana. Use username *examples* and password *examples* to login.
In this example, we do not provision a dashboard for Grafana. You need to manually load the endlessh-go dashboard, by either importing it from the Grafana.com using ID [15156](https://grafana.com/grafana/dashboards/15156), or pasting the dashboard JSON text to the text area. See the [Grafana documentation](https://grafana.com/docs/grafana/latest/dashboards/export-import/) about import. Then select *Prometheus* as the data source.

View File

@@ -0,0 +1,59 @@
services:
endlessh:
container_name: endlessh
image: shizunge/endlessh-go:latest
restart: always
command:
- -interval_ms=1000
- -logtostderr
- -v=1
- -enable_prometheus
- -geoip_supplier=ip-api
networks:
- example_network
ports:
- 2222:2222 # SSH port
- 127.0.0.1:2112:2112 # Prometheus metrics port
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: always
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=45d
- --web.console.libraries=/usr/share/prometheus/console_libraries
- --web.console.templates=/usr/share/prometheus/consoles
- --web.enable-admin-api
networks:
- example_network
ports:
- 127.0.0.1:9090:9090
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus:/prometheus
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: always
networks:
- example_network
ports:
- 127.0.0.1:3000:3000
environment:
- GF_SECURITY_ADMIN_USER=examples
- GF_SECURITY_ADMIN_PASSWORD=examples
volumes:
- grafana_var:/var/lib/grafana/
- ./grafana-datasource.yml:/etc/grafana/provisioning/datasources/prometheus.yml
networks:
example_network:
volumes:
prometheus:
grafana_var:

View File

@@ -0,0 +1,6 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090

View File

@@ -0,0 +1,5 @@
scrape_configs:
- job_name: 'endlessh'
scrape_interval: 60s
static_configs:
- targets: ['endlessh:2112']

264
geoip/country.go Normal file
View File

@@ -0,0 +1,264 @@
// Copyright (C) 2023-2024 Shizun Ge
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
package geoip
// Map country's ISO to their capital's latitude and longitude.
// Country's ISO see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
type location struct {
Latitude float64
Longitude float64
}
var countryToLocation = map[string]location{
"AD": {42.5, 1.5},
"AE": {24.4511, 54.3969},
"AF": {34.5328, 69.1658},
"AG": {17.1211, -61.8447},
"AI": {18.2167, -63.05},
"AL": {41.33, 19.82},
"AM": {40.1814, 44.5144},
"AO": {-8.8383, 13.2344},
"AR": {-34.5997, -58.3819},
"AS": {-14.274, -170.7046},
"AT": {48.2083, 16.3725},
"AU": {-35.2931, 149.1269},
"AW": {12.5186, -70.0358},
"AZ": {40.3667, 49.8352},
"BA": {43.8563, 18.4132},
"BB": {13.0975, -59.6167},
"BD": {23.7289, 90.3944},
"BE": {50.8353, 4.3314},
"BF": {12.3686, -1.5275},
"BG": {42.6979, 23.3217},
"BH": {26.225, 50.5775},
"BI": {-3.3825, 29.3611},
"BJ": {6.402, 2.518},
"BL": {17.8958, -62.8508},
"BM": {32.2942, -64.7839},
"BN": {4.9167, 114.9167},
"BO": {-16.4942, -68.1475},
"BR": {-15.7939, -47.8828},
"BS": {25.0667, -77.3333},
"BT": {27.4833, 89.6333},
"BW": {-24.6569, 25.9086},
"BY": {53.9022, 27.5618},
"BZ": {17.25, -88.7675},
"CA": {45.4247, -75.695},
"CD": {-4.3317, 15.3139},
"CF": {4.3732, 18.5628},
"CG": {-4.2667, 15.2833},
"CH": {46.948, 7.4474},
"CI": {5.3364, -4.0267},
"CK": {-21.207, -159.771},
"CL": {-33.45, -70.6667},
"CM": {3.8578, 11.5181},
"CN": {39.904, 116.4075},
"CO": {4.6126, -74.0705},
"CR": {9.9333, -84.0833},
"CU": {23.1367, -82.3589},
"CV": {14.9177, -23.5092},
"CW": {12.108, -68.935},
"CX": {-10.4167, 105.7167},
"CY": {35.1725, 33.365},
"CZ": {50.0833, 14.4167},
"DE": {52.5167, 13.3833},
"DJ": {11.595, 43.1481},
"DK": {55.6805, 12.5615},
"DM": {15.3, -61.3833},
"DO": {18.4764, -69.8933},
"DZ": {36.7764, 3.0586},
"EC": {-0.22, -78.5125},
"EE": {59.4372, 24.745},
"EG": {30.0444, 31.2358},
"ER": {15.3333, 38.9167},
"ES": {40.4167, -3.7167},
"ET": {9.0272, 38.7369},
"FI": {60.1756, 24.9342},
"FJ": {-18.1333, 178.4333},
"FK": {-51.7, -57.85},
"FM": {6.9178, 158.185},
"FO": {62, -6.7833},
"FR": {48.8566, 2.3522},
"GA": {0.3901, 9.4544},
"GB": {51.5072, -0.1275},
"GD": {12.0444, -61.7417},
"GE": {41.7225, 44.7925},
"GF": {4.933, -52.33},
"GH": {5.6037, -0.187},
"GI": {36.1324, -5.3781},
"GL": {64.175, -51.7333},
"GM": {13.4531, -16.5775},
"GN": {9.538, -13.6773},
"GP": {16.0104, -61.7055},
"GQ": {3.7521, 8.7737},
"GR": {37.9842, 23.7281},
"GS": {-54.2833, -36.5},
"GT": {14.6099, -90.5252},
"GU": {13.4745, 144.7504},
"GW": {11.8592, -15.5956},
"GY": {6.7833, -58.1667},
"HK": {22.3069, 114.1831},
"HN": {14.0942, -87.2067},
"HR": {45.8131, 15.9772},
"HT": {18.5425, -72.3386},
"HU": {47.4983, 19.0408},
"ID": {-6.2146, 106.8451},
"IE": {53.3497, -6.2603},
"IL": {31.7833, 35.2167},
"IM": {54.15, -4.4819},
"IN": {28.6139, 77.209},
"IQ": {33.35, 44.4167},
"IR": {35.7, 51.4167},
"IS": {64.1475, -21.935},
"IT": {41.8931, 12.4828},
"JE": {49.1858, -2.11},
"JM": {17.9714, -76.7931},
"JO": {31.95, 35.9333},
"JP": {35.6839, 139.7744},
"KE": {-1.2864, 36.8172},
"KG": {42.8667, 74.5667},
"KH": {11.5696, 104.921},
"KI": {1.3382, 173.0176},
"KM": {-11.7036, 43.2536},
"KN": {17.2983, -62.7342},
"KP": {39.03, 125.73},
"KR": {37.56, 126.99},
"KW": {29.375, 47.98},
"KY": {19.2866, -81.3744},
"KZ": {51.1333, 71.4333},
"LA": {17.9667, 102.6},
"LB": {33.8869, 35.5131},
"LC": {14.0167, -60.9833},
"LI": {47.1397, 9.5219},
"LK": {6.9, 79.9164},
"LR": {6.3106, -10.8047},
"LS": {-29.31, 27.48},
"LT": {54.6833, 25.2833},
"LU": {49.6106, 6.1328},
"LV": {56.9475, 24.1069},
"LY": {32.8752, 13.1875},
"MA": {26.0928, -10.6089},
"MC": {43.7396, 7.4069},
"MD": {47.0228, 28.8353},
"ME": {42.4397, 19.2661},
"MF": {18.0706, -63.0847},
"MG": {-18.9386, 47.5214},
"MH": {7.0918, 171.3802},
"MK": {41.9833, 21.4333},
"ML": {12.6458, -7.9922},
"MM": {16.795, 96.16},
"MN": {47.9214, 106.9055},
"MP": {15.2137, 145.7546},
"MQ": {14.6104, -61.08},
"MR": {18.0858, -15.9785},
"MS": {16.7928, -62.2106},
"MT": {35.8978, 14.5125},
"MU": {-20.1667, 57.5},
"MV": {4.175, 73.5083},
"MW": {-13.9833, 33.7833},
"MX": {19.4333, -99.1333},
"MY": {3.1478, 101.6953},
"MZ": {-25.9153, 32.5764},
"NA": {-22.57, 17.0836},
"NC": {-22.2625, 166.4443},
"NE": {13.5086, 2.1111},
"NF": {-29.0569, 167.9617},
"NG": {9.0556, 7.4914},
"NI": {12.15, -86.2667},
"NL": {52.08, 4.31},
"NO": {59.9111, 10.7528},
"NP": {27.7167, 85.3667},
"NR": {-0.5477, 166.9209},
"NU": {-19.056, -169.921},
"NZ": {-41.2889, 174.7772},
"OM": {23.6139, 58.5922},
"PA": {9, -79.5},
"PE": {-12.06, -77.0375},
"PF": {-17.5334, -149.5667},
"PG": {-9.4789, 147.1494},
"PH": {14.6, 120.9833},
"PK": {33.6989, 73.0369},
"PL": {52.23, 21.0111},
"PM": {46.7811, -56.1764},
"PN": {-25.0667, -130.0833},
"PR": {18.4037, -66.0636},
"PT": {38.708, -9.139},
"PW": {7.5006, 134.6242},
"PY": {-25.3, -57.6333},
"QA": {25.3, 51.5333},
"RE": {-20.8789, 55.4481},
"RO": {44.4, 26.0833},
"RS": {44.8167, 20.4667},
"RU": {55.7558, 37.6178},
"RW": {-1.9536, 30.0606},
"SA": {24.65, 46.71},
"SB": {-9.4333, 159.95},
"SC": {-4.6236, 55.4544},
"SD": {15.6031, 32.5265},
"SE": {59.3294, 18.0686},
"SG": {1.3, 103.8},
"SH": {-15.9251, -5.7179},
"SI": {46.05, 14.5167},
"SK": {48.1447, 17.1128},
"SL": {8.4833, -13.2331},
"SM": {43.932, 12.4484},
"SN": {14.7319, -17.4572},
"SO": {2.0408, 45.3425},
"SR": {5.8667, -55.1667},
"SS": {4.85, 31.6},
"ST": {0.3333, 6.7333},
"SV": {13.6989, -89.1914},
"SX": {18.0256, -63.0492},
"SY": {33.5131, 36.2919},
"SZ": {-26.3208, 31.1617},
"TC": {21.4664, -71.136},
"TD": {12.11, 15.05},
"TG": {6.1319, 1.2228},
"TH": {13.75, 100.5167},
"TJ": {38.5731, 68.7864},
"TL": {-8.5536, 125.5783},
"TM": {37.95, 58.3833},
"TN": {36.8008, 10.18},
"TO": {-21.1347, -175.2083},
"TR": {39.93, 32.85},
"TT": {10.6667, -61.5167},
"TV": {-8.5243, 179.1942},
"TZ": {-6.8, 39.2833},
"UA": {50.45, 30.5236},
"UG": {0.3136, 32.5811},
"US": {38.9047, -77.0163},
"UY": {-34.8667, -56.1667},
"UZ": {41.3, 69.2667},
"VA": {41.9033, 12.4534},
"VC": {13.1667, -61.2333},
"VE": {10.5, -66.9333},
"VG": {18.4167, -64.6167},
"VI": {18.3419, -64.9332},
"VN": {21.0245, 105.8412},
"VU": {-17.7333, 168.3167},
"WF": {-13.2825, -176.1736},
"WS": {-13.8333, -171.8333},
"XG": {31.5069, 34.456},
"XK": {42.6633, 21.1622},
"XR": {78.2167, 15.6333},
"XW": {31.7764, 35.2269},
"YE": {15.35, 44.2},
"YT": {-12.7871, 45.275},
"ZA": {-25.7464, 28.1881},
"ZM": {-15.4167, 28.2833},
"ZW": {-17.8292, 31.0522},
}

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2021 Shizun Ge
// Copyright (C) 2021-2024 Shizun Ge
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -14,67 +14,44 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
package main
package geoip
import (
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
"strings"
"github.com/oschwald/geoip2-golang"
"github.com/pierrre/geohash"
)
type freegeoip struct {
Ip string `json:"ip"`
CountryCode string `json:"country_code"`
CountryName string `json:"country_name"`
RegionCode string `json:"region_code"`
RegionName string `json:"region_name"`
City string `json:"city"`
Zipcode string `json:"zipcode"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
MetroCode int `json:"metro_code"`
AreaCode int `json:"area_code"`
type GeoOption struct {
GeoipSupplier string
MaxMindDbFileName string
}
func geohashAndLocationFromFreegeoip(address string) (string, string, string, error) {
var geo freegeoip
response, err := http.Get("https://freegeoip.live/json/" + address)
if err != nil {
return "s000", "Unknown", "Unknown", err
}
defer response.Body.Close()
body, err := ioutil.ReadAll(response.Body)
if err != nil {
return "s000", "Unknown", "Unknown", err
}
err = json.Unmarshal(body, &geo)
if err != nil {
return "s000", "Unknown", "Unknown", err
}
func composeLocation(country string, region string, city string) string {
var locations []string
for _, s := range []string{geo.CountryName, geo.RegionName, geo.City} {
for _, s := range []string{country, region, city} {
if strings.TrimSpace(s) != "" {
locations = append(locations, s)
}
}
location := strings.Join(locations, ", ")
if location == "" {
location = "Unknown"
return "Unknown"
}
country := geo.CountryName
if country == "" {
country = "Unknown"
}
gh := geohash.EncodeAuto(geo.Latitude, geo.Longitude)
return location
}
return gh, country, location, nil
func composeCountry(country string) string {
if country == "" {
return "Unknown"
}
return country
}
type ipapi struct {
@@ -91,9 +68,9 @@ type ipapi struct {
Longitude float64 `json:"lon"`
}
func geohashAndLocationFromIpapi(address string) (string, string, string, error) {
func geohashAndLocationFromIpapi(ipAddr string) (string, string, string, error) {
var geo ipapi
response, err := http.Get("http://ip-api.com/json/" + address)
response, err := http.Get("http://ip-api.com/json/" + ipAddr)
if err != nil {
return "s000", "Unknown", "Unknown", err
}
@@ -110,37 +87,62 @@ func geohashAndLocationFromIpapi(address string) (string, string, string, error)
}
if geo.Status != "success" {
return "s000", "Unknown", "Unknown", fmt.Errorf("failed to query %v via ip-api: status: %v, message: %v", address, geo.Status, geo.Message)
return "s000", "Unknown", "Unknown", fmt.Errorf("failed to query %v via ip-api: status: %v, message: %v", ipAddr, geo.Status, geo.Message)
}
var locations []string
for _, s := range []string{geo.CountryName, geo.RegionName, geo.City} {
if strings.TrimSpace(s) != "" {
locations = append(locations, s)
}
}
location := strings.Join(locations, ", ")
if location == "" {
location = "Unknown"
}
country := geo.CountryName
if country == "" {
country = "Unknown"
}
gh := geohash.EncodeAuto(geo.Latitude, geo.Longitude)
country := composeCountry(geo.CountryName)
location := composeLocation(geo.CountryName, geo.RegionName, geo.City)
return gh, country, location, nil
}
func geohashAndLocation(address string, geoipSupplier string) (string, string, string, error) {
switch geoipSupplier {
func geohashAndLocationFromMaxMindDb(ipAddr, maxMindDbFileName string) (string, string, string, error) {
db, err := geoip2.Open(maxMindDbFileName)
if err != nil {
return "s000", "Unknown", "Unknown", err
}
defer db.Close()
// If you are using strings that may be invalid, check that ip is not nil
ip := net.ParseIP(ipAddr)
cityRecord, err := db.City(ip)
if err != nil {
return "s000", "Unknown", "Unknown", err
}
countryName := cityRecord.Country.Names["en"]
cityName := cityRecord.City.Names["en"]
latitude := cityRecord.Location.Latitude
longitude := cityRecord.Location.Longitude
iso := cityRecord.Country.IsoCode
if latitude == 0 && longitude == 0 {
// In case of using Country DB, city is not available.
loc, ok := countryToLocation[iso]
if ok {
latitude = loc.Latitude
longitude = loc.Longitude
} else {
if iso != "" {
// For debugging, adding the iso to the country name.
countryName = countryName + " (" + iso + ")"
}
}
}
gh := geohash.EncodeAuto(latitude, longitude)
country := composeCountry(countryName)
location := composeLocation(countryName, "", cityName)
return gh, country, location, nil
}
func GeohashAndLocation(ipAddr string, option GeoOption) (string, string, string, error) {
switch option.GeoipSupplier {
case "off":
return "s000", "Geohash off", "Geohash off", nil
case "ip-api":
return geohashAndLocationFromIpapi(address)
case "freegeoip":
return geohashAndLocationFromFreegeoip(address)
return geohashAndLocationFromIpapi(ipAddr)
case "max-mind-db":
return geohashAndLocationFromMaxMindDb(ipAddr, option.MaxMindDbFileName)
default:
return "s000", "Unknown", "Unknown", fmt.Errorf("unknown geoipSupplier %v.", geoipSupplier)
return "s000", "Unknown", "Unknown", fmt.Errorf("unknown geoipSupplier %v.", option.GeoipSupplier)
}
}

28
go.mod
View File

@@ -1,21 +1,25 @@
module endlessh-go
go 1.17
go 1.24.2
require (
github.com/golang/glog v1.0.0
github.com/pierrre/geohash v1.0.0
github.com/prometheus/client_golang v1.11.0
github.com/golang/glog v1.2.5
github.com/oschwald/geoip2-golang v1.13.0
github.com/pierrre/geohash v1.1.3
github.com/prometheus/client_golang v1.23.2
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect
google.golang.org/protobuf v1.26.0-rc.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/oschwald/maxminddb-golang v1.13.0 // indirect
github.com/pires/go-proxyproto v0.8.1 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.66.1 // 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
google.golang.org/protobuf v1.36.8 // indirect
)

206
go.sum
View File

@@ -1,156 +1,76 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/Codefor/geohash v0.0.0-20140723084247-1b41c28e3a9d h1:iG9B49Q218F/XxXNRM7k/vWf7MKmLIS8AcJV9cGN4nA=
github.com/Codefor/geohash v0.0.0-20140723084247-1b41c28e3a9d/go.mod h1:RVnhzAX71far8Kc3TQeA0k/dcaEKUnTDSOyet/JCmGI=
github.com/TomiHiltunen/geohash-golang v0.0.0-20150112065804-b3e4e625abfb h1:wumPkzt4zaxO4rHPBrjDK8iZMR41C1qs7njNqlacwQg=
github.com/TomiHiltunen/geohash-golang v0.0.0-20150112065804-b3e4e625abfb/go.mod h1:QiYsIBRQEO+Z4Rz7GoI+dsHVneZNONvhczuA+llOZNM=
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/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/broady/gogeohash v0.0.0-20120525094510-7b2c40d64042 h1:iEdmkrNMLXbM7ecffOAtZJQOQUTE4iMonxrb5opUgE4=
github.com/broady/gogeohash v0.0.0-20120525094510-7b2c40d64042/go.mod h1:f1L9YvXvlt9JTa+A17trQjSMM6bV40f+tHjB+Pi+Fqk=
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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/fanixk/geohash v0.0.0-20150324002647-c1f9b5fa157a h1:Fyfh/dsHFrC6nkX7H7+nFdTd1wROlX/FxEIWVpKYf1U=
github.com/fanixk/geohash v0.0.0-20150324002647-c1f9b5fa157a/go.mod h1:UgNw+PTmmGN8rV7RvjvnBMsoTU8ZXXnaT3hYsDTBlgQ=
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-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-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
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.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.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
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.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/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/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/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mmcloughlin/geohash v0.9.0 h1:FihR004p/aE1Sju6gcVq5OLDqGcMnpBY+8moBqIsVOs=
github.com/mmcloughlin/geohash v0.9.0/go.mod h1:oNZxQo5yWJh0eMQEP/8hwQuVx9Z9tjwFUqcTB1SmG0c=
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/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/pierrre/compare v1.0.2 h1:k4IUsHgh+dbcAOIWCfxVa/7G6STjADH2qmhomv+1quc=
github.com/pierrre/compare v1.0.2/go.mod h1:8UvyRHH+9HS8Pczdd2z5x/wvv67krDwVxoOndaIIDVU=
github.com/pierrre/geohash v1.0.0 h1:f/zfjdV4rVofTCz1FhP07T+EMQAvcMM2ioGZVt+zqjI=
github.com/pierrre/geohash v1.0.0/go.mod h1:atytaeVa21hj5F6kMebHYPf8JbIrGxK2FSzN2ajKXms=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/golang/glog v1.2.5 h1:DrW6hGnjIhtvhOIiAKT6Psh/Kd/ldepEa81DKeiRJ5I=
github.com/golang/glog v1.2.5/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
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/mmcloughlin/geohash v0.10.0 h1:9w1HchfDfdeLc+jFEf/04D27KP7E2QmpDu52wPbJWRE=
github.com/mmcloughlin/geohash v0.10.0/go.mod h1:oNZxQo5yWJh0eMQEP/8hwQuVx9Z9tjwFUqcTB1SmG0c=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/oschwald/geoip2-golang v1.13.0 h1:Q44/Ldc703pasJeP5V9+aFSZFmBN7DKHbNsSFzQATJI=
github.com/oschwald/geoip2-golang v1.13.0/go.mod h1:P9zG+54KPEFOliZ29i7SeYZ/GM6tfEL+rgSn03hYuUo=
github.com/oschwald/maxminddb-golang v1.13.0 h1:R8xBorY71s84yO06NgTmQvqvTvlS/bnYZrrWX1MElnU=
github.com/oschwald/maxminddb-golang v1.13.0/go.mod h1:BU0z8BfFVhi1LQaonTwwGQlsHUEu9pWNdMfmq4ztm0o=
github.com/pierrre/assert v0.9.0 h1:eIKXsqcLSeLAOXYGHreen2D5CTZ2/N0/cJBNdxuVLdM=
github.com/pierrre/assert v0.9.0/go.mod h1:3tthe4L3xYU4biRPVTFo9t2YRO4Dg3+zrLyMS4YanCE=
github.com/pierrre/compare v1.4.13 h1:b6gi3OgN1emmD1Ly37m+B/Pbq6tac+w3lNGT5xu4I10=
github.com/pierrre/compare v1.4.13/go.mod h1:+ie0ecM2nS32oLck0FWDstwIUSZ0YF4KBIaACOvKhJM=
github.com/pierrre/geohash v1.1.3 h1:3u+EbHm2FZQnZCu3E2SaeryIQYtA/eH1YYzDpFm/42c=
github.com/pierrre/geohash v1.1.3/go.mod h1:K5UlVmtRxicTXgp6eShrlAOk2Neu9zOe76C/ug7RIZ8=
github.com/pierrre/go-libs v0.17.0 h1:bjxd9unioV/YDkUW7obETp2IFct0kO9HePURn81UL8s=
github.com/pierrre/go-libs v0.17.0/go.mod h1:920odOqc5mZREW9GFWg056mjQ2prNVRGUZO7HRS2Jlc=
github.com/pierrre/pretty v0.14.3 h1:I100hHs1C/MCd3M0D/hIV7J2OXl7amLD0uP2jnB7mRw=
github.com/pierrre/pretty v0.14.3/go.mod h1:HTaFDNtT9ELVK5pODLfXRLiEiyIx3MmQUL5UadrR3/0=
github.com/pires/go-proxyproto v0.8.1 h1:9KEixbdJfhrbtjpz/ZwCdWDD2Xem0NZ38qMYaASJgp0=
github.com/pires/go-proxyproto v0.8.1/go.mod h1:ZKAAyp3cgy5Y5Mo4n9AlScrkCZwUy0g3Jf+slqQVcuU=
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 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
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_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
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 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
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 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
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/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/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/the42/cartconvert v0.0.0-20131203171324-aae784c392b8 h1:I4DY8wLxJXCrMYzDM6lKCGc3IQwJX0PlTLsd3nQqI3c=
github.com/the42/cartconvert v0.0.0-20131203171324-aae784c392b8/go.mod h1:fWO/msnJVhHqN1yX6OBoxSyfj7TEj1hHiL8bJSQsK30=
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-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/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-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
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-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
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.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
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_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/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/the42/cartconvert v1.0.0 h1:g8kt6ic2GEhdcZ61ZP9GsWwhosVo5nCnH1n2/oAQXUU=
github.com/the42/cartconvert v1.0.0/go.mod h1:fWO/msnJVhHqN1yX6OBoxSyfj7TEj1hHiL8bJSQsK30=
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=
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-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
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/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

240
main.go
View File

@@ -1,4 +1,4 @@
// Copyright (C) 2021 Shizun Ge
// Copyright (C) 2021-2024 Shizun Ge
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,104 +17,124 @@
package main
import (
"endlessh-go/client"
"endlessh-go/geoip"
"endlessh-go/metrics"
"flag"
"fmt"
"math/rand"
"net"
"net/http"
"os"
"strings"
"time"
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
proxyproto "github.com/pires/go-proxyproto"
)
var (
numCurrentClients int64
numTotalClients int64
numTotalClientsClosed int64
numTotalBytes int64
numTotalMilliseconds int64
totalClients prometheus.CounterFunc
totalClientsClosed prometheus.CounterFunc
totalBytes prometheus.CounterFunc
totalSeconds prometheus.CounterFunc
clientIP *prometheus.CounterVec
clientSeconds *prometheus.CounterVec
)
func initPrometheus(connHost, prometheusPort, prometheusEntry string) {
totalClients = prometheus.NewCounterFunc(
prometheus.CounterOpts{
Name: "endlessh_client_open_count_total",
Help: "Total number of clients that tried to connect to this host.",
}, func() float64 {
return float64(numTotalClients)
},
)
totalClientsClosed = prometheus.NewCounterFunc(
prometheus.CounterOpts{
Name: "endlessh_client_closed_count_total",
Help: "Total number of clients that stopped connecting to this host.",
}, func() float64 {
return float64(numTotalClientsClosed)
},
)
totalBytes = prometheus.NewCounterFunc(
prometheus.CounterOpts{
Name: "endlessh_sent_bytes_total",
Help: "Total bytes sent to clients that tried to connect to this host.",
}, func() float64 {
return float64(numTotalBytes)
},
)
totalSeconds = prometheus.NewCounterFunc(
prometheus.CounterOpts{
Name: "endlessh_trapped_time_seconds_total",
Help: "Total seconds clients spent on endlessh.",
}, func() float64 {
return float64(numTotalMilliseconds) / 1000
},
)
clientIP = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "endlessh_client_open_count",
Help: "Number of connections of clients.",
},
[]string{"ip", "geohash", "country", "location"},
)
clientSeconds = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "endlessh_client_trapped_time_seconds",
Help: "Seconds a client spends on endlessh.",
},
[]string{"ip"},
)
prometheus.MustRegister(totalClients)
prometheus.MustRegister(totalClientsClosed)
prometheus.MustRegister(totalBytes)
prometheus.MustRegister(totalSeconds)
prometheus.MustRegister(clientIP)
prometheus.MustRegister(clientSeconds)
http.Handle("/"+prometheusEntry, promhttp.Handler())
func startSending(maxClients int64, bannerMaxLength int64, records chan<- metrics.RecordEntry) chan *client.Client {
clients := make(chan *client.Client, maxClients)
go func() {
glog.Infof("Starting Prometheus on %v:%v, entry point is /%v", connHost, prometheusPort, prometheusEntry)
http.ListenAndServe(connHost+":"+prometheusPort, nil)
for {
c, more := <-clients
if !more {
return
}
go func() {
bytesSent, err := c.Send(bannerMaxLength)
remoteIpAddr := c.RemoteIpAddr()
localPort := c.LocalPort()
millisecondsSpent := c.MillisecondsSinceLast()
if err != nil {
c.Close()
records <- metrics.RecordEntry{
RecordType: metrics.RecordEntryTypeStop,
IpAddr: remoteIpAddr,
LocalPort: localPort,
MillisecondsSpent: millisecondsSpent,
}
return
}
clients <- c
records <- metrics.RecordEntry{
RecordType: metrics.RecordEntryTypeSend,
IpAddr: remoteIpAddr,
LocalPort: localPort,
MillisecondsSpent: millisecondsSpent,
BytesSent: bytesSent,
}
}()
}
}()
return clients
}
func startAccepting(maxClients int64, connType, connHost, connPort string, interval time.Duration, clients chan<- *client.Client, records chan<- metrics.RecordEntry, proxyProtocolEnabled bool, proxyProtocolReadHeaderTimeout int) {
go func() {
l, err := net.Listen(connType, connHost+":"+connPort)
if err != nil {
glog.Errorf("Error listening: %v", err)
os.Exit(1)
}
// Wrap the listener in a proxy protocol listener
if proxyProtocolEnabled {
l = &proxyproto.Listener{Listener: l, ReadHeaderTimeout: time.Duration(proxyProtocolReadHeaderTimeout) * time.Millisecond}
}
// Close the listener when the application closes.
defer l.Close()
glog.Infof("Listening on %v:%v", connHost, connPort)
for {
// Listen for an incoming connection.
conn, err := l.Accept()
if err != nil {
glog.Errorf("Error accepting connection from port %v: %v", connPort, err)
os.Exit(1)
}
c := client.NewClient(conn, interval, maxClients)
remoteIpAddr := c.RemoteIpAddr()
records <- metrics.RecordEntry{
RecordType: metrics.RecordEntryTypeStart,
IpAddr: remoteIpAddr,
LocalPort: connPort,
}
clients <- c
}
}()
}
type arrayStrings []string
func (a *arrayStrings) String() string {
return strings.Join(*a, ", ")
}
func (a *arrayStrings) Set(value string) error {
*a = append(*a, value)
return nil
}
const defaultPort = "2222"
var connPorts arrayStrings
func main() {
intervalMs := flag.Int("interval_ms", 1000, "Message millisecond delay")
bannerMaxLength := flag.Int64("line_length", 32, "Maximum banner line length")
maxClients := flag.Int64("max_clients", 4096, "Maximum number of clients")
connType := flag.String("conn_type", "tcp", "Connection type. Possible values are tcp, tcp4, tcp6")
connHost := flag.String("host", "0.0.0.0", "Listening address")
connPort := flag.String("port", "2222", "Listening port")
connHost := flag.String("host", "0.0.0.0", "SSH listening address")
flag.Var(&connPorts, "port", fmt.Sprintf("SSH listening port. You may provide multiple -port flags to listen to multiple ports. (default %q)", defaultPort))
prometheusEnabled := flag.Bool("enable_prometheus", false, "Enable prometheus")
prometheusHost := flag.String("prometheus_host", "0.0.0.0", "The address for prometheus")
prometheusPort := flag.String("prometheus_port", "2112", "The port for prometheus")
prometheusEntry := flag.String("prometheus_entry", "metrics", "Entry point for prometheus")
geoipSupplier := flag.String("geoip_supplier", "off", "Supplier to obtain Geohash of IPs. Possible values are \"off\", \"ip-api\", \"freegeoip\"")
prometheusCleanUnseenSeconds := flag.Int("prometheus_clean_unseen_seconds", 0, "Remove series if the IP is not seen for the given time. Set to 0 to disable. (default 0)")
geoipSupplier := flag.String("geoip_supplier", "off", "Supplier to obtain Geohash of IPs. Possible values are \"off\", \"ip-api\", \"max-mind-db\"")
maxMindDbFileName := flag.String("max_mind_db", "", "Path to the MaxMind DB file.")
proxyProtocolEnabled := flag.Bool("proxy_protocol_enabled", false, "Enable PROXY protocol support. This causes the server to expect PROXY protocol headers on incoming connections.")
proxyProtocolReadHeaderTimeout := flag.Int("proxy_protocol_read_header_timeout_ms", 200, "Timeout for reading the PROXY protocol header in milliseconds. If the connection does not send a valid PROXY protocol header in this time, the header is ignored.")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), "Usage of %v \n", os.Args[0])
@@ -123,56 +143,38 @@ func main() {
flag.Parse()
if *prometheusEnabled {
initPrometheus(*connHost, *prometheusPort, *prometheusEntry)
if *connType == "tcp6" && *prometheusHost == "0.0.0.0" {
*prometheusHost = "[::]"
}
metrics.InitPrometheus(*prometheusHost, *prometheusPort, *prometheusEntry)
}
rand.Seed(time.Now().UnixNano())
records := metrics.StartRecording(*maxClients, *prometheusEnabled, *prometheusCleanUnseenSeconds,
geoip.GeoOption{
GeoipSupplier: *geoipSupplier,
MaxMindDbFileName: *maxMindDbFileName,
})
clients := startSending(*maxClients, *bannerMaxLength, records)
interval := time.Duration(*intervalMs) * time.Millisecond
// Listen for incoming connections.
if *connType == "tcp6" && *connHost == "0.0.0.0" {
*connHost = "[::]"
}
l, err := net.Listen(*connType, *connHost+":"+*connPort)
if err != nil {
glog.Errorf("Error listening: %v", err)
os.Exit(1)
if len(connPorts) == 0 {
connPorts = append(connPorts, defaultPort)
}
// Close the listener when the application closes.
defer l.Close()
glog.Infof("Listening on %v:%v", *connHost, *connPort)
clients := make(chan *client, *maxClients)
go func() {
for {
c, more := <-clients
if !more {
return
for _, connPort := range connPorts {
startAccepting(*maxClients, *connType, *connHost, connPort, interval, clients, records, *proxyProtocolEnabled, *proxyProtocolReadHeaderTimeout)
}
for {
if *prometheusCleanUnseenSeconds <= 0 {
time.Sleep(time.Duration(1<<63 - 1))
} else {
time.Sleep(time.Second * time.Duration(60))
records <- metrics.RecordEntry{
RecordType: metrics.RecordEntryTypeClean,
}
if time.Now().Before(c.next) {
time.Sleep(c.next.Sub(time.Now()))
}
err := c.Send(*bannerMaxLength)
if err != nil {
c.Close()
continue
}
go func() { clients <- c }()
}
}()
listener := func() {
for {
// Listen for an incoming connection.
conn, err := l.Accept()
if err != nil {
glog.Errorf("Error accepting: %v", err)
os.Exit(1)
}
// Handle connections in a new goroutine.
for numCurrentClients >= *maxClients {
time.Sleep(interval)
}
clients <- NewClient(conn, interval, *maxClients, *geoipSupplier, *prometheusEnabled)
}
}
listener()
}

195
metrics/metrics.go Normal file
View File

@@ -0,0 +1,195 @@
// Copyright (C) 2024 Shizun Ge
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
package metrics
import (
"endlessh-go/geoip"
"net/http"
"os"
"time"
"strings"
"net"
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
var (
pq *UpdatablePriorityQueue
totalClients *prometheus.CounterVec
totalClientsClosed *prometheus.CounterVec
totalBytes *prometheus.CounterVec
totalSeconds *prometheus.CounterVec
clientIP *prometheus.CounterVec
clientSeconds *prometheus.CounterVec
)
func InitPrometheus(prometheusHost, prometheusPort, prometheusEntry string) {
pq = NewUpdatablePriorityQueue()
totalClients = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "endlessh_client_open_count_total",
Help: "Total number of clients that tried to connect to this host.",
}, []string{"local_port"},
)
totalClientsClosed = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "endlessh_client_closed_count_total",
Help: "Total number of clients that stopped connecting to this host.",
}, []string{"local_port"},
)
totalBytes = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "endlessh_sent_bytes_total",
Help: "Total bytes sent to clients that tried to connect to this host.",
}, []string{"local_port"},
)
totalSeconds = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "endlessh_trapped_time_seconds_total",
Help: "Total seconds clients spent on endlessh.",
}, []string{"local_port"},
)
clientIP = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "endlessh_client_open_count",
Help: "Number of connections of clients.",
},
[]string{"ip", "local_port", "geohash", "country", "location"},
)
clientSeconds = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "endlessh_client_trapped_time_seconds",
Help: "Seconds a client spends on endlessh.",
},
[]string{"ip", "local_port"},
)
promReg := prometheus.NewRegistry()
promReg.MustRegister(totalClients)
promReg.MustRegister(totalClientsClosed)
promReg.MustRegister(totalBytes)
promReg.MustRegister(totalSeconds)
promReg.MustRegister(clientIP)
promReg.MustRegister(clientSeconds)
handler := promhttp.HandlerFor(promReg, promhttp.HandlerOpts{EnableOpenMetrics: true})
http.Handle("/"+prometheusEntry, handler)
go func() {
if strings.HasPrefix(prometheusHost, "unix:") {
socketPath := prometheusHost[5:] // trim the "unix:" prefix
glog.Infof("Starting Prometheus on Unix socket %v, entry point is /%v", socketPath, prometheusEntry)
serveOnUnixSocket(socketPath)
} else {
ipPort := prometheusHost+":"+prometheusPort
glog.Infof("Starting Prometheus on IP port %v, entry point is /%v", ipPort, prometheusEntry)
serveOnIpPort(ipPort)
}
}()
}
func serveOnUnixSocket(socketPath string) {
_ = os.Remove(socketPath) // allow failure
unixListener, err := net.Listen("unix", socketPath)
if err != nil {
glog.Errorf("Error starting Prometheus on socket %v: %v", socketPath, err)
os.Exit(1)
}
if err := http.Serve(unixListener, nil); err != nil {
glog.Errorf("Error starting Prometheus at socket %v: %v", socketPath, err)
os.Exit(1)
}
}
func serveOnIpPort(ipPort string) {
if err := http.ListenAndServe(ipPort, nil); err != nil {
glog.Errorf("Error starting Prometheus at IP port %v: %v", ipPort, err)
os.Exit(1)
}
}
const (
RecordEntryTypeStart = iota
RecordEntryTypeSend = iota
RecordEntryTypeStop = iota
RecordEntryTypeClean = iota
)
type RecordEntry struct {
RecordType int
IpAddr string
LocalPort string
MillisecondsSpent int64
BytesSent int
}
func StartRecording(maxClients int64, prometheusEnabled bool, prometheusCleanUnseenSeconds int, geoOption geoip.GeoOption) chan RecordEntry {
records := make(chan RecordEntry, maxClients)
go func() {
for {
r, more := <-records
if !more {
return
}
if !prometheusEnabled {
continue
}
switch r.RecordType {
case RecordEntryTypeStart:
geohash, country, location, err := geoip.GeohashAndLocation(r.IpAddr, geoOption)
if err != nil {
glog.Warningf("Failed to obtain the geohash of %v: %v.", r.IpAddr, err)
}
clientIP.With(prometheus.Labels{
"ip": r.IpAddr,
"local_port": r.LocalPort,
"geohash": geohash,
"country": country,
"location": location}).Inc()
totalClients.With(prometheus.Labels{"local_port": r.LocalPort}).Inc()
pq.Update(r.IpAddr, time.Now())
case RecordEntryTypeSend:
secondsSpent := float64(r.MillisecondsSpent) / 1000
clientSeconds.With(prometheus.Labels{
"ip": r.IpAddr,
"local_port": r.LocalPort}).Add(secondsSpent)
totalSeconds.With(prometheus.Labels{"local_port": r.LocalPort}).Add(secondsSpent)
totalBytes.With(prometheus.Labels{"local_port": r.LocalPort}).Add(float64(r.BytesSent))
pq.Update(r.IpAddr, time.Now())
case RecordEntryTypeStop:
secondsSpent := float64(r.MillisecondsSpent) / 1000
clientSeconds.With(prometheus.Labels{
"ip": r.IpAddr,
"local_port": r.LocalPort}).Add(secondsSpent)
totalSeconds.With(prometheus.Labels{"local_port": r.LocalPort}).Add(secondsSpent)
totalClientsClosed.With(prometheus.Labels{"local_port": r.LocalPort}).Inc()
pq.Update(r.IpAddr, time.Now())
case RecordEntryTypeClean:
top := pq.Peek()
deadline := time.Now().Add(-time.Second * time.Duration(prometheusCleanUnseenSeconds))
for top != nil && top.Value.Before(deadline) {
clientIP.DeletePartialMatch(prometheus.Labels{"ip": top.Key})
clientSeconds.DeletePartialMatch(prometheus.Labels{"ip": top.Key})
pq.Pop()
top = pq.Peek()
}
}
}
}()
return records
}

94
metrics/priority_queue.go Normal file
View File

@@ -0,0 +1,94 @@
package metrics
import (
"container/heap"
"time"
)
// Pair represents a key-value pair with a timestamp
type Pair struct {
Key string
Value time.Time
HeapIdx int // Index in the heap for efficient updates
}
// PriorityQueue is a min-heap implementation for Pairs
type PriorityQueue []*Pair
// Len returns the length of the priority queue
func (pq PriorityQueue) Len() int { return len(pq) }
// Less compares two pairs based on their values (timestamps)
func (pq PriorityQueue) Less(i, j int) bool {
return pq[i].Value.Before(pq[j].Value)
}
// Swap swaps two pairs in the priority queue
func (pq PriorityQueue) Swap(i, j int) {
pq[i], pq[j] = pq[j], pq[i]
pq[i].HeapIdx = i
pq[j].HeapIdx = j
}
// Push adds a pair to the priority queue
func (pq *PriorityQueue) Push(x interface{}) {
pair := x.(*Pair)
pair.HeapIdx = len(*pq)
*pq = append(*pq, pair)
}
// Pop removes the pair with the minimum value (timestamp) from the priority queue
func (pq *PriorityQueue) Pop() interface{} {
old := *pq
n := len(old)
pair := old[n-1]
pair.HeapIdx = -1 // for safety
*pq = old[0 : n-1]
return pair
}
// UpdatablePriorityQueue represents the data structure with the priority queue
type UpdatablePriorityQueue struct {
pq PriorityQueue
keyMap map[string]*Pair
}
// NewUpdatablePriorityQueue initializes a new UpdatablePriorityQueue
func NewUpdatablePriorityQueue() *UpdatablePriorityQueue {
return &UpdatablePriorityQueue{
pq: make(PriorityQueue, 0),
keyMap: make(map[string]*Pair),
}
}
// Update adds or updates a key-value pair in the data structure
func (ds *UpdatablePriorityQueue) Update(key string, value time.Time) {
if pair, ok := ds.keyMap[key]; ok {
// Key exists, update the time
pair.Value = value
heap.Fix(&ds.pq, pair.HeapIdx)
} else {
// Key does not exist, create a new entry
pair := &Pair{Key: key, Value: value}
heap.Push(&ds.pq, pair)
ds.keyMap[key] = pair
}
}
// Peek returns the entry with the minimal time
func (ds *UpdatablePriorityQueue) Peek() *Pair {
if ds.pq.Len() == 0 {
return nil
}
return ds.pq[0]
}
// Pop removes the entry with the minimal time
func (ds *UpdatablePriorityQueue) Pop() *Pair {
if ds.pq.Len() == 0 {
return nil
}
pair := heap.Pop(&ds.pq).(*Pair)
delete(ds.keyMap, pair.Key)
return pair
}