Rename product to OrbitWard

This commit is contained in:
Keith Smith
2026-05-26 21:24:54 -06:00
parent af72a6c563
commit 177bdcc8a7
41 changed files with 129 additions and 105 deletions
+1 -1
View File
@@ -1 +1 @@
"""OrbitalWard backend package."""
"""OrbitWard backend package."""
+1 -1
View File
@@ -5,4 +5,4 @@ router = APIRouter(tags=["health"])
@router.get("/health")
def health() -> dict[str, str]:
return {"status": "ok", "service": "orbitalward-backend"}
return {"status": "ok", "service": "orbitward-backend"}
+4 -4
View File
@@ -14,7 +14,7 @@ router = APIRouter(prefix="/notifications/channels", tags=["notifications"])
def _channel_to_read(channel: NotificationChannel) -> NotificationChannelRead:
settings = dict(channel.settings or {})
settings.setdefault("username", "OrbitalWard")
settings.setdefault("username", "OrbitWard")
return NotificationChannelRead(
id=channel.id,
name=channel.name,
@@ -40,7 +40,7 @@ def create_channel(
db: Session = Depends(get_db),
) -> NotificationChannelRead:
channel_settings = dict(payload.settings or {})
channel_settings.setdefault("username", "OrbitalWard")
channel_settings.setdefault("username", "OrbitWard")
channel = NotificationChannel(
name=payload.name,
channel_type=payload.channel_type,
@@ -70,8 +70,8 @@ def test_channel(
response = httpx.post(
url,
json={
"username": (channel.settings or {}).get("username") or "OrbitalWard",
"text": f"OrbitalWard test notification for {channel.name}",
"username": (channel.settings or {}).get("username") or "OrbitWard",
"text": f"OrbitWard test notification for {channel.name}",
},
timeout=10,
)
+2 -2
View File
@@ -20,12 +20,12 @@ def verify_password(plain_password: str, hashed_password: str) -> bool:
def create_access_token(subject: str) -> str:
expires_at = datetime.now(UTC) + timedelta(minutes=settings.access_token_expire_minutes)
payload = {"sub": subject, "exp": expires_at}
return jwt.encode(payload, settings.orbitalward_secret_key, algorithm=ALGORITHM)
return jwt.encode(payload, settings.orbitward_secret_key, algorithm=ALGORITHM)
def decode_access_token(token: str) -> str | None:
try:
payload = jwt.decode(token, settings.orbitalward_secret_key, algorithms=[ALGORITHM])
payload = jwt.decode(token, settings.orbitward_secret_key, algorithms=[ALGORITHM])
return payload.get("sub")
except JWTError:
return None
+8 -4
View File
@@ -1,15 +1,19 @@
from functools import lru_cache
from pydantic import AnyHttpUrl, Field
from pydantic import AliasChoices, AnyHttpUrl, Field
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
orbitalward_env: str = "development"
orbitalward_secret_key: str = Field(default="change-me", min_length=8)
database_url: str = "postgresql+psycopg://orbitalward:orbitalward@postgres:5432/orbitalward"
orbitward_env: str = Field(default="development", validation_alias=AliasChoices("ORBITWARD_ENV", "ORBITALWARD_ENV"))
orbitward_secret_key: str = Field(
default="change-me",
min_length=8,
validation_alias=AliasChoices("ORBITWARD_SECRET_KEY", "ORBITALWARD_SECRET_KEY"),
)
database_url: str = "postgresql+psycopg://orbitward:orbitward@postgres:5432/orbitward"
redis_url: str = "redis://redis:6379/0"
frontend_url: AnyHttpUrl | str = "http://localhost:5173"
backend_url: AnyHttpUrl | str = "http://localhost:8000"
+1 -1
View File
@@ -7,7 +7,7 @@ from app.core.config import settings
def _fernet() -> Fernet:
digest = hashlib.sha256(settings.orbitalward_secret_key.encode("utf-8")).digest()
digest = hashlib.sha256(settings.orbitward_secret_key.encode("utf-8")).digest()
return Fernet(base64.urlsafe_b64encode(digest))
+1 -1
View File
@@ -25,7 +25,7 @@ async def lifespan(_: FastAPI) -> AsyncIterator[None]:
app = FastAPI(
title="OrbitalWard API",
title="OrbitWard API",
version="0.1.0",
description="Self-hosted infrastructure monitoring API",
lifespan=lifespan,