Skip to content

Commit 9e01475

Browse files
authored
fix(db): apply abspath to logged path in _safe_url() (#148)
Without this, _safe_url() could log a relative path while the actual connection uses the absolute one (resolved in _build_database_url).
1 parent 1cac350 commit 9e01475

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/db/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ def _safe_url(self) -> str:
204204
if not db_path:
205205
backup_path = os.getenv("BACKUP_PATH", "/data/backups")
206206
db_path = os.path.join(backup_path, "telegram_backup.db")
207+
db_path = os.path.abspath(db_path)
207208
return f"sqlite+aiosqlite:///{db_path}"
208209
# PostgreSQL — build from non-sensitive env vars, mask password
209210
host = os.getenv("POSTGRES_HOST", "localhost")

0 commit comments

Comments
 (0)