From c2e3d669da90c819ff7715c729a707a6678506ce6b13d452d4a9b884c09d5dc9 Mon Sep 17 00:00:00 2001 From: Lixen Wraith Date: Sat, 10 Oct 2026 12:20:27 -0400 Subject: [PATCH] v0.31.1 minor fixes and updates --- Dockerfile | 2 +- README.md | 4 ++-- doc/README.md | 2 +- doc/formatters.md | 7 +++---- doc/installation.md | 2 +- doc/todo.md | 2 +- go.sum | 2 -- internal/config/config.go | 2 +- internal/config/schema_test.go | 7 +++---- internal/format/adapter.go | 2 +- 10 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7c18717..7c162f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Builder pin and go.mod directive are the same patch release deliberately; # an older builder reports the mismatch only after downloading the module graph. -ARG GO_VERSION=1.27.1 +ARG GO_VERSION=1.27.2 # The builder runs natively and cross-compiles, so foreign platforms need no emulation. FROM --platform=$BUILDPLATFORM docker.io/library/golang:${GO_VERSION}-alpine AS build diff --git a/README.md b/README.md index 95bf534..45b6d8d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ LogWisp Logo

- Go + Go License Platforms Documentation @@ -196,7 +196,7 @@ systemd unit or FreeBSD rc.d script and its configuration; `make deb` and - **Operating systems**: Linux (kernel 6.10+), FreeBSD (14.0+) - **Architecture**: amd64 -- **Go**: 1.27.1+ to build from source +- **Go**: 1.27.2+ to build from source Network sources and sinks use IPv4 or IPv6, following the address family of the configured host. diff --git a/doc/README.md b/doc/README.md index ce9de30..59dafe8 100644 --- a/doc/README.md +++ b/doc/README.md @@ -125,7 +125,7 @@ lw -c config.toml - **Operating systems**: Linux (kernel 6.10+), FreeBSD (14.0+) - **Architecture**: amd64 -- **Go**: 1.27.1+ to build from source +- **Go**: 1.27.2+ to build from source Network sources and sinks bind and dial IPv4 or IPv6, each keeping strictly to the family of its host ([Networking](networking.md#address-family)). diff --git a/doc/formatters.md b/doc/formatters.md index 7053fa8..f40e99e 100644 --- a/doc/formatters.md +++ b/doc/formatters.md @@ -21,7 +21,7 @@ Omitting `[pipelines.flow.format]` entirely selects `raw`. Each as type and default: -- `type` (string, `raw`): `raw`, `txt` (alias `text`), or `json`. +- `type` (string, `raw`): `raw`, `txt`, or `json`. - `sanitizer_policy` (string, derived from `type`): `raw`, `txt`, `json`, or `shell`. - `flags` (int64, `0`): bitmask override; `0` selects a per-type default. @@ -122,9 +122,8 @@ Each policy, then what to use it with: - `shell`: strips shell metacharacters, whitespace, and control characters. - Data that will be passed to a command. -When `sanitizer_policy` is omitted, the policy is derived from `type`: `json` -for `json`, `txt` for `txt`/`text`, and `raw` for anything else — so the safe -pairing is the default. +When `sanitizer_policy` is omitted, it is the policy of the same name as +`type`, so the safe pairing is the default. > `shell` strips dangerous characters but is **not** sufficient to make a string > safe for shell construction. Pass arguments through `exec` argv instead of diff --git a/doc/installation.md b/doc/installation.md index 2accceb..2def19a 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -4,7 +4,7 @@ - Operating systems: Linux (kernel 6.10+), FreeBSD (14.0+) - Architecture: amd64; arm64 builds but is untested -- To build: Go 1.27.1 or newer (FreeBSD: the `go127` package), and GNU make +- To build: Go 1.27.2 or newer (FreeBSD: the `go127` package), and GNU make or BSD make - For `make e2e`: bash 5+, coreutils, curl, openssl and go (the proxy test builds its reverse proxy). Optional, else those checks SKIP: node with diff --git a/doc/todo.md b/doc/todo.md index 43695be..004e23a 100644 --- a/doc/todo.md +++ b/doc/todo.md @@ -114,7 +114,7 @@ Steps: 4. `lixenwraith/terminal` v0.2.0: done: 16 and no color, the terminal's default colors, `/dev/tty`, bracketed paste, themed form controls. Still optional, in `color`: export the 16 xterm reference shades (RGBTo16 maps - the site's hues badly, so the 16-color tier is chosen by hand). v0.3.0: + the site's hues badly, so the 16-color tier is chosen by hand). v0.2.1: radio buttons, narrow form fields and option lists, menus, frames, rules, wires and windows, moved from `lw --tui`. 5. `lw --tui`: done ([doc/cli.md](cli.md#lw---tui)). diff --git a/go.sum b/go.sum index ddaef54..d2177f4 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,6 @@ github.com/lixenwraith/config v0.2.2 h1:X+l3Tf8Rbk49cipYBJU7/pfdw5wDwD4hRxtFH7rZ github.com/lixenwraith/config v0.2.2/go.mod h1:yfJQwKS+/6Dg70GIoHeYc0eYztOPETpqe6nUIbakcyg= github.com/lixenwraith/log v0.1.11 h1:dKWLnaR8dhXxj4l/aU5XZiFIsr8geaJQbOf8m7SiKhU= github.com/lixenwraith/log v0.1.11/go.mod h1:EE8i5nSAW2yZBTytKuhdgehmgzrby6kW1k5DyH1SvBg= -github.com/lixenwraith/terminal v0.2.1-0.20261010134811-bbb83d6c20df h1:HPfMYYSfNva8cMlgyTtZntu3oUwNKXW48rCwpmTEPoU= -github.com/lixenwraith/terminal v0.2.1-0.20261010134811-bbb83d6c20df/go.mod h1:f9Ntk+xKBS2LWQEe6gk/1TOpG22HH0scTe4wlPhEy44= github.com/lixenwraith/terminal v0.2.1 h1:KsMfmxrRicBFWMdXJIEJ3cpLWVw6IoNF8GwgsxbD3kQ= github.com/lixenwraith/terminal v0.2.1/go.mod h1:V0P/FDpY+UeSvx1VIVuTG7llo0RbK3XrSJLDA7GqHqY= github.com/lixenwraith/toml v0.1.3 h1:mhnNVLNogdaqjGd3eC4rV9ZqY3j1Sv+DK1erZ+SPFeI= diff --git a/internal/config/config.go b/internal/config/config.go index 0bb5208..37675af 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -85,7 +85,7 @@ type HeartbeatConfig struct { // FormatConfig is how a pipeline writes its entries type FormatConfig struct { - Type string `toml:"type" default:"raw" lw:"enum=raw|txt|text|json" help:"entry format; text is txt"` + Type string `toml:"type" default:"raw" lw:"enum=raw|txt|json" help:"entry format"` Flags int64 `toml:"flags,omitempty" lw:"zero=by type" help:"formatter flags"` TimestampFormat string `toml:"timestamp_format,omitempty" lw:"zero=RFC 3339" help:"Go time layout of timestamps"` SanitizerPolicy string `toml:"sanitizer_policy,omitempty" lw:"enum=raw|json|txt|shell,zero=by type" help:"how control characters are escaped"` diff --git a/internal/config/schema_test.go b/internal/config/schema_test.go index 5175f3b..e27478d 100644 --- a/internal/config/schema_test.go +++ b/internal/config/schema_test.go @@ -58,10 +58,6 @@ func TestZeroDefaultsAndNegatives(t *testing.T) { if err != nil || chain.BackoffMaxMS != 30000 { t.Fatalf("backoff maximum below the minimum: %+v %v", chain, err) } - format := FormatConfig{Type: "text"} - if err := Settle(&format); err != nil { - t.Fatalf("format text: %v", err) - } } // Command-line text and JSON numbers become the kinds the options declare, so @@ -123,6 +119,9 @@ func TestValidateConfigNamesThePath(t *testing.T) { "color: must be one of auto, always, never, got \"\"": func(c *Config) { c.Color = "" }, + `pipelines[0].flow.format.type: must be one of raw, txt, json, got "text"`: func(c *Config) { + c.Pipelines[0].Flow.Format = &FormatConfig{Type: "text"} + }, "pipelines[0].flow.heartbeat.interval_ms: must be at least 100, got 10": func(c *Config) { c.Pipelines[0].Flow.Heartbeat = &HeartbeatConfig{IntervalMS: 10} }, diff --git a/internal/format/adapter.go b/internal/format/adapter.go index 3bb3e28..c16571f 100644 --- a/internal/format/adapter.go +++ b/internal/format/adapter.go @@ -35,7 +35,7 @@ func NewFormatterAdapter(cfg *config.FormatConfig) (*FormatterAdapter, error) { switch cfg.Type { case "json": s = sanitizer.New().Policy(sanitizer.PolicyJSON) - case "txt", "text": + case "txt": s = sanitizer.New().Policy(sanitizer.PolicyTxt) default: s = sanitizer.New().Policy(sanitizer.PolicyRaw)