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-19 22:20:51 +01:00
|
|
|
|
|
|
|
THUMBNAIL_DIR = os.getenv("THUMBNAIL_DIR",'thumbnails')
|
|
|
|
|
2023-01-19 15:41:27 +01:00
|
|
|
WIN_DRIVE_LETTER = 'B'
|
|
|
|
DEFAULT_SEARCH_NUMBER = 10
|
2023-01-17 16:17:22 +01:00
|
|
|
|
2023-01-19 22:20:51 +01:00
|
|
|
DEBUG = True
|
|
|
|
|
|
|
|
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"
|
|
|
|
)
|