Add cPanel UAPI pull integration (v1 proof of concept)#2835
Closed
georgestephanis wants to merge 2 commits intoAutomattic:trunkfrom
Closed
Add cPanel UAPI pull integration (v1 proof of concept)#2835georgestephanis wants to merge 2 commits intoAutomattic:trunkfrom
georgestephanis wants to merge 2 commits intoAutomattic:trunkfrom
Conversation
Add two new design documents: SYNC_ARCHITECTURE.md describes the Studio sync architecture (auth, site discovery, pull/push flows, state management, and extension points). CPANEL_INTEGRATION.md is a detailed implementation plan for adding cPanel UAPI as a new provider (v1 pull-only), covering connection setup, pull flow, Redux/ipc changes, UI components, and a list of affected files. It also documents critical roadblocks (no DB import UAPI, no documented binary download endpoint), recommended workarounds, and team questions about scope and credential storage.
Adds the ability to pull a remote WordPress site hosted on cPanel into a local Studio site. Connects via cPanel UAPI using hostname, username, and API token — no OAuth required. Pull flow: compress wp-content on server → download archive → dump database via UAPI → build Jetpack-format tar.gz locally → stop local server → import via existing importBackup → restart. New files: - src/modules/cpanel/types.ts — CpanelSyncSite, CpanelPullStatusInfo types - src/modules/cpanel/lib/cpanel-api.ts — UAPI client, file download, DB dump helpers - src/modules/cpanel/lib/ipc-handlers.ts — IPC handlers for connect/disconnect/get/pull/cancel - src/modules/cpanel/components/cpanel-credentials-modal.tsx — connection setup form - src/modules/cpanel/components/cpanel-connected-site.tsx — pull UI with progress bar and cancel - src/stores/cpanel/cpanel-connected-sites.ts — RTK Query API for connected sites - src/stores/cpanel/cpanel-operations-slice.ts — Redux slice for pull state + IPC event bridge Modified: storage-types (adds connectedCpanelSites), ipc-utils (cpanel-pull-progress event), ipc-handlers (re-exports), constants (IPC_VOID_HANDLERS), preload (IPC wiring), stores/index (reducer + middleware + error listener), modules/sync/index (Connect cPanel button + site rendering) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Apologies, this is something I'm tinkering with in a fork with Claude, didn't mean to open up a PR in the main project. I'm trying to see what is and isn't possible to extend Studio in a fork to connect to existing hosting infastructures elsewhere -- both to enable migrations to Pressable/WPCOM (by pulling and deploying) but also to use for local development and testing of WordPress installations across a plethora of hosts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
How AI was used in this PR
This PR was built with Claude Code (AI pair programming). The architecture was designed collaboratively: explored the existing WP.com sync flow, documented it in
SYNC_ARCHITECTURE.md, then planned the cPanel integration inCPANEL_INTEGRATION.mdbefore implementation. All code was reviewed and iterated on for type safety and lint compliance.Key AI contributions: UAPI client, Jetpack-format archive construction, Redux slice + IPC event bridge, RTK Query API, UI components. Human review recommended before merge especially on the cPanel API interaction patterns and the archive building logic.
Proposed Changes
Fileman::list_fileswp-contenton server → download archive → dump database viaMysql::dump_database_schema→ build Jetpack-format tar.gz locally → stop local server → import via existingimportBackup()→ restartcancelCpanelPullIPC handlercpanel-pull-progressIPC event → Redux slice → progress bar in UI (compressing → downloading → exporting-db → building-archive → importing → finished/failed/cancelled)connectedCpanelSitesarray inappdata-v1.jsonwith file lockingTesting Instructions
npm startpublic_html)Without a live cPanel account: Review the architecture in
CPANEL_INTEGRATION.mdandSYNC_ARCHITECTURE.mdfor the design intent.Architecture notes
See
CPANEL_INTEGRATION.md(repo root) for full design doc including known roadblocks:/download?skipencode=1) — stable in practice but not a formal UAPI endpointPre-merge Checklist
npm run typecheckpasses clean (0 errors)npx eslint --fixapplied to all modified files (0 warnings)__())