Skip to content

Commit

Permalink
19.2 (#70)
Browse files Browse the repository at this point in the history
* Configuration parameter changed from proxy_path to base_path - to avoid ambiguities

* Fix ambiguous situations around the period when DST changes.

* Emit [Error] message when socket cannot be created. Resolves #63.

* Refactored Storage class to better handle temp folder management.

* Fixed a number of typos.

* Preliminary Readme for 19.1

* Preparation for 19.1b1

* Preparation for 19.1b1

* Preparation for 19.1b1

* Preparation for 19.1b2

* Show error if verification fails in node properties dialog

* Add reference to py3 only.

* v19.2b3

* get_cc: 'SessionManager' object has no attribute 'delete': Fixed

* fixed an issue due to lazy refactoring.

* Linux: Suppress stderr output when querying for the ntp server information.

* Network Bandwidth: 3 month chart substituted by 6 month chart - according oninooo.

* Network Weights: 6 month chart included.

* Fixed Keyboard (Left / Right) navigation in Dashboard

* Preparation for v19.2b4

* Fix: Add NoneType guard when querying for messages.

* Another fix for keyboard navigation on the Dashboard

* Removed obsolete section 'control'.

* Fixed typo in Readme

* Updated tor.1.txt

* 'New day' message added to the log of nodes.

* Fixed: Cursor key (left, right) navigation at the Dashboard ... finally!

* Fixed some minor issued around the HiddenService Cookie property.

* Fixed 'new day' logging message

* Hunting for an issue concerning the persistance of bandwidth data.

* OO sometimes returns strings with encoded unicode characters. Fixed.

* tor.1.txt updated.

* Yet another attempt to fix the 'New Day' notification.

* Fixed: Issue in the handshaking with the Update service.

* Fixed: warning if bandwidth data cannot be persisted displays fpid yet not fp.

* 19.2
  • Loading branch information
ralphwetzel authored Dec 2, 2019
1 parent d8c59cb commit 5b1baf0
Show file tree
Hide file tree
Showing 284 changed files with 58,505 additions and 30,602 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ downloads/
eggs/
/xtor
.eggs/
lib/

lib64/
parts/
sdist/
Expand Down Expand Up @@ -64,4 +64,4 @@ theonionbox/theonionbox.ltd

# Special to The Onion Box
# Glide Library comes with a 'dist' directory that we need!
!theonionbox/libs/glide-*/dist/
!theonionbox/libs/glide-*/dist/
6 changes: 3 additions & 3 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM python:2.7
FROM python:3.6

EXPOSE 8080

RUN pip install pip --upgrade && pip install theonionbox

COPY theonionbox.cfg /usr/local/lib/python2.7/site-packages/theonionbox
COPY theonionbox.cfg /usr/local/lib/python3.6/site-packages/theonionbox

ENTRYPOINT ["/usr/local/bin/theonionbox", "-c", "/usr/local/lib/python2.7/site-packages/theonionbox/theonionbox.cfg"]
ENTRYPOINT ["/usr/local/bin/theonionbox", "-c", "/usr/local/lib/python3.6/site-packages/theonionbox/theonionbox.cfg"]
131 changes: 32 additions & 99 deletions Docker/theonionbox.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
## Configuration File for TheOnionBox
## Latest Modification: 2019510 for Dockerfile


[config]
## v4.0 will only support version = 2
protocol = 2

## Latest Modification: 20190811 while preparing v5.0 - which then became 19.2

[TheOnionBox]
## Address of your Onion Box:
Expand Down Expand Up @@ -48,8 +42,7 @@ host = 0.0.0.0
## DON'T distribute this combined private/public key to clients!
## (see http://www.piware.de/2011/01/creating-an-https-server-in-python/#comment-11380)
##
## ssl = yes # deprecated 20170218
## Just set ssl_certificate & ssl_key to enable ssl mode!

## The file that holds the Certificate!
# ssl_certificate = server.pem
## The file that holds the Key!
Expand Down Expand Up @@ -92,13 +85,20 @@ host = 0.0.0.0
# port = 9051
## Default for a TorBrowser
# port = 9151
## You may use 'default' (port = default) to test for 9051 (relay default) and 9151 (browser default)
# port = default
## Note: This defaults to port = default if not defined!

## You may use 'auto' (port = auto) to test for 9051 (relay default) and 9151 (browser default)
# port = auto
## Note: This defaults to port = auto if not defined!

## ControlSocket of this Tor instance
# socket = /var/run/tor/control

## Authorization Cookie - necessary to access a Tor node via a hidden service utilizing HiddenServiceAuthorizeClient
# auth_cookie = YourCookieHereLength22
## There's no default value for this option.

# TODO 20190811: [Tor] options below this line are deprecated!

## Timeout when connecting to Tor.
## Usually the connection should be established very quick;
## you may increase this if connecting to very remote systems.
Expand Down Expand Up @@ -126,119 +126,52 @@ host = 0.0.0.0
# tor_preserve_WARN = no
# tor_preserve_NOTICE = no


[TorProxy]
## These parameters configure a connection to a Tor node acting as SocksProxy into the Tor network.
## Note: Operation via a proxy given by a unix domain socket is (as of 04/2017) not supported!

## If you establish connection cookies for hosts to be controlled via the control center, there is the need
## to verify that those cookies are defined. To perform the verification, we need valid control port
## settings of the node acting as proxy:

## How shall we establish the connection to the node?
## => via a ControlSocket (define additionally 'socket' parameter):
# control = socket
## => via a ControlPort (define additionally 'port' parameter):
# control = port
## You may use control = default to operate with [Tor]control
## Note: This defaults to control = default if not defined!

## You may use control = tor to operate with the node configured in [Tor]
# control = tor
## Note: This defaults to control = tor if not defined!

## Address of the proxy to use
## Do NOT use 'localhost' but 127.0.0.1 to connect locally
## You may use 'default' (host = default) to use [Tor]host
# host = default
## You may use 'tor' (host = tor) to use [Tor]host
# host = tor
# host = 127.0.0.1
## Note: This defaults to host = default if not defined!

## Port for the proxy
## SocksPort of the proxy
## Default for a Relay (or Bridge)
# proxy = 9050
## Default for a Tor Browser
# proxy = 9150
## You may use 'default' (proxy = default) to test for 9050 (relay default) and 9150 (browser default)
# proxy = default
## Note: This defaults to proxy = default if not defined!

## You may use 'auto' (proxy = auto) to test for 9050 (relay default) and 9150 (browser default)
# proxy = auto
## Note: This defaults to proxy = auto if not defined!

## ControlPort of the proxy Tor node
## Default for a Relay (or Bridge)
# port = 9051
## Default for a Tor Browser
# port = 9151
## You may use 'default' (port = default) to test for 9051 (relay default) and 9151 (browser default)
# port = default
## Note: This defaults to port = default if not defined!

## ControlSocket of the proxy Tor node
# socket = /var/run/tor/control
## You may use 'default' (socket = default) to use [Tor]socket
# socket = default
## Note: This defaults to socket = default if not defined!


#####
## Those are the Tor nodes to be controlled with the control center
## Note: You must not name any of the following sections 'config', 'TheOnionBox', 'Tor' or 'TorProxy'.


## Define one section per node:
# [myControlledNode]
## You may use 'auto' (port = auto) to test for 9051 (relay default) and 9151 (browser default)
# port = auto
## You may use 'tor' (port = tor) to use [Tor]port
# port = tor

## Alternatively: Beginning the section identifier with '#' indicates a nickname;
## if you later omit the 'nick' parameter, the nickname will be derived from the section identifier.
# [#myControlledNode]
## If you intend to define several ways to connect to this node,
## add whatever you like after a ':' to distinguish the sections:
# [#myControlledNode:2]

## Alternatively: You can use the fingerprint (with preceding '$') as section identifier.
## Ensure a length of 41 characters: '$' + fingerprint[40];
## if you later omit the 'fp' parameter, the fingerprint will be derived from the section identifier.
# [$5COOL5C30AXX4B3DE460815323967087ZZ53D947]
## If you intend to define several ways to connect to this node,
## add whatever you like after a ':' to distinguish the sections:
# [$5COOL5C30AXX4B3DE460815323967087ZZ53D947:2]


## How shall we establish the connection to this node?
## => via a ControlSocket (define additionally 'socket' parameter):
# control = socket
## => via a ControlPort (define additionally 'host' & 'port' parameter):
# control = port
## => via a Proxy (define a proxy via the [Proxy] section and set 'host' to an address reachable through this proxy):
# control = proxy
## Note: There is no default setting. If not defined, this section (and thus the node) will be ignored.

## IP Address of this Tor node
# host = 127.0.0.1
## You may as well define an onion or http address
# host = takeonionaddress.onion
## Note: There is no default setting.

## ControlPort of this Tor node
## Default for a Relay (or Bridge)
# port = 9051
## Note: There is no default setting.

## This is only relevant for very rare setups - yet if you like, you may use it!
## ControlSocket of this Tor node
## ControlSocket of the proxy Tor node
# socket = /var/run/tor/control
## Note: There is no default setting.

## Hidden Service connections may be secured by definition of a authorization cookie.
## To operate via those connections, you may define this cookie here.
## For further details refer to 'HiddenServiceAuthorizeClient' on https://www.torproject.org/docs/tor-manual.html
# cookie = xuseyourcookieherexTOB
## The Box will ensure that the cookie is registered before establishing the connection.
## Note: There is no default setting.

## The nickname of this node
# nick = myControlledNode
## Defining a nickname here overrides a nickname defined as the name of the section.
## Note: The Box is able to retrieve the nickname itself,
## yet defining nickname (and fingerprint) parameters saves onionoo queries.
## Note: There is no default setting.

## The fingerprint of this node
# fp = $5COOL5C30AXX4B3DE460815323967087ZZ53D947
## Defining a fingerprint here overrides a fingerprint defined as the name of the section.
## Note: The Box is able to retrieve the fingerprint itself,
## yet defining fingerprint (and nickname) parameters saves onionoo queries.
## Note: There is no default setting.
## You may use 'tor' (socket = tor) to use [Tor]socket
# socket = tor
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 - 2018 Ralph Wetzel
Copyright (c) 2015 - 2019 Ralph Wetzel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
50 changes: 42 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,41 @@
![Supported Python versions](https://img.shields.io/pypi/pyversions/theonionbox.svg?style=flat-square)
![Status](https://img.shields.io/pypi/status/theonionbox.svg?style=flat-square)

---
### The Onion Box v19: Preliminary documentation
## The ControlCenter

This latest version of The Onion Box introduces three changes of relevance:
* The current versioning scheme was dropped in preference for [Calendar Versioning](www.calver.org). Thus v19.2 will become the successor of v4.3.1.
* The Onion Box v19.2 and later requires Python 3.6 or Python 3.7. If you need to operate with Python2, you have to stay with The Onion Box v4.3.1.
* In addition to the well known (legacy) dashboard, suitable to monitor just a single Tor instance, The Onion Box now provides a ControlCenter mode to monitor a(ny) number of Tor nodes in parallel. That's how it looks like:

![image](docs/images/cc.png)

This is the shorttrack way to enable the ControlCenter mode:

1) Setup your Onion Box as you did before - and you'll get the legacy dashboard (as before).
2) Create a configuration file, that shall be used to store the configuration data of the ControlCenter. The easiest way to do this on a *nix-type system:
```
(theonionbox) ~/theonionbox $ touch cc.cfg
```
Please ensure write privileges for that file to the user running your Onion Box.
3) Tell your Onion Box where to find this configuration file - via the command line parameter `--controlcenter` or `-x`:

