GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - cemc-oper-archive/nmp-web: Cloud web for NWPC Monitor Platform.

BranchesTags
Open more actions menu

Latest commit

 

History

40 Commits
40 Commits

Folders and files

NameName
Last commit message
Last commit date
conf
conf
 
 
nmp_web
nmp_web
 
 
static
static
 
 
templates
templates
 
 
tests/manual/status_message
tests/manual/status_message
 
 
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
run_website.py
run_website.py
 
 
setup.py
setup.py
 
 

Repository files navigation

nmp-web

A cloud website for NMP(NWPC Monitor Platform).

Deploy

Python

Use pyenv to install python and create a virtualenv.

Create a virtualenv for nmp-web, such as nmp-web-env.

Project

Download source code into some directory, such as /srv/nmp-web/www/nmp-web.

Install source code under virtualenv using pip install -e ..

Redis

Create redis server using Docker.

Gunicorn

Install gnuicorn in nmp-web-env.

pip install gnuicorn

Create a script to start gunicorn process in vritualenv.

#!/bin/bash
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv virtualenv-init -)"
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi

cd /srv/nmp-web
pyenv activate nmp-web-env

export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
export LC_API_SERVER="url for leancloud"

export MODE=production
export NMP_WEB_CONFIG=some/config/file/path

gunicorn -w 1 -b 127.0.0.1:3000 nmp_web.wsgi:application \
	--log-level=debug

Supervisor

Install supervisor.

sudo apt install supervisor

Create a configure file.

[program:nmp_web]
command = path_to_script
directory = /srv/nmp-web
user = user name
startsecs = 3

redirect_stderr = true
stdout_logfile_maxbytes = 50MB
stdout_logfile_backups = 10
stdout_logfile = path_to_log

Start supervisor program nmp_web using:

superivsorctl start nmp_web

nginx

Install nginx.

Update nginx.conf to enable gzip and allow large client data of workflow status blob.

client_max_body_size 8M;
client_body_buffer_size 128k;

gzip on;
gzip_min_length 1k;
gzip_buffers 16 64k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;

Add nmp_web in site-available directory.

server {
    listen      80;

    server_name www.nwpcmonitor.cc;

    return 301 https://www.nwpcmonitor.cc$request_uri;
}
server {
    listen 443;

    server_name www.nwpcmonitor.cc;

    root       /srv/nmp-web/www/nmp-web;
    access_log path_to_access_log;
    error_log  path_to_error_log;

    location /favicon.ico {
        root /srv/nmp-web/www/nmp-web;
    }

    location ~ ^\/static\/.*$ {
        root /srv/nmp-web/www/nmp-web;
    }

    location / {
        proxy_pass       http://127.0.0.1:3000;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Add SSL for nmp_web.

License

Copyright © 2015-2019, Perilla Roc

nmp-web is licensed under GPL v3.0

About

Cloud web for NWPC Monitor Platform.

Topics

monitoringnmpnwpc

Resources

Readme
GPL-3.0 license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.