readme
This commit is contained in:
154
README.md
154
README.md
@@ -10,7 +10,7 @@ the blinkies and stamps stuff is literally just because i want an easy way to up
|
|||||||
|
|
||||||
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.
|
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
|
# A note on data 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.
|
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.
|
||||||
|
|
||||||
@@ -20,153 +20,19 @@ both are a little janky as they've just been implemented rather quickly to cover
|
|||||||
|
|
||||||
**individual member import via zip folder is not currently possible**
|
**individual member import via zip folder is not currently possible**
|
||||||
|
|
||||||
# dev set up (windows)
|
# Development set up (Windows)
|
||||||
|
|
||||||
- after cloning, run `py -3 -m venv .venv` in the root directory and then `.venv\Scripts\activate`
|
[Dev instructions are here](https://tea.cubes.link/cube/myriad/wiki/Development-setup-%28Windows%29)
|
||||||
- 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
|
# Deployment
|
||||||
|
|
||||||
- you will need to run `.venv\Scripts\activate` from the folder every time you start working on it
|
[Deployment instructions are here](https://tea.cubes.link/cube/myriad/wiki/deployment-instructions)
|
||||||
- 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 (linux)
|
# Usage
|
||||||
|
|
||||||
it is recommended to run waitress in a tmux window for easier management
|
- 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 us
|
||||||
|
|
||||||
create new tmux window
|
# Preview
|
||||||
|
|
||||||
```tmux new -s myriad```
|
[Check out our own personal instance](https://system.cubes.link)
|
||||||
|
|
||||||
detach from tmux window
|
|
||||||
|
|
||||||
`ctrl+b` -> `d`
|
|
||||||
|
|
||||||
attach to existing tmux window
|
|
||||||
|
|
||||||
```tmux attach -t myriad```
|
|
||||||
|
|
||||||
## installing
|
|
||||||
|
|
||||||
ensure system is up to date
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt upgrade
|
|
||||||
```
|
|
||||||
|
|
||||||
clone the repo and set up virtual env
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://tea.cubes.link/cube/myriad.git
|
|
||||||
|
|
||||||
cd myriad
|
|
||||||
|
|
||||||
python3 -m venv venv
|
|
||||||
|
|
||||||
source venv/bin/activate
|
|
||||||
```
|
|
||||||
|
|
||||||
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`
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
## updating
|
|
||||||
|
|
||||||
**WARNING: Before updating ALWAYS use administration settings to back up your entire system to a downloadable zip file**
|
|
||||||
|
|
||||||
stop waitress (CTRL+C) and use `git pull` to pull changes
|
|
||||||
|
|
||||||
start waitress again to reload
|
|
||||||
|
|
||||||
|
|
||||||
# config
|
|
||||||
|
|
||||||
- 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
|
|
||||||
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
|
|
||||||
|
|
||||||
- Flask
|
|
||||||
|
|
||||||
# preview
|
|
||||||
|
|
||||||
- these screenshots are all from the public viewer's perspective
|
|
||||||
|
|
||||||
- homepage with pinned members
|
|
||||||

|
|
||||||
|
|
||||||
- main blog post feed
|
|
||||||

|
|
||||||
|
|
||||||
- member page showing their uploaded icons (just about)
|
|
||||||

|
|
||||||
|
|
||||||
- groups view
|
|
||||||

|
|
||||||
|
|
||||||
- a sample part of the administration
|
|
||||||

|
|
||||||
Reference in New Issue
Block a user