Git Product home page Git Product logo

consul-kv-backup's Introduction

kv-backup

Backup Consul's KV Store with TLS and HTTP Basic auth support

I couldn't find a Consul KV backup/restore tool that supported all of the TLS/auth options I needed out of the box. Here's the beginnings of one in go.

This doesn't have Consul ACL support at the moment, feel free to add it!

NAME:
   kv-backup - Back up Consul's KV store

USAGE:
   kv-backup [global options] command [command options] [arguments...]

VERSION:
   0.1

COMMANDS:
   backup	Dump Consul's KV database to a JSON file
   restore	restore a JSON backup of Consul's KV store
   help, h	Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --cacert, -r 		Client CA cert [$CONSUL_CA_CERT]
   --prefix "/"			Root key prefix [$CONSUL_PREFIX]
   --cert, -c 			Client cert [$CONSUL_CERT]
   --key, -k 			Client key [$CONSUL_KEY]
   --addr, -a "127.0.0.1"	Consul address (No leading 'http(s)://') [$CONSUL_HTTP_ADDR]
   --scheme, -s "http"		Consul connection scheme (HTTP or HTTPS) [$CONSUL_SCHEME]
   --port, -p "8500"		Consul port [$CONSUL_PORT]
   --insecure, -i		Skip TLS host verification [$CONSUL_INSECURE]
   --username, --un 		HTTP Basic auth user [$CONSUL_USER]
   --password, --pw 		HTTP Basic auth password [$CONSUL_PASS]
   --help, -h			show help
   --version, -v		print the version

For TLS connections, kv-backup will load the system root CAs on most mainstream Linux distros. If --cacert is defined, this CA will be added to the list of root CAs.

NAME:
   backup - Dump Consul's KV database to a JSON file

USAGE:
   command backup [command options] [arguments...]

OPTIONS:
   --outfile, -o 	Write output to a file [$CONSUL_OUTPUT]

Skipping the -o flag on backup will pretty-print the json to stdout

NAME:
   restore - restore a JSON backup of Consul's KV store

USAGE:
   command restore [arguments...]

To restore, pass the name of a backup file (no stdin support yet)

consul-kv-backup's People

Contributors

colebrumley avatar jrcs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

consul-kv-backup's Issues

Unable to build

Trying to build with
go build consul_kv_backup.go on MacOS
Getting :

consul_kv_backup.go:15:2: cannot find package "github.com/hashicorp/consul/api" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/hashicorp/consul/api (from $GOROOT)
/Users/anton/go/src/github.com/hashicorp/consul/api (from $GOPATH)
consul_kv_backup.go:16:2: cannot find package "gopkg.in/urfave/cli.v1" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/gopkg.in/urfave/cli.v1 (from $GOROOT)
/Users/anton/go/src/gopkg.in/urfave/cli.v1 (from $GOPATH)

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.