From af937daebb2d3b627b83389ce02d3bff8d5fcdb4 Mon Sep 17 00:00:00 2001 From: jessikitty Date: Thu, 24 Sep 2026 14:33:52 +1000 Subject: [PATCH] Add BACKUP_FOLDER and BACKUP_KEEP config --- app/config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/config.py b/app/config.py index 7e8a338..f00d400 100644 --- a/app/config.py +++ b/app/config.py @@ -28,6 +28,15 @@ class Config: BRICKSET_PASSWORD = os.environ.get('BRICKSET_PASSWORD') BRICKSET_API_URL = 'https://brickset.com/api/v3.asmx' + # Backups + # Defaults to /backups so archives never land inside the + # uploads tree (which would make each backup include the previous one). + BACKUP_FOLDER = os.environ.get('BACKUP_FOLDER') or \ + os.path.join(os.path.dirname(basedir), 'backups') + # Keep only the newest N archives after a backup made from the web UI. + # Set to 0 to keep everything. + BACKUP_KEEP = int(os.environ.get('BACKUP_KEEP', 5)) + # Pagination SETS_PER_PAGE = int(os.environ.get('SETS_PER_PAGE', 20))