Skip to content

bsdlp/mtrpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mtrpy

With flask, mtr.

Visit live demo here:

mtr.io/static

curl http://mtr.io

INSTALLATION

sudo apt-get install nginx python3 python3-setuptools mtr-tiny \
git uwsgi uwsgi-plugin-python3
sudo easy_install pip
sudo pip install virtualenv
cd /srv/http/mtrpy/application
virtualenv env
source env/bin/activate
pip install flask pbs

/etc/uwsgi/apps-available/mtrpy.ini

[uwsgi]
daemonize=/var/log/uwsgi/mtrpy.log
uwsgi-file=/srv/http/mtrpy/run.py
chdir=/srv/http/mtrpy/
pyhome=/srv/http/mtrpy/env
module=app
virtualenv=/srv/http/mtrpy/env
callable=app
plugin=python33
enable-threads=true

/etc/nginx/sites-available/mtrpy

limit_req_zone  $binary_remote_addr  zone=one:10m   rate=1r/s;
server {
    listen 80;
    server_name your.server.name.tld;

    location /static {
        alias /srv/http/mtrpy/app/static;
    }

    location / {
        include uwsgi_params;
        uwsgi_pass unix:/run/uwsgi/app/mtrpy/socket;
    }

    location /mtrwindow {
        limit_req   zone=one  burst=5;
        include uwsgi_params;
        uwsgi_pass unix:/run/uwsgi/app/mtrpy/socket;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;

    location = /50x.html {
        root /usr/share/nginx/html;
    }
}

About

curlable flask app for the network diagnostic tool `mtr`

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published