finish examples

This commit is contained in:
urist 2025-03-06 15:41:15 +01:00
parent 3e6795964d
commit 74837d5bce

View file

@ -269,6 +269,10 @@ sudo systemctl stop tor #stop the tor service
mkdir -p /var/lib/tor/auth_keys #create the client auth keys folder to store our second layer of authentication
mkdir -p /var/lib/tor/onion/grafana #create the client auth keys folder to store our second layer of authentication
chmod 400 -R /var/lib/tor/auth_keys #set restrictive file permissions
#line below will allow your aggregator to connect to your monitored server. Without it no requests can even reach it
echo "[prometheusclientaddr].onion:descriptor:x25519:DBQW3GP5FCN2KQBDKTDKDAQUQWBEGBZ5TFYJE4KTJFBUOJPKYZBQ" > /var/lib/tor/auth_keys/prometheus_server.auth_private
chmod 400 -R /var/lib/tor/onion #set restrictive file permissions
vi /etc/tor/torrc #edit the torrc file to add content
@ -286,7 +290,7 @@ private_key=descriptor:x25519:YCPURSYN4FL4QKQSXFTGLYNBHOVVRCQYRZLFHMZFCUFU5R6DCR
public_key=descriptor:x25519:UUQW4LIO447WRQOSRSNDXEW5NZMSR3CYOP65ZIFWH6G2PUKWV5WQ
echo "YCPURSYN4FL4QKQSXFTGLYNBHOVVRCQYRZLFHMZFCUFU5R6DCRMQ" > ~/mygrafana_auth_key
echo "UUQW4LIO447WRQOSRSNDXEW5NZMSR3CYOP65ZIFWH6G2PUKWV5WQ" > /var/lib/tor/onion/grafana/0.auth
echo "descriptor:x25519:UUQW4LIO447WRQOSRSNDXEW5NZMSR3CYOP65ZIFWH6G2PUKWV5WQ" > /var/lib/tor/onion/grafana/0.auth
chown debian-tor:debian-tor -R /var/lib/tor # make tor owner of this folder
@ -330,17 +334,13 @@ scrape_configs:
<h2>Grafana configuration</h2>
First let's start grafana and make it available: as root,
Let's start grafana and make it available: as root, as tor is already configured we can then access it through our torbrowser
<br>
<pre><code class="nim">
docker run -d -p 3000:3000 --name=grafana grafana/grafana-enterprise
</code</pre>
docker run -d -p 3000:3000 --name=grafana grafana/grafana
</code></pre>
As tor is already configured you can find your grafana url by looking at /var/lib/tor/onion/grafana/hostname
<br><br>
Now let's configure a couple of dashboards
</p>
@ -354,8 +354,10 @@ Now let's configure a couple of dashboards
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<p>
<h1> <b>Connecting to our grafana instance</b></h1>
On your monitoring server you can find your hostname at /var/lib/tor/grafana/hostname. Use it in the tor browser to reach your instance. You might be prompted for your private key if tor browser doesn't use your system's tor daemon. To avoid that you can change its connection settings.<br>
On your monitoring server you can find your hostname at /var/lib/tor/grafana/hostname. Use it in the tor browser to reach your instance. You will be prompted for your private key, you can find it where you saved it earlier ~/mygrafana_auth_key, paste the part after
<img src="grafana_login.png"/>
@ -366,17 +368,21 @@ Now let's configure a couple of dashboards
<img src="add_datasource.png"/>
<br>
<br>
Now, let's configure it (specifying localhost:9001 as the API port)<br>
Now, let's configure it (specifying localhost:9090 as the API port)<br>
<br>
<img src="datasource_config.png"/>
<br>
<br>
<br>
And Voila! we have simple system monitoring over tor in a dashboard: <br>
<img src="example_dashboard.png"/>
</p>
</div>
</div><!-- /row -->
</div> <!-- /container -->