Skip to content

Self host staging deploy#702

Merged
feruzm merged 9 commits intodevelopfrom
dp
Apr 13, 2026
Merged

Self host staging deploy#702
feruzm merged 9 commits intodevelopfrom
dp

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Mar 14, 2026

Summary by CodeRabbit

  • New Features

    • Managed Hosting signup flow (username, configure, payment with Keychain/manual, success) and a Hosting page/route
    • Custom domain support with CNAME setup instructions
  • Documentation

    • Deployment guide updated with pricing, setup steps, and payment memo format
  • Backend

    • Audit logging for tenant, subscription, upgrade and domain events; client IP/user-agent captured
    • CORS origin handling made configurable
  • Tests

    • New unit tests for utilities, permlinks, RSS URL, memo/types parsing, and hosting components
  • Chores

    • CI/CD workflow added for builds, image publishing and deploys

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 14, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

Adds an AuditService and integrates non-blocking audit logs across hosting API routes and payment processing; introduces a HostingSignup React flow with Hive Keychain payment and route; adds Vitest configs and multiple unit tests; switches docker-compose to image-based deploys and adds a multi-stage GitHub Actions workflow and deployment docs updates.

Changes

Cohort / File(s) Summary
CI/CD & Deployment
/.github/workflows/self-hosted.yml, apps/self-hosted/hosting/docker-compose.yml, apps/self-hosted/DEPLOYMENT.md
New multi-job GitHub Actions workflow (tests → build-blog/build-api → deploy-staging/deploy); docker-compose changed to use prebuilt images; DEPLOYMENT.md updated from "planned" to concrete instructions.
Testing config & packages
apps/self-hosted/vitest.config.ts, apps/self-hosted/hosting/api/vitest.config.ts, apps/self-hosted/package.json, apps/self-hosted/hosting/api/package.json
Added Vitest configs and test scripts; vitest added to deps/devDeps and test script entries introduced.
Audit logging service
apps/self-hosted/hosting/api/src/services/audit-service.ts
New AuditService and AuditEntry interface with fire-and-forget inserts into audit_log and parseClientIp helper; errors are logged but not thrown.
API audit integration
apps/self-hosted/hosting/api/src/routes/auth.ts, .../routes/domains.ts, .../routes/tenants.ts, .../payment-listener.ts
Integrated AuditService + client IP parsing into auth (/verify), domain add/verify/remove, tenant create/subscribe/upgrade/config/delete, and payment listener; logs emitted non-blocking with relevant metadata.
Frontend: Hosting signup & route
apps/self-hosted/src/features/hosting/components/hosting-signup.tsx, apps/self-hosted/src/routes/hosting.tsx, apps/self-hosted/src/routeTree.gen.ts
New HostingSignup component (username → configure → payment → success) with API integration, polling activation, Hive Keychain flow; new /hosting route and route-tree entries added.
Unit tests: utilities & types
apps/self-hosted/src/features/.../permlink.test.ts, apps/self-hosted/src/features/.../utils.test.ts, apps/self-hosted/src/utils/rss-feed-url.test.ts, apps/self-hosted/hosting/api/src/types.test.ts
Numerous new tests covering permlink generation, deepClone/update utilities, RSS feed URL behavior, and comprehensive memo/Tenant mapping tests.
Type/import adjustments & services
apps/self-hosted/hosting/api/src/services/domain-service.ts, .../tenant-service.ts, apps/self-hosted/hosting/api/src/services/tenant-service.ts
Adjusted import paths for shared types (../../types → ../types) and minor re-exports; no public signature changes.
Runtime/input tweaks
apps/self-hosted/src/utils/rss-feed-url.ts, apps/self-hosted/hosting/api/src/types.ts, apps/self-hosted/hosting/api/src/index.ts
RSS util trims and rejects whitespace-only IDs; parseMemo explicitly validates months > 0; CORS origins made dynamic using BASE_DOMAIN env var.
New tests & helpers
apps/self-hosted/src/features/hosting/components/*, apps/self-hosted/src/utils/*, apps/self-hosted/src/features/*
Added client-side tests and helpers (e.g., utils tests) supporting new frontend features.

Sequence Diagram(s)

sequenceDiagram
    participant User as User/Browser
    participant HSC as HostingSignup (UI)
    participant API as Hosting API
    participant HK as Hive Keychain

    User->>HSC: Enter username
    HSC->>API: GET /v1/tenants/{username}/status
    API-->>HSC: availability / status
    User->>HSC: Submit config
    HSC->>API: POST /v1/tenants (username, config)
    API-->>HSC: Created + PaymentInstructions
    User->>HSC: Click "Pay with Keychain"
    HSC->>HK: Initiate transfer (to, amount, memo)
    HK-->>HSC: Transfer success
    HSC->>API: Poll GET /v1/tenants/{username}/status
    API-->>HSC: subscriptionStatus = "active"
    HSC->>User: Show success (onSuccess)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Poem

🐰 A tiny hop, a logging beat,

Signup blossoms, payments meet,
Tests and images sail away,
CI hums through night and day,
Self-hosted burrow wakes—hooray! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Self host staging deploy' is vague and does not clearly convey the primary changes in this comprehensive pull request, which includes CI/CD pipeline setup, audit logging, hosting signup feature, and test infrastructure. Use a more descriptive title that captures the main objective, such as 'Add CI/CD pipeline, audit logging, and hosting signup feature' or 'Implement self-hosted deployment infrastructure and signup flow'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm merged commit b2daddf into develop Apr 13, 2026
1 check passed
@feruzm feruzm deleted the dp branch April 13, 2026 11:04
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.

1 participant