Sign inSign up

dyntek/konpile

By dyntek

•Updated over 3 years ago

A Web GUI for rendering configuration files from several types of data file sources.

Image
0

834

dyntek/konpile repository overview

⁠The Konfiguration Compiler

License: MIT GitHub Repo Website

Konpile is a tool for generating configuration files from data files. This is useful for generating large and complex configuration files for network and security devices. Konpile is written in Python and uses the Jinja2⁠ templating language. Konpile can be used as a web service, a Docker container, or a Python script.

⁠Getting Started

⁠Konpile for Web

For your immediate use, a Konpile web service is hosted by The Dyntek Labs⁠ and is made available at https://konpile.dynteklabs.com⁠. The web service will allow you to upload data files and write a template. The template can be rendered and the output will be downloaded. This method will not allow you to use translation files, but will allow you to use multiple data files and explore your variables before rendering.

⁠The Docker Container

Often times, you'd like the peace of mind from processing your configurations on your own infrastructure. The easiest way to get started with Konpile yourself is via the Docker container. Konpile is available as a stateless and portable web service from a Docker⁠ image. Install Docker from here⁠ and then pull and start the container:

docker pull dyntek/konpile
docker run -d -p 80:80 dyntek/konpile

In this example, the web service will be available at http://localhost:80⁠ as well as any other IP address that is available to your Docker host.

⁠Overview of Schemas

⁠Data Files

You may use JSON, CSV, and Excel files to provide data to Konpile. When JSON is used, the data is pulled directly from the JSON file and is made available in the same format as the JSON file.

When CSV is used, the data is pulled from the CSV file into a list of key-value pairs. The first row of the CSV file, the header, defines variable names for the template.

When Excel is used, data is pulled from the Excel file sheet by sheet. Like with CSV, the first row of each sheet is used as the variable names to be passed along to the template. However, unlike CSV, fields containing comma separated values in the Excel document are split into a list of values. This is useful for defining multiple values for a single variable.

⁠Templates

Konpile uses the Jinja2⁠ templating language. Jinja2 is a powerful industry standard templating language used in a variety of applications. Konpile uses Jinja2 to render a template file with the data provided from the data files. The template file is a plain text file with the .j2 extension.

An example template file:

{% for line in sheet_name %}
{{ line.column_name1 }}
{% endfor %}

In the above example, this template will render a value column_name1 for each row, or line, in the specified sheet, sheet_name.

Learning to write a good template, one which can leverage the power of the Jinja2 templating language, is the most difficult part of using Konpile. The Jinja2 Template Designer Documentation⁠ is a great place to learn about the Jinja2 templating language. To aid you in learning Jinja2, Konpile is shipped with a few example templates. These templates can be found in the samples directory.

⁠Sponsorship

This project is sponsored by Dyntek⁠ and maintained by their working group, The Dyntek Labs⁠. Dyntek is a leading provider of professional services and managed solutions for advanced IT infrastructure, data center, cloud, and security.

The Dyntek Labs is a research and development group within Dyntek that focuses on developing new and innovative solutions to enable ourselves, our customers, and the community to be more efficient and secure.

Tag summary

Content type

Image

Digest

sha256:064af6a4c…

Size

49 MB

Last updated

over 3 years ago

docker pull dyntek/konpile