readme and init changes

This commit is contained in:
cube
2026-03-28 22:46:52 +00:00
parent c3dec04c8d
commit a4f8dd5abb
3 changed files with 51 additions and 19 deletions

View File

@@ -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
```
@@ -70,6 +111,3 @@ TMP_FOLDER = 'myriad/static/tmp' # folder for creating export files
- 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)

View File

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

View File

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