move files, add installation guide and configs

This commit is contained in:
Jonathan Baecker 2020-04-29 16:58:27 +02:00
parent 10e34e982c
commit 527662968a
12 changed files with 133 additions and 9 deletions

View File

@ -3,30 +3,32 @@ ffplayout-gui
This is the dev version v2.0.0 from ffplayout GUI.
Check [install.md](docs/install.md) for installation
**This version is not ready to use!!**
## concept previews:
## some impressions belows:
#### Login
![login](/docs/login.png)
![login](/assets/login.png)
#### Landing Page
![landing-page](/docs/landing-page.png)
![landing-page](/assets/landing-page.png)
#### Control Page
![control](/docs/control.png)
![control](/assets/control.png)
#### Media Page
![media](/docs/media.png)
![media](/assets/media.png)
#### Media Page / Upload
![media-upload](/docs/media-upload.png)
![media-upload](/assets/media-upload.png)
#### Message Page
![message](/docs/message.png)
![message](/assets/message.png)
#### Logging Page
![logging](/docs/logging.png)
![logging](/assets/logging.png)
#### Configuration Page / GUI
![config-gui](/docs/config-gui.png)
![config-gui](/assets/config-gui.png)

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 160 KiB

View File

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

View File

Before

Width:  |  Height:  |  Size: 378 KiB

After

Width:  |  Height:  |  Size: 378 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -0,0 +1,13 @@
[Unit]
Description=ffplayout api daemon
After=network.target
[Service]
WorkingDirectory=/var/www/ffplayout/ffplayout
ExecStart=/var/www/ffplayout/venv/bin/gunicorn --workers 6 --timeout 300 --log-level=info --log-file=- --access-logfile=- --bind unix:/var/www/ffplayout/ffplayout/ffplayout.sock ffplayout.wsgi:application
KillMode=process
User=www-data
Group=www-data
[Install]
WantedBy=multi-user.target

63
docs/ffplayout.conf Normal file
View File

@ -0,0 +1,63 @@
map $sent_http_content_type $expires {
"text/html" 1h; # set this to your needs
"text/html; charset=utf-8" 1h; # set this to your needs
default 1d; # set this to your needs
}
server {
listen 127.0.1.4;
server_name ffplayout.local ffplayout;
gzip on;
gzip_types text/plain application/xml text/css application/javascript;
gzip_min_length 1000;
charset utf-8;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
location / {
if ($http_origin ~ '^https?://(localhost|ffplayout\.local|ffplayout)') {
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
}
if ($request_method = OPTIONS ) {
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
root /var/www/ffplayout/ffplayout/frontend/dist/;
}
location ~ ^/(api|admin) {
if ($http_origin ~ '^https?://(localhost|ffplayout\.local|ffplayout)') {
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
}
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://unix:/var/www/ffplayout/ffplayout/ffplayout.sock;
}
location /static/ {
alias /var/www/ffplayout/ffplayout/static/;
}
access_log /var/log/nginx/ffplayout_access.log;
error_log /var/log/nginx/ffplayout_error.log warn;
}

46
docs/install.md Normal file
View File

@ -0,0 +1,46 @@
# Manuel Installation Guide
**We are assuming that the system user `www-data` will run all processes!**
### API Setup
##### Preparation
- clone repo to `/var/www/ffplayout`
- cd in root folder from repo
- add virtual environment: `virtualenv -p python3 venv`
- run `source ./venv/bin/activate`
- install dependencies: `pip install -r requirements-base.txt`
- cd in `ffplayout`
- generate secret: `python manage.py shell -c 'from django.core.management import utils; print(utils.get_random_secret_key())'`
- open **ffplayout/settings.py**
- past secret key in variable `SECRET_KEY`
- change `DEBUG = True` to `DEBUG = False`
- set `ALLOWED_HOSTS` with correct URL
- set URL in `CORS_ORIGIN_WHITELIST`
- collect staticfiles: `python manage.py collectstatic`
##### System Setup
- copy **docs/ffplayout-api.service** from root folder to **/etc/systemd/system/**
- enable service and start it: `systemctl enable ffplayout-api.service && systemctl start ffplayout-api.service`
- install **nginx**
- edit **docs/ffplayout.conf**
- set correct IP and `server_name`
- add domain `http_origin` test value
- add https redirection and SSL if is necessary
- copy **docs/ffplayout.conf** to **/etc/nginx/sites-available/**
- symlink config: `ln -s /etc/nginx/sites-available/ffplayout.conf /etc/nginx/sites-enabled/`
- restart nginx
- run `visudo` and add:
```
www-data ALL = NOPASSWD: /bin/systemctl start ffplayout-engine.service, /bin/systemctl stop ffplayout-engine.service, /bin/systemctl reload ffplayout-engine.service, /bin/systemctl restart ffplayout-engine.service, /bin/systemctl status ffplayout-engine.service, /bin/systemctl is-active ffplayout-engine.service, /bin/journalctl -n 1000 -u ffplayout-engine.service
```
### Frontend
**We need a recent version of npm**
- go to folder **/var/www/ffplayout/ffplayout/frontend**
- install dependencies: `npm install`
- build app: `npm run build`
Your frontend should be now in **/var/www/ffplayout/ffplayout/frontend/dist** folder, which we are included already in the nginx config. You can service now the GUI under your domain URL.