feat(factory): serve dashboard at root and create project repos refs NOISSUE

This commit is contained in:
2026-04-10 20:23:07 +02:00
parent 82e53a6651
commit 227ad1ad6f
12 changed files with 220 additions and 154 deletions

View File

@@ -4,12 +4,18 @@ import os
from typing import Optional
from pathlib import Path
from pydantic import Field
from pydantic_settings import BaseSettings
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
"""Application settings loaded from environment variables."""
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
extra="ignore",
)
# Server settings
HOST: str = "0.0.0.0"
PORT: int = 8000
@@ -23,7 +29,7 @@ class Settings(BaseSettings):
GITEA_URL: str = "https://gitea.yourserver.com"
GITEA_TOKEN: str = ""
GITEA_OWNER: str = "ai-software-factory"
GITEA_REPO: str = "ai-software-factory"
GITEA_REPO: str = ""
# n8n settings
N8N_WEBHOOK_URL: str = ""
@@ -105,6 +111,21 @@ class Settings(BaseSettings):
"""Get Gitea token with trimmed whitespace."""
return self.GITEA_TOKEN.strip()
@property
def gitea_owner(self) -> str:
"""Get Gitea owner/organization with trimmed whitespace."""
return self.GITEA_OWNER.strip()
@property
def gitea_repo(self) -> str:
"""Get the optional fixed Gitea repository name with trimmed whitespace."""
return self.GITEA_REPO.strip()
@property
def use_project_repositories(self) -> bool:
"""Whether the service should create one repository per generated project."""
return not bool(self.gitea_repo)
@property
def n8n_webhook_url(self) -> str:
"""Get n8n webhook URL with trimmed whitespace."""
@@ -177,11 +198,5 @@ class Settings(BaseSettings):
"""Get test PostgreSQL database name."""
return self.POSTGRES_TEST_DB.strip()
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
extra = "ignore"
# Create instance for module-level access
settings = Settings()