Files
myriad/README.md

172 lines
6.2 KiB
Markdown
Raw Normal View History

2026-03-15 23:16:24 +00:00
# myriad
2026-03-31 14:54:17 +01:00
flask app for plural systems to publicly share member lists. the software is in basically a usable state right now, just be sure to keep regular backups. documentation is fairly limited but we're working on that. drop an email to `myriad [at] cubes [dot] link` if you wanna contact us about this project :)
2026-03-16 01:39:00 +00:00
2026-03-20 02:19:39 +00:00
logged in users are presumed to all be admins with distinction only between being logged in and not
2026-03-20 19:27:01 +00:00
in the blog view, member privacy outweighs individual post privacy. if a private member makes a public post, it will not show up in the public feed. however, if that member switches to public, their public posts will all become publicly viewable (but private posts will remain private).
2026-03-21 00:30:47 +00:00
the blinkies and stamps stuff is literally just because i want an easy way to upload them when i find them. and im the dev so i get to decide mwa ha ha
2026-03-23 22:27:54 +00:00
make sure blinkies are actually blinkie-sized, and stamps are likewise stamp-sized. too much variation in size will make the layout weird. there's not validation because its designed just to make uploading the images not require ftp + manual code as i had been doing before.
## export / import
there are currently various ways to export and import data for use within myriad. individual member exports and imports deal only with the fields (though icons, stamps, and blinkies can be exported to a zip folder). they're designed to be used with an active database for whatever purpose the user requires.
the other option is to export the entire system to json or zip file. **importing an entire system is best used on a completely empty database, as it deals with inserting id fields**. a full system import is useful for when an update is released that requires the database to be re-initialised, you can quickly restore information and images you had before.
both are a little janky as they've just been implemented rather quickly to cover the base requirement of being able to migrate the database in some form. **don't rely on them, be sure to keep your own backups**.
2026-03-30 16:48:04 +01:00
**individual member import via zip folder is not currently possible**
# dev set up (windows)
2026-03-16 01:39:00 +00:00
2026-03-16 01:39:43 +00:00
- after cloning, run `py -3 -m venv .venv` in the root directory and then `.venv\Scripts\activate`
- then `pip install Flask` inside the virtual env
- you might also need to init a database, so use `flask --app myriad init-db`
- to start the site use `flask --app myriad run --debug`
do not deploy this way, the packaged flask server is not secure. production instructions will be provided when the project is ready
- you will need to run `.venv\Scripts\activate` from the folder every time you start working on it
- 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
2026-03-28 22:46:52 +00:00
# prod set up (linux)
it is recommended to run waitress in a tmux window for easier management
2026-03-28 22:52:07 +00:00
create new tmux window
2026-03-28 22:46:52 +00:00
```tmux new -s myriad```
2026-03-28 22:46:52 +00:00
2026-03-28 22:52:07 +00:00
detach from tmux window
2026-03-28 22:46:52 +00:00
2026-03-28 22:52:07 +00:00
`ctrl+b` -> `d`
2026-03-28 22:46:52 +00:00
2026-03-28 22:52:07 +00:00
attach to existing tmux window
2026-03-28 22:46:52 +00:00
```tmux attach -t myriad```
2026-03-28 22:46:52 +00:00
2026-03-28 22:52:07 +00:00
## installing
2026-03-28 22:46:52 +00:00
2026-03-31 00:39:30 +01:00
ensure system is up to date
```
sudo apt-get update
sudo apt upgrade
```
2026-03-28 22:52:07 +00:00
clone the repo and set up virtual env
2026-03-28 22:46:52 +00:00
```
git clone https://tea.cubes.link/cube/myriad.git
2026-03-28 22:52:56 +00:00
cd myriad
2026-03-28 22:52:56 +00:00
python3 -m venv venv
2026-03-28 22:52:56 +00:00
source venv/bin/activate
```
2026-03-28 22:46:52 +00:00
2026-03-28 22:52:07 +00:00
install necessary packages in the virtual env
```
pip install flask
2026-03-28 22:52:56 +00:00
pip install waitress
```
2026-03-28 22:52:07 +00:00
make sure all directories exist
```
mkdir instance
2026-03-28 22:52:56 +00:00
mkdir myriad/static/icons
2026-03-28 22:52:56 +00:00
mkdir myriad/static/blinkies
2026-03-28 22:52:56 +00:00
mkdir myriad/static/stamps
2026-03-28 22:52:56 +00:00
mkdir myriad/static/tmp
```
2026-03-28 22:52:07 +00:00
copy sample from readme and paste into the following
```sudo nano instance/config.py```
2026-03-28 22:52:07 +00:00
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())'```
2026-03-28 22:52:07 +00:00
add a new line to config.py and paste in the key
```SECRET_KEY = '(paste generated key here)'```
2026-03-28 22:52:07 +00:00
initialize the database
```flask --app myriad init-db```
2026-03-28 22:52:07 +00:00
start running the site
```waitress-serve --port=80 --call 'myriad:create_app'```
2026-03-28 22:52:07 +00:00
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```
2026-03-28 22:52:56 +00:00
2026-03-28 22:52:07 +00:00
`REGISTRATION = False`
2026-03-28 22:46:52 +00:00
2026-03-28 23:09:06 +00:00
once you have disabled registration you will need to go to /auth/login in order to log in. removing the link in the sidebar just (slightly) obfuscates the possibilty from passing users
2026-03-28 22:46:52 +00:00
## updating
**WARNING: Before updating ALWAYS use administration settings to back up your entire system to a downloadable zip file**
2026-03-28 22:46:52 +00:00
stop waitress (CTRL+C) and use `git pull` to pull changes
2026-03-28 22:52:07 +00:00
2026-03-28 22:46:52 +00:00
start waitress again to reload
2026-03-28 22:52:07 +00:00
# config
2026-03-17 02:01:14 +00:00
- create `config.py` in the instance folder and customise the following settings to your needs
```
REGISTRATION = True # Make sure to disable in production
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
THEMES_FOLDER = 'myriad/static/themes' # where theme choices will be stored
2026-03-23 22:27:54 +00:00
TMP_FOLDER = 'myriad/static/tmp' # folder for creating export files
```
# usage
- the software here is free to use, and there's no requirement to link back
- edit the styles and functionality to suit your needs. i'm sure some of you out there are far better with CSS than I am
# dependencies
2026-03-19 02:56:39 +00:00
- Flask
# preview
2026-03-19 03:05:22 +00:00
- these screenshots are all from the public viewer's perspective
2026-03-19 02:56:39 +00:00
- homepage with pinned members
2026-03-19 03:05:22 +00:00
![homepage with pinned members](https://i.ibb.co/mF52TSnM/Screenshot-2026-03-19-025454.png)
- main blog post feed
![main blog post feed](https://i.ibb.co/tj5WCsx/Screenshot-2026-03-19-025836.png)
- member page showing their uploaded icons (just about)
![member page](https://i.ibb.co/8LJBwVf2/Screenshot-2026-03-19-030004.png)
- groups view
![groups view](https://i.ibb.co/mF9JFR7x/Screenshot-2026-03-19-030108.png)
- a sample part of the administration
2026-03-28 22:46:52 +00:00
![sample administration area](https://i.ibb.co/pr6qFywy/Screenshot-2026-03-19-030406.png)