Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.
/ sss-backup Public archive

Make your automatics backup easier with sss-backup πŸš€ !

Notifications You must be signed in to change notification settings

rharkor/sss-backup

Repository files navigation

sss-backup πŸ›‘οΈ

sss-backup logo

πŸš€ Getting Started

Welcome to sss-backup, your go-to tool for automated file backup to an S3 bucket! πŸ“¦

πŸ‘‰ Note: This tool is optimized for Unix systems and hasn't been tested on Windows.

πŸ” Encryption with GPG

Keep your backups secure with GPG encryption. Here's how to set it up:

  1. Generate a Key Pair:

    gpg --full-generate-key
  2. List Your Keys:

    gpg --list-secret-keys --keyid-format LONG

    Look for the line starting with sec to find your KeyID.

  3. Export Your Public Key:

    gpg --armor --export <key-id>

    You can save this to a file or share it directly.

  4. Import Someone Else's Public Key (not required in backup process):

    gpg --import /path/to/recipientkey.asc

    Optionally, fully trust the imported key if you're confident in its authenticity:

    gpg --edit-key <RecipientKeyID>

    In GPG console, type trust, select trust level, and then quit.

πŸƒ Running sss-backup

  1. Set Up:

    wget -q https://raw.githubusercontent.com/rharkor/sss-backup/main/docker-compose.yml -O docker-compose.yml && wget -q https://raw.githubusercontent.com/rharkor/sss-backup/main/.env.example -O .env && wget -q https://raw.githubusercontent.com/rharkor/sss-backup/main/bkp-config.json -O bkp-config.json

    Modify .env and bkp-config.json as needed.

  2. Run the Container:

    πŸ”„ With Cron:

    docker compose pull
    docker compose up -d

    πŸš€ One Time:

    docker pull rg.fr-par.scw.cloud/sss-backup/sss-backup:latest
    docker run --rm -v $(pwd)/bkp-config.json:/usr/src/app/bkp-config.json:ro -v $(pwd)/.env:/usr/src/app/.env:ro -v /:/backup:ro -v $(pwd)/.tmp:/usr/src/app/.tmp:rw -it -e HOST_ROOT='/backup' --env-file .env rg.fr-par.scw.cloud/sss-backup/sss-backup:latest

πŸ“¦ Use a backup

  1. First download the backup from your S3 bucket.
  2. Decrypt
    gpg --output backup.tar.gz --decrypt backup.tar.gz.gpg
  3. Extract
     tar -xvzf backup.tar.gz

πŸ’» Development

πŸ‘¨β€πŸ’» To Contribute:

  1. Install Dependencies:

    npm install
  2. Run Locally:

    npm run index.ts
  3. Build and Push Docker Image:

    docker build -t rg.fr-par.scw.cloud/sss-backup/sss-backup:latest .
    docker push rg.fr-par.scw.cloud/sss-backup/sss-backup:latest

Happy backing up with sss-backup! πŸ’Ύ πŸŽ‰

Known issues

This error occurs in the uploading step on large files:

      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
at **node_internal_captureLargerStackTrace (node:internal/errors:563:5)
at **node_internal_errnoException (node:internal/errors:690:12)
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
Emitted 'error' event on TLSSocket instance at:
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}

Node.js v20.11.0

No solution found yet