Compare commits

...

7 Commits

9 changed files with 54 additions and 14 deletions

View File

@ -13,11 +13,13 @@ A TORch solution consists of 3 processes:
* MQTT broker - Any MQTT broker, reachable via IPv4 or Tor, through TLS or insecure communications * MQTT broker - Any MQTT broker, reachable via IPv4 or Tor, through TLS or insecure communications
* `torch-subscriber` - Listens for and handles onion hostname publications * `torch-subscriber` - Listens for and handles onion hostname publications
Easily launch a TORch Node monitor service using the [`torch-subscriber-docker`](https://git.rudefox.io/bj/torch-subscriber-docker) project
## Installation ## Installation
### Install Package from Rudefox Debian Repo ### Install Package from Rudefox Debian Repo
1. Add the [Rudefox Repo](https://rudefox.io/repo/) as an `apt` source 1. [Add the Rudefox Repo](https://rudefox.io/repo/) as an `apt` source
2. Install the `torch-agent` package 2. Install the `torch-agent` package
@ -37,7 +39,7 @@ Using the e-mail address you provided during GPG key generation, run `build-deb.
```bash ```bash
./build-deb.sh john@doe.com ./build-deb.sh john@doe.com
apt update && apt install build/torch-agent_0.0.5-1_all.deb apt update && apt install build/torch-agent_0.0.6-1_all.deb
``` ```
This will: This will:

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
torch-agent (0.0.5-1) stable; urgency=medium torch-agent (0.0.6-1) stable; urgency=medium
* Update * Update

View File

@ -4,9 +4,7 @@ tor &
while ! curl -s --socks5 127.0.0.1:9050 'https://check.torproject.org/' | grep -qm1 Congratulations while ! curl -s --socks5 127.0.0.1:9050 'https://check.torproject.org/' | grep -qm1 Congratulations
do do
sleep 3 sleep 0.5
done done
sleep 3
torch-agent $1 $2 $3 $4 torch-agent $1 $2 $3 $4

View File

@ -1,7 +1,15 @@
listener 8883 websockets_log_level 9
connection_messages true connection_messages true
log_type all log_type all
websockets_log_level 9
listener 1883
cafile /mosquitto/config/ca.crt
#keyfile /mosquitto/config/mqtt.example.com.key
#certfile /mosquitto/config/mqtt.example.com.crt
require_certificate true
use_identity_as_username true
listener 8883
cafile /mosquitto/config/ca.crt cafile /mosquitto/config/ca.crt
keyfile /mosquitto/config/mqtt.example.com.key keyfile /mosquitto/config/mqtt.example.com.key
certfile /mosquitto/config/mqtt.example.com.crt certfile /mosquitto/config/mqtt.example.com.crt

View File

@ -1,3 +1,3 @@
#!/usr/bin/bash #!/usr/bin/bash
docker run -it --rm --user $(echo $UID) --name mosquitto -p 8883:8883 -v $(pwd)/broker-config:/mosquitto/config eclipse-mosquitto docker run -it --rm --user $(echo $UID) --name mosquitto -p 8883:8883 -p 1883:1883 -v $(pwd)/broker-config:/mosquitto/config eclipse-mosquitto

View File

@ -1,3 +1,3 @@
#!/usr/bin/bash #!/usr/bin/bash
mosquitto_sub -L mqtts://mqtt.example.com/it/torch/\+/ssh_onion --cafile subscriber-config/ca.crt --key subscriber-config/subscriber.key --cert subscriber-config/subscriber.crt mosquitto_sub -L mqtts://mqtt.example.com/torch/\+/onion_url --cafile subscriber-config/ca.crt --key subscriber-config/subscriber.key --cert subscriber-config/subscriber.crt

7
publish-deb.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
USERNAME=$1
PASSWORD=$2
VERSION=$3
curl -u "$USERNAME:$PASSWORD" -H "Content-Type: multipart/form-data" --data-binary "@dist/torch-agent_${VERSION}-1_all.deb" "https://repo.rudefox.io/repository/apt-release/"

View File

@ -1,22 +1,47 @@
#################
# The `tor` section heading is required
[tor] [tor]
# Optional: The Tor onion proxy host and port (default: 127.0.0.1:9050)
#ProxyHost 127.0.0.1
ProxyPort = 9050 ProxyPort = 9050
# Optional: The Tor controller port (default: 9051) for creating new hidden services
ControllerPort = 9051 ControllerPort = 9051
#################
# The `ssh` section heading is required
[ssh] [ssh]
# Optional: Local SSH sevice port (default: 22)
Port = 22 Port = 22
#################
# The `mqtt` section heading is required
[mqtt] [mqtt]
# Optional: The MQTT broker host and port (default: localhost:1883)
# Can be either IPv4 or Tor onion hostname
BrokerHost = mqtt.example.com BrokerHost = mqtt.example.com
#BrokerHost = example1i3uyrbfoi3fi.onion #BrokerHost = example1i3uyrbfoi3fi.onion
BrokerPort = 1883 BrokerPort = 1883
# Optional: ID that will be used as an MQTT client ID when connecting to the broker (defaults to the current host's hostname)
ClientID = my-client ClientID = my-client
Topic = example/topic
### Options for Using TLS # Optional: Topic to be used when publishing connection info (defaults to 'torch/[hostname]/onion_url')
#Topic = example/topic
### Optional: TLS Options
#
# Note: when CaFile, CertFile and KeyFile are ALL defined, then TLS (MQTTS) is used to connect to the broker. Otherwise MQTT is used.
#
# Optional: Whether or not TORch Agent will verify the hostname of the broker and require it to match the name on the certificate the broker provides. This will be automatically DISABLED for connections to Tor onion hosts
#RequireCertificate = true #RequireCertificate = true
#CaFile = ca.crt #CaFile = ca.crt
#CertFile = client.crt #CertFile = client.crt
#KeyFile = client.key #KeyFile = client.key

View File

@ -1 +1 @@
__version__ = "0.0.5" __version__ = "0.0.6"