tested deployment and brought learnings to README. added nginx config.

This commit is contained in:
b3yond 2018-03-27 01:04:07 +02:00
parent 2d7b222c21
commit 51dec7e072
2 changed files with 53 additions and 2 deletions

View file

@ -74,7 +74,7 @@ We wrote these installation notes, so you can set up the website easily:
To Do:
```shell
sudo apt install python3 virtualenv uwsgi uwsgi-plugin-python nginx
sudo apt install python3 virtualenv uwsgi uwsgi-plugin-python3 nginx
```
* set up nginx
@ -92,7 +92,7 @@ virtualenv -p python3 .
Install the dependencies:
```shell
pip install tweepy pytoml requests Mastodon.py bottle pyjwt
pip install tweepy pytoml Mastodon.py bottle pyjwt pylibscrypt
```
Configure the bot:
@ -105,3 +105,23 @@ vim config.toml
This configuration is only for the admin. Users can log into
twitter/mastodon/mail and configure their personal bot on the settings page.
Deploy ticketfrei with uwsgi:
```shell
echo "Enter your domain name into the following prompt:" && read DOMAIN
# configure nginx
sudo sed -r "s/example.org/$DOMAIN/g" deployment/example.org.conf > /etc/nginx/sites-enabled/$DOMAIN.conf
# create folder for socket
sudo mkdir /var/run/ticketfrei
sudo chown tech:www-data -R /var/run/ticketfrei
# start up nginx
sudo service nginx restart
# create and start the frontend systemd service
sudo cp deployment/ticketfrei-web.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start ticketfrei-web.service
```

View file

@ -0,0 +1,31 @@
server {
listen 443 ssl;
server_name example.org;
ssl_certificate /etc/letsencrypt/live/example.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.org/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
access_log /var/log/nginx/example.org_access.log;
error_log /var/log/nginx/example.org_error.log;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
location / {
include uwsgi_params;
uwsgi_pass unix:///var/run/ticketfrei/ticketfrei.sock;
}
location /.well-known/acme-challenge {
root /var/www/acme;
}
}
server {
listen 80;
listen [::]:80;
server_name example.org;
return 301 https://$server_name$request_uri;
}