Files
panel/cmd
Copilot 7da411b2f3 feat: 工具箱-迁移功能 (Toolbox Migration) (#1358)
* Initial plan

* feat: add migration backend service, routes and Wire injection

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* feat: add migration frontend - API, WebSocket, MigrationView and tab integration

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* refactor: move migration types to pkg/types, fix code review issues

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* chore: final cleanup

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* feat: add refresh button on migration pre-check step

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* feat: add SSH key exchange for rsync authentication

Generate temporary ED25519 key pair before migration, deploy public
key to remote via POST /api/toolbox_migration/ssh_key, use -i flag
in all rsync/ssh commands, cleanup key from both sides after migration.

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* fix: lint

* fix: lint

* fix: align migration code with actual codebase patterns

- Project service name: use project name directly (not ace-project-xxx)
- MySQL dump: use MYSQL_PWD env var (not -p flag), remove --socket
- PostgreSQL dump: use PGPASSWORD env var with pg_dump -h 127.0.0.1 -U postgres
- PostgreSQL import: use PGPASSWORD with psql -h 127.0.0.1 -U postgres
- MySQL import: use MYSQL_PWD on remote
- Website create API: use correct listens/domains/type fields
- Project create API: use root_dir/exec_start/user fields
- Database create API: pass server_id properly
- Site directory: use filepath.Join(app.Root, "sites") instead of hardcoded path
- maskPassword: handle MYSQL_PWD/PGPASSWORD env var format

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* fix: add PHP version and proxy backend to website create API body

PHP sites now include the php version number, and reverse proxy sites
include the backend address from Proxies[0].Pass. This matches the
WebsiteCreate validation rules (requiredIf:Type,php / requiredIf:Type,proxy).

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* refactor: replace map[string]any with typed request structs for all remote API calls

Use request.WebsiteCreate, request.DatabaseCreate, request.ProjectCreate,
and request.ToolboxMigrationSSHKey instead of ad-hoc map[string]any.
This ensures all required/validated fields are properly typed and present.

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* fix: website list empty and database migration items stuck in running status

1. Website list: pass "all" to websiteRepo.List() instead of "" — empty
   string was treated as a type filter matching nothing.

2. Database status: result was stored with name "aaa (mysql)" but
   failResult/succeedResult looked up by "aaa" — name mismatch meant
   status was never updated from "running". Use displayName consistently.

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* fix: use acepanel CLI to get remote DB passwords, show success text in results

1. Remote DB import: use `acepanel setting get mysql_root_password` and
   `acepanel setting get postgres_password` on the remote server via SSH
   instead of guessing file paths. The $() is escaped so it executes on
   the remote side, not locally.

2. Migration results: successful items now show "Migration succeeded"
   text alongside the completion timestamp instead of a bare date.

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* fix: lint

* refactor: 不基于rsync的迁移

* fix: lint

* fix: lint

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>
Co-authored-by: 耗子 <haozi@loli.email>
2026-02-10 02:51:03 +08:00
..
2026-01-24 19:34:44 +08:00