fix: enforce absolute paths for state and database files

This commit is contained in:
2026-04-07 23:21:16 -04:00
parent eb4be44c9a
commit a9c7ddec2b
45 changed files with 212 additions and 3 deletions

View File

@@ -11,7 +11,9 @@ from pydantic import BaseModel, field_validator
from decnet.distros import random_hostname as _random_hostname
STATE_FILE = Path("decnet-state.json")
# Calculate absolute path to the project root (where the config file resides)
_ROOT: Path = Path(__file__).parent.parent.absolute()
STATE_FILE: Path = _ROOT / "decnet-state.json"
def random_hostname(distro_slug: str = "debian") -> str: