Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
svengo authored May 23, 2024
1 parent ff6c73e commit d69f876
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

Simple Docker container to run a Tor node.


# Quick reference
### Quick reference

- **Maintained by**:
[Sven Gottwald](https://github.com/svengo/)
Expand All @@ -26,23 +25,23 @@ Simple Docker container to run a Tor node.
[Tor Project](https://www.torproject.org/)


# Supported tags and corresponding `Dockerfile` links
### Supported tags and corresponding `Dockerfile` links

- [`latest`, `0.4.8.11`](https://github.com/svengo/docker-tor/blob/025abed5929d69e35e646dac81d32795ab2c6dce/Dockerfile)

I will regularly rebuild the image to include updated Alpine packages with important security fixes.

## How to use this image

# How to use this image

## Start a simple Tor node
### Start a simple Tor node

This command will start a Tor node and open ports 9001 and 9030:

``` console
docker run -d -p 9001:9001 -p 9030:9030 --name tor svengo/tor
```

## Data storage
### Data storage

Data is stored in an anonymous volume that is mounted on ``/data`` (see docker inspect for more information). You can use a host volume to store the data in a specific directory on the host. The directory could exist, the permissions are handled by the container.

Expand All @@ -52,47 +51,47 @@ Start the container:
docker run -d -p 9001:9001 -p 9030:9030 --name tor -v /data/tor:/data svengo/tor
```

## Basic configuration
### Basic configuration

Use environment variables for basic configuration. The contents of the environment variables are used to build `/etc/tor/torrc-defaults`. For more advanced configuration you can edit the `/data/torrc` configuration file directly.

``` console
docker run -d -p 9001:9001 -p 9030:9030 --name tor -v /data/tor:/data -e "NICKNAME=MyDockerTorNode" -e "CONTACTINFO=foo@example.com" svengo/tor``
```

### Docker Compose
#### Docker Compose

You can use [docker-compose.yml](https://github.com/svengo/docker-tor/blob/main/docker-compose.yml). Don't forget to edit the file to suit your needs.

### Environment Variables
#### Environment Variables

svengo/tor uses several environment variables to generate the ``torrc-defaults``-file, the variables are set to reasonable defaults (see below). You can edit ``/data/torrc`` to your needs after the first run.

#### ORPORT
##### ORPORT

`ORPORT=[address:]PORT|auto [flags]`

Advertise this port to listen for connections from Tor clients and servers. This option is required to be a Tor server. Set it to "auto" to have Tor pick a port for you. Set it to 0 to not run an ORPORT at all.
Advertise this port to listen for connections from Tor clients and servers. This option is required to be a Tor server. Set it to "auto" to have Tor pick a port for you. Set it to 0 to not run an ORPORT at all.

(Default: ``9001``)

#### DIRPORT
##### DIRPORT

`DIRPORT=[address:]PORT|auto [flags]`

If this option is nonzero, advertise the directory service on this port. Set it to "auto" to have Tor pick a port for you.
If this option is nonzero, advertise the directory service on this port. Set it to "auto" to have Tor pick a port for you.

(Default: ``9030``)

#### EXITPOLICY
##### EXITPOLICY

`EXITPOLICY=policy,policy,…`

Set an exit policy for this server. Each policy is of the form "accept[6]|reject[6] ADDR[/MASK][:PORT]". If /MASK is omitted then this policy just applies to the host given. Instead of giving a host or network you can also use "*" to denote the universe (0.0.0.0/0 and ::/128), or *4 to denote all IPv4 addresses, and *6 to denote all IPv6 addresses. PORT can be a single port number, an interval of ports "FROM_PORT-TO_PORT", or "*". If PORT is omitted, that means "*".

(Default: ``reject *:* # no exits allowed``)

#### CONTROLPORT
##### CONTROLPORT

`CONTROLPORT=PORT|unix:path|auto [flags]`

Expand All @@ -102,23 +101,23 @@ se Tor to allow any process on the local host to control it.

(Default: ``9051``)

#### HASHEDCONTROLPASSWORD
##### HASHEDCONTROLPASSWORD

`HASHEDCONTROLPASSWORD=hashed_password`

Allow connections on the control port if they present the password whose one-way hash is hashed_password. You can compute the hash of a password by running ``docker run svengo/tor tor --hash-password password``

(Default: ``16:872860B76453A77D60CA2BB8C1A7042072093276A3D701AD684053EC4C``)

#### NICKNAME
##### NICKNAME

`NICKNAME=name`

Set the server’s nickname to 'name'. Nicknames must be between 1 and 19 characters inclusive, and must contain only the characters ``[a-zA-Z0-9]``.

(Default: ``ididnteditheconfig``)

#### CONTACTINFO
##### CONTACTINFO

`CONTACTINFO=email_address`

Expand All @@ -128,7 +127,7 @@ You can use [Tor ContactInfo Generator](https://torcontactinfogenerator.netlify.

(Default: ``Random Person <nobody AT example dot com>``)

#### MYFAMILY
##### MYFAMILY

`MYFAMILY=node,node,...`

Expand All @@ -138,12 +137,12 @@ When listing a node, it’s better to list it by fingerprint than by nickname: f

(Default: *empty*)

#### ADDRESS
##### ADDRESS

`ADDRESS=tor-node01.example.com`

The IPv4 address of this server, or a fully qualified domain name of this server that resolves to an IPv4 address. You can leave this unset, and Tor will try to guess your IPv4 address. This IPv4 address is the one used to tell clients and other servers where to find your Tor server; it doesn't affect the address that your server binds to. It also seems to work with an IPv6 address.

## Feedback

# Feedback
Please report any problems as issues on github: https://github.com/svengo/docker-tor/issues
Please report any problems as issues on [github](https://github.com/svengo/docker-tor/issues).

0 comments on commit d69f876

Please sign in to comment.