```
(theonionbox) ~/theonionbox $ theonionbox -x cc.cfg
```

4) Use the + - button in the upper right corner of the ControlCenter to add additional Tor nodes to be monitored.

5) The legacy dashboard with detail data for each node will show up if you follow the dedicated 'Show Details' link of each node.

6) To re-arrange the nodes in your ControlCenter, just Drag & Drop them around.

Enjoy!


---

_The Onion Box_ provides a web interface to monitor the operation of
a [Tor](https://www.torproject.org) node. It is able to monitor any Tor node operated as relay, as bridge and even as client - as long as it can establish a connection to the node and authenticate successfully.
Expand Down Expand Up @@ -173,17 +208,16 @@ _Weights_ displays the weights history data as known to Onionoo.
The number of available charts depends on the age of the Tor node monitored. You may switch the chart displayed via the _History Charts_ buttons.

---

### Control Center
Do you intend to monitor more than one Tor node? Are you interested in the Oninooo data of other Tor nodes? The section _Box | Control Center_ provides that functionality.
~~Do you intend to monitor more than one Tor node? Are you interested in the Oninooo data of other Tor nodes? The section _Box | Control Center_ provides that functionality.~~

![image](docs/images/control.png)

#### Search
Enter a search phrase - which should be a (part of a) nickname of a Tor node or a (portion of a) fingerprint - into the _Search_ field and press enter. This search phrase will be used to query Onionoo - and the result presented in a popup bubble. If the search was successful, you may click on the links provided to display the Tor network status protocol data of that Tor node.
~~Enter a search phrase - which should be a (part of a) nickname of a Tor node or a (portion of a) fingerprint - into the _Search_ field and press enter. This search phrase will be used to query Onionoo - and the result presented in a popup bubble. If the search was successful, you may click on the links provided to display the Tor network status protocol data of that Tor node.~~

#### Controlled Hosts
If you provided access control information for additional Tor nodes in the configuration file of your box, those nodes are listed under _Controlled Hosts_. Click on the fingerprint and you will be connected to that Tor node.
~~If you provided access control information for additional Tor nodes in the configuration file of your box, those nodes are listed under _Controlled Hosts_. Click on the fingerprint and you will be connected to that Tor node.~~

---

Expand Down Expand Up @@ -386,8 +420,8 @@ Second finding! There were three additional subdirectories created:
* `docs`, that holds the images used in this document.
* `service`, to provide the launchers if you intend to run your box as a [system service / daemon](#the-onion-box-as-system-service-aka-daemon) and the files to support the [Docker](#the-onion-box-docker-support) image setup.

The python packages - for the box and all it's dependencies - are located in `lib/python2.7/site-packages/`. Be aware, that the `python ` path segment might be different (e.g. `lib/python3.6/site-packages/`) if your virtual environment operates with another version of python!
_The Box Launcher_ (named as well `theonionbox`) is located in `bin/`, next to the executables of the python version used in your virtual environment.
The Python packages - for the box and all it's dependencies - are located in `lib/python2.7/site-packages/`. Be aware, that the `python` path segment might be different (e.g. `lib/python3.6/site-packages/`) if your virtual environment operates with another version of Python!
_The Box Launcher_ (named as well `theonionbox`) is located in `bin/`, next to the executables of the Python version used in your virtual environment.

If the structure of your installation looks equivalent, your box is now cleared for takeoff!

Expand Down Expand Up @@ -1329,15 +1363,15 @@ ProxyPass "/theonionbox" "http://192.168.178.46:8080"
After a restart of Apache, browsing to `localhost/theonionbox` on your proxy server should then redirect to `http://192.168.178.46:8080`.
Doing so should open your *Box* page - yet it looks scrumbled and doesn't operate as it should.

To solve that issue you have to set the parameter `proxy_path` in your `theonionbox.cfg` configuration file to match the `<proxyname>` you defined earlier:
To solve that issue you have to set the parameter `base_path` in your `theonionbox.cfg` configuration file to match the `<proxyname>` you defined earlier:

```
# Per default, the Box operates at the root level of a domain e.g. http://localhost:8080/.
# If you intend to operate it (behind a proxy!) at a deeper level (e.g. @ http://my.server.com/theonionbox/)
# you have to define that base path here. You are not limited to a single path element.
# Please assure that this is an absolute filepath yet without the domain:port, beginning with a leading slash,
# no trailing slash, no quotation marks:
proxy_path = /theonionbox
base_path = /theonionbox
```
Now everything should work as expected.

Expand Down
1 change: 1 addition & 0 deletions cc/ControlCenter/__init__.pyj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from controlcenter import ControlCenter
File renamed without changes.
Loading

0 comments on commit 5b1baf0

Please sign in to comment.