caddymultidynaconfig

package module
v0.0.0-...-f747950 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2023 License: Unlicense Imports: 9 Imported by: 0

README

unlicense Report Support me on Patreon

Caddy Multi Dyna Config

A Caddy 2 config adapter allowing the use of multiple merged configs with dynamic updates automatically picked up by watching file system changes.

Basically:

caddy run -c dyna.json --adapter cmdc

where dyna.json is something like:

{
	"files": ["/etc/caddy/main.caddyfile"],
	"dirs": ["/etc/caddy/sites-enabled"]
}

will result in a merge of that main.caddyfile with all supported files (.json and .caddyfile by default, extensible by including more config adapters in your build) under sites-enabled getting applied as the config, automatically reloaded upon any change to main.caddyfile or to sites-enabled.

Merge happens according to the default rules of go-jsons on the Caddy JSON structure.

Probably don't run this in Very Serious Production Environments :)

License

This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE file or unlicense.org.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	Files []string `json:"files"`
	Dirs  []string `json:"dirs"`
	// contains filtered or unexported fields
}

Adapter merges and dynamically reloads multiple configs.

func (*Adapter) Adapt

func (a *Adapter) Adapt(body []byte, options map[string]interface{}) (result []byte, warnings []caddyconfig.Warning, err error)

Adapt loads the meta-configuration of the Adapter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL