diff --git a/app.py b/app.py index fed6bed..cfe2f2a 100644 --- a/app.py +++ b/app.py @@ -19,9 +19,9 @@ from bp import ( ) -async def coop_context() -> dict: +async def blog_context() -> dict: """ - Coop app context processor. + Blog app context processor. - menu_items: via shared.services.navigation - cart_count/cart_total: via cart service (shared DB) @@ -50,8 +50,8 @@ def create_app() -> "Quart": from services import register_domain_services app = create_base_app( - "coop", - context_fn=coop_context, + "blog", + context_fn=blog_context, domain_services_fn=register_domain_services, ) diff --git a/bp/auth/routes.py b/bp/auth/routes.py index 58418fe..bc0571f 100644 --- a/bp/auth/routes.py +++ b/bp/auth/routes.py @@ -26,7 +26,7 @@ from shared.models import User, MagicLink, UserNewsletter from shared.models.ghost_membership_entities import GhostNewsletter from shared.config import config from shared.utils import host_url -from shared.infrastructure.urls import coop_url +from shared.infrastructure.urls import blog_url from shared.services.widget_registry import widgets from sqlalchemy.orm import selectinload @@ -83,7 +83,7 @@ def register(url_prefix="/auth"): if cross_cart_sid: qsession["cart_sid"] = cross_cart_sid if g.get("user"): - return redirect(coop_url("/")) + return redirect(blog_url("/")) return await render_template("_types/auth/login.html") @@ -346,6 +346,6 @@ def register(url_prefix="/auth"): @auth_bp.post("/logout/") async def logout(): qsession.pop(SESSION_USER_KEY, None) - return redirect(coop_url("/")) + return redirect(blog_url("/")) return auth_bp diff --git a/bp/auth/services/login_redirect.py b/bp/auth/services/login_redirect.py index 9dba0a3..ad4f7a3 100644 --- a/bp/auth/services/login_redirect.py +++ b/bp/auth/services/login_redirect.py @@ -1,7 +1,7 @@ from urllib.parse import urlparse from quart import session -from shared.infrastructure.urls import coop_url +from shared.infrastructure.urls import blog_url LOGIN_REDIRECT_SESSION_KEY = "login_redirect_to" @@ -32,7 +32,7 @@ def store_login_redirect_target() -> None: def pop_login_redirect_target() -> str: path = session.pop(LOGIN_REDIRECT_SESSION_KEY, None) if not path or not isinstance(path, str): - return coop_url("/auth/") + return blog_url("/auth/") # Absolute URL: return as-is (cross-app redirect) if path.startswith("http://") or path.startswith("https://"): @@ -40,6 +40,6 @@ def pop_login_redirect_target() -> str: # Relative path: must start with / and not // if path.startswith("/") and not path.startswith("//"): - return coop_url(path) + return blog_url(path) - return coop_url("/auth/") + return blog_url("/auth/") diff --git a/bp/blog/ghost/ghost_sync.py b/bp/blog/ghost/ghost_sync.py index 25c00b2..790b25c 100644 --- a/bp/blog/ghost/ghost_sync.py +++ b/bp/blog/ghost/ghost_sync.py @@ -1100,7 +1100,7 @@ async def sync_single_post(sess: AsyncSession, ghost_id: str) -> None: if not post.is_page and post.user_id: from shared.services.federation_publish import try_publish from shared.infrastructure.urls import app_url - post_url = app_url("coop", f"/{post.slug}/") + post_url = app_url("blog", f"/{post.slug}/") post_tags = [tag_map[t["id"]] for t in (gp.get("tags") or []) if t["id"] in tag_map] if post.status == "published": @@ -1165,7 +1165,7 @@ async def sync_single_page(sess: AsyncSession, ghost_id: str) -> None: if post.user_id: from shared.services.federation_publish import try_publish from shared.infrastructure.urls import app_url - post_url = app_url("coop", f"/{post.slug}/") + post_url = app_url("blog", f"/{post.slug}/") post_tags = [tag_map[t["id"]] for t in (gp.get("tags") or []) if t["id"] in tag_map] if post.status == "published": diff --git a/config/app-config.yaml b/config/app-config.yaml index 278134e..3aa6a76 100644 --- a/config/app-config.yaml +++ b/config/app-config.yaml @@ -3,13 +3,13 @@ base_host: "wholesale.suma.coop" base_login: https://wholesale.suma.coop/customer/account/login/ base_url: https://wholesale.suma.coop/ title: Rose Ash -coop_root: /market -coop_title: Market +market_root: /market +market_title: Market blog_root: / blog_title: all the news cart_root: /cart app_urls: - coop: "http://localhost:8000" + blog: "http://localhost:8000" market: "http://localhost:8001" cart: "http://localhost:8002" events: "http://localhost:8003" diff --git a/services/__init__.py b/services/__init__.py index d1baee4..11d9769 100644 --- a/services/__init__.py +++ b/services/__init__.py @@ -1,9 +1,9 @@ -"""Blog (coop) app service registration.""" +"""Blog app service registration.""" from __future__ import annotations def register_domain_services() -> None: - """Register services for the blog (coop) app. + """Register services for the blog app. Blog owns: Post, Tag, Author, PostAuthor, PostTag, PostLike. Standard deployment registers all 4 services as real DB impls diff --git a/shared b/shared index b16ba34..798087d 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit b16ba34b40291a71a546130862acc00959c225fd +Subproject commit 798087de9ab76db40e390825aba2cac2faec9b51