mirror of https://github.com/CIRCL/lookyloo
Add config to run as service behind nginx
parent
aa659234bb
commit
ca5d07b8b8
35
README.md
35
README.md
|
@ -59,7 +59,6 @@ And restart xdm:
|
||||||
service xdm restart
|
service xdm restart
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# Installation of scrapysplashwrapper
|
# Installation of scrapysplashwrapper
|
||||||
|
|
||||||
You need a running splash instance, preferably on docker: https://splash.readthedocs.io/en/stable/install.html
|
You need a running splash instance, preferably on docker: https://splash.readthedocs.io/en/stable/install.html
|
||||||
|
@ -80,3 +79,37 @@ pew toggleglobalsitepackages # PyQt4 is not easily installable in a virtualenv
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install -e .
|
pip install -e .
|
||||||
```
|
```
|
||||||
|
# Run the app locally
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export DISPLAY=:0
|
||||||
|
export FLASK_APP=lookyloo
|
||||||
|
flask run
|
||||||
|
```
|
||||||
|
|
||||||
|
## With a reverse proxy (Nginx)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install uwsgi
|
||||||
|
```
|
||||||
|
|
||||||
|
### Config files
|
||||||
|
|
||||||
|
You have to configure the two following files:
|
||||||
|
|
||||||
|
* `etc/nginxsites-available/lookyloo`
|
||||||
|
* `etc/systemd/system/lookyloo.service`
|
||||||
|
|
||||||
|
And copy them to the appropriate directories and run the following command:
|
||||||
|
`sudo ln -s /etc/nginx/sites-available/lookyloo /etc/nginx/sites-enabled`
|
||||||
|
|
||||||
|
Make sure everything is working:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo systemctl start lookyloo
|
||||||
|
sudo systemctl enable lookyloo
|
||||||
|
sudo nginx -t
|
||||||
|
# If it is cool:
|
||||||
|
sudo service restart nginx
|
||||||
|
```
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name server_domain_or_IP;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
include uwsgi_params;
|
||||||
|
uwsgi_pass unix:/home/<CHANGE_ME>/lookyloo/lookyloo.sock;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
[Unit]
|
||||||
|
Description=uWSGI instance to serve lookyloo
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=www-data
|
||||||
|
Group=www-data
|
||||||
|
WorkingDirectory=/home/<CHANGE_ME>/lookyloo
|
||||||
|
Environment="PATH=/home/<CHANGE_ME>/<MY_VIRTUALENV_PATH>/bin"
|
||||||
|
ExecStart=/home/<CHANGE_ME>/<MY_VIRTUALENV_PATH>/bin/uwsgi --ini lookyloo.ini
|
||||||
|
Environment=DISPLAY=:0
|
||||||
|
Environment=FLASK_APP=lookyloo
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
[uwsgi]
|
||||||
|
module = wsgi:app
|
||||||
|
|
||||||
|
master = true
|
||||||
|
processes = 5
|
||||||
|
|
||||||
|
socket = lookyloo.sock
|
||||||
|
chmod-socket = 660
|
||||||
|
vacuum = true
|
||||||
|
|
||||||
|
die-on-term = true
|
|
@ -5,7 +5,7 @@ import json
|
||||||
|
|
||||||
from har2tree import CrawledTree, hostname_treestyle
|
from har2tree import CrawledTree, hostname_treestyle
|
||||||
from scrapysplashwrapper import crawl
|
from scrapysplashwrapper import crawl
|
||||||
from ete3_webserver import NodeActions, WebTreeHandler
|
from .ete3_webserver import NodeActions, WebTreeHandler
|
||||||
|
|
||||||
from flask import Flask, render_template, request
|
from flask import Flask, render_template, request
|
||||||
from flask_bootstrap import Bootstrap
|
from flask_bootstrap import Bootstrap
|
||||||
|
|
Loading…
Reference in New Issue