docker: fix data persistence with TINYWEB_DATA_DIR env var

This commit is contained in:
blankie 2026-06-14 07:48:34 +00:00
parent 27147bd3f9
commit 1461c62c91
4 changed files with 4 additions and 5 deletions

2
db.py
View file

@ -6,7 +6,7 @@ import os
from urllib.parse import urlparse, urljoin, parse_qs, urlencode, urlunparse, quote
from bs4 import BeautifulSoup
DATA_DIR = os.path.expanduser("~/.tinyweb")
DATA_DIR = os.environ.get("TINYWEB_DATA_DIR") or os.path.expanduser("~/.tinyweb")
DATABASE = os.path.join(DATA_DIR, "index.db")
BLOCKED_NETWORKS = [