The v1.6.0 work (webmentions, reply contexts, rate limiter, migration 010) was built and deployed as git.thesatelliteoflove.com/phil/starpunk:v1.6.0-rc.2 but never committed. This restores the application code from /app in the running container so later work builds on what production runs. Tests and docs for v1.6.0 were not in the image and are not recovered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
1.6 KiB
Python
59 lines
1.6 KiB
Python
"""
|
|
Route registration module for StarPunk
|
|
|
|
This module handles registration of all route blueprints including public,
|
|
admin, auth, and (conditionally) dev auth routes.
|
|
"""
|
|
|
|
from flask import Flask
|
|
|
|
from starpunk.routes import admin, auth, micropub, public, search, webmention
|
|
|
|
|
|
def register_routes(app: Flask) -> None:
|
|
"""
|
|
Register all route blueprints with the Flask app
|
|
|
|
Args:
|
|
app: Flask application instance
|
|
|
|
Registers:
|
|
- Public routes (homepage, note permalinks)
|
|
- Auth routes (login, callback, logout, token, authorization)
|
|
- Micropub routes (Micropub API endpoint)
|
|
- Admin routes (dashboard, note management)
|
|
- Dev auth routes (if DEV_MODE enabled)
|
|
"""
|
|
# Register public routes
|
|
app.register_blueprint(public.bp)
|
|
|
|
# Register auth routes
|
|
app.register_blueprint(auth.bp)
|
|
|
|
# Register Micropub routes
|
|
app.register_blueprint(micropub.bp)
|
|
|
|
# Register admin routes
|
|
app.register_blueprint(admin.bp)
|
|
|
|
# Register search routes
|
|
app.register_blueprint(search.bp)
|
|
|
|
# Register webmention routes (v1.6.0)
|
|
if app.config.get("WEBMENTION_ENABLED", True):
|
|
app.register_blueprint(webmention.bp)
|
|
|
|
# Conditionally register dev auth routes
|
|
if app.config.get("DEV_MODE"):
|
|
app.logger.warning(
|
|
"=" * 60
|
|
+ "\n"
|
|
+ "WARNING: Development authentication enabled!\n"
|
|
+ "This should NEVER be used in production.\n"
|
|
+ "Set DEV_MODE=false for production deployments.\n"
|
|
+ "=" * 60
|
|
)
|
|
from starpunk.routes import dev_auth
|
|
|
|
app.register_blueprint(dev_auth.bp)
|