Moving fast and breaking things
This is a first commit in preparation for 2.0 - now using prototempaltes™ - updated README - makefile for some nice shortcuts - add new tikettes - remove tikettes Things that don't work (yet) - authentication on the main frontend (there is none) - generating PDFs
This commit is contained in:
93
README.md
93
README.md
@@ -1,64 +1,53 @@
|
||||
zetikettes
|
||||
==========
|
||||
zetikettes 2.0
|
||||
==============
|
||||
|
||||
ouaich.
|
||||
ouaich. tavu.
|
||||
|
||||
**NOTE**: release 2.0 broke compatibility with previous "releases". Maxime has all the recent data to repopulate a new database.
|
||||
|
||||
|
||||
Initial setup
|
||||
-------------
|
||||
|
||||
### Database setup and population
|
||||
|
||||
Populate an empty database (if none already exists):
|
||||
|
||||
```
|
||||
sudo make initial-db
|
||||
```
|
||||
|
||||
This will setup an initial database under `/var/lib/zetikettes/data`
|
||||
|
||||
Optionally, you may need credentials to access the admin page:
|
||||
|
||||
```
|
||||
make superuser
|
||||
```
|
||||
|
||||
### System service
|
||||
|
||||
```
|
||||
docker build -t zetikettes .
|
||||
sudo mkdir -p /etc/docker/compose/zetikettes
|
||||
sudo cp docker-compose.yml /etc/docker/compose/zetikettes/
|
||||
sudo cp compose.yml /etc/docker/compose/zetikettes/
|
||||
sudo systemctl enable --now docker-compose@zetikettes
|
||||
```
|
||||
|
||||
If not already present in `/etc/systemd/system/`, the `docker-compose@` service file is provided.
|
||||
|
||||
### www static files
|
||||
|
||||
```
|
||||
make staticfiles
|
||||
```
|
||||
|
||||
This will install frontend and django admin static files under `/var/lib/zetikettes`
|
||||
|
||||
### Nginx
|
||||
|
||||
Example configuration is provided in `nginx_locations`.
|
||||
|
||||
Nginx is configured to:
|
||||
- redirect /zetikettes/srv/ to localhost:8000
|
||||
- redirect /zetikettes/ to /var/lib/zetikettes/static
|
||||
|
||||
Conf is in /etc/nginx/sites-available/default
|
||||
|
||||
Test
|
||||
----
|
||||
|
||||
```
|
||||
docker run --rm -it -v $PWD/templates:/data zetikettes /bin/bash /root/zetikettes/old/mkjam.sh
|
||||
```
|
||||
|
||||
This should produce a .pdf in `templates/`. Open it to check that
|
||||
layout & fonts are correct.
|
||||
|
||||
Run
|
||||
---
|
||||
|
||||
```
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
Notes for deploying
|
||||
-------------------
|
||||
|
||||
.h3 Initialize empty database
|
||||
```
|
||||
python manage.py migrate
|
||||
```
|
||||
|
||||
.h3 Prepare static files
|
||||
```
|
||||
python manage.py collectstatic
|
||||
```
|
||||
The files will be in `www_static/` and need to be moved to `/var/lib/zetikettes/www_static`
|
||||
|
||||
.h3 Change host settings
|
||||
If not deploying on `aerith.ponteilla.net`, you'll need to edit `backend/zetikettes/zetikettes/settings.py` to change a couple things in there.
|
||||
|
||||
|
||||
Change available templates
|
||||
--------------------------
|
||||
|
||||
1. go to /zetikettes/admin
|
||||
1. add the newtikette
|
||||
1. still no need to restart the container (magic!)
|
||||
2. profit.
|
||||
- redirect `/zetikettes/srv/` to `localhost:8000`
|
||||
- redirect `/zetikettes/` to `/var/lib/zetikettes/frontend`
|
||||
- redirect `/zetikettes/srv/static` to `/var/lib/zetikettes/www_static`
|
||||
|
||||
Reference in New Issue
Block a user