coolrestore CLI by Replworks
Infrastructure Recovery CLI | Preview-first & Atomic

Restore Coolify storage safely after an incident.

Preview changes before touching the disk. Apply only with explicit confirmation. Built for S3-compatible storage with isolated staging, traversal rejection, and atomic replace rollback.

$ brew install --cask replworks/tap/coolrestore

Available via Homebrew, APT, statically linked binaries, or Go.

Plan-First
Default runs never touch disk
Atomic
Filesystem rename & rollback
S3 Native
RustFS, MinIO, AWS S3 compatible
0 Leaks
Zero credential exposure in logs
Live Demonstration

Predictable, transparent operations

Inspect outputs before executing changes. Every step produces deterministic status codes and structured output.

coolrestore-terminal ~ v1.0.0

# Preview a restore from S3. By default, no target files are created or modified.

$ coolrestore --env-file ./coolrestore.env --source s3://coolify-backups/storage/2026-09-26.tar.gz --target /var/lib/coolify/storage
source: s3://coolify-backups/storage/2026-09-26.tar.gz
target: /var/lib/coolify/storage
mode: merge
outcome: planned
regular_files: 2
added:
+ uploads/avatar.png
overwritten:
~ config/app.php

Notice: Target directory remains untouched. Use --confirm to apply this plan.

Security Architecture

Engineered for worst-case resilience

Storage recovery is typically executed during high-stress incidents. coolrestore is built with strict defensive constraints to eliminate human error and corrupted archive propagation.

Safe by Default (Preview Plan)

Without the explicit --confirm flag, coolrestore never touches or creates target files. It calculates differences, validates safety, and prints a precise dry-run plan.

Atomic Replace Rollback

In replace mode, the staging directory is switched atomically via filesystem renames. If anything fails mid-switch, prior state is restored without leaving partial changes.

Target Concurrency Lock

A robust target lock prevents simultaneous restore operations on the same directory. Any concurrent attempt is aborted immediately to avoid race conditions and corruption.

Strict Traversal Rejection

Archives containing ../ path traversal, escaping symlinks, hard links, or disallowed file types are rejected completely before any target modification.

Zero Credential Leakage

Secrets are passed exclusively via standard environment variables or explicit --env-file. Command-line flags and output logs never expose credentials or secret tokens.

Pre-Flight Disk Space Check

Before mutation begins, available disk capacity is verified against uncompressed archive sizes plus staging artifacts. Inadequate space aborts the execution cleanly.

Execution Pipeline

How coolrestore handles your archive

Unlike traditional tar extract commands that run directly into destination folders, coolrestore routes all operations through isolated staging, integrity verification, and atomic state switching.

1

Acquisition & Isolation

Downloads from S3-compatible endpoints (or local path) into an isolated staging area on the target filesystem.

2

Strict Integrity & Security Scan

Verifies gzip integrity, calculates file sizes, checks against path traversal attacks, and validates entry boundaries.

3

Target Lock & Space Reservation

Acquires an exclusive lock on the target directory and checks filesystem capacity before proceeding.

4

Plan Preview or Atomic Application

Outputs diff report by default. If confirmed, commits changes via Merge or atomic Replace with instant rollback safety.

Choose Your Restore Mode

Mode: merge (Default) Additive

Adds missing files and updates existing files from the archive. Any files already in the target that are not in the archive are completely preserved.

coolrestore --source s3://... --target /path --confirm
Mode: replace Exact Match + Rollback

Target becomes an exact replica of the archive. Utilizes atomic filesystem renames on the same filesystem. In case of disruption, rolls back to prior state automatically.

coolrestore --source s3://... --target /path --mode replace --confirm

Ecosystem & Storage Compatibility

Works seamlessly with your infrastructure stack

Coolify Volumes
RustFS
AWS S3
MinIO
Cloudflare R2
Local Tarballs (.tar.gz)
Distribution

Get coolrestore on your server

Static, zero-dependency binaries ready for production servers and local workstations.

Install directly via one-liner or add the official Replworks tap (macOS & Linux):

# One-liner install (auto-taps repository)
$ brew install --cask replworks/tap/coolrestore
# Or add tap first, then install
$ brew tap replworks/tap
$ brew install --cask coolrestore

Environment File Setup (.env)

coolrestore explicitly avoids auto-discovering dotenv files from cwd for security. Pass your config file securely with --env-file:

AWS_ACCESS_KEY_ID=your-key-id
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_REGION=us-east-1
AWS_ENDPOINT_URL=https://rustfs.your-domain.com
AWS_S3_FORCE_PATH_STYLE=true
CLI Reference

Commands & Options

All command-line arguments and flags supported by coolrestore.

Flag / Command Type Description
coolrestore (default) command Executes restore operation (defaults to safe dry-run plan without --confirm).
coolrestore diagnose command Read-only check for S3 reachability, permissions, or local file readability without downloading body.
coolrestore list command Lists all .tar.gz archive objects under a trailing-slash S3 prefix with timestamps and sizes.
--source <URI|PATH> string (required) S3 URI (s3://bucket/key.tar.gz) or absolute local file path. Prefix ends in /.
--target <DIR> string (required*) Absolute directory where archive contents will be restored (*not required for diagnose/list).
--mode <merge|replace> string (default: merge) merge adds/overwrites and retains existing files; replace makes target identical to archive.
--confirm boolean Explicit authorization to write changes to disk. Required for actual mutation and replace mode.
--latest boolean Selects newest .tar.gz object under a trailing-slash S3 prefix by last-modified timestamp.
--env-file <PATH> string Explicit path to secure dotenv file containing AWS/S3 access credentials and endpoint configuration.
--staging <DIR> string Custom base directory for isolated archive extraction (must share filesystem with target for replace mode).

Frequently Asked Questions

Does running coolrestore modify my server immediately?

No. By default, coolrestore runs in preview-only mode. It downloads to an isolated staging area, verifies archive health, calculates what would be added or overwritten, and outputs a plan. It will never write to your target directory without --confirm.

How does atomic replace rollback protect my storage?

In replace mode, staging and target must reside on the same filesystem. The swap is executed through atomic directory renames. If any failure occurs during the switch, the previous state is restored immediately, avoiding partially overwritten volumes.

Can I restore non-Coolify backup archives?

Yes. Any standard gzip-compressed tar archive (.tar.gz) residing in S3-compatible storage or on a local disk can be restored into any valid target directory.