Skip to content

Latest commit

 

History

History
172 lines (126 loc) · 3.3 KB

PLUGINS.md

File metadata and controls

172 lines (126 loc) · 3.3 KB

Plugins

Plugins should be declared in [plugins] top level section of your configuration file.

If you see (multiple) marker, it means plugin expect a toml nested array of table (could be 0 elements). JSON equivalents would be :

[plugins.foo]
x = 42
[[plugins.foo.bar]] # Is (multiple)
a = true
b = false

[[plugins.foo.bar]] # Is (multiple)
a = false
b = true
"plugins": {
    "foo": {
        "x": 42,
        "bar": [
            {
                "a": true,
                "b": false
            },
            {
                "a": false,
                "b": true
            }
        ]
    }
}

Could be empty set :

[plugins.foo]
x = 42
"plugins": {
    "foo": {
        "x": 42
    }
}

SH

This is the most basic plugin but also quite an anti-pattern.

You should only invoke sh plugin for edge cases, when no other plugin is fitting your needs.

[plugins.sh]
cmd = []
[plugins.sh]
cmd = [
    "ln -s $(find / -name *.pc | head -n 1) /etc/pkg-build",
    "ssh-keygen -t rsa -b 2048 -f /usr/share/key -N $(echo $PASS | md5sum | cut -d ' ' -f 1)",
]

Is the Dockerfile equivalent of :

RUN ln -s $(find / -name *.pc | head -n 1) /etc/pkg-build
RUN ssh-keygen -t rsa -b 2048 -f /usr/share/key -N $(echo $PASS | md5sum | cut -d ' ' -f 1)

ZSH

Install and configure Zsh (oh-my-zsh) as you like.

[plugins.zsh]
theme = "afowler"
plugins = []    # Plugins name or link
extras = []     # Extra line for .zshrc

# Add zsh aliases (multiple)
[[plugins.zsh.aliases]]
name = ""
cmd = ""

COPY

Copy host local files inside container.

warning Do not use this plugin to put any sensible file (private keys, tokens, passwords) inside your image, especially if you aim tu push it to a container registry.
Use [secrets] instead.

[plugins.copy]

[[plugins.copy.files]]   # File / directory entry (multiple)
src = ""                 # Host path
dest = ""                # Container path

DOWNLOAD

Download ressource from any URL. Underlying code will use wget to fetch ressource(s).

[plugins.download]

[[plugins.download.ressources]]   # Ressource to download (multiple)
url = ""                          # Ressource public URL
target = ""                       # Target container path for download

GIT CLONE

Clone a git repository inside your conainer.

[plugins.git]

[[plugins.git.repos]]   # Ressource to download (multiple)
url = ""                # Repository URL
target = ""             # Target clone directory in container

PIP INSTALL

Install pip packages.

[plugins.pip]
packages = []       # String array of packages
extra_indexes = []  # String array of extra index url

Custom plugins

To add your very own plugin, create a jinja file and add it inside kitt/static/plugins. Then, you can use it directly inside your config file without any code change.

For example, if you wish to implement a tmux plugin, create a tmux.j2 file and set the variables inside your config file if necessary.

RUN echo {{ data }} >> ${HOME}/.tmux.conf
[plugins.tmux]
data = "..."

Only the first line is mandatory to include it in the build process.