Add third-party license notices, generated and embedded in the binary
Security / Vulnerability check (push) Successful in 44s
Test / Lint and test (push) Successful in 2m5s

THIRD-PARTY-LICENSES.md holds the license and notice files of the Go
distribution and of the 35 modules that ./cmd/uberbringer links on
linux amd64, armv6, armv7 and arm64, as each distribution ships them.
tools/genlicenses writes it on go generate from go list -deps, so
modules only the tools and tests use stay out. Beside each module's
root license it takes NOTICE files and the license files in its linked
packages' directories, which cover vendored code in gofiber/utils,
klauspost/compress and fasthttp. Each module is listed with its
version, so any dependency change needs the file regenerated. The
generator fails on a module with no license file or a license it does
not recognize.

The same text goes to internal/app/uberbringer/licenses_embed.md, which
the binary embeds and the new `uberbringer licenses` command prints.
The release archives carry the file, and the Docker image keeps it with
LICENSE.txt in /usr/share/licenses/uberbringer/.

The Makefile's openapi and openapi-check targets become generate and
generate-check. They, the CI step and the gate in CLAUDE.md check
docs/swagger.json and both license files, and a test fails when a
committed copy is out of date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-11-30 21:58:39 -06:00
1 parent ee65e72c44
commit 0c88b4ffd5
19 files changed
+4969 -23

No files matched your search

+28 -6
View File
@@ -496,6 +496,7 @@ uberbringer preview [file.json|-] show the lines a job would print
uberbringer preview --module note [file|-] show the receipt a module builds
uberbringer config get <key> print one setting, e.g. webserver.port
uberbringer version print the version
uberbringer licenses print the licenses of the third-party software
```
`token` signs a token with `api.secret`. Without flags, it may use every
@@ -547,7 +548,7 @@ make check # the CI gate, below
make build # bin/uberbringer
make fmt # gofmt + goimports
make vuln # govulncheck
make openapi # regenerate docs/swagger.json (go generate ./...)
make generate # regenerate docs/swagger.json and the license notices (go generate ./...)
make snapshot # release archives in dist/; publishes nothing
```
@@ -558,8 +559,8 @@ order:
2. `tidy-check`: `go mod tidy -diff`.
3. `go vet`.
4. staticcheck.
5. `openapi-check`: `go generate ./...` must leave `docs/swagger.json`
unchanged.
5. `generate-check`: `go generate ./...` must leave `docs/swagger.json`,
`THIRD-PARTY-LICENSES.md` and its embedded copy unchanged.
6. `go test -race -timeout 5m`.
7. `release-check`: `goreleaser check`, which validates the release config
without building.
@@ -577,6 +578,19 @@ name: their `json` and `jsonschema` tags and their doc comments. Never edit
the file by hand: change the route table or the types, run
`go generate ./...`, and commit the document with the change.
`THIRD-PARTY-LICENSES.md` is generated by `tools/genlicenses`. It holds the
license and notice files of the Go distribution and of every module that
`./cmd/uberbringer` links on the release platforms. A module's files come
from its root and from the directories of its linked packages, which cover
code it vendors under licenses of their own. Modules that only the tools and
tests use are left out. The generator writes the same text to
`internal/app/uberbringer/licenses_embed.md`, which the binary embeds and
`uberbringer licenses` prints. After adding, bumping or dropping a
dependency, run `go generate ./...` and commit both files with `go.mod`.
The generator fails on a module that ships no license file, or whose
license it does not recognize; teach `licenseMarkers` in
`tools/genlicenses/notices.go` its wording once the license is acceptable.
The linters are pinned as Go tools in `go.mod`, so `go tool staticcheck`,
`go tool govulncheck` and `go tool goimports` need no separate install. The
module path is `uberbringer`, so packages import as
@@ -598,6 +612,7 @@ internal/pkg/printqueue/ Job queue, worker and status history
configs/ Example configuration
examples/ Example jobs, such as the block calibration receipt
packaging/ systemd unit
tools/genlicenses/ Generates THIRD-PARTY-LICENSES.md and its embedded copy from the linked modules
tools/genopenapi/ Generates docs/swagger.json from the route table
docs/ API reference, OpenAPI document, design notes and feature plans
```
@@ -611,7 +626,7 @@ CI runs on the Gitea runner from `.gitea/workflows/`. The repository has no
`.github/` directory.
- `test.yml` runs the `make check` gate on every branch push. It lints,
checks that `docs/swagger.json` is up to date, tests and validates the
checks that the generated files are up to date, tests and validates the
release config, but builds no binaries, and it does not run on pull
requests or tags. Binaries are built only by `release.yml`.
- `security.yml` runs govulncheck on pushes to main and every Monday at
@@ -621,8 +636,8 @@ CI runs on the Gitea runner from `.gitea/workflows/`. The repository has no
- It runs only for tags whose commit is on main, and refuses any other tag.
- `vX.Y.Z-rc.N` tags are published as prereleases, so they never become the
latest release that `install.sh` installs.
- Each archive holds the binary, `LICENSE.txt`, `README.md`,
`docs/api.md`, `docs/swagger.json`, `CHANGELOG.md`,
- Each archive holds the binary, `LICENSE.txt`, `THIRD-PARTY-LICENSES.md`,
`README.md`, `docs/api.md`, `docs/swagger.json`, `CHANGELOG.md`,
`configs/config.example.toml` and `packaging/uberbringer.service`.
- The release notes link to `CHANGELOG.md` at the tag.
@@ -634,3 +649,10 @@ Licensed under the European Union Public Licence v. 1.2 (EUPL-1.2). The full
text is in [LICENSE.txt](LICENSE.txt), and translations into every official EU
language are equally valid. Releases up to and including 0.1.2 were published
under the GNU Affero General Public License v3.0.
The binary contains third-party software under licenses of its own: the Go
standard library and runtime, and Go modules.
[THIRD-PARTY-LICENSES.md](THIRD-PARTY-LICENSES.md) lists them with their
license and notice texts. The file comes with every release archive, and the Docker
image keeps it with `LICENSE.txt` in `/usr/share/licenses/uberbringer/`.
`uberbringer licenses` prints the same text.