Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/elek/envtoconf

Utility for docker container to generate config files from environment variables
https://github.com/elek/envtoconf

Last synced: 2 days ago
JSON representation

Utility for docker container to generate config files from environment variables

Awesome Lists containing this project

README

        

Simple go application to generate config files from environment varialbles (key value pairs) based on specific naming convention. Used in docker container to generate the configuration files based on the environment variables.

The environment should be in form:

```
FILENAME.EXT_any.key=value
```

The name of the file (with extension) will be converted to lowercase.

The extracted key value pairs will be transformed to other formats based on the extension.

Supported formats/extensions:

* xml: hadoop xml format
* env, cfg: `key=value` format
* conf, sh: `export key=value` format
* yaml, yml: YAML format. Arrays supported with indexes as `key.value.1: 1` and `key.value.2: 2`
* properties: `key: properties`
* ini: `section.key=value` format converted to:
```
[section]
key=value
```

Optional, the extension and the format could be different with the syntax:

```
FILENAME.EXT!FORMAT_any.key=value
```

With this syntax any filename with extension could be configured with a predefined format.