a bash.org clone built with Flask
Find a file
2017-01-06 19:44:44 +01:00
smash Fix typo in css 2017-01-06 19:44:44 +01:00
.gitignore Initial commit 2016-11-30 19:49:29 +00:00
config.json Add motd to config 2017-01-06 19:35:59 +01:00
LICENSE Initial commit 2016-11-30 19:49:29 +00:00
Procfile Procfile and changes for deployment 2016-12-02 00:57:27 +00:00
README.md New tags page, simple privilege elevation page, additional info in models 2016-12-29 01:22:05 +01:00
requirements.txt Partially migrated to SQLAlchemy 2017-01-02 02:18:00 +01:00
run.py Procfile and changes for deployment 2016-12-02 00:57:27 +00:00
runtime.txt Move runtime file 2017-01-05 00:50:06 +01:00

smash

a bash.org clone built with Flask

How to run

This program is designed to be easy to deploy via Heroku. It can also run locally. Database is stored locally in an sqlite file.

First, you have to edit the config file (config.json). DBNAME needs to be a valid filename for the database. APPNAME is the name that will be displayed in the title bar in the browser, while APPBRAND is the name that will be displayed in the navbar on every page.

SECRETKEY will be used to encrypt and sign session cookies, so it needs to be a cryptographically-secure random string. ADMINSECRET will be used to elevate privileges to allow approving and deleting new quotes. There are no user accounts since there are no user-specific functionalities.

APPNAME and APPBRAND will be loaded from the environment if they're left empty in the config.

After basic config is done, run this to start the server:

python run.py

The program looks for HEROKU in the environment; if that variable is equal to 1, it interprets this as a sign that it's running in a production environment and starts in the externally visible mode with debug turned off. It also needs the PORT environment variable to have some sensible value; this is configured automatically when deploying on heroku.

The first time it's started it will create the local database and all required tables, as specified by models. After that it's ready to be used.

All logging is done by printing to stdout - heroku adds that to the app logs visible in the dashboard.