Make DEFAULT_PASS configurable

pull/88/head
Akhyar Amarullah 8 years ago
parent 9414b970f7
commit f6cc48e682

@ -5,6 +5,7 @@ MAIN_DIR =
LOG_DIR =
PORT = 8083
NEWEST_BOOKS = 60
DEFAULT_PASS = admin123
[Advanced]
TITLE_REGEX = ^(A|The|An|Der|Die|Das|Den|Ein|Eine|Einen|Dem|Des|Einem|Eines)\s+
DEVELOPMENT = 0

@ -55,8 +55,9 @@ APP_DB_ROOT = check_setting_str(CFG, 'General', 'APP_DB_ROOT', os.getcwd())
MAIN_DIR = check_setting_str(CFG, 'General', 'MAIN_DIR', os.getcwd())
LOG_DIR = check_setting_str(CFG, 'General', 'LOG_DIR', os.getcwd())
PORT = check_setting_int(CFG, 'General', 'PORT', 8083)
NEWEST_BOOKS = check_setting_str(CFG, 'General', 'NEWEST_BOOKS', 60)
NEWEST_BOOKS = check_setting_int(CFG, 'General', 'NEWEST_BOOKS', 60)
RANDOM_BOOKS = check_setting_int(CFG, 'General', 'RANDOM_BOOKS', 4)
DEFAULT_PASS = check_setting_str(CFG, 'General', 'DEFAULT_PASS', 'admin123')
# override from environment variables, if any
DB_ROOT = env.get('DB_ROOT', DB_ROOT)
APP_DB_ROOT = env.get('APP_DB_ROOT', APP_DB_ROOT)
@ -65,6 +66,7 @@ LOG_DIR = env.get('LOG_DIR', LOG_DIR)
PORT = int(env.get('PORT', PORT))
NEWEST_BOOKS = int(env.get('NEWEST_BOOKS', NEWEST_BOOKS))
RANDOM_BOOKS = int(env.get('RANDOM_BOOKS', RANDOM_BOOKS))
DEFAULT_PASS = env.get('DEFAULT_PASS', DEFAULT_PASS)
CheckSection('Advanced')

@ -7,7 +7,6 @@ from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import *
import os
import config
from os import environ as env
from werkzeug.security import generate_password_hash
dbpath = os.path.join(config.APP_DB_ROOT, "app.db")
@ -20,7 +19,7 @@ ROLE_DOWNLOAD = 2
ROLE_UPLOAD = 4
ROLE_EDIT = 8
ROLE_PASSWD = 16
DEFAULT_PASS = env.get("DEFAULT_PASS", "admin123")
DEFAULT_PASS = config.DEFAULT_PASS
class User(Base):

@ -1,4 +1,4 @@
##About
## About
Calibre Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing [Calibre](https://calibre-ebook.com) database.
@ -6,7 +6,8 @@ Calibre Web is a web app providing a clean interface for browsing, reading and d
![screenshot](https://raw.githubusercontent.com/janeczku/docker-calibre-web/master/screenshot.png)
##Features
## Features
- Bootstrap 3 HTML5 interface
- User management
- Admin interface
@ -34,15 +35,22 @@ Calibre Web is a web app providing a clean interface for browsing, reading and d
*Username:* admin
*Password:* admin123
## Runtime Configuration Options
## Configuration Options
`PUBLIC_REG`
Set to 1 to enable public user registration.
`ANON_BROWSE`
Set to 1 to allow not logged in users to browse the catalog.
`UPLOADING`
Set to 1 to enable PDF uploading. This requires the imagemagick library to be installed.
`DEFAULT_PASS`
Default password for user `admin`
> See `config.ini.example` for all available options. You can also use environment variables to override them.
## Requirements
Python 2.7+
@ -82,6 +90,7 @@ http {
Apache 2.4 configuration for a local server listening on port 443, mapping calibre web to /calibre-web:
The following modules have to be activated: headers, proxy, proxy_html, proxy_http, rewrite, xml2enc.
```
Listen 443

Loading…
Cancel
Save