louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
57.47k stars 5.19k forks source link

monitor hidden services (provided by the Tor network) #1624

Open Oscaramr opened 2 years ago

Oscaramr commented 2 years ago

⚠️ Please verify that this feature request has NOT been suggested before.

🏷️ Feature Request Type

New Monitor

🔖 Feature description

Use torrc and connect via onion links.

✔️ Solution

Using Torrc use Socks5 or Http Proxy with that proxy add a monitor to track your hidden services.

❓ Alternatives

No response

📝 Additional Context

No response

gaby commented 2 years ago

@Oscaramr Have you try monitoring a service via https://www.tor2web.org/ ?

Oscaramr commented 2 years ago

@Oscaramr Have you try monitoring a service via https://www.tor2web.org/ ?

I have tried tor2web so much times i just cant get it to work, searched around for so long wont happen. Onion v3 btw if that matters

JacksonChen666 commented 2 years ago

monitoring an onion service (aka hidden service) is already possible, only needing additional setup of proxies (assuming the machine hosting uptime kuma also has access to tor (not the browser) via SOCKS proxy, even if the onion is being hosted on another computer).

setup instructions 1. setup tor to expose a SOCKS5 proxy on a specific port (that port is for the proxy) 2. create/edit a HTTP monitor and fill in all the details normally (yes, including the onion address, but without the tor2web stuff) example: Screen Shot 2022-05-08 at 20 49 41 3. setup a new proxy 4. change the proxy protocol to SOCKS (likely to be v5) 5. set server address of the proxy to `127.0.0.1` and the port to `9050` (this assumes tor is running on the same machine as uptime kuma and that tor is listening on port 9050 for SOCKS5 proxy) example: Screen Shot 2022-05-08 at 20 49 49 6. save the proxy configuration 7. save the monitor configuration done. if it doesn't work, make sure you're running tor (not the tor browser) and you've enabled the SOCKS port in the torrc.
ghost commented 1 year ago

How to do this if the Uptime Kuma docker image is used? I have used 172.17.0.1 as docker0 interface IP, but doesn't seem to connect to tor daemon.

JacksonChen666 commented 1 year ago

On January 26, 2023 5:08:42 PM UTC, NebulaOnion @.***> wrote:

How to do this if the Uptime Kuma docker image is used? I have used 172.17.0.1 as docker0 interface IP, but doesn't seem to connect to tor daemon.

127.0.0.1 is loopback. within a docker container, that means the loopback of the docker container, not the host machine (probably where the tor SOCKS proxy is available at). as such, you must specify the host with a running tor program with the SOCKS port exposed (to the docker container), which is not going to be 127.0.0.1 within the docker container.

you shouldn't need to modify your docker container for uptime kuma to get things working. you will probably have to modify tor configs to get it available, and find out the "host" ip address.

cozybear-dev commented 1 year ago

For those interested, I implemented this just now for my own Tor servers.

https://github.com/cozybear-dev/uptime-checkor

aaroncarlucci commented 1 year ago

I need to monitor Tor services that are available over TCP. I don't see proxy configuration enabled for TCP monitoring. Probably related to #1949, but monitoring Tor services is quite limited if TCP is not supported.

cozybear-dev commented 1 year ago

I need to monitor Tor services that are available over TCP. I don't see proxy configuration enabled for TCP monitoring. Probably related to #1949, but monitoring Tor services is quite limited if TCP is not supported.

I mean, what also is an option is to create a docker network that only exists via the Tor proxy. But this means that all checks for the uptime kuma container in that network will always go through Tor - regardless of your proxy config in kuma itself. If that isn't an issue, I'd try that. Should be quite easy. Perhaps I'll extend my current PoC with something like this. I'll update here if I do.

cozybear-dev commented 1 year ago

https://github.com/flungo-docker/tor-router

This is outdated but still very relevant. Will try it out with a config based on this repo. Then you can just start any container and mount it to the tor docker network and you're good to go. Instead of having to use the socks proxy explicitly.