Coder Social home page Coder Social logo

nusenu / ansible-relayor Goto Github PK

View Code? Open in Web Editor NEW
242.0 242.0 42.0 553 KB

An Ansible Role for Tor Relay Operators

License: GNU General Public License v3.0

HTML 85.59% Shell 9.77% Ruby 4.64%
ansible ansible-role tor tor-network tor-relay-operator

ansible-relayor's People

Contributors

anadahz avatar goll avatar jn9999 avatar kberanek avatar lirt avatar nusenu avatar rdkr avatar tsekityam avatar ypid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-relayor's Issues

FreeBSD: build tor with OpenSSL ECDH support (enable-ec_nistp_64_gcc_128)

When installing tor via pkg, openssl from base is used, which comes without enable-ec_nistp_64_gcc_128 support.

[notice] We were built to run on a 64-bit CPU, with OpenSSL 1.0.1 or later, but with a version of OpenSSL that apparently lacks accelerated support for the NIST P-224 and P-256 groups. Building openssl with such support (using the enable-ec_nistp_64_gcc_128 option when configuring it) would make ECDH much faster.

To compile with openssl from ports:
make WITH_OPENSSL_PORT=yes install

systemd: multiple CapabilityBoundingSet statements are not merged

systemd 215-14's man page about CapabilityBoundingSet:
This option may appear more than once in which case the bounding sets are merged.

So
CapabilityBoundingSet = cap1 cap2

should be semantically identical to

CapabilityBoundingSet = cap1
CapabilityBoundingSet = cap2 

but that is not the case.

OpenBSD: add a var that allows for opt-in to bootstrap ports

Currently we fail hard if ports are not available on the system.
Provide a var that allows the user to opt-in for automatic ports bootstrapping.

wget http://ftp.openbsd.org/pub/OpenBSD/5.7/xenocara.tar.gz http://ftp.openbsd.org/pub/OpenBSD/5.7/ports.tar.gz  http://ftp.openbsd.org/pub/OpenBSD/5.7/SHA256.sig

signify -C -p /etc/signify/openbsd-57-base.pub -x SHA256.sig xenocara.tar.gz ports.tar.gz
tar ...
cvs ...

OpenBSD: tor rc script runs pkill/pgrep with "startswith" match instead of requiring complete match

This is not a bug in this ansible role but it affects us.

Impact of this problem:

/etc/rc.d/tor start
might never start the intended daemon if another tor instance is already running (rc_check believes tor is already running).

/etc/rc.d/tor stop
might kill all (including unrelated) tor instances instead of one.

/etc/rc.d/tor restart
might kill all tor instances and starts only one.

One line (actually one character) "patch" submitted to the OpenBSD tor maintainer:

8a9,10
> pexp="${daemon}${daemon_flags:+ ${daemon_flags}}$"
> 

references:
http://article.gmane.org/gmane.os.openbsd.misc/222896

Add example playbooks

Having examples in the README is useful, but I think that it would be better to have complete playbooks with comments with clear instructions on how to use them directly in the repo. I will provide a new pull request if this idea is accepted.

OpenBSD: only one out of two expected tor instances is started correctly

after running

ansible-playbook tor.yml -l server --tags openbsd

there is only one tor instance started with the appropriate '-f ' parameter, the second tor instance runs the default torrc /etc/tor/torrc

Manually starting it (tor -f ..) works fine.
/etc/rc.conf.local looks fine.

/etc/rc.d/tor_IP_port start
does NOT start tor as expected (only in one case)

ansible version: 1.9.1

Add a way to avoid sudo if the user is already root

On DigitalOcean and other ISP the machines come with only the root user present. By default (on Debian 8.0 and 8.1) sudo is not installed.

If the machine is dedicated to be a Tor node I see no reason to install sudo and add another user for the installation of Tor.

It should be possible then to check if the user is already root and, if so, do not add sudo to all commands. Furthermore the sudo directive in anslble playbooks is deprecated.

If setting up the node with root is not advisable then it should be mentioned (e.g. in the README).

Linux: migrate to systemd

We will start requiring systemd and ship our own systemd unit files that support multiple instances (if they are not in any upstream packages). We will not interfere with the init.d script or systemd unit file from the packager.

With this step we will also replace direct invocations of 'tor' via the shell module
https://github.com/nusenu/ansible-relayor/blob/master/tasks/configure.yml#L109
with the systemctl/service module.

Tested unit file on debian jessie:
https://github.com/nusenu/tor-multi-instance-initscripts/blob/master/debian/tor%40.service

We will no longer support debian wheezy once we migrate to systemd, but we hope that jessie isn't to far from being released.

OpenBSD: tor package outdated - come up with a better tor install strategy

We currently use pkg to install tor, but
OpenBSD 5.7 provides an outdated tor package (v0.2.5.10) via:
http://ftp.openbsd.org/pub/OpenBSD/5.7/packages/amd64/

Ports in -stable ships the last 0.2.5.x (currently 0.2.5.12).
So the better option would be to install the port.
There is currently no ansible module for OpenBSD ports as far as I've seen, so this will be an 'command/shell' module task.

I'm also inclined to install tor 0.2.6.x which is not directly available in the -stable ports put the patch to MAIN is minimal (changes only the tor version number and fingerprint).

Another alternative would be to take the tor 0.2.6.x package from snapshot
http://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/
(probably not the best / cleanest idea since mixing -stable with snapshot packages is strongly discouraged)

So for now I'm inclined to go with 0.2.5.12 from -stable ports, in future we want to switch to 0.2.6.x.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.