From 0dbab431a0970758ea56a59e3fc5fb91120f548a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Sun, 25 Jan 2026 20:55:15 +0100 Subject: [PATCH] support for file's content64 --- cmd/dkl-local-server/render-context.go | 5 +++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/dkl-local-server/render-context.go b/cmd/dkl-local-server/render-context.go index 22ca212..8934ee1 100644 --- a/cmd/dkl-local-server/render-context.go +++ b/cmd/dkl-local-server/render-context.go @@ -32,6 +32,8 @@ import ( var cmdlineParam = restful.QueryParameter("cmdline", "Linux kernel cmdline addition") +var b64 = base64.StdEncoding.WithPadding(base64.NoPadding) + type renderContext struct { Host *localconfig.Host SSLConfig *cfsslconfig.Config @@ -102,6 +104,8 @@ func (ctx *renderContext) Config() (ba []byte, cfg *config.Config, err error) { return } + // log.Print("rendered config:\n", string(ba)) + cfg = &config.Config{} if err = yaml.Unmarshal(ba, cfg); err != nil { return @@ -189,6 +193,7 @@ func (ctx *renderContext) TemplateFuncs() map[string]any { enc := base64.StdEncoding.WithPadding(base64.NoPadding) return enc.EncodeToString([]byte(input)) }, + "host_ip": func() (s string) { return ctx.Host.IPs[0] }, diff --git a/go.mod b/go.mod index e4187fd..90948f8 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 k8s.io/apimachinery v0.33.2 m.cluseau.fr/go v0.0.0-20230809064045-12c5a121c766 - novit.tech/direktil/pkg v0.0.0-20250706092353-d857af8032a1 + novit.tech/direktil/pkg v0.0.0-20260125193049-56f78e083a84 ) replace github.com/zmap/zlint/v3 => github.com/zmap/zlint/v3 v3.3.1 diff --git a/go.sum b/go.sum index dfb9066..9ecbd64 100644 --- a/go.sum +++ b/go.sum @@ -346,5 +346,5 @@ k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8 k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= m.cluseau.fr/go v0.0.0-20230809064045-12c5a121c766 h1:JRzMBDbUwrTTGDJaJSH0ap4vRL0Q9CN1bG8a6n49eaQ= m.cluseau.fr/go v0.0.0-20230809064045-12c5a121c766/go.mod h1:BMv3aOSYpupuiiG3Ch3ND88aB5CfAks3YZuRLE8j1ls= -novit.tech/direktil/pkg v0.0.0-20250706092353-d857af8032a1 h1:hKj9qhbTAoTxYIj6KaMLJp9I+bvZfkSM/QwK8Bd496o= -novit.tech/direktil/pkg v0.0.0-20250706092353-d857af8032a1/go.mod h1:zjezU6tELE880oYHs/WAauGBupKIEQQ7KqWTB69RW10= +novit.tech/direktil/pkg v0.0.0-20260125193049-56f78e083a84 h1:eqLPaRpVth1WgdvprKKtc4CVF13dkxuKbo7bLzlYG6s= +novit.tech/direktil/pkg v0.0.0-20260125193049-56f78e083a84/go.mod h1:zjezU6tELE880oYHs/WAauGBupKIEQQ7KqWTB69RW10=