mirror of
https://github.com/makefu/bump.git
synced 2024-03-22 11:32:52 +01:00
add configuration for nginx/supervisor, add run.sh
This commit is contained in:
parent
cb81b44a27
commit
3f1714ab7d
5 changed files with 30 additions and 9 deletions
|
@ -11,7 +11,6 @@ It is written as a replacement for the gorgeous sprunge.us
|
||||||
pip install -r deps.txt
|
pip install -r deps.txt
|
||||||
|
|
||||||
## Startup
|
## Startup
|
||||||
|
|
||||||
. bin/activate
|
|
||||||
cd bump
|
./run.sh
|
||||||
gunicorn -b 127.0.0.1:4000 init:app
|
|
||||||
|
|
|
@ -6,6 +6,9 @@ import os
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
storedir = os.path.join(app.root_path, 'store')
|
storedir = os.path.join(app.root_path, 'store')
|
||||||
app.config['storedir'] = storedir
|
app.config['storedir'] = storedir
|
||||||
|
print("Storedir is %s" % storedir)
|
||||||
|
if not os.path.isdir(storedir):
|
||||||
|
os.mkdir(storedir)
|
||||||
|
|
||||||
|
|
||||||
def returns_plain(f):
|
def returns_plain(f):
|
||||||
|
@ -84,9 +87,4 @@ def generate_key():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.debug = True
|
app.debug = True
|
||||||
print("Storedir is %s" % storedir)
|
|
||||||
try:
|
|
||||||
os.mkdir(storedir)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
app.run(host='0.0.0.0')
|
app.run(host='0.0.0.0')
|
||||||
|
|
14
etc/bump.nginx.conf
Normal file
14
etc/bump.nginx.conf
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
server {
|
||||||
|
listen [::]:80;
|
||||||
|
server_name _;
|
||||||
|
access_log /var/log/nginx/log/note.log main;
|
||||||
|
error_log /var/log/nginx/log/note_error.log;
|
||||||
|
default_type text/plain;
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:4000/;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
}
|
||||||
|
}
|
5
etc/bump.supervisor.conf
Normal file
5
etc/bump.supervisor.conf
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[program:bump]
|
||||||
|
command=sh run.sh
|
||||||
|
user=note
|
||||||
|
directory=/opt/bump
|
||||||
|
autorestart=true
|
5
run.sh
Executable file
5
run.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -ef
|
||||||
|
. bin/activate
|
||||||
|
cd bump
|
||||||
|
gunicorn -b 127.0.0.1:4000 init:app
|
Loading…
Reference in a new issue