guest_worker/README.md

62 lines
1.2 KiB
Markdown
Raw Normal View History

2019-10-23 22:33:37 +02:00
## Webserver
Webserver is published to the web trough ssh remote forward. In /etc/ssh/sshd_config set `GatewayPorts yes`.
Then start `autossh` to maintain the connection:
```bash
autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -R 8888:localhost:8888 here.rubenvandeven.com
```
To resolve the country the (imprecise) GeoLite2 Free Country dataset is used. Download it [from MaxMind](https://dev.maxmind.com/geoip/geoip2/geolite2/) and store it in the project root folder.
## Scanning
For scanning run visudo and add to the sudoers file:
```
mt ALL=(ALL) NOPASSWD: /usr/bin/scanimage
```
# Installation
Software dependencies:
- python3
- pipenv
- usbrelay
- autossh
Python deps:
```bash
pipenv install
```
## Usbrelay
When installing usbrelay
```
apt install usbrelay
```
And set udev rules to access the device by anyone, according to usbrelay docs:
```
SUBSYSTEM=="usb", ATTR{idVendor}=="16c0",ATTR{idProduct}=="05df", MODE="0666"
KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", MODE="0666"
```
into `/etc/udev/rules.d/50-dct-tech-usb-relay-2.rules` and then reload rules:
```bash
sudo udevadm control --reload-rules && sudo udevadm trigger
```