MAstodon posts fixed
Build LinkLog Development Image / development-image (push) Successful in 11s

This commit is contained in:
2026-08-26 09:26:16 +02:00
parent 333aab8e8a
commit 22add753fe
12 changed files with 682831 additions and 35 deletions
+10 -1
View File
@@ -10,6 +10,14 @@ BASE_DIR = Path(__file__).resolve().parent.parent.parent
DB_PATH = BASE_DIR / 'data' / 'linklog.db'
def normalize_public_url(value: str) -> str:
value = value.strip().rstrip('/')
if '://' in value:
return value
scheme = 'http' if value.startswith(('localhost', '127.0.0.1')) else 'https'
return f'{scheme}://{value}'
@dataclass
class Settings:
app_name: str = os.getenv('LINKLOG_APP_NAME', 'LinkLog')
@@ -17,7 +25,7 @@ class Settings:
database_url: str = os.getenv('LINKLOG_DATABASE_URL', f'sqlite:///{DB_PATH}')
secret_key: str = os.getenv('LINKLOG_SECRET_KEY', 'dev-secret-key-change-me')
token_expiry_days: int = int(os.getenv('LINKLOG_TOKEN_EXPIRY_DAYS', '30'))
public_url: str = os.getenv('LINKLOG_PUBLIC_URL', 'http://localhost:8000').rstrip('/')
public_url: str = normalize_public_url(os.getenv('LINKLOG_PUBLIC_URL', 'http://localhost:8000'))
smtp_host: str = os.getenv('LINKLOG_SMTP_HOST', '')
smtp_port: int = int(os.getenv('LINKLOG_SMTP_PORT', '587'))
smtp_username: str = os.getenv('LINKLOG_SMTP_USERNAME', '')
@@ -28,6 +36,7 @@ class Settings:
password_reset_expiry_hours: int = int(os.getenv('LINKLOG_PASSWORD_RESET_EXPIRY_HOURS', '1'))
mastodon_client_name: str = os.getenv('LINKLOG_MASTODON_CLIENT_NAME', 'LinkLog')
mastodon_oauth_expiry_minutes: int = int(os.getenv('LINKLOG_MASTODON_OAUTH_EXPIRY_MINUTES', '10'))
log_level: str = os.getenv('LINKLOG_LOG_LEVEL', 'INFO').upper()
tracking_params: list[str] = None
def __post_init__(self):