Skip to content

Releases

v1.0.0

Choose a tag to compare

@austinginder austinginder released this 05 Sep 20:50

Overview

CaptainCore CLI 1.0 runs on SQLite and no longer needs an embedded WordPress. Through 0.13 the CLI kept every site, environment, account and provider record inside a private local WordPress install and reached them by shelling out to WP-CLI and a folder of PHP scripts, so standing up the CLI meant standing up PHP, WP-CLI and a throwaway WordPress site first. Version 1.0 stores all of that in a local SQLite database at ~/.captaincore/data/captaincore.db (GORM on the pure-Go glebarez/sqlite driver, so no cgo and no system SQLite), reads its settings through a native Go config package, and talks to the CaptainCore Manager over a plain Go HTTP client. The CaptainCore Manager plugin remains the source of truth the CLI syncs from; what went away is the local WordPress underneath the CLI.

Installation is now one static binary. curl -fsSL https://raw.githubusercontent.com/CaptainCore/captaincore/master/install.sh | bash puts it in place, captaincore connect points it at your Manager with a WordPress application password and pulls down every site, environment, account, domain and provider, and captaincore upgrade keeps it current from GitHub releases. The bash and remote scripts the CLI still uses at runtime ship embedded in the binary and unpack themselves on first run.

Along the way the CLI grew a full restic operations toolkit, fleet-wide version drift reporting, a git-backed quicksave malware scanner, long-term log archival, and 38 new remote scripts, most of them security detection.

Breaking Changes

  • The private local WordPress install and WP-CLI are no longer read or supported. Data lives in ~/.captaincore/data/captaincore.db. Existing installs must run captaincore connect (or the one-time captaincore migrate wp-to-sqlite) before any data command works. Commands that need data exit with Error: Database not available. Run 'captaincore connect'.
  • captaincore monitor <site|target> is now captaincore monitor run <site|target>, and captaincore capture <site|target> is now captaincore capture generate <site|target>. Update cron entries.
  • fetch-site-data emits key:value pairs instead of positional lines. Anything parsing the old output breaks.
  • Backups now include WordPress core files. Every core-file exclusion (wp-admin/, wp-includes/, index.php, wp-login.php, xmlrpc.php and friends) was removed from lib/excludes and lib/restic-excludes. Expect larger first backups after upgrading.
  • 45 of the 51 PHP scripts in lib/local-scripts/ were deleted and 57 files were removed from app/ (the dns/, key/, cli/, get/ and utils/ trees, monitor, copy, configs, scan-errors, regenerate-thumbnails, manifest-generate and the *-generate / *-list variants). Custom automation that called those files by path will break; the replacements are Cobra commands.
  • The configs.php config layer is retired. config.json is read and written by Go and rewritten with mode 0600. Bash callers use captaincore config fetch instead.
  • On a binary install the CLI owns ~/.captaincore/app and ~/.captaincore/lib and rewrites them whenever the binary version changes (stamped in .assets-version). Local edits there do not survive an upgrade. A git checkout at that path is detected and left alone.
  • backup download takes the payload as --payload=<token> (the third positional argument still works).

New Features

Install, connect, upgrade

  • install.sh. Detects Linux or macOS on x86_64, arm64 or armv7, downloads the release archive and checksums.txt, verifies the sha256 and installs to /usr/local/bin (INSTALL_DIR, CAPTAINCORE_VERSION=vX.Y.Z and --force are supported).
  • captaincore connect [--url=] [--username=] [--password=] [--server-url=] [--skip-ssl]. Authenticates with a WordPress application password against /wp-json/captaincore/v1/cli/connect, upserts sites, environments, accounts, domains, junction rows, providers, configurations and defaults into SQLite, then writes the token, API URL, GUI URL and site list into config.json and the token into data/config.json for captaincore server. --server-url registers this server's public address with the Manager for job dispatch, so pairing both directions is one command and no wp-config constant is required (needs captaincore-manager newer than 1.1.0). A Manager still on plain permalinks is handled by falling back to the ?rest_route= form, and a freshly connected Manager with zero sites counts as connected. A re-run shows an add/update/remove preview and asks before applying, then warns about a missing rclone, restic or git. captaincore connect --sync does the same non-interactively for cron.
  • captaincore upgrade [--check] [--yes] [--force] [--version=vX.Y.Z]. Follows the GitHub releases/latest redirect (no API token), downloads the archive for this OS and CPU, verifies it against the release checksums, sanity-runs the new binary and swaps it in place, with a sudo mv fallback. --check exits 1 when behind. A source checkout is refused unless --force.
  • Embedded runtime scripts. app/ and lib/ ship inside the binary (go:embed) and unpack into ~/.captaincore/ on the first run of each version. config.json and data/ are never touched.
  • Release builds for Linux and macOS on x86_64, arm64 and armv7 (CGO_ENABLED=0, static), with stable asset names under releases/latest/download/.
  • captaincore migrate wp-to-sqlite [<site-id>...]. One-time backfill from a Manager for pre-1.0 installs.

