update docs, remove bin, fix ux on no data
parent
615665a943
commit
3bef35dd32
@ -1,17 +1,20 @@
|
||||
setup:
|
||||
python3 -m venv .venv
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
mkdir data
|
||||
wget https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb -P data
|
||||
mkdir -p data
|
||||
wget https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb -P data --no-clobber
|
||||
|
||||
up:
|
||||
docker-compose up -d
|
||||
|
||||
dev:
|
||||
./bin/dev
|
||||
./manage.sh run
|
||||
|
||||
prod:
|
||||
./bin/prod
|
||||
./manage.sh prod
|
||||
|
||||
logs:
|
||||
docker-compose logs -f
|
||||
|
||||
kill:
|
||||
pkill -ef xmrnodes
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source .venv/bin/activate
|
||||
export FLASK_APP=xmrnodes/app.py
|
||||
export FLASK_SECRETS=config.py
|
||||
export FLASK_DEBUG=1
|
||||
flask $1
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source .venv/bin/activate
|
||||
export FLASK_APP=xmrnodes/app.py
|
||||
export FLASK_SECRETS=config.py
|
||||
export FLASK_DEBUG=1
|
||||
flask run
|
@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
BASE=data/gunicorn
|
||||
|
||||
source .venv/bin/activate
|
||||
export FLASK_APP=xmrnodes/app.py
|
||||
export FLASK_SECRETS=config.py
|
||||
export FLASK_DEBUG=0
|
||||
export FLASK_ENV=production
|
||||
|
||||
mkdir -p $BASE
|
||||
|
||||
gunicorn \
|
||||
--bind 127.0.0.1:4000 "xmrnodes.app:app" \
|
||||
--daemon \
|
||||
--log-file $BASE/gunicorn.log \
|
||||
--pid $BASE/gunicorn.pid \
|
||||
--access-logfile $BASE/access.log \
|
||||
--reload
|
||||
|
||||
echo "Starting gunicorn with pid $(cat $BASE/gunicorn.pid)"
|
@ -0,0 +1,7 @@
|
||||
SECRET_KEY=randomstringyoumakeup
|
||||
SERVER_NAME=127.0.0.1:5000
|
||||
DATA_DIR=./data
|
||||
TOR_HOST=127.0.0.1
|
||||
TOR_PORT=9050
|
||||
NODE_HOST=singapore.node.xmr.pm
|
||||
NODE_PORT=18080
|
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
source .venv/bin/activate
|
||||
export FLASK_APP=xmrnodes/app.py
|
||||
export FLASK_SECRETS=config.py
|
||||
export FLASK_DEBUG=1
|
||||
export FLASK_ENV=development
|
||||
|
||||
# override
|
||||
source .env
|
||||
|
||||
if [[ ${1} == "prod" ]];
|
||||
then
|
||||
export FLASK_DEBUG=0
|
||||
export FLASK_ENV=production
|
||||
export BASE=./data/gunicorn
|
||||
mkdir -p $BASE
|
||||
pgrep -F $BASE/gunicorn.pid
|
||||
if [[ $? != 0 ]]; then
|
||||
gunicorn \
|
||||
--bind 127.0.0.1:4000 "xmrnodes.app:app" \
|
||||
--daemon \
|
||||
--log-file $BASE/gunicorn.log \
|
||||
--pid $BASE/gunicorn.pid \
|
||||
--reload
|
||||
sleep 2
|
||||
echo "Started gunicorn on 127.0.0.1:4000 with pid $(cat $BASE/gunicorn.pid)"
|
||||
fi
|
||||
else
|
||||
flask $@
|
||||
fi
|
@ -0,0 +1,14 @@
|
||||
import os
|
||||
from secrets import token_urlsafe
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
SECRET_KEY = os.environ.get('SECRET_KEY', token_urlsafe(14))
|
||||
SERVER_NAME = os.environ.get('SERVER_NAME', '127.0.0.1:5000')
|
||||
DATA_DIR = os.environ.get('DATA_DIR', './data')
|
||||
TOR_HOST = os.environ.get('TOR_HOST', '127.0.0.1')
|
||||
TOR_PORT = os.environ.get('TOR_PORT', 9050)
|
||||
NODE_HOST = os.environ.get('NODE_HOST', 'singapore.node.xmr.pm')
|
||||
NODE_PORT = os.environ.get('NODE_PORT', 18080)
|
Loading…
Reference in New Issue