ComicOPDS/config.py

47 lines
1.4 KiB
Python
Raw Normal View History

2022-06-07 09:16:43 +02:00
import os
from werkzeug.security import generate_password_hash
2023-01-20 09:26:32 +01:00
from sys import platform
2022-06-07 09:16:43 +02:00
2023-01-17 16:17:22 +01:00
#CONTENT_BASE_DIR = os.getenv("CONTENT_BASE_DIR", "/library") #docker
2023-01-20 09:26:32 +01:00
if platform == "linux" or platform == "linux2":
CONTENT_BASE_DIR = os.getenv("CONTENT_BASE_DIR", "/home/drudoo/ComicsTest/Comics") #linux
elif platform == "win32":
CONTENT_BASE_DIR = os.getenv("CONTENT_BASE_DIR", "/Comics/ComicRack") #windows
#CONTENT_BASE_DIR = os.getenv("CONTENT_BASE_DIR", "testlibrary") #windows test library
2023-01-20 11:45:09 +01:00
# Added folder for thumbnails. These are loaded as covers for the files.
THUMBNAIL_DIR = os.getenv("THUMBNAIL_DIR",'thumbnails')
2023-01-20 11:45:09 +01:00
# If using Windows, insert the drive letter of your comics here.
# Both the script and comics needs to be on the same drive.
2023-01-19 15:41:27 +01:00
WIN_DRIVE_LETTER = 'B'
2023-01-20 11:45:09 +01:00
# If using custom searches, then insert the default amout of results here.
# It is also possible to override this in the json file.
2023-01-19 15:41:27 +01:00
DEFAULT_SEARCH_NUMBER = 10
2023-01-17 16:17:22 +01:00
2023-01-20 11:45:09 +01:00
# Debug output
# False: no print out in terminal
# True: logs are printet to terminal
DEBUG = True
# Max thumbnail size
MAXSIZE = (500,500)
def _print(arg):
if DEBUG:
print(arg)
2022-06-07 09:16:43 +02:00
TEENYOPDS_ADMIN_PASSWORD = os.getenv("TEENYOPDS_ADMIN_PASSWORD", None)
users = {}
if TEENYOPDS_ADMIN_PASSWORD:
users = {
"admin": generate_password_hash(TEENYOPDS_ADMIN_PASSWORD),
}
else:
print(
"WANRNING: admin password not configured - catalog will be exposed was public"
)