Local data layer

  • SQLite with GORM. Fourteen auto-migrated tables (captaincore_sites, _environments, _accounts, _domains, _account_site, _account_domain, _account_user, _captures, _snapshots, _keys, _configurations, _recipes, _connections, _providers), plus data/monitor_stats.db for monitor runs. Both database files are chmod 0600. Tuned for parallel bulk runs: WAL journal, busy_timeout=30000, synchronous=NORMAL, one pooled connection so writes queue instead of racing, and a WAL checkpoint after bulk runs.
  • Native Go API client (apiclient/) for every Manager call.
  • captaincore config fetch [<section>] [<key>], config fetch-captain-ids, config from-api [--field=], and captaincore configuration get [--field=] [--bash] / configuration sync. captaincore cron prints the stored scheduled tasks as JSON.
  • captaincore info [--json]. Version, platform, Manager and API URLs, and site, account, environment and domain counts.

Hosting providers

  • Provider framework (providers/) with a registry. Ships Kinsta (api_key, company_id) and GridPane (api_key), each able to list remote sites and enrich a site with SSH user, host, port, password, home directory, home URL, WordPress version and monthly visits.
  • captaincore provider add <name> <slug> --credentials='[{"name":"api_key","value":"..."}]', provider list, provider update <id> [--credentials=] [--status=], provider delete <id>, provider sync, provider remote-sites <id>, provider import <id> [--site-ids=] [--account-id=] [--update-extras].
  • captaincore connection add <domain> <domain-token> <captaincore-token> and connection list for CaptainCore-to-CaptainCore links.
  • captaincore site ssh-refresh <site> pulls fresh SSH credentials from the provider; captaincore ssh-detect <user> <address> <port> and captaincore ssh-verify <conn> probe a connection.

Backups and restic operations (native Go)

  • Direct backup mode is the default. backup generate pipes the vault script plus a temporary secrets payload over SSH and the managed host runs restic straight to B2; the old pull-to-local flow survives only as backup_mode="local". The remote run hands the snapshot list back inline, so backup list-generate and backup verify never run restic locally. Flags: --parallel=3, --skip-db, --skip-remote, --skip-if-recent=24h, --dry-run.
  • Self-healing connections. When rclone cannot reach a site, backup generate regenerates its rclone config, retries, then calls site ssh-refresh to pull fresh SSH credentials from the hosting provider. A broken vault.txt (missing bucket) is detected and its keys regenerated.
  • Repository maintenance: backup check <site> [--init] [--read-data], backup verify <site>, backup snapshots <site> [id] [--sizes] [--format=json], backup repo-info <site> [--stats], backup find <site> <pattern>, backup forget <site> <snapshot-id> [--confirm] [--prune], backup prune <site> [--dry-run] [--repack-uncompressed], backup repair <site> [--packs] [--snapshots] [--forget], backup unlock <site> [--remove-all].
  • Restic v2 migration: backup upgrade <site> and backup migrate-v2 <site> [--force] [--skip-repack] [--skip-cache-cleanup] move repositories to the v2 format with compression.
  • Key safety: backup key-backup <site> [--type=backup|quicksave] and backup key-restore <site> guard against losing the B2 repository key.
  • Housekeeping: backup cleanup <site> [--dry-run] removes local backup/ folders on remote-backup sites; backup storage-cleanup [--confirm] removes orphaned site folders from B2 (dry-run by default); backup show <site> <backup-id> <file-id>, backup runtime <site>, backup fetch-link.
  • Per-site PID locks. backup generate, prune and migrate-v2 take a backup.lock holding the PID (stale locks from dead processes are cleared silently) and pass --retry-lock 30m so concurrent runs wait or skip instead of colliding. Quicksaves use the same quicksave.lock mechanism.

Quicksaves

  • quicksave malware-scan <site|@target> [--full] [--format=json] runs the signature set in lib/malware-signatures.json over the git history; --full runs Wordfence CLI across the whole quicksave directory.
  • **Remote fi...
Read more

v0.13.0

Choose a tag to compare

@austinginder austinginder released this 20 Nov 16:07

Changelog

