From 75d6e39dcaa27f0404e606a188fa4de46cae91f9 Mon Sep 17 00:00:00 2001 From: B Stack Date: Mon, 14 Feb 2022 15:42:18 -0500 Subject: add initial centos7 doc --- README.md | 10 +++++++++- stackbin.py | 3 +-- stackbin.wsgi.ini | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index be7d7eb..8e5cc6b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,15 @@ This is my proposed solution to my pastebin problem. * UUIDs instead of sequential integer ID numbers * Private pastes (accessible to admin, and to users with the whole link) -# Instructions +# Using stackbin +## Installing + +You can use flask for development servers, and uwsgi for production. For a production stack on CentOS 7: + + yum install nginx uwsgi uwsgi-logger-file python36-flask uwsgi-plugin-python36 python36-sqlalchemy python36-uwsgidecorators + pip3 install --user flask-sqlalchemy pytimeparse + +## Instructions Configure the application with `config.cfg` based on `config.cfg.example`. diff --git a/stackbin.py b/stackbin.py index 4c0d164..bcfd3d5 100755 --- a/stackbin.py +++ b/stackbin.py @@ -10,7 +10,7 @@ from pytimeparse.timeparse import timeparse # python3-pytimeparse try: from uwsgidecorators import timer # python3-uwsgidecorators except: - pass + print("Warning! Without uwsgidecorators, the cleanup timer cannot run.") import time ## ripped from https://stackoverflow.com/questions/183042/how-can-i-use-uuids-in-sqlalchemy/812363#812363 @@ -284,5 +284,4 @@ def favicon(): abort(404) if __name__ == "__main__": - manager.add_command('runserver', Server(host=app.config["APP_HOST"], port=app.config["APP_PORT"])) app.run() diff --git a/stackbin.wsgi.ini b/stackbin.wsgi.ini index 4b38ea8..cf35ffb 100644 --- a/stackbin.wsgi.ini +++ b/stackbin.wsgi.ini @@ -1,5 +1,8 @@ [uwsgi] -plugins = logfile +# CentOS 7 uwsgi needs "python36" added to this list. +plugins = logfile, python36 +# Devuan does not. +#plugins = logfile http-socket = 0.0.0.0:5000 wsgi-file = stackbin.py callable = app -- cgit