GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Cimpress-MCP/fsconsul: Write Consul K/Vs to the filesystem

BranchesTags
Open more actions menu

Latest commit

 

History

136 Commits
136 Commits

Folders and files

NameName
Last commit message
Last commit date
test_data
test_data
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
main.go
main.go
 
 
readme.md
readme.md
 
 
template_functions.go
template_functions.go
 
 
watch.go
watch.go
 
 
watch_test.go
watch_test.go
 
 

Repository files navigation

fsconsul

fsconsul writes data to the filesystem by reading it from Consul's K/V store.

fsconsul allows configuration data to be placed on disk without a consuming application needing to know about the existence of Consul. This makes it especially easy to configure applications throughout all your environments: development, testing, production, etc. On any change, fsconsul will run the provided command, so you can perform any additional actions (restarting your application, for example) necessary.

fsconsul is a port of envconsul which in turn was inspired by envdir in its simplicity, name, and function.

Download & Usage

To install fsconsul, clone this repo into your go workspace and do a go install.

Configuration

fsconsul can be configured entirely by command-line switches, but for more complex cases, you may wish to provide the path to a config JSON file as the -configFile switch. The format of the JSON file is:

{
	"consul" : {
		"addr": "127.0.0.1:8500"
		"dc": "dc1",
		"token" : "my-reader-token"
	},
	"mappings" : [{
		"onchange": "service restart app1",
		"prefix": "/myteam/dev/app1/config/",
		"path": "/etc/app1/",
		"keystore": "/var/lib/encryption_keys"
	},{
		"onchange": "service restart app2",
		"prefix": "/myteam/dev/app2/config/",
		"path": "/etc/app2/",
		"keystore": "/var/app2/encryption_keys"
	}]
}

Run fsconsul to see the usage help:


$ fsconsul
Usage: fsconsul [options] prefix path onchange

  Write files to the specified locations on the local system by reading K/Vs
  from Consul's K/V store with the given prefixes and executing a program on
  any change.  Prefixes and paths must be pipe-delimited if provided as
  command-line switches.

Options:

  -addr="": consul HTTP API address with port
  -configFile="": json file containing all configuration (if this is provided, all other config is ignored)
  -dc="": consul datacenter, uses local if blank
  -keystore="": directory of keys used for decryption
  -once=false: run once and exit
  -token="": token to use for ACL access

CI

Builds are automatically run by Travis on any push or pull request.

Travis Status

Builds

Tagged builds are automatically published to bintray for OS X, Linux, and Windows.

Download

About

Write Consul K/Vs to the filesystem

Resources

Readme
License
Activity
Custom properties

Stars

91 stars

Watchers

14 watching

Forks

16 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.