mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 18:23:09 +00:00
f069cdb0dc
There are two patches applied to 'calibre-web' in order to make it more NixOS friendly: - default-logger.patch switches default log output to /dev/stdout, as otherwise calibre-web tries to open a file relative to its location, which it can't do as the store is read-only. It's not possible to pass log file location via command line flags. - run-migrations.patch adds an env var __RUN_MIGRATIONS_AND_EXIT that, when set, instructs calibre-web to run DB migrations and exit. As almost all config parameters are configured via UI in sqlite3 DB, this patch allows the DB to be pre-created so it can be updated by systemd pre-start script later. Thus, allowing calibre-web to be configured declaratively.
18 lines
714 B
Diff
18 lines
714 B
Diff
diff --git a/cps/logger.py b/cps/logger.py
|
|
index b204de31..3206e2bf 100644
|
|
--- a/cps/logger.py
|
|
+++ b/cps/logger.py
|
|
@@ -32,10 +32,10 @@ ACCESS_FORMATTER_TORNADO = Formatter("[%(asctime)s] %(message)s")
|
|
|
|
FORMATTER = Formatter("[%(asctime)s] %(levelname)5s {%(name)s:%(lineno)d} %(message)s")
|
|
DEFAULT_LOG_LEVEL = logging.INFO
|
|
-DEFAULT_LOG_FILE = os.path.join(_CONFIG_DIR, "calibre-web.log")
|
|
-DEFAULT_ACCESS_LOG = os.path.join(_CONFIG_DIR, "access.log")
|
|
LOG_TO_STDERR = '/dev/stderr'
|
|
LOG_TO_STDOUT = '/dev/stdout'
|
|
+DEFAULT_LOG_FILE = LOG_TO_STDOUT
|
|
+DEFAULT_ACCESS_LOG = LOG_TO_STDOUT
|
|
|
|
logging.addLevelName(logging.WARNING, "WARN")
|
|
logging.addLevelName(logging.CRITICAL, "CRIT")
|