From dd66e6f3b760558b3004c500a3259457b2349e0c Mon Sep 17 00:00:00 2001 From: cube Date: Sat, 28 Mar 2026 22:52:07 +0000 Subject: [PATCH] readme --- README.md | 77 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index db4975a..cc02f60 100644 --- a/README.md +++ b/README.md @@ -27,46 +27,71 @@ do not deploy this way, the packaged flask server is not secure. production inst it is recommended to run waitress in a tmux window for easier management -create new tmux window: -tmux new -s myriad +create new tmux window -detach from tmux window: -ctrl+b -> d +`tmux new -s myriad` -attach to existing tmux window: -tmux attach -t myriad +detach from tmux window -git clone https://tea.cubes.link/cube/myriad.git -cd myriad -python3 -m venv venv -source venv/bin/activate +`ctrl+b` -> `d` -pip install flask -pip install waitress +attach to existing tmux window -mkdir instance -mkdir myriad/static/icons -mkdir myriad/static/blinkies -mkdir myriad/static/stamps -mkdir myriad/static/tmp +`tmux attach -t myriad` -sudo nano instance/config.py -(copy and paste sample from readme) +## installing -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)' +clone the repo and set up virtual env -flask --app myriad init-db -waitress-serve --port=80 --call 'myriad:create_app' +`git clone https://tea.cubes.link/cube/myriad.git` +`cd myriad` +`python3 -m venv venv` +`source venv/bin/activate` -after running and setting up first user stop waitress (CTRL+C), then `sudo nano instance/config.py` and set `REGISTRATION = False` +install necessary packages in the virtual env + +`pip install flask` +`pip install waitress` + +make sure all directories exist + +`mkdir instance` +`mkdir myriad/static/icons` +`mkdir myriad/static/blinkies` +`mkdir myriad/static/stamps` +`mkdir myriad/static/tmp` + +copy sample from readme and paste into the following + +`sudo nano instance/config.py` + +in a window where you can copy the output, (or in python itself) generate a secret key and copy it to the clipboard + +`python -c 'import secrets; print(secrets.token_hex())'` + +add a new line to config.py and paste in the key + +`SECRET_KEY = '(paste generated key here)'` + +initialize the database + +`flask --app myriad init-db` + +start running the site + +`waitress-serve --port=80 --call 'myriad:create_app'` + +after running and setting up first user stop waitress (CTRL+C), then edit the config to disable user registration for security + +`sudo nano instance/config.py` +`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