Commit Graph

53 Commits

Author SHA1 Message Date
I-HSIN Cheng
5c5a954b68
fix(tls): Honor client.insecure when doing TLS checks (#547)
* fix(watchdog): Add functions to avoid dangling file descriptors

* Change function name and add comment under core/endpoint.go
- change the function name of CloseHTTPConnection() to Close()
- add some comments above Close() function

* Update core/endpoint.go

* Update core/endpoint.go

* fix(client): Honor client.insecure when doing TLS checking
* add features in client/client.go to enable client.insecure when doing TLS checking

---------

Co-authored-by: Richard Cheng <richard_cheng@trendmicro.com>
Co-authored-by: TwiN <twin@linux.com>
2023-08-08 22:17:26 -04:00
Heitor
5f69351b6b
feat: support monitoring WebSocket endpoints (#511)
* feat: support monitoring WebSocket endpoints

WebSocket endpoints are automatically identified by the URL protocol
specification: `wss://` or `ws://`. The request body is used as the
"message" written to the server, and the answer is stored in the
`[BODY]`.

Optionally, the user can set the `jsonrpc` flag to automatically wrap
the request body in a JSON RPC 2.0 method call.

* core:websocket: close connection after using it

* test: add tests related to WebSocket support

- test we can identify the endpoint type for WebSockets based on the URL
  supplied: `wss://` (with SSL/TLS) and `ws://` (plain text).
- test we can generate a JsonRPC 2.0 message via the new endpoint flag
  `JsonRPC`.

* core:endpoint: fix name of jsonrpc parameter

See https://en.wikipedia.org/wiki/JSON-RPC#Version_2.0

* core:websocket: fix dangling open connection on error

Move the `defer ws.Close()` to after opening the connection, so the
socket is closed also in case of errors.

* remove jsonrpc flag

* core:websocket: fix nil pointer dereference

The connection should only be closed if successfully opened.

* Move websocket function to client

* update go.mod

* Fix build errors

* Fix errors

* Update client/client.go

---------

Co-authored-by: TwiN <twin@linux.com>
2023-08-08 22:12:37 -04:00
TwiN
447e140479
feat(connectivity): Allow internet connection validation prior to endpoint execution (#461) 2023-05-02 22:41:22 -04:00
Flo J
ee8e0c4b40
fix(deps): Replace deprecated go-ping dependency to pro-bing (maintained fork) (#444)
update go-ping to pro-ping maintained fork

additionally add a hint in the README for previliged mode

Co-authored-by: floj <floj@users.noreply.github.com>
Co-authored-by: TwiN <twin@linux.com>
2023-03-26 17:26:40 -04:00
TwiN
3059e3e028
feat: Support multiple configuration files (#396)
* Revert "Revert "feat: Support multiple configuration files" (#395)"

This reverts commit 87740e74a6.

* feat: Properly implement support for config directory
2023-01-08 17:53:37 -05:00
TwiN
27502acd10 chore: Improve oauth2 configuration error 2022-12-15 23:25:37 -05:00
TwiN
f6a621da28 chore: Bump module version to v5 2022-12-06 01:41:18 -05:00
TwiN
eb4e22e76b chore: Replace 1.1.1.1 by 8.8.8.8 everywhere due to 1.1.1.1 being unreliable 2022-11-15 21:50:54 -05:00
TwiN
d24ff5bd07 refactor: Move whois to client package and implement caching 2022-11-15 21:50:54 -05:00
Ian Chen
fa47a199e5
feat: support SCTP & UDP as endpoint type (#352)
* feat: support SCTP & UDP as endpoint type

* update README

* modify endpoint type test for sctp & udp
2022-11-09 19:22:13 -05:00
TwiN
319f460553 docs: Update GetHTTPClient comment 2022-07-28 20:29:29 -04:00
TwiN
ab2bee9c4b chore!: Update module from v3 to v4 2022-06-20 21:25:14 -04:00
TwiN
326ea1c3d1 refactor(client): Clean up client dns resolver 2022-06-13 20:35:51 -04:00
TwiN
6d64c3c250 chore: Reformat some code and docs 2022-06-12 19:18:58 -04:00
Andre Bindewald
2cbb35fe3b
feat(client): Added client configuration option for using a custom DNS resolver (#284) 2022-06-12 18:45:08 -04:00
TwiN
5b1aeaeb0c chore(test): Use io instead of io/ioutil 2022-05-16 22:19:42 -04:00
TwiN
8970ad5ad5 refactor: Align new code from #259 with existing code 2022-03-09 21:05:57 -05:00
Andre Bindewald
c4255e65bc
feat(client): OAuth2 Client credential support (#259)
* Initial implementation

* Added OAuth2 support to `client` config

* Revert "Initial implementation"

This reverts commit 7f2f3a603a.

* Restore vendored clientcredentials

* configureOAuth2 is now a func (including tests)

* README update

* Use the same OAuth2Config in all related tests

* Cleanup & comments
2022-03-09 20:53:51 -05:00
TwiN
8c73ae6035 Fix #22: Improve alerting provider tests by mocking HTTP client 2021-12-02 23:10:21 -05:00
TwiN
6ed93d4b82
Rename Service to Endpoint (#192)
* Add clarifications in comments

* #191: Rename Service to Endpoint
2021-10-23 16:47:12 -04:00
TwiN
6c45f5b99c ⚠ Migrate TwinProduction/gatus to TwiN/gatus 2021-10-07 21:28:04 -04:00
TwinProduction
c423afb0bf Fix #182: Fix ICMP on Docker Linux 2021-10-07 01:21:13 -04:00
TwinProduction
dfd2f7943f Fix issue with privileged call on linux 2021-10-01 02:33:16 -04:00
TwinProduction
ac43ef4ab7 Refactor some code 2021-09-30 20:56:09 -04:00
TwinProduction
bc25fea1c0 Minor improvements 2021-09-30 20:45:47 -04:00
Carlotronics
30cb7b6ec8
Health check for SSL/TLS services (#177)
* protocol: starttls: add timeout support

Signed-off-by: Charles Decoux <charles@phowork.fr>

* protocol: add ssl support

Signed-off-by: Charles Decoux <charles@phowork.fr>
2021-09-30 16:15:17 -04:00
TwinProduction
cdbc075439 Fix #146: Alerting causes panic with some providers 2021-07-29 18:13:37 -04:00
TwinProduction
9cd6355056 #126: Add client configuration 2021-07-28 21:52:14 -04:00
TwinProduction
43150ae484 Fix #132: ICMP doesn't work on Mac OS 2021-07-18 20:43:44 -04:00
TwinProduction
b88ae5fcf6 Improve test coverage 2021-07-18 17:29:08 -04:00
TwinProduction
a1afeea56b Close #126: Don't follow redirects 2021-07-06 22:01:46 -04:00
TwinProduction
35c33620a5 Remove hidden feature HTTP_CLIENT_TIMEOUT_IN_SECONDS 2021-06-18 10:07:55 -04:00
TwinProduction
ca977fefa8 Minor improvements 2021-06-05 16:35:52 -04:00
gopher-johns
2131fa4412
#120: Add support for StartTLS protocol
* add starttls

* remove starttls from default config

Co-authored-by: Gopher Johns <gopher.johns28@gmail.com>
2021-06-05 15:47:11 -04:00
TwinProduction
19a0ba7271 #111: Don't explicitly specify ip4 for ICMP 2021-05-13 21:20:50 -04:00
TwinProduction
857ad584e7 #104: Add support for HTTP_CLIENT_TIMEOUT_IN_SECONDS (undocumented) 2021-04-30 22:58:14 -04:00
Andrii Vakarev
7ff8907eda Respect system proxy 2021-02-19 01:03:38 +01:00
TwinProduction
855c106e9b Reduce ping timeout during test 2021-01-12 22:19:19 -05:00
TwinProduction
04de262268 Add comment for pingTimeout 2021-01-12 21:37:21 -05:00
TwinProduction
26d8870cab Improve test coverage 2021-01-12 21:26:28 -05:00
TwinProduction
aec867ae69 Fix #72: Connected placeholder shouldn't resolve to true when when host is unreachable 2021-01-12 21:08:18 -05:00
TwinProduction
9095649afb Minor update 2021-01-04 23:38:47 -05:00
TwinProduction
ddbf391c39 Rename TestGetHttpClient to TestGetHTTPClient 2020-12-28 17:19:41 -05:00
TwinProduction
2eca1ab145 Get the round-trip time directly from the pinger 2020-12-27 17:07:50 -05:00
TwinProduction
83a5813daf Work on #61: Add support for ICMP
+ Update dependencies
2020-12-25 00:07:18 -05:00
TwinProduction
835704bf8a Set MaxIdleConns and MaxIdleConnsPerHost to 100 and 20 respectively 2020-10-30 09:51:42 -04:00
TwinProduction
2066497553 Set MaxIdleConns and MaxIdleConnsPerHost to 100 and 20 respectively 2020-10-30 09:50:40 -04:00
TwinProduction
77ad91a297 Fix Golint 2020-10-23 16:29:20 -04:00
TwinProduction
1bde98868e Improve code documentation 2020-10-23 15:58:59 -04:00
TwinProduction
3ecfe4d322 Close #18: Support monitoring TCP services 2020-10-04 19:49:02 -04:00