Skip to content

v2.7.2

Latest

Choose a tag to compare

@github-actions github-actions released this 24 Nov 04:39

Feature Update with Graft 🚀

V2.7.2: Passphrase-Protected SSH Keys

  1. Passphrase Keys Work: Registering a server with a passphrase-protected private key made every command that connected to it fail with unable to parse private key: ssh: this private key is passphrase protected. Graft now asks for the passphrase when a command needs the key.
  2. Asked Once Per Command: The passphrase is kept in memory only until the command finishes and is never saved to disk. A command that opens several connections, reconnects after a network drop, or runs rsync and ssh (graft sync, graft pull, graft -sh) asks only once. Graft passes the passphrase to its own ssh and rsync, and only answers ssh's passphrase prompt, so it is never sent to a server as a password. Three wrong tries end the command.
  3. Checked When You Add It: graft registry add and graft init now check the key as soon as you enter its path and ask for the passphrase to confirm it unlocks the key. A key that cannot be used, or a wrong passphrase, is caught there instead of on your first deploy.
  4. No Hang on Closed Input: If input runs out at the key path prompt, for example from a script, Graft now stops with no key path entered instead of asking again forever.

V2.7.1: SSH Key Rollout Fixes

  1. Key Rollout Works Again: graft pub rollout failed on every server with Process exited with status 1. The old key was matched with a sed pattern, and the / characters found in almost every key broke it. Keys are now matched as plain text, and a failure shows the server's own error message.
  2. No More Lockouts: The rollout is now all-or-nothing. The new key is added next to the old one on every server and checked with a real login using it. If any server fails, the new key is removed from every server and your current key stays in use. Before, the new key was saved locally even when servers had failed, which could leave you with a key those servers did not accept.
  3. Old Key Revoked Last: Only after every server accepts the new key is it saved locally and the old key removed from the servers. Removal refuses to run unless the new key is in place, and authorized_keys is edited in place so its owner, mode and SELinux label stay the same.
  4. Read-Only Key Files: Saving the new key no longer fails with Access is denied when graftpem has been made read-only for OpenSSH on Windows. Keys are written to a temporary file and swapped in, and on Windows the private key is restricted to your account so OpenSSH accepts it.

V2.7 Highlights: Database Backups

  1. Database Backups: graft db <name> backup set configures pg_dump backups of a single database to Cloudflare R2, AWS S3 or any S3-compatible bucket, on a schedule you choose (time zone, first run time, every 1-24 hours that divide the day). Each run checks the dump, uploads it, confirms the size in the bucket and then prunes backups older than your retention (7 days by default).
  2. Backup Menu: graft db <name> backup list shows every backup with a short id, the date and time in your local zone, age, size, a latest marker and whether it has been restore-tested. test, restore and download use the same menu; press Enter for the latest.
  3. Verified Restore: backup test restores a backup into an isolated throwaway database and runs seven logged checks (download size, archive signature, strict restore, schema, row counts against the live database, freshness, index health), then deletes it. backup restore always runs those checks first, takes a safety backup of the current data, restores in a single all-or-nothing transaction and asks you to type the database name.
  4. Download Links and Prune by Id: backup download [-expires 24h] prints a temporary signed link (up to 7 days) to fetch a backup straight from R2/S3. backup prune removes backups past the retention period; backup prune <id> keeps only that restore-tested backup and deletes every other one, however recent. A regular prune removes it too once it passes the retention period.
  5. Telegram Alerts: backup alert connects a Telegram bot and finds your chat id. You are alerted when a scheduled backup fails, when no backup has succeeded for more than two intervals, and when a restore or prune <id> runs. backup log shows the full log of every step.
  6. Safer Infra Backup: graft infra db backup now fails when the dump fails instead of uploading an empty file, checks the gzip and cleans up its temporary files.

V2.0 - V2.6 Highlights:

Deploying and managing projects

  1. Rollback: Revert to previous deployments with graft rollback or graft rollback service <name>.
  2. Multi Environment Support: Manage multiple deployment environments with separate configs, workflows and DNS. graft env ls lists all environments with their registry, domain and deployment mode.
  3. Service Scaling: Scale any service to N replicas with graft scale <service> <n> — Traefik automatically load balances across them. Scale persists through deploys.
  4. Git Remote Modes and Automated GitHub Workflows: Deploy through GitHub Workflows and CI/CD channels, with workflows generated from graft-compose.yml.
  5. Graft-Hook and Webhook Mapping: A webhook service for Graft-based servers, and mapping of webhook domains to servers.
  6. Cloudflare Integration: Automated DNS zone mapping and zone management.
  7. Docker Passthrough Commands: Execute docker commands on remote hosts or specific registries via Graft.
  8. Default SSH Key and Default Registry: Manage SSH keys with graft pub and rotate with graft pub rollout. graft -default <name> marks a registry as the fallback for work outside a project: when a command has no -r, no -p and no project in the current directory, Graft runs exactly what graft -r <default> <command> would have run, and says which registry it picked. graft -default on its own reports the current one, graft registry ls marks it, and deleting that registry clears it. init, pub, projects and registry already work without a project and are never redirected.

Databases

  1. Isolated DB Credentials (Security): graft db <name> init creates a dedicated Postgres user and password per database. Each project gets scoped credentials — admin credentials never leak to project secrets.
  2. Per-Environment Database Linking and Unified Init: The database name is stored per environment in project metadata, and graft psql auto-connects to the right database for the current env. Initialize databases from project scope (graft db), host scope (graft host db) or registry scope (graft -r <registry> db); all paths prompt to link to an environment with overwrite protection.
  3. PSQL Passthrough: Full psql passthrough with env-aware auto-connect. Supports all native psql flags (-c, -f, -t, etc.).

Tunnels

  1. SSH Database Tunnel: graft db <name> serve [:port] tunnels remote Postgres to localhost via SSH — connect with pgAdmin, DBeaver or your local app. No public port exposure needed.
  2. Service and Port Tunneling: graft host tunnel <container> [-port <remote>:<local>] and graft -r <reg> tunnel <container> -port <serverport>:<localport> tunnel any Docker container or port to localhost, auto-detecting exposed ports when -port is omitted. Works with any protocol — HTTP, Postgres, Redis, gRPC. Breaking: the port flag is -port (or --port), not -p, because -p is the global project flag. Old -p port arguments are no longer recognized and fall back to auto-detection, so update any scripts that used -p. The tunnel reference is now in documentations/COMMANDS.md.

Security and reliability

  1. Dependency Security Update: Upgraded golang.org/x/crypto to v0.57.0, resolving GitHub Dependabot alerts in the SSH package (auth bypass via unenforced revocation, permission enforcement bypass, deadlocks, DoS and panics).
  2. SSH Connection Reliability: Multiple concurrent sessions and tunnels no longer hang. Every network step is bounded by a timeout — the liveness probe, the SSH handshake and authentication, channel opens and the SFTP subsystem — so a half-dead connection (wifi blip, NAT idle drop, roaming) fails fast and self-heals instead of blocking forever. The SFTP subsystem starts only when a command transfers files, and tunnels no longer probe liveness before each forwarded connection.
  3. known_hosts Correctness (Security): Hosts on non-default ports are recorded in the format the lookup uses, so repeat connections stop appending duplicate entries. An unreadable known_hosts is now reported instead of silently skipping host key verification.
  4. Bug Fixes and Improvements

Changelog

  • e7e9a59 Bump version to v2.7.2 and add passphrase key release notes
  • bb356c5 Support passphrase-protected SSH keys

Released by skssmd using GoReleaser.