From 1f08dd6d444ab1a74841e98a1bd546f5b34ec34c Mon Sep 17 00:00:00 2001 From: Raelon Masters Date: Mon, 3 Aug 2020 13:02:57 -0400 Subject: [PATCH] Revised program setup routine to work within the constrains of the docker setup. --- README.md | 41 ++++++++++++++++++++------------------- config.json | 4 ++-- configure | 25 ++++++++++++++++++++++++ src/backend/lib/config.py | 4 ++++ 4 files changed, 52 insertions(+), 22 deletions(-) create mode 100755 configure diff --git a/README.md b/README.md index db8f30f..c78e762 100755 --- a/README.md +++ b/README.md @@ -20,11 +20,12 @@ Follow or influence development @

## Current Features * Recursive Scanning -* Fast database access +* Library Stored in PostgreSql database * [Django](https://www.djangoproject.com/) based frontend * Basic seaching via a SearchVector of author, title, & file_name fields. * Ebook Downloading * Collections +* User System ## Currently Supported Formats @@ -35,7 +36,7 @@ Follow or influence development @

# New Features -* .mobi Yep mobis are now a thing! +* .mobi Support * Result set ordering * You can now choose to order your results: * Title @@ -53,16 +54,15 @@ Follow or influence development @

* Ascending / Descending result set * Display of the result set count, and your current position in the set. * A pop over layer to hold things like - * [ ] User login - * [ ] Control panel - * [ ] Book details - * Whatever else :) + * [x] User login & Registration + * [x] Control panel + * [x] Book details ## Installation Example pyShelf Installation Video -## Further Installation & Support Information +## Installation & Support Information * [SUPPORT.md](https://github.com/th3r00t/pyShelf/blob/development/.github/SUPPORT.md) @@ -74,24 +74,25 @@ Follow or influence development @

# Installation -This project is currently targeted towards Network Administrators, and other home -enthusiasts whom I assume will know how to setup a [Django](https://www.djangoproject.com/) app, and a +This project is targeted towards Network Administrators, and home enthusiasts whom I assume will know how to setup a [Django](https://www.djangoproject.com/) app, and a [PostgreSQL](https://www.postgresql.org/) server. Once your environment is ready very little is required to get the system up and running: * From the main directory * setup configurations as discussed in [SUPPORT.md](https://github.com/th3r00t/pyShelf/blob/development/.github/SUPPORT.md) - * `pip install -r requirements.txt` - * `cd src` - * `python manage.py migrate` - * `cd ..` - * `./importbooks` - * `./makecollections` -* Browse to the site as defined in your apache | nginx config - -## Installation & Support Information - -* [SUPPORT.md](https://github.com/th3r00t/pyShelf/blob/development/.github/SUPPORT.md) + * Run the following commands +` +pip install -r requirements.txt +cd src +python manage.py makemigrations +python manage.py makemigration interface +python manage.py migrate +python manage.py migrate interface +cd .. +./configure +./importBooks +` +Browse to the site as defined in your apache | nginx config ## Development diff --git a/config.json b/config.json index 56985a6..cb1b519 100755 --- a/config.json +++ b/config.json @@ -9,5 +9,5 @@ "PASSWORD": "pyshelf", "BOOKSHELF": "data/shelf.json", "ALLOWED_HOSTS": "*", - "SECRET": "r0m#@$d(cs^si9_jmm)z-z#6-4-(snoctd)l(4becso9k=dwvs" -} \ No newline at end of file + "SECRET": "" +} diff --git a/configure b/configure new file mode 100755 index 0000000..3eb55ea --- /dev/null +++ b/configure @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import json +from django.core.management.utils import get_random_secret_key + +def load_config(): + with open('config.json',"r") as file: + config = json.load(file) + file.close() + return config + +def write_config(config): + with open('config.json',"w") as file: + json.dump(config, file) + file.close() + +def set_secret(config=load_config()): + if config["SECRET"] == "": + config["SECRET"] = get_random_secret_key() + write_config(config) + print(config["SECRET"]) + else: + print(config["SECRET"]) + +set_secret() diff --git a/src/backend/lib/config.py b/src/backend/lib/config.py index 155bebd..dfa3636 100755 --- a/src/backend/lib/config.py +++ b/src/backend/lib/config.py @@ -45,3 +45,7 @@ class Config: with open(str(_cp), "r") as read_file: data = json.load(read_file) return data + + def django_secret(self, _data): + pass +