From 03306e646e3ee421f582ef69a2158724bcf2614b Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 9 Oct 2019 19:10:00 -0600 Subject: admin: /config and /id endpoints This integrates a feature that was previously reserved for enterprise users, according to https://github.com/caddyserver/caddy/issues/2786. The /config and /id endpoints make granular config changes possible as well as the exporting of the current configuration. The /load endpoint has been modified to wrap the /config handler so that the currently-running config can always be available for export. The difference is that /load allows configs of varying formats and converts them using config adapters. The adapted config is then processed with /config as JSON. The /config and /id endpoints accept only JSON. --- caddyconfig/configadapters.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'caddyconfig') diff --git a/caddyconfig/configadapters.go b/caddyconfig/configadapters.go index 1a0801f..071221f 100644 --- a/caddyconfig/configadapters.go +++ b/caddyconfig/configadapters.go @@ -27,10 +27,10 @@ type Adapter interface { // Warning represents a warning or notice related to conversion. type Warning struct { - File string - Line int - Directive string - Message string + File string `json:"file,omitempty"` + Line int `json:"line,omitempty"` + Directive string `json:"directive,omitempty"` + Message string `json:"message,omitempty"` } // JSON encodes val as JSON, returning it as a json.RawMessage. Any -- cgit v1.2.3