Skip to content

Commit

Permalink
Primary cmd help message.
Browse files Browse the repository at this point in the history
  • Loading branch information
Otávio Fernandes committed Mar 30, 2019
1 parent 646b766 commit a80f7d5
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions cmd/vault-handler/vault_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,46 @@ import (

var rootCmd = &cobra.Command{
Use: "vault-handler",
Short: "",
Long: ``,
Short: "Hashicorp-Vault companion, to upload/download contents from Vault based on a manifest.",
Long: `
#
# vault-handler
#
Hashicorp-Vault companion to upload and download secrets. It can be used as a Kubernetes
init-container or a command-line application, where you can define manifest files to define how
secrets are placed in Vault, corresponding how secret-files are organized in the file-system.
## Environment Variables
Command-line arguments can be expressed inline, or by exporting environment variables. For
example, the argument "--vault-addr" becomes "VAULT_HANDLER_VAULT_ADDR" in environment. Note the
prefix "VAULT_HANDLER_" in front of the actual argument value, also the capitalization and
replacement of dashes ("-") by underscores ("_").
## Manifest Files
YAML based manifest files are the last argument in "vault-handler" command-line. They represent the
layout of files in the file-system, and will drive the reflection of this data in Vault. Please
consider the GitHub project page for manifest documentation:
https://github.com/otaviof/vault-handler
## Example
First you may want to export configuration in the environment:
$ export VAULT_HANDLER_VAULT_ADDR="http://127.0.0.1:8200"
$ export VAULT_HANDLER_VAULT_ROLE_ID="role-id"
$ export VAULT_HANDLER_VAULT_SECRET_ID="secret-id"
And later call "vault-handler" with additional arguments, and the manifest files:
$ vault-handler upload --input-dir /var/tmp --dry-run /path/to/manifest.yaml
$ vault-handler download --output-dir /tmp --dry-run /path/to/manifest.yaml
## Command-Line
`,
}

// configFromEnv creates a configuration object using Viper, which brings overwritten values from
Expand Down

0 comments on commit a80f7d5

Please sign in to comment.