<commit_before>OnionDoor
=========

The OnionDoor script runs on a RaspberryPi in the Berlin ZweibelRaum
office. Currently the script simply opens the door in response to a
buzzer press. A more complex access control policy is planned for the
future.

The door system is a Ritto TwinBus system with a handset and door open
button in the office. The RaspberryPi interfaces to the buzzer and open
push button via two opto-isolators and a current limiting circuit.

Installation
------------

This script uses the RPi.GPIO python library for interfacing with the
RaspberryPi GPIO pins. This library is shipped with the current version
of Raspbian.

    sudo python setup.py install
    sudo cp oniondoor.service /etc/systemd/system/oniondoor.service
    sudo systemctl enable oniondoor.service

Tor should be configured to forward http traffic to the webserver on
port 5000. iptables rules need to be configured to forward local requests
on port 80.

    iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 5000
    iptables -t nat -I OUTPUT -p tcp -o lo --dport 80 -j REDIRECT --to-ports 5000

OnionDoor will look for a config file at:

    /usr/var/oniondoor.main-instance/config.py


RaspberryPi Pinout
------------------

![GPIO Pinout](/images/gpio-pinout.png)


Circuit Schematic
-----------------

TOOD<commit_msg>Corrected some typos<commit_after>OnionDoor
=========

The OnionDoor script runs on a RaspberryPi in the Berlin ZwiebelRaum
office. Currently the script simply opens the door in response to a
buzzer press. A more complex access control policy is planned for the
future.

The door system is a Ritto TwinBus system with a handset and door open
button in the office. The RaspberryPi interfaces to the buzzer and open
push button via two opto-isolators and a current limiting circuit.

Installation
------------

This script uses the RPi.GPIO python library for interfacing with the
RaspberryPi GPIO pins. This library is shipped with the current version
of Raspbian.

    sudo python setup.py install
    sudo cp oniondoor.service /etc/systemd/system/oniondoor.service
    sudo systemctl enable oniondoor.service

Tor should be configured to forward http traffic to the webserver on
port 5000. Iptables rules need to be configured to forward local requests
on port 80.

    iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 5000
    iptables -t nat -I OUTPUT -p tcp -o lo --dport 80 -j REDIRECT --to-ports 5000

OnionDoor will look for a config file at:

    /usr/var/oniondoor.main-instance/config.py


RaspberryPi Pinout
------------------

![GPIO Pinout](/images/gpio-pinout.png)


Circuit Schematic
-----------------

TODO
{'fraction_non_alphanumeric': 0.08504289444237224, 'fraction_numerical': 0.013427825438269302, 'mean_word_length': 3.1840873634945397, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1805793', 'n_tokens_mistral': 842, 'n_tokens_neox': 745, 'n_words': 363}