* refactor: Partially break core package into dns, result and ssh packages
* refactor: Move core package to config/endpoint
* refactor: Fix warning about overlapping imported package name with endpoint variable
* refactor: Rename EndpointStatus to Status
* refactor: Merge result pkg back into endpoint pkg, because it makes more sense
* refactor: Rename parameter r to result in Condition.evaluate
* refactor: Rename parameter r to result
* refactor: Revert accidental change to endpoint.TypeDNS
* refactor: Rename parameter r to result
* refactor: Merge util package into endpoint package
* refactor: Rename parameter r to result
* feat: enhance HTTP client configuration with proxy support
- Add `ProxyURL` field to `Config` struct with YAML tag
- Implement proxy URL parsing and setting in `getHTTPClient` method
- Add test case for `getHTTPClient` method with custom proxy URL setting
- Include `net/url` package in both `config.go` and `config_test.go` files
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* docs: enhance README with Proxy and OAuth2 Docs
- Remove empty lines from README.md
- Add documentation for proxy configuration in client examples
- Include YAML examples for client using a proxy, custom DNS resolver, OAuth2, and identity-aware proxy configurations in README.md
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* docs: add proxy client
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* Update client/config.go
* Update README.md
* Update client/config_test.go
---------
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: TwiN <twin@linux.com>
* client: config: add Google Identity-Aware-Proxy support
* Add correct sum and mod
* Update README.md
* Update README.md
* client: config: add Google Identity-Aware-Proxy support
* Add correct sum and mod
* Update README.md
* Update README.md
* Change IAP acronym to Identity-Aware-Proxy
* Change IAP acronym to Identity-Aware-Proxy in README.md
* Fix conflict in go.mod
* merge readme from twin/master
* Fix typo error in readme.md
* Update client/config.go
---------
Co-authored-by: TwiN <twin@linux.com>
* feat(SSH): Add support for SSH endpoint
This commit adds support for SSH endpoint monitoring. Users can now configure an endpoint to be monitored using an SSH command by prefixing the endpoint's URL with ssh:\\. The configuration options for an SSH endpoint include the username, password, and command to be executed on the remote server. In addition, two placeholders are supported for SSH endpoints: [CONNECTED] and [STATUS].
This commit also updates the README to include instructions on how to configure SSH endpoints and the placeholders that can be used in their conditions. The README has been updated to include the new SSH-related options in the endpoints[] configuration object.
Here's a summary of the changes made in this commit:
Added support for SSH endpoint monitoring
Updated the documentation to include instructions on how to configure SSH endpoints and the placeholders that can be used in their conditions
* 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>
* 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>
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>
* 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
* 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>