From 575c6d18b01ce8694a23825a67d4e7f07944b18e Mon Sep 17 00:00:00 2001 From: th3r00t Date: Thu, 19 Dec 2019 13:42:26 -0500 Subject: [PATCH 1/4] Update SUPPORT.md Added contact information and basic install steps. --- .github/SUPPORT.md | 76 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index 4d250ae..a9bce99 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -1,6 +1,80 @@ ## Getting Help With **pyShelf** -If you have issues during initial setup please make sure you have a working Web Server (the pyShelf team recommends Nginx) +If you have issues during initial setup please make sure you have a working Web Server (the pyShelf team recommends [NGINX](https://nginx.com), and that you have correctly setup your webserver to forward cgi requests to [uWSGI](https://uwsgi-docs.readthedocs.io/en/latest/Download.html). Additionaly uWSGI must be setup to serve the application. A sample NGINX config (**pyshelf_nginx.conf**), and (**uwsgi.ini**) are included in the project root. + +### pyshelf_nginx.conf +``` +# the upstream component nginx needs to connect to +upstream django { + # server unix:///path/to/your/mysite/mysite.sock; # for a file socket + server 127.0.0.1:8001; # for a web port socket (we'll use this first) +} +``` +* Set the **server** port, this must match the socket decleration in your uwsgi config **uwsgi.ini** by default. +``` +# configuration of the server +server { + # the port your site will be served on + listen 8000; + # the domain name it will serve for + server_name 127.0.0.1; # substitute your machine's IP address or FQDN + charset utf-8; + + # max upload size + client_max_body_size 75M; # adjust to taste +``` +* Set **listen** to the port you want to serve the frontend on +* Set **server_name** to the ip address, or FQDN of your server +``` + # Django media + location /media { + alias /home/raelon/Projects/pyShelf/frontend/interface/media; # your Django project's media files - amend as required + } + + location /static { + alias /home/raelon/Projects/pyShelf/frontend/interface/static; # your Django project's static files - amend as required + } + + location /books { + internal; + alias /home/raelon/Projects/pyShelf/books; + # Absolute location of your ebook files + } + + # Finally, send all non-media requests to the Django server. + location / { + uwsgi_pass django; + include /home/raelon/Projects/pyShelf/uwsgi_params; # the uwsgi_params file you installed + } +} +``` +* Adjust all the `alias /home/raelon/Project/pyShelf` entries to match your install directory ensure you **do not change** the `/frontend/interface/media` or `/frontend/interface/static` portions +* Adjust `alias /home/raelon/Projects/pyShelf/books` to match the location of your books + +### uwsgi.ini +``` +[uwsgi] +# chdir = {Full path to pyShelf/frontend} +chdir=/home/raelon/Projects/pyShelf/src +module=frontend.wsgi +master=True +pidfile=/tmp/pyShelf.pid +vacuum=True +socket=127.0.0.1:8001 +``` +* Set `chdir=/home/raelon/Projects/pyshelf` leaving `/src` **intact** to match your install directory +* Set `socket=127.0.0.1:8001` to match the entry as defined above in `upstream django{` + +Now you may restart your webserver to apply the changes, and then either run `uwsgi -i uwsgi.ini` fron the project root, or restart your uwsgi service. + +### Import your books +* Run ./importBooks in your project root + +### Access pyShelf's frontend +* Browse to `http://localhost:8000` _substitute ip:port as defined in your webserver_ and you should be greeted by the pyShelf frontend. + +### Still Stuck? +Please contact us using any of the options below for support. Please be prepared with your nginx error logs. ### Via Email * Support Email: [support@pyshelf.com](mailto://support@pyshelf.com) From 3b4aed73556aeaea6ede5fe676eb439d3c51ba3b Mon Sep 17 00:00:00 2001 From: th3r00t Date: Thu, 19 Dec 2019 13:44:48 -0500 Subject: [PATCH 2/4] Update SUPPORT.md --- .github/SUPPORT.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index a9bce99..f491b32 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -1,6 +1,7 @@ ## Getting Help With **pyShelf** If you have issues during initial setup please make sure you have a working Web Server (the pyShelf team recommends [NGINX](https://nginx.com), and that you have correctly setup your webserver to forward cgi requests to [uWSGI](https://uwsgi-docs.readthedocs.io/en/latest/Download.html). Additionaly uWSGI must be setup to serve the application. A sample NGINX config (**pyshelf_nginx.conf**), and (**uwsgi.ini**) are included in the project root. +**

Ensure your Webserver has appropriate access to your install directory!

** ### pyshelf_nginx.conf ``` From 7366060a5a30bb7a2acf86cd1aaec204f31b4300 Mon Sep 17 00:00:00 2001 From: th3r00t Date: Thu, 19 Dec 2019 13:47:25 -0500 Subject: [PATCH 3/4] Update SUPPORT.md --- .github/SUPPORT.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index f491b32..d11d4c6 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -11,7 +11,7 @@ upstream django { server 127.0.0.1:8001; # for a web port socket (we'll use this first) } ``` -* Set the **server** port, this must match the socket decleration in your uwsgi config **uwsgi.ini** by default. +* Set `server 127.0.0.1:8001`, this must match the socket decleration in your uwsgi config **uwsgi.ini**. ``` # configuration of the server server { @@ -24,8 +24,8 @@ server { # max upload size client_max_body_size 75M; # adjust to taste ``` -* Set **listen** to the port you want to serve the frontend on -* Set **server_name** to the ip address, or FQDN of your server +* Set `listen 8000;` to the port you want to serve the frontend on +* Set `server_name 127.0.0.1;` to the ip address, or FQDN of your server ``` # Django media location /media { @@ -69,7 +69,7 @@ socket=127.0.0.1:8001 Now you may restart your webserver to apply the changes, and then either run `uwsgi -i uwsgi.ini` fron the project root, or restart your uwsgi service. ### Import your books -* Run ./importBooks in your project root +* Run `./importBooks` in your project root ### Access pyShelf's frontend * Browse to `http://localhost:8000` _substitute ip:port as defined in your webserver_ and you should be greeted by the pyShelf frontend. From 2491caf7ce8125bf3289a768f6241d0c4341e7da Mon Sep 17 00:00:00 2001 From: th3r00t Date: Thu, 19 Dec 2019 13:50:14 -0500 Subject: [PATCH 4/4] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e782569..9d8fe31 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ Having used Calibre for hosting my eBook collection in the past, I found myself * In addition to the above steps you must now also make the requisite changes in config.json to reflect the connection to your postgresql server Server Frontend +## Further Installation & Support Information +* [SUPPORT.md](https://github.com/th3r00t/pyShelf/blob/development/.github/SUPPORT.md) + ## 0.3.0 Patch Notes. ### "And now we search."