From ba5c8ae1eb6c69f99511761df76b22cce47c4463 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 8 Dec 2022 22:15:25 -0800 Subject: [PATCH] update readme --- README.md | 87 ++++++++++++++++++++++++++++++++++++++++++++ requirements-dev.txt | 3 -- 2 files changed, 87 insertions(+), 3 deletions(-) delete mode 100644 requirements-dev.txt diff --git a/README.md b/README.md index da8666a..9131d5c 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,93 @@ No middle-men. p2p tips. No passwords. Wallet signing authentication. +## Setup + +This install guide was written for Ubuntu. + +Launch a new VPS and point a domain of your choice to it. I'll refer to said domain as `$DOMAIN` below. + +``` +# Update package list +apt update + +# Install web server, tools, and system libraries +apt install nginx python3-venv certbot python3-certbot-nginx docker.io docker-compose make + +# Note - If you don't want to run Docker, you can just install/run monero-wallet-rpc and background it instead + +# Remove default Nginx config +rm /etc/nginx/sites-enabled/default + +# Add http Nginx config +vim /etc/nginx/sites-enabled/nerochan.conf +<<< +server { + listen 80; + server_name nerochan-test.suchwow.xyz; + error_log /var/log/nginx/nerochan-test.suchwow.xyz-error.log warn; + access_log /var/log/nginx/nerochan-test.suchwow.xyz-access.log; + client_body_in_file_only clean; + client_body_buffer_size 32K; + client_max_body_size 30M; + sendfile on; + send_timeout 600s; + + location / { + proxy_pass http://127.0.0.1:4000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Frame-Options "SAMEORIGIN"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Cookie $http_cookie; + proxy_redirect off; + } +} +>>> + +# Configure SSL for web server - certbot will inject SSL config into your above nerochan.conf +certbot --nginx -d $DOMAIN --agree-tos -m $YOUR_EMAIL + +# Create new user for running app +useradd -m -G docker -s /bin/bash nerochan # omit docker group if running without it + +# sudo into nerochan user +sudo -u nerochan bash +cd ~/ + +# Clone the repo +git clone https://github.com/lalanza808/nerochan + +# Setup secrets +cp env-example .env + +# Build and run monero-wallet-rpc +make up # uses docker-compose to build a container image which runs ./bin/run_wallet.sh (monero-wallet-rpc) + +# Install Python dependencies for Flask app +make setup + +# Initialize the database based on nerochan/models.py (default goes to ./data/sqlite.db) +make init + +# Run Gunicorn production web service +make prod + +# Register new user on the site + +# Make user an admin via CLI +./manage.py add_admin $HANDLE +``` + +If everything worked as intended, you should have Gunicorn running in the background on port 4000 as `nerochan` user, with Nginx config accepting requests for your $DOMAIN, proxying requests to Gunicorn. You'll have a SQLite database keeping all the relational app data somewhere you've defined (default is app repo ./data/sqlite.db), and a filesystem for future uploads from your artists. You'll have an administrator within the application's /admin interface for managing the system. + +To process tips, run the following (setup a cron task): + +``` +./manage.py verify_tips +``` + ## Dev Stuff diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 1b2ffd0..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,3 +0,0 @@ -flake8==6.0.0 -pyflakes==3.0.1 -lorem==0.1.1