From e554bda3eb59e49e7560312f97031261795e2978 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 25 May 2019 15:46:57 -0600 Subject: [PATCH] Add instructions for setting up supervisor --- authserver/README.md | 25 +++++++++++++++++++++++++ webserver/README.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 webserver/README.md diff --git a/authserver/README.md b/authserver/README.md index 7176e95..2f945ef 100644 --- a/authserver/README.md +++ b/authserver/README.md @@ -4,6 +4,8 @@ Provides an API to the web client and web server to serve tool data and authenti ## Setup +### Initial run + ``` $ sudo apt install python3 python3-pip python3-virtualenv # for Debian $ virtualenv -p python3 env @@ -20,6 +22,29 @@ Once logged in, navigate to "Profiles" and make your Protospace user a lockout a Now you have total control of the system and can make other users lockout admins though the API or web interface. +### Supervisor + +Supervisor is used to keep the script always running. + +``` +$ sudo apt install supervisor +``` + +Create a file named /etc/supervisor/conf.d/authserver.conf and add: + +``` +[program:authserver] +user=tanner +directory=/opt/pslockout/pslockout/authserver +command=/bin/bash -c 'source env/bin/activate && python manage.py runserver 0.0.0.0:8000' +autostart=true +autorestart=true +stderr_logfile=/var/log/authserver.log +stderr_logfile_maxbytes=1MB +stdout_logfile=/var/log/authserver.log +stdout_logfile_maxbytes=1MB +``` + ## API The API is RESTful and returns hyperlinked json data. **URLs require a trailing slash.** diff --git a/webserver/README.md b/webserver/README.md new file mode 100644 index 0000000..b7fed28 --- /dev/null +++ b/webserver/README.md @@ -0,0 +1,28 @@ +# Protospace lockout socket server + +Runs on a server. Connects to web clients over web sockets and receives updates from all lockouts. + +## Setup + +### Supervisor + +Supervisor is used to keep the script always running. + +``` +$ sudo apt install supervisor +``` + +Create a file named /etc/supervisor/conf.d/webserver.conf and add: + +``` +[program:webserver] +user=tanner +directory=/opt/pslockout/pslockout/webserver +command=/bin/bash -c 'yarn start' +autostart=true +autorestart=true +stderr_logfile=/var/log/webserver.log +stderr_logfile_maxbytes=1MB +stdout_logfile=/var/log/webserver.log +stdout_logfile_maxbytes=1MB +```