Metadata-Version: 2.1
Name: dkp
Version: 0.2.0
Summary: DocKer compose Packer
License: MIT
Author: Aleksandr Baryshnikov
Author-email: owner@reddec.net
Requires-Python: >=3.8
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/markdown

# DKP - DocKer compose Packer

[![PyPI - Version](https://img.shields.io/pypi/v/dkp)](https://pypi.org/project/dkp/)

Packs existent docker-compose project in executable single encrypted (GPG
AES256) archive (tar + gz). It means, that you don't need to install DKP or
remember procedure details during restore which dramatically reduces stress and
make your life simpler. In the end - it's hard to remember how to restore backup
made by N generations of administrators years ago before you...

The pipeline is:

```mermaid
flowchart TD
    A[tar volumes] -->B(tar images)
    B --> C[add env files and manifests]
    C --> D[add restore scripts]
    D --> E[compress and encrypt]
    E --> F[wrap to self-extracting file]
```

For backup you need:

- gpg
- python 3.8+ (see tests in workflow)
- sh
- tar
- gzip
- docker with compose plugin

For restore you need:

- gpg
- sed
- tar
- gzip

## Installation

**Recomended**

    pip install dkp

Alternative - just download [dkp/dkp.py](dkp/dkp.py) and make it executable.

## Backward compatibility

Once backup created, the version of DKP doesn't matter anymore since archive is
self-complete independent file.

New DKP versions may introduce more features as well as different layout of
final archive, but it will not affect previous backups.

## Usage

### Create backup

```
usage: dkp [-h] [--output OUTPUT] [--skip-images] [--passphrase PASSPHRASE] [project]

DocKer compose Packer - backup compose project with all batteries included

positional arguments:
  project               Compose project name. Default is docker-compose-pack

options:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        Output file. Default docker-compose-pack.bin
  --skip-images, -S     Do not archive images
  --passphrase PASSPHRASE, -p PASSPHRASE
                        Passphrase to encrypt backup. Can be set via env PASSPHRASE
```

### Restore

```
Usage:

./path/to/backup/file [--restore/-r] [-s/--start] [-h/--help] [passphrase]

   passphrase      Key to decrypt archive. Can be set by env PASSPHRASE

  -h, --help       Show this help
  -r, --restore    Automatically restore project after unpacking
  -s, --start      Automatically start project after unpacking. Implicitly enables --restore
```

