diff --git a/browser/app/__init__.py b/browser/app/__init__.py index ef1392a..7d0bf9b 100644 --- a/browser/app/__init__.py +++ b/browser/app/__init__.py @@ -1,9 +1,9 @@ -# The monolith has been split into three apps (apps/coop, apps/market, apps/cart). +# The monolith has been split into three apps (apps/blog, apps/market, apps/cart). # This package remains for shared infrastructure modules (middleware, redis_cacher, # csrf, errors, authz, filters, utils, bp/*). # # To run individual apps: -# hypercorn apps.coop.app:app --bind 0.0.0.0:8000 +# hypercorn apps.blog.app:app --bind 0.0.0.0:8000 # hypercorn apps.market.app:app --bind 0.0.0.0:8001 # hypercorn apps.cart.app:app --bind 0.0.0.0:8002 # diff --git a/browser/templates/_types/auth/_main_panel.html b/browser/templates/_types/auth/_main_panel.html index 230b07a..195255d 100644 --- a/browser/templates/_types/auth/_main_panel.html +++ b/browser/templates/_types/auth/_main_panel.html @@ -18,7 +18,7 @@ {% endif %} {% endif %} -
+ Home diff --git a/browser/templates/_types/root/mobile/_full_user.html b/browser/templates/_types/root/mobile/_full_user.html index cdecae0..fdb241e 100644 --- a/browser/templates/_types/root/mobile/_full_user.html +++ b/browser/templates/_types/root/mobile/_full_user.html @@ -1,5 +1,5 @@ -{% set href=coop_url('/auth/account/') %} +{% set href=blog_url('/auth/account/') %}

diff --git a/db/session.py b/db/session.py index 123d476..8e60fae 100644 --- a/db/session.py +++ b/db/session.py @@ -7,7 +7,7 @@ from quart import Quart, g DATABASE_URL = ( os.getenv("DATABASE_URL_ASYNC") or os.getenv("DATABASE_URL") - or "postgresql+asyncpg://localhost/coop" + or "postgresql+asyncpg://localhost/blog" ) _engine = create_async_engine( diff --git a/infrastructure/factory.py b/infrastructure/factory.py index 1bd7e4e..477bc23 100644 --- a/infrastructure/factory.py +++ b/infrastructure/factory.py @@ -54,7 +54,7 @@ def create_base_app( context_fn: Async function returning a dict for template context. Each app provides its own — the cart app queries locally, - while coop/market apps fetch via internal API. + while blog/market apps fetch via internal API. If not provided, a minimal default context is used. before_request_fns: Extra before-request hooks (e.g. cart_loader for the cart app). @@ -84,7 +84,7 @@ def create_base_app( cookie_domain = os.getenv("SESSION_COOKIE_DOMAIN") # e.g. ".rose-ash.com" if cookie_domain: app.config["SESSION_COOKIE_DOMAIN"] = cookie_domain - app.config["SESSION_COOKIE_NAME"] = "coop_session" + app.config["SESSION_COOKIE_NAME"] = "blog_session" # Ghost / Redis config app.config["GHOST_API_URL"] = os.getenv("GHOST_API_URL") diff --git a/infrastructure/jinja_setup.py b/infrastructure/jinja_setup.py index 305d820..6e7dd36 100644 --- a/infrastructure/jinja_setup.py +++ b/infrastructure/jinja_setup.py @@ -13,7 +13,7 @@ from shared.browser.app.csrf import generate_csrf_token from shared.browser.app.authz import has_access from shared.browser.app.filters import register as register_filters -from .urls import coop_url, market_url, cart_url, events_url, login_url, page_cart_url, market_product_url +from .urls import blog_url, market_url, cart_url, events_url, login_url, page_cart_url, market_product_url def setup_jinja(app: Quart) -> None: @@ -93,7 +93,7 @@ def setup_jinja(app: Quart) -> None: app.jinja_env.globals["site"] = site # cross-app URL helpers available in all templates - app.jinja_env.globals["coop_url"] = coop_url + app.jinja_env.globals["blog_url"] = blog_url app.jinja_env.globals["market_url"] = market_url app.jinja_env.globals["cart_url"] = cart_url app.jinja_env.globals["events_url"] = events_url diff --git a/infrastructure/urls.py b/infrastructure/urls.py index 5b0972a..17d5562 100644 --- a/infrastructure/urls.py +++ b/infrastructure/urls.py @@ -21,8 +21,8 @@ def app_url(app_name: str, path: str = "/") -> str: return base + path -def coop_url(path: str = "/") -> str: - return app_url("coop", path) +def blog_url(path: str = "/") -> str: + return app_url("blog", path) def market_url(path: str = "/") -> str: @@ -66,9 +66,9 @@ def market_product_url(product_slug: str, suffix: str = "", market_place=None) - def login_url(next_url: str = "") -> str: - # Auth lives in blog (coop) for now. Set AUTH_APP=federation to switch. + # Auth lives in blog for now. Set AUTH_APP=federation to switch. from quart import session as qsession - auth_app = os.getenv("AUTH_APP", "coop") + auth_app = os.getenv("AUTH_APP", "blog") base = app_url(auth_app, "/auth/login/") params: list[str] = [] if next_url: diff --git a/services/widget_registry.py b/services/widget_registry.py index 45f2e2a..5b57fb6 100644 --- a/services/widget_registry.py +++ b/services/widget_registry.py @@ -48,8 +48,8 @@ class _WidgetRegistry: slug = w.slug def _href(s=slug): - from shared.infrastructure.urls import coop_url - return coop_url(f"/auth/{s}/") + from shared.infrastructure.urls import blog_url + return blog_url(f"/auth/{s}/") self._account_nav.append(AccountNavLink( label=w.label,