This commit is contained in:
cube
2026-03-28 22:52:07 +00:00
parent 3563b08d6d
commit dd66e6f3b7

View File

@@ -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