Dockerize: self-contained stack + B2 backup sidecar

This commit is contained in:
Bonna
2026-06-06 14:25:45 -05:00
parent fa3c030b36
commit 7f2057f139
9 changed files with 173 additions and 3 deletions

4
app.py
View File

@@ -45,7 +45,7 @@ def money_filter(value):
except (TypeError, ValueError):
return "0.00"
TAX_FILE = os.path.join(os.path.dirname(__file__), "data", "taxes.json")
TAX_FILE = os.path.join(os.environ.get("DATA_DIR", os.path.join(os.path.dirname(__file__), "data")), "taxes.json")
def load_taxes():
if os.path.exists(TAX_FILE):
@@ -160,7 +160,7 @@ def inject_unreviewed_count():
count = sum(1 for t in transactions if not t.get("reviewed"))
return dict(unreviewed_count=count)
DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
DATA_DIR = os.environ.get("DATA_DIR", os.path.join(os.path.dirname(__file__), "data"))
TRANSACTIONS_FILE = os.path.join(DATA_DIR, "transactions.json")
RULES_FILE = os.path.join(DATA_DIR, "rules.json")
BUDGET_FILE = os.path.join(DATA_DIR, "budget.json")