- Move TOKEN_ENCRYPTION_KEY from DB to env var (no longer stored alongside encrypted data) - Add one-time setup token printed to server logs to prevent anonymous setup takeover - Setup token persists until first successful login, allowing config retries - Remove setup_complete flag in favor of app_settings nullability check - Fix stale Myst→Firebreak references in crypto.py, dev.sh, pyproject.toml - Add dynamic OAuth callback URL in setup wizard - Fix global heading color override to use foreground instead of danger - Add aria-label to brand link for accessibility - Remove forced redirect to /settings after first login - Remove reconfigure link from landing page - Add styled error page with HTML/JSON content negotiation - Add 401 guard dog easter egg Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
874 B
Python
22 lines
874 B
Python
from __future__ import annotations
|
|
|
|
import datetime
|
|
|
|
from sqlalchemy import CheckConstraint, DateTime, String, Text, func
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class AppSettings(Base):
|
|
__tablename__ = "app_settings"
|
|
__table_args__ = (CheckConstraint("id = 1", name="single_row"),)
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True, default=1)
|
|
forgejo_base_url: Mapped[str] = mapped_column(String, nullable=False)
|
|
forgejo_oauth_client_id: Mapped[str] = mapped_column(String, nullable=False)
|
|
forgejo_oauth_client_secret_encrypted: Mapped[str] = mapped_column(Text, nullable=False)
|
|
firebreak_public_base_url: Mapped[str] = mapped_column(String, nullable=False, default="")
|
|
setup_completed_at: Mapped[datetime.datetime] = mapped_column(
|
|
DateTime(timezone=True), server_default=func.now()
|
|
)
|