Skip to content

docs: wire consent storage and bug reports for docs.coordinode.com#8

Merged
polaz merged 1 commit intomainfrom
feat/#7-wire-docs-api
Apr 12, 2026
Merged

docs: wire consent storage and bug reports for docs.coordinode.com#8
polaz merged 1 commit intomainfrom
feat/#7-wire-docs-api

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented Apr 12, 2026

Summary

  • theme/index.ts: createKVStorage uses absolute URL https://coordinode-docs.sw.foundation/api/consent
  • BugReportWidget.vue: fetch uses absolute URL https://coordinode-docs.sw.foundation/api/report-bug

Why a subdomain proxy?

coordinode.com DNS is on PowerDNS (not Cloudflare), so Cloudflare Worker zone routes for docs.coordinode.com are impossible. coordinode-docs.sw.foundation (in the sw.foundation CF zone) acts as API proxy — same pattern as gitlab-mcp.sw.foundation and privacy.sw.foundation.

Worker PRs:

Closes #7

Use coordinode-docs.sw.foundation as API proxy — coordinode.com DNS
is on PowerDNS (not Cloudflare), so direct CF Worker zone routing is
impossible. sw.foundation subdomain acts as proxy (same pattern as
gitlab-mcp and privacy sites).

- theme/index.ts: createKVStorage absolute URL pointing to
  coordinode-docs.sw.foundation/api/consent
- BugReportWidget.vue: fetch absolute URL pointing to
  coordinode-docs.sw.foundation/api/report-bug

Closes #7
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 12, 2026

📝 Walkthrough

Summary by CodeRabbit

Bug Fixes

  • Updated bug report submission endpoint to use absolute URL format for improved routing reliability.
  • Updated consent management endpoint configuration to use absolute URL format for consistent API access.

Walkthrough

Two documentation theme files updated to use absolute URLs pointing to coordinode-docs.sw.foundation proxy instead of relative API paths for bug report submission and consent storage endpoints.

Changes

Cohort / File(s) Summary
API Endpoint Configuration
docs/.vitepress/theme/components/BugReportWidget.vue, docs/.vitepress/theme/index.ts
Replaced relative API endpoints with absolute proxied URLs to coordinode-docs.sw.foundation for bug report submission and consent storage management.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

  • vue-privacy-worker#53: The PR's switch to absolute proxied API URLs for consent storage (https://coordinode-docs.sw.foundation/api/consent) directly aligns with this issue's objective of adding the coordinode-docs.sw.foundation endpoint for consent management.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately and concisely summarizes the main changes: wiring consent storage and bug reports to use the proxy domain for the docs site.
Description check ✅ Passed The PR description provides clear context for the changes, explaining the DNS constraints and proxy setup pattern with supporting detail about referenced worker PRs.
Linked Issues check ✅ Passed Both code changes directly address the linked issue #7: theme/index.ts uses the absolute consent URL and BugReportWidget.vue uses the absolute bug report URL as required.
Out of Scope Changes check ✅ Passed All changes are scoped to the linked issue requirements. Only two files were modified with focused endpoint updates and a clarifying comment, with no unrelated alterations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#7-wire-docs-api

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/.vitepress/theme/index.ts`:
- Around line 17-19: The hardcoded proxy origin passed to createKVStorage
("https://coordinode-docs.sw.foundation/api/consent") should be extracted into a
single shared constant (e.g., CONSENT_API_ORIGIN) sourced from a config module
or env (preferably process.env/VITE_CONSENT_API_ORIGIN) and used to compose the
full endpoint (join origin + "/api/consent") before calling createKVStorage;
update docs/.vitepress/theme/index.ts to import that constant (or read the env)
and replace the inline URL, and propagate the same constant to any other files
that currently hardcode this host so all endpoints derive from the single
config.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b292a35f-c56c-4c00-809f-a80adf7b131d

📥 Commits

Reviewing files that changed from the base of the PR and between bb89b14 and f544a60.

📒 Files selected for processing (2)
  • docs/.vitepress/theme/components/BugReportWidget.vue
  • docs/.vitepress/theme/index.ts

Comment on lines +17 to +19
// Absolute URL: coordinode.com DNS is on PowerDNS (not Cloudflare), so the
// consent worker is proxied through coordinode-docs.sw.foundation (CF zone).
storage: createKVStorage("https://coordinode-docs.sw.foundation/api/consent"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Extract the proxy origin to shared config/env to avoid endpoint drift.

Line 19 hardcodes the API host in theme code. Since the same host is used in multiple files, move the origin to one config constant (preferably env-driven) and compose endpoint paths from it.

♻️ Proposed refactor
+const DOCS_API_ORIGIN =
+  (import.meta.env as Record<string, string>).VITE_DOCS_API_ORIGIN ||
+  "https://coordinode-docs.sw.foundation";
+
 const consentTheme = enhanceWithConsent(DefaultTheme, {
   gaId: GA_ID,
@@
-  storage: createKVStorage("https://coordinode-docs.sw.foundation/api/consent"),
+  storage: createKVStorage(`${DOCS_API_ORIGIN}/api/consent`),
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/.vitepress/theme/index.ts` around lines 17 - 19, The hardcoded proxy
origin passed to createKVStorage
("https://coordinode-docs.sw.foundation/api/consent") should be extracted into a
single shared constant (e.g., CONSENT_API_ORIGIN) sourced from a config module
or env (preferably process.env/VITE_CONSENT_API_ORIGIN) and used to compose the
full endpoint (join origin + "/api/consent") before calling createKVStorage;
update docs/.vitepress/theme/index.ts to import that constant (or read the env)
and replace the inline URL, and propagate the same constant to any other files
that currently hardcode this host so all endpoints derive from the single
config.

@polaz polaz merged commit d709cbb into main Apr 12, 2026
8 checks passed
@polaz polaz deleted the feat/#7-wire-docs-api branch April 17, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: wire vue-privacy consent + bug reports worker for docs.coordinode.com

1 participant