feat: osctrld v1.1.0 — daemon mode, osquery lifecycle, extensions, YAML config#1
Merged
Conversation
Documents the plan to fix bugs (force flag binding, typo, dead code), migrate logging from stdlib log to log/slog, improve test coverage for core action logic, and add a CI pipeline with golangci-lint.
9-task plan covering bug fixes, slog migration, test coverage for action and helper functions, Makefile fixes, and CI pipeline with golangci-lint.
Fix 'Cound' -> 'Could' in http-utils.go. Remove premature cmd.CombinedOutput() in runScript that executed the script and discarded the result before cmd.Run() tried to run it again.
TestLoadConfigurationValid was failing because it referenced tests/osctrld-test.json with a relative path that didn't resolve when running from the repository root.
Replace log.Printf/Println with slog.Info/Warn/Error/Debug. Remove emoji prefixes, use structured key-value fields instead. Remove manual verbose guards — slog level filter handles this. Initialize TextHandler in cliWrapper with level based on --verbose flag.
Cover writeContentExists (create, same-content skip, no-force reject, force overwrite), genericRetrieve (success, server error, connection refused), retrieveScript, retrieveCert, retrieveVerify, retrieveFlags, checkFileExist, and checkFileContent.
Cover getFlags, getCert, enrollNode, removeNode, and verifyNode using httptest servers to mock the osctrl API. Tests cover both success and server error paths.
Runs govet, errcheck, staticcheck, unused, gosimple, ineffassign, and typecheck on every PR and push to main. Tests run with -race and coverage reporting.
Migrate from log/slog to github.com/rs/zerolog with configurable output format (text/JSON) via --log-format flag.
8-task plan covering dependency addition, CLI flag, logger init, and mechanical slog-to-zerolog migration across all 5 source files.
Migrate actions.go (29 call sites), actions_helpers.go (3), config.go (1), and http-utils.go (1) to zerolog's fluent API. No slog or stdlib log references remain in the codebase.
Long-running `service` command with 60-min configurable interval, jitter, graceful shutdown, and flags+cert sync on each tick.
7-task plan: config field, jitter helper, command registration, syncOnce helper, daemon loop with graceful shutdown, service files.
Remove dead code (runScript), simplify fmt.Sprintf wrapping, and check all error returns in test helpers.
Use runtime.GOOS instead of hardcoded "darwin" so the test passes on both macOS and Linux runners.
Removes the main branch trigger and snapshot version generation. Goreleaser now only runs when a version tag (v*) is pushed, preventing conflicts with existing release assets.
Add documentation for daemon mode, osquery lifecycle management, extension deployment, structured logging, configuration reference, and deployment instructions for systemd and launchd. Update sample config with new fields.
Rename JSONConfiguration to Configuration with yaml/mapstructure tags. Rename jsonConfig global to appConfig. Add YAML sample config and test. Update README, service files, and gitignore to default to YAML. Both YAML and JSON formats are supported — Viper detects from extension.
javuto
reviewed
May 24, 2026
| const ( | ||
| // OsctrldVersion to have the version for all components | ||
| OsctrldVersion string = "1.0.0" | ||
| OsctrldVersion string = "2.0.0" |
Contributor
There was a problem hiding this comment.
Let's not bump the major release just yet, better do 1.1.0
javuto
requested changes
May 24, 2026
javuto
approved these changes
May 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Production-ready v2.0.0 of osctrld with four major features:
servicecommand) — long-running sync loop with configurable interval and jitter, graceful shutdown on SIGINT/SIGTERMAdditional improvements
log/slogtogithub.com/rs/zerologwith configurable format (textorjson)Verboseinstead ofForce)Stats
Test plan
go test -race -v ./cmd/osctrld/)