1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

merging fixes from text linux box

This commit is contained in:
checktheroads
2019-05-13 21:58:48 -07:00
parent 2107c58d32
commit d65ed753d9
18 changed files with 38 additions and 4 deletions

View File

@@ -12,3 +12,39 @@ Gunicorn is a WSGI server written in Python.
## Configure
Locate your `gunicorn` executable with `which gunicorn`.
### Permissions
Gunicorn requires read/write/executable access to the entire `hyperglass/hyperglass` directory in order to read its configuration and execute the python code. If running gunicorn as www-data, fix permissions with:
```console
# chown -R www-data:www-data /opt/hyperglass/hyperglass
# chmod -R 744 /opt/hyperglass/hyperglass
```
<!-- # Supervisor Installation
To make cross-platform service functionality easier, it is recommended to use [`supervisord`](http://supervisord.org/) to manage the Hyperglass application. If you prefer, `systemd` or your service manager of choice may be used.
Install supervisord:
```console
# apt install -y supervisor
```
Create supervisord configuration for Hyperglass:
```console
# nano /etc/supervisor/conf.d/hyperglass.conf
[program:hyperglass]
command = /usr/local/bin/gunicorn -c /opt/hyperglass/hyperglass/gunicorn_config.py hyperglass.wsgi
directory = /opt/hyperglass/
user = www-data
```
Start supervisord:
```console
# systemctl start supervisor
# systemctl status supervisor
``` -->

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env python3
# Module Imports
import os
import sys
import json
import toml

View File

@@ -189,27 +189,24 @@ var submitForm = function() {
type: 'POST',
data: JSON.stringify({router: router, cmd: cmd, ipprefix: ipprefix}),
contentType: "application/json; charset=utf-8",
context: document.body,
readyState: resultsbox.show() && progress.show(),
statusCode: {
200: function(response, code) {
console.log(code, response);
progress.hide();
$('#output').html(`<br><div class="content"><p class="query-output" id="output">${response}</p></div>`);
},
405: function(response, code) {
console.log(code, response);
progress.hide();
$('#ipprefix').addClass('is-warning');
$('#output').html(`<br><div class="notification is-warning" id="output">${response.responseText}</div>`);
},
415: function(response, code) {
console.log(code, response);
progress.hide();
$('#ipprefix').addClass('is-danger');
$('#output').html(`<br><div class="notification is-danger" id="output">${response.responseText}</div>`);
},
429: function(response, code) {
console.log(code, response);
progress.hide();
$("#ratelimit").addClass("is-active");
}