315decf πŸ› FIX: Backup download
2a5a0fc πŸ› FIX: Captain ID
4198507 πŸ› FIX: Edge case
f9c1274 πŸ› FIX: Monitor cache purge
8d38bcb πŸ› FIX: SSH arguments
ff7fbe3 πŸ› FIX: Staging updates
76de2cb πŸ› FIX: Stat total
82b1372 πŸ› FIX: Stat totals
9924957 πŸ› FIX: Sync data after quicksave
67a95e7 πŸ› FIX: Typo
8dca7bc πŸ› FIX: Upload command
6bc9ef6 πŸ‘Œ IMPROVE: Account sync
1bdf1df πŸ‘Œ IMPROVE: Background jobs
89ad049 πŸ‘Œ IMPROVE: Backup commands
e861610 πŸ‘Œ IMPROVE: Backup list generate
c61c1c5 πŸ‘Œ IMPROVE: Deactivate
77de857 πŸ‘Œ IMPROVE: Fetch token
13e312b πŸ‘Œ IMPROVE: Generate if missing
34cfad9 πŸ‘Œ IMPROVE: Migrate
83b6a59 πŸ‘Œ IMPROVE: Quicksave
b851ddc πŸ‘Œ IMPROVE: Quicksave output
b8da7eb πŸ‘Œ IMPROVE: Quicksave performance
0bd51d6 πŸ‘Œ IMPROVE: Self references
bb6a2c1 πŸ‘Œ IMPROVE: Stat calculation
23926e8 πŸ‘Œ IMPROVE: Theme update
68a61cb πŸ‘Œ IMPROVE: Update script
d84a673 πŸ‘Œ IMPROVE: recipe command
ac666d3 πŸ“¦ NEW: Command backup list-missing
4ddcc04 πŸ“¦ NEW: Debug flag
41027a1 πŸ“¦ NEW: Version flag
433af89 πŸš€ RELEASE: Version 0.13.0

v0.12.0

Choose a tag to compare

@austinginder austinginder released this 04 Jul 04:58

Changelog

40f34e8 πŸ› FIX: Backup command
eeed19e πŸ› FIX: CLI process tracking
9fc5df4 πŸ› FIX: Captain ID
7e93c2a πŸ› FIX: Deploy to production
1f1de09 πŸ› FIX: Deploy to production
daca9da πŸ› FIX: File restore
10aa2d7 πŸ› FIX: File rollback
bb2af74 πŸ› FIX: Prevent backup from running in bulk
5e21369 πŸ› FIX: Quicksave
31d7f44 πŸ› FIX: Show changes
18be521 πŸ› FIX: Stacked site wp-content
60d1ff2 πŸ› FIX: Stats generate
49a6297 πŸ› FIX: Typo
2f5fbc8 πŸ› FIX: Upload with SSH keys
8de9a1f πŸ› FIX: WP Engine support
519e2ca πŸ‘Œ IMPROVE: Adjust bulk
4eee03d πŸ‘Œ IMPROVE: Bulk handling
3c5da3c πŸ‘Œ IMPROVE: Bulk selection
2f11867 πŸ‘Œ IMPROVE: Bulk support
129499a πŸ‘Œ IMPROVE: Bulk targeting
c311d64 πŸ‘Œ IMPROVE: Code format
3d1503f πŸ‘Œ IMPROVE: Compatibility
92f21a4 πŸ‘Œ IMPROVE: Configuration sync
628ddf5 πŸ‘Œ IMPROVE: Database selection
98a10d7 πŸ‘Œ IMPROVE: Deploy to staging with snapshots
151bf23 πŸ‘Œ IMPROVE: File handling
36cd886 πŸ‘Œ IMPROVE: Final snapshot
ec943de πŸ‘Œ IMPROVE: Handle non WordPress sites
8fc8c15 πŸ‘Œ IMPROVE: Improve sync data
9beba7f πŸ‘Œ IMPROVE: Lower cache time
0cf2e6c πŸ‘Œ IMPROVE: Plugin updates
430068f πŸ‘Œ IMPROVE: Prepare
9db1339 πŸ‘Œ IMPROVE: Running processes tracking
4bf23e9 πŸ‘Œ IMPROVE: SSH error handling
18b16c4 πŸ‘Œ IMPROVE: SSH key selection
40f8e7a πŸ‘Œ IMPROVE: SSH script logic
973fa97 πŸ‘Œ IMPROVE: Site add and delete
e2bca53 πŸ‘Œ IMPROVE: Site selection
d19b62c πŸ‘Œ IMPROVE: Site selection
79b5edd πŸ‘Œ IMPROVE: Snapshots and deployments
bd7fcf2 πŸ‘Œ IMPROVE: Support default key
9d22c65 πŸ‘Œ IMPROVE: Tracking commands
8b2e91a πŸ‘Œ IMPROVE: Update command
183483f πŸ“– DOC: Update license
453ab90 πŸ“¦ NEW: Command account delete
23783e7 πŸ“¦ NEW: Command configuration get
2043303 πŸ“¦ NEW: Command configuration-sync
4682977 πŸ“¦ NEW: Fathom tracker.js
825b540 πŸ“¦ NEW: Go CLI
a88453c πŸ“¦ NEW: GoReleaser
b95e310 πŸ“¦ NEW: SSH fail command
e2cdd10 πŸ“¦ NEW: Seperate API for stats
4a4d40d πŸ“¦ NEW: iThemes Security compatibility
9b70e75 πŸš€ RELEASE: Version 0.12.0