complete installation instructions

This commit is contained in:
Ville Rantanen
2018-12-15 10:16:30 +02:00
parent 5554aa000c
commit 5c50eb4670

View File

@@ -34,3 +34,80 @@ During the poll, you can observe the vote counts:
- If the question se allows voters to see results after casting their vote
`show_results: true`, then observer can also see the results.
# Example installation on debian
## Install web server as root
```
apt install nginx virtualenv python3 git
# edit the config of /etc/nginx/sites-enabled/default to have your host name
systemctl enable nginx
systemctl start nginx
virtualenv -p python3 certbot
. cerbot/bin/activate
pip install certbot-nginx
certbot --nginx
```
- In /etc/nginx/sites-enabled/defaut: replace the "location /" with a proxy:
```
location / {
proxy_pass http://127.0.0.1:8041/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
```
- Restart server, `systemctl restart nginx`
- At this point your browser should error with a bad gateway
## Install aBot as a normal user
```
git clone https://bitbucket.org/MoonQ/abot
cd abot
./install.me
```
- You can run the `./start.me` to test your installation
- It's recommended to run service as a daemon for more robustness, to survive
reboots etc.. You can do it for example with runit.
## Installing runit
- Run these commands as root:
```
apt install runit runit-systemd
systemctl enable runit
systemctl start runit
mkdir -p /etc/sv/abot/log
```
- Edit file /etc/sv/abot/run, with correct values
```
#!/bin/sh
exec 2>&1
cd /[PATH-TO-ABOT-INSTALLATION]
exec chpst -u [NORMAL-USER-NAME] ./start.me
```
- Edit file /etc/sv/abot/log/run, with correct values
```
#!/bin/sh
exec chpst -u [NORMAL-USER-NAME] svlogd -tt /[PATH-TO-ABOT-INSTALLATION]/log
```
- Enable service:
```
ln -s /etc/sv/abot /etc/service/abot
```
- Finally, as the normal user, create the log folder, `mkdir [PATH-TO-ABOT-INSTALLATION]/log`
- The log folder should be populated with file `current` which has the log of the process.