Compare commits
2 Commits
88fcb17dc5
...
d7a385fd45
Author | SHA1 | Date | |
---|---|---|---|
|
d7a385fd45 | ||
|
edc9366a5b |
@ -1,12 +1,15 @@
|
|||||||
{
|
{
|
||||||
"CALIBRE_DIR": "PATH\\TO\\your\\calibre\library",
|
"CALIBRE_DIR": "/usr/src/app/calibredir",
|
||||||
"SECRET_KEY": "u(8^+rb%rz5hsx4v^^y(ul7g(4n7a8!db@s*9(m5cs*2_ppy8+",
|
"SECRET_KEY": "u(8^+rb%rz5hsx4v^^y(ul7g(4n7a8!db@s*9(m5cs*2_ppy8+",
|
||||||
"ALLOWED_HOSTS": [
|
"ALLOWED_HOSTS": [
|
||||||
"127.0.0.1"
|
"127.0.0.1"
|
||||||
],
|
],
|
||||||
"INTERNAL_IPS": [
|
"INTERNAL_IPS": [
|
||||||
"127.0.0.1"
|
"127.0.0.1"
|
||||||
],
|
],
|
||||||
"DEBUG" : false,
|
"DEBUG" : true,
|
||||||
"LOGFILE" : "/home/massiveatoms/Desktop/logs/django.log"
|
"LOGFOLDER" : "/usr/src/app/data/logs/",
|
||||||
|
"ISDOCKER" : true
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
21
README.md
21
README.md
@ -24,24 +24,10 @@ Django 3.0
|
|||||||
Calibre 4.13 (I have not tested it with anything else atm, will be resolved later)
|
Calibre 4.13 (I have not tested it with anything else atm, will be resolved later)
|
||||||
|
|
||||||
# how to use:
|
# how to use:
|
||||||
1. clone repo
|
1. [Docker setup](./deployment/instructions.md#user-content-docker-detup)
|
||||||
2. Remove the `.bak` from `./CalibreWebCompanion/settings.json.bak` and `db.sqlite3.bak`
|
2. [Non Docker setup](./deployment/instructions.md#user-content-non-docker-detup)
|
||||||
3. Edit `./CalibreWebCompanion/settings.json`. Definitely change the secret key
|
|
||||||
4. Not sure if the db needs to be regenerated, but we'll see later __!!!!!!!!!!__
|
|
||||||
5. pip install -r requirements.txt
|
|
||||||
6. install gunicorn and nginx
|
|
||||||
7. move this nginx.conf to /etc/nginx
|
|
||||||
8. make whatever user nginx runs as (in this case, massiveatoms) the owner of calibredir
|
|
||||||
9. give execute permissions to parent of calibredir
|
|
||||||
10. cd to repo, run `gunicorn CalibreWebCompanion.wsgi`
|
|
||||||
11. start nginx `sudo systemctl restart nginx`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`./CalibreWebCompanion`
|
|
||||||
run `./manage.py runserver`
|
|
||||||
|
|
||||||
# Ignore pretty much everything below if you're not working on the project
|
# Ignore pretty much everything below if you're not working on the project
|
||||||
|
|
||||||
# Profiling
|
# Profiling
|
||||||
@ -74,7 +60,8 @@ You can then go to [http://localhost:8089/](http://localhost:8089/) to see live
|
|||||||
- [ ] cache with vary headers
|
- [ ] cache with vary headers
|
||||||
- [ ] localisation
|
- [ ] localisation
|
||||||
- [ ] Beautifying template (only works well on 720p, no other viewports)
|
- [ ] Beautifying template (only works well on 720p, no other viewports)
|
||||||
- [ ] Setup email functionality
|
- [ ] Setup email functionality (atm, there's only a dummy one, and you can't reset passwords)
|
||||||
|
- [ ] isolate the styling and templates, so we can swap them out by just swapping directory content
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,36 +1,45 @@
|
|||||||
# non docker stuff
|
|
||||||
1. clone repo
|
|
||||||
2. pip install -r requirements.txt
|
|
||||||
3. install gunicorn and nginx
|
|
||||||
4. move this nginx.conf to /etc/nginx
|
|
||||||
5. make whatever user nginx runs as (in this case, massiveatoms) the owner of calibredir
|
|
||||||
6. give execute permissions to parent of calibredir
|
|
||||||
7. cd to repo, run `gunicorn CalibreWebCompanion.wsgi`
|
|
||||||
8. start nginx `sudo systemctl restart nginx`
|
|
||||||
|
|
||||||
Slight issues with this atm:
|
# Docker setup (no provided docker image atm)
|
||||||
1. server_name in nginx.conf needs to be changed
|
1. clone the repo
|
||||||
2. User needs to be edited in nginx.conf, now it's just my user acc. This affectd step 4-6
|
2. rename ./calireWebCompanion/settings.json.bak to settings.json
|
||||||
3. where to do ssl?
|
3. change the secret key
|
||||||
|
4. run `build --tag calibreweb:1.0 . -f ./deployment/Dockerfile` to build the image
|
||||||
|
5. run your container with your bind/mount your volumes/paths/things
|
||||||
Suggestions:
|
Here's an example of step 5
|
||||||
1. We might want to use sockets instead of ip/port?
|
|
||||||
2. logging
|
|
||||||
3. autostart gunicorn/nginx
|
|
||||||
4. some extra instrumentation for gunicorn https://docs.gunicorn.org/en/latest/deploy.html
|
|
||||||
|
|
||||||
# docker stuff
|
|
||||||
here are the commands i use to build and run:
|
|
||||||
1. build --tag calibreweb:1.0.1 . -f ./deployment/Dockerfile
|
|
||||||
2.
|
|
||||||
```
|
```
|
||||||
docker run --publish 8000:80\
|
docker run --publish 80:80\
|
||||||
-v '/home/massiveatoms/Desktop/logs:/usr/src/app/data' \
|
-v '/home/massiveatoms/Desktop/logs:/usr/src/app/data' \
|
||||||
-v '/run/media/massiveatoms/1AEEEA6EEEEA421D/Documents and Settings/MassiveAtoms/Documents/Calibre Library/:/usr/src/app/calibredir' \
|
-v '/run/media/massiveatoms/1AEEEA6EEEEA421D/Documents and Settings/MassiveAtoms/Documents/Calibre Library/:/usr/src/app/calibredir' \
|
||||||
--name cw calibreweb:1.0.1
|
--name cw calibreweb:1.0.1
|
||||||
```
|
```
|
||||||
|
|
||||||
Docker stuff to fix:
|
your Calibre path/volume/whatever needs to be mounted at `/usr/src/app/calibredir`, and you need to mount a volume for the db and logs at `/usr/src/app/data`
|
||||||
1. permission/ownership issue with volumes and nginx
|
|
||||||
2. we need a setup script that changes secretkey, and generates the default db
|
Issues with it at the moment:
|
||||||
|
1. we still need to do something to create a random secret key. Atm, this would still
|
||||||
|
|
||||||
|
# Docker (provided image)
|
||||||
|
not done yet
|
||||||
|
|
||||||
|
# non docker setup
|
||||||
|
this might need to be modified, since some things have changed to adapt it for docker setup
|
||||||
|
1. clone repo
|
||||||
|
2. pip install -r requirements.txt
|
||||||
|
3. rename the settings.json.bak to settings.json, change logging folder, change secret key, set isdocker to false
|
||||||
|
4. install gunicorn and nginx
|
||||||
|
5. move this nginx.conf to /etc/nginx
|
||||||
|
6. create a user and group `www`
|
||||||
|
7. make whatever user nginx runs as (for now, www) the owner of calibredir
|
||||||
|
8. give execute permissions to parent of calibredir
|
||||||
|
9. cd to repo, run `gunicorn CalibreWebCompanion.wsgi`
|
||||||
|
10. start nginx `sudo systemctl restart nginx`
|
||||||
|
11. make steps 9 and 10 happen on startup?
|
||||||
|
|
||||||
|
Slight issues with this atm:
|
||||||
|
1. where to do ssl?
|
||||||
|
|
||||||
|
|
||||||
|
Suggestions:
|
||||||
|
1. We might want to use sockets instead of ip/port?
|
||||||
|
2. autostart gunicorn/nginx
|
||||||
|
3. some extra instrumentation for gunicorn https://docs.gunicorn.org/en/latest/deploy.html
|
||||||
|
Loading…
Reference in New Issue
Block a user