From a4f8dd5abbf1440add70a62ddcffa018915ed92f Mon Sep 17 00:00:00 2001 From: cube Date: Sat, 28 Mar 2026 22:46:52 +0000 Subject: [PATCH] readme and init changes --- README.md | 54 +++++++++++++++++++++++++++++++++++++++------- myriad/__init__.py | 5 +++++ pyproject.toml | 11 ---------- 3 files changed, 51 insertions(+), 19 deletions(-) delete mode 100644 pyproject.toml diff --git a/README.md b/README.md index fb9cd2f..db4975a 100644 --- a/README.md +++ b/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 ![groups view](https://i.ibb.co/mF9JFR7x/Screenshot-2026-03-19-030108.png) - a sample part of the administration -![sample administration area](https://i.ibb.co/pr6qFywy/Screenshot-2026-03-19-030406.png) - -- the theme editor is pretty ugly right now but it does work -![the theme editor](https://i.ibb.co/sJRK187w/Screenshot-2026-03-19-030504.png) \ No newline at end of file +![sample administration area](https://i.ibb.co/pr6qFywy/Screenshot-2026-03-19-030406.png) \ No newline at end of file diff --git a/myriad/__init__.py b/myriad/__init__.py index 07fd641..ecc0ec6 100644 --- a/myriad/__init__.py +++ b/myriad/__init__.py @@ -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) diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 40e7832..0000000 --- a/pyproject.toml +++ /dev/null @@ -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" \ No newline at end of file