Support custom domains for individual tags
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Issue xác định ranh giới backend agent/plugin router, các frontend route plugins, tag administration UI/API và core router là những entry point liên quan. Hãy bắt đầu bằng cách lần theo cách các request từ Host đến các template/UI routes và cách tag lifecycle cũng như administrator configuration được biểu diễn. Để được coi là hoàn tất, cần quyết định một routing model và xác định behavior cho validation, permissions, navigation, authentication và các thay đổi trong tag lifecycle.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe
An Answer instance can contain multiple topic communities, but every tag is currently accessed under the single site domain, for example community.example.com/tags/golang.
Some operators want topic-specific entry points while keeping one Answer deployment, user base, database, and administration surface. For example:
golang.example.comopens thegolangtag landing page.kubernetes.example.comopens thekubernetestag landing page.- A branded campaign or partner domain opens the tag that represents that community.
This avoids operating a separate Answer instance for every topic and makes focused communities easier to share and brand.
The current plugin mechanism cannot implement this end to end. Backend agent plugins can register handlers only inside the existing API router groups, while frontend route plugins add client-side application routes. Neither can inspect the top-level request Host before the UI/template router nor map that Host to a tag landing page.
Describe the solution you'd like
Support an optional custom domain binding for a tag. When a request reaches the root of a bound domain, Answer should resolve the mapping and open the corresponding tag landing page.
Expected properties:
- A domain can be bound to at most one active tag.
- Domain values are normalized and validated; schemes and paths are not part of the stored mapping.
- Existing
/tags/{slug}URLs and deployments without bindings continue to work unchanged. - Domain configuration is restricted to administrators.
- DNS and TLS certificate provisioning remain the operator's responsibility.
- Behavior is defined for deleted, renamed, merged, or synonymous tags.
There are two possible implementation directions.
Option 1: Add a plugin extension point
Add a server-level plugin hook that runs before the template/UI routes and can match the request Host, then rewrite or redirect the request to a target application route. A plugin could use its existing configuration UI, including the tag selector field, to maintain domain-to-tag mappings.
Advantages:
- Keeps custom-domain behavior outside the core tag model.
- Creates a reusable extension point for other host-based experiences, such as tenant portals or campaign entry pages.
- Allows different deployments to choose redirect, rewrite, or other policies.
Costs and risks:
- Introduces a security-sensitive routing API with ordering, failure-isolation, caching, and Host-header validation requirements.
- The hook must interact correctly with private mode, authentication, static assets, API routes, and configured base paths.
- The plugin contract would need a stable way to resolve tag metadata and react to tag rename/delete/merge events.
- A broad extension point may be larger and harder to maintain than this specific feature requires.
Option 2: Add tag-domain binding as a built-in feature
Add a domain mapping to the tag model (or a dedicated mapping table), expose it in the tag administration UI/API, and resolve the request Host in the core router.
Advantages:
- Provides a discoverable, consistent administrator experience.
- Keeps validation, uniqueness, permissions, migrations, tag lifecycle, and routing behavior in one place.
- Has a smaller and more explicit behavior surface than a general Host-routing plugin API.
Costs and risks:
- Adds a deployment-specific concept to the core tag model.
- Is less reusable for non-tag Host-routing use cases.
- Core code must define navigation, authentication, canonical URL, and cache behavior across multiple domains.
Describe alternatives you've considered
- Configure a reverse proxy to redirect each domain to the primary site's
/tags/{slug}URL. This requires no Answer change, but the custom domain disappears after the redirect and every operator must maintain the mapping externally. - Configure a reverse proxy to rewrite the path while preserving the custom domain. This can display the landing page, but Answer is not aware of the alternate origin, so cookies, OAuth callbacks, CSRF/origin checks, canonical URLs, generated links, and navigation may be inconsistent.
- Run one Answer instance per topic. This provides complete isolation but duplicates infrastructure, users, administration, upgrades, and data.
Questions for maintainers
- Should this be a general plugin extension point or a built-in tag feature?
- Should a bound domain remain visible and serve the tag page, or should it redirect to the primary site's
/tags/{slug}URL? - If the custom domain remains visible, should only its root represent the tag, or should all navigation continue on that domain?
- Should unrelated domains be supported, or only subdomains that can share authentication cookies with the primary site?
- What should happen to a binding when a tag is renamed, merged, converted to a synonym, or deleted?
- Ngôn ngữ chính
- Go
- Star
- 15.7k
- Fork
- 1.4k
- Merge trung bình
- 1 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 6
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/answer
-
List button click not working Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-out Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Gravatar hash is computed from the un-lowercased email, so mixed-case accounts render an identicon Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Tất cả issue của apache/answer
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
googleapis/librarian#7670 · 2 bình luận ·