Fix readonly database error by setting proper permissions on storage directory

This commit is contained in:
Automated Action 2025-06-25 13:34:05 +00:00
parent 5cfa4ee90f
commit d3a069aee9
2 changed files with 4 additions and 4 deletions

View File

@ -25,10 +25,10 @@ class Settings(BaseSettings):
if isinstance(v, str):
return v
# Ensure the database directory exists
# Ensure the database directory exists with proper permissions
db_dir = info.data.get("DB_DIR")
if db_dir:
db_dir.mkdir(parents=True, exist_ok=True)
db_dir.mkdir(parents=True, exist_ok=True, mode=0o755)
return f"sqlite:///{db_dir}/db.sqlite"

View File

@ -3,8 +3,8 @@ from sqlalchemy.orm import sessionmaker
from app.core.config import settings
# Ensure the database directory exists
settings.DB_DIR.mkdir(parents=True, exist_ok=True)
# Ensure the database directory exists with proper permissions
settings.DB_DIR.mkdir(parents=True, exist_ok=True, mode=0o755)
# Create SQLAlchemy engine
engine = create_engine(