readme and init changes
This commit is contained in:
54
README.md
54
README.md
@@ -23,9 +23,52 @@ do not deploy this way, the packaged flask server is not secure. production inst
|
||||
- re-building the entire database with `flask --app myriad init-db` (losing all the data inside) will be necessary as development continues. DO NOT STORE ANYTHING IMPORTANT DURING DEVELOPMENT
|
||||
- start the site with `flask --app myriad run --debug` as usual
|
||||
|
||||
# prod set up
|
||||
# prod set up (linux)
|
||||
|
||||
it is recommended to run waitress in a tmux window for easier management
|
||||
|
||||
create new tmux window:
|
||||
tmux new -s myriad
|
||||
|
||||
detach from tmux window:
|
||||
ctrl+b -> d
|
||||
|
||||
attach to existing tmux window:
|
||||
tmux attach -t myriad
|
||||
|
||||
git clone https://tea.cubes.link/cube/myriad.git
|
||||
cd myriad
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
|
||||
pip install flask
|
||||
pip install waitress
|
||||
|
||||
mkdir instance
|
||||
mkdir myriad/static/icons
|
||||
mkdir myriad/static/blinkies
|
||||
mkdir myriad/static/stamps
|
||||
mkdir myriad/static/tmp
|
||||
|
||||
sudo nano instance/config.py
|
||||
(copy and paste sample from readme)
|
||||
|
||||
python -c 'import secrets; print(secrets.token_hex())'
|
||||
copy value generated above (maybe do the generation on a local machine so it easier to copy/paste)
|
||||
add new line to config.py:
|
||||
SECRET_KEY = '(paste generated key here)'
|
||||
|
||||
flask --app myriad init-db
|
||||
waitress-serve --port=80 --call 'myriad:create_app'
|
||||
|
||||
after running and setting up first user stop waitress (CTRL+C), then `sudo nano instance/config.py` and set `REGISTRATION = False`
|
||||
|
||||
## updating
|
||||
|
||||
stop waitress (CTRL+C) and use `git pull` to pull changes
|
||||
start waitress again to reload
|
||||
if it is a database changing update, use backup features, re-init db, then re-import from backup
|
||||
|
||||
- not ready yet
|
||||
|
||||
# config
|
||||
|
||||
@@ -37,8 +80,6 @@ ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'} # Can be anything you want
|
||||
ICON_UPLOAD_FOLDER = 'myriad/static/icons' # where member icons will be stored
|
||||
BLINKIES_UPLOAD_FOLDER = 'myriad/static/blinkies' # where site assets "blinkies" will be stored
|
||||
STAMPS_UPLOAD_FOLDER = 'myriad/static/stamps' # where site assets "stamps" will be stored
|
||||
INLINE_UPLOAD_FOLDER = 'myriad/static/inline' # where site assets "misc inline" will be stored
|
||||
MISC_UPLOAD_FOLDER = 'myriad/static/misc' # where other small images will be stored
|
||||
THEMES_FOLDER = 'myriad/static/themes' # where theme choices will be stored
|
||||
TMP_FOLDER = 'myriad/static/tmp' # folder for creating export files
|
||||
```
|
||||
@@ -69,7 +110,4 @@ TMP_FOLDER = 'myriad/static/tmp' # folder for creating export files
|
||||

|
||||
|
||||
- a sample part of the administration
|
||||

|
||||
|
||||
- the theme editor is pretty ugly right now but it does work
|
||||

|
||||

|
||||
@@ -11,6 +11,11 @@ def create_app(test_config=None):
|
||||
|
||||
# ensure the instance folder exists
|
||||
os.makedirs(app.instance_path, exist_ok=True)
|
||||
os.makedirs(app.ICON_UPLOAD_FOLDER, exist_ok=True)
|
||||
os.makedirs(app.BLINKIES_UPLOAD_FOLDER, exist_ok=True)
|
||||
os.makedirs(app.STAMPS_UPLOAD_FOLDER, exist_ok=True)
|
||||
os.makedirs(app.THEMES_FOLDER, exist_ok=True)
|
||||
os.makedirs(app.TMP_FOLDER, exist_ok=True)
|
||||
|
||||
from . import db
|
||||
db.init_app(app)
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
[project]
|
||||
name = "myriad"
|
||||
version = "1.0.0"
|
||||
description = "First release of myriad"
|
||||
dependencies = [
|
||||
"flask",
|
||||
]
|
||||
|
||||
[build-system]
|
||||
requires = ["flit_core<4"]
|
||||
build-backend = "flit_core.buildapi"
|
||||
Reference in New Issue
Block a user