Coder Social home page Coder Social logo

borg-central's Introduction

Remote Borg

Lets you setup a local repo and pulls data from a configured machine.

Mysql & MariaDB & MongoDB & Postgres

Dumps databases inside docker containers from the main mariadb, mysql, postgres and mongodb repos on dockerhub

Usage

Set the environment variable to the names of the database containers, you would like to backup

    environment:
      - mysql_db_containers="container0 container1 container2"
      - mongo_db_containers="container3 container4 container5"
      - postgres_db_containers="container8 container7 container6"

If you don't want to backup mysql containers, leave it blank

    environment:
      - mysql_db_containers=
      - mongo_db_containers=
      - postgres_db_containers=

Usage

At the target machine, that you want to backup, create a user account that is accessible via ssh with the 'private.key' file, that you mount to the container. For database backups add this user to the docker group:

useradd -m borg -s /bin/sh
mkdir -p /home/borg/.ssh
ssh-keygen -t ed25519 -f /home/borg/.ssh/private.key
mv /home/borg/.ssh/private.key.pub /home/borg/.ssh/authorized_keys
usermod -aG docker borg
# default sshd config disallows users without password
passwd borg

The target machine's address and SSH port must be configured as environment variables

    environment:
      - remote_user=borg
      - remote_port=22
      - remote_host=machine.lan

The container's address:port must be reachable from the target machine, and known to the container via environment variables:

    environment:
      - port=222
      - host=backup_server.lan

The paths that should be backuped are configured like so:

    environment:
      - backup_paths ="/etc /var/porn /srv/leaks"

If you don't want to backup any paths, leave it blank

    environment:
      - backup_paths=

The Borg Passphrase should be set and has a default value.

platforms

automatically detected platforms are x86_64 & armv6/7/8

FAQ

Why is it so noisy?

It's easier to debug and modify this way.

Why is it creating weird usernames?

Everytime the service logs into another machine, an individiual user account with dedicated private key is generated and deleted immediately afterwards, to connect back to the container and central backup machine. I don't consider this a security measure, but it felt weird and a fun t hing to do.

borg-central's People

Contributors

printfuck avatar

Watchers

James Cloos avatar  avatar

Forkers

etherneet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.