site_files_upload
Upload local files or directories to a FastPanel site's web root via SSH. Uses rsync or scp, normalizes permissions for web serving. Supports dry-run preview and delete mirroring.
Instructions
Upload a local file or directory from THIS machine into a site's web root, over SSH (rsync, scp fallback). Resolves the site's index_dir + owner via site_get, transfers with your own ssh key (bytes never pass through the model), then chowns to the site's system user AND normalises perms on the destination subtree to FastPanel's web defaults (dirs 755, files 644) so nginx/PHP-FPM can serve it (local file modes are not relied on). rsync TRAILING-SLASH semantics: local_path 'build/' uploads the CONTENTS of build into the destination; 'build' (no slash) uploads the build dir itself, creating /build. dest_subpath is relative to the web root (omit to target the root). delete:true mirrors the source (rsync --delete removes remote files absent locally) — needs rsync, gated behind confirm. WRITE — set dry_run:true to preview, confirm:true to execute. Requires SSH configured (FASTPANEL_SSH_HOST).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| delete | No | rsync --delete: make the remote an exact mirror of local_path, removing remote-only files. Destructive. | |
| confirm | No | ||
| dry_run | No | ||
| site_id | Yes | Site id from sites_list | |
| local_path | Yes | Path on THIS machine to a file or directory. Trailing slash on a dir uploads its contents. | |
| dest_subpath | No | Destination relative to the site web root (e.g. 'public' or 'wp-content/uploads'). Omit for the web root itself. |