Skip to content

dpliakos/dekonf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lightblue gopher dressed as medieval librarian

dekonf

The keeper of software lore, aids thee in taming the ever-shifting winds of secrets arrangement






Description

Problem

I usually am in a situation where I have to deal with multiple versions of configuration files with secrets (e.g. .env or appsettings.development.json) when I develop or debug an application. To solve this problem I usually use comments when the configuration file format supports it or I hold multiple copies in another place.

Solution

This tool enables the developer to store multiple versions of a configuration file. It is designed to be used during development (and debuging). The different versions of the configuration file are stored under a .dekonf directory at the project root. dekonf replaces the configuration file that the project is using with one that is stored under .dekonf when you want to use it.

Typical use case

  1. You already have a project with a configuration file. Let's say .env
  2. Initialize a dekonf project dekonf init --config .env
  3. Now you want to test your project with different, but temporary, configuration (e.g. to use another backend server or email service)
  4. You create a different dekonf environment dekonf use -n staging-server or dekonf use -n staging-services etc
  5. You do you and your testing was finished, so you want to return to the development settings
  6. You change back to original environment dekonf use default (note that the env default is created with the dekonf init command)

Installation

Build from source

  • go get
  • make build
  • make install - requires sudo
  • Use it as a cli tool dekonf --version

Build using docker

  • docker build -t dekonf .
  • Use it as container docker run --rm -v "$PWD":/root/projectRoot dekonf dekonf --version

Usage

Create a project

dekonf init

Fill the path your project configuration file

See the available environments

dekonf ls

Create and use an environment

dekonf use -n test01

Change environment

dekonf use default

Commit your changes to the current env

dekonf commit

Restore the changes from a stored version to the current env

dekonf restore

Reference

Manages different versions of a configuration file

Usage:
  dekonf [command]

Available Commands:
  commit      Stores the current config file
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  init        Initializes a dekonf environment
  ls          List the available environments
  restore     Restores the current configuration file with the copy that is saved in the .dekonf dir
  use         Selects or creates an environment

Flags:
  -d, --debug     Prints debug messages
  -h, --help      help for dekonf
  -v, --version   version for dekonf

About

A cli tool that manages your config files

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages