ソースを参照

docs(licenses): publish THIRD_PARTY.md with dependency notices (#1171)

The release binaries compile in ~50 third-party Go modules (gonzalop/mq
is MIT, plus BSD-2/3-Clause and Apache-2.0 modules) but only AGPL's own
LICENSE was shipped. Add THIRD_PARTY.md with every module, its license
and the upstream URL, the script that regenerates it (go-licenses), and
include the file in the three goreleaser archives next to LICENSE.

modernc.org/mathutil reports as Unknown in the tool but its LICENSE is
BSD-3-Clause (verified by hand); noted in the file.

Closes #1170
Nacho 2 ヶ月 前
親
コミット
998e2c9ef6
3 ファイル変更、133 行追加、0 行削除
  1. 3 0
      .goreleaser.yaml
  2. 64 0
      THIRD_PARTY.md
  3. 66 0
      deploy/gen-third-party.sh

+ 3 - 0
.goreleaser.yaml

@@ -82,6 +82,7 @@ archives:
       {{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}
     files:
       - LICENSE
+      - THIRD_PARTY.md
       - src: server-go/.env.example
         dst: .env.example
 
@@ -92,6 +93,7 @@ archives:
       {{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}
     files:
       - LICENSE
+      - THIRD_PARTY.md
 
   - id: netpulse-agent
     ids: [netpulse-agent]
@@ -100,6 +102,7 @@ archives:
       {{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}
     files:
       - LICENSE
+      - THIRD_PARTY.md
       - src: agent/deploy/netpulse-agent.init
         dst: netpulse-agent.init
 

+ 64 - 0
THIRD_PARTY.md

@@ -0,0 +1,64 @@
+# Third-Party Licenses
+
+NetPulse itself is licensed under the GNU Affero General Public License v3.0 (see `LICENSE`).
+
+The release binaries ship with the following third-party Go modules compiled in. Their licenses are all permissive (MIT / BSD-2-Clause / BSD-3-Clause / Apache-2.0) and require preserving their copyright notices, which this file collects. Full license texts are available at the linked URLs and in the Go module cache used at build time.
+
+Regenerate with `deploy/gen-third-party.sh` (requires `go install github.com/google/go-licenses@latest`).
+
+## Server (`server-go`)
+
+| Module | License | License URL |
+|---|---|---|
+| github.com/araddon/dateparse | MIT | https://github.com/araddon/dateparse/blob/6b43995a97de/LICENSE |
+| github.com/dustin/go-humanize | MIT | https://github.com/dustin/go-humanize/blob/v1.0.1/LICENSE |
+| github.com/golang-jwt/jwt/v5 | MIT | https://github.com/golang-jwt/jwt/blob/v5.3.1/LICENSE |
+| github.com/gonzalop/mq | MIT | https://github.com/gonzalop/mq/blob/v0.9.11/LICENSE |
+| github.com/google/jsonschema-go/jsonschema | MIT | https://github.com/google/jsonschema-go/blob/v0.4.2/LICENSE |
+| github.com/google/uuid | BSD-3-Clause | https://github.com/google/uuid/blob/v1.6.0/LICENSE |
+| github.com/gorilla/websocket | BSD-2-Clause | https://github.com/gorilla/websocket/blob/e064f32e3674/LICENSE |
+| github.com/gosnmp/gosnmp | BSD-2-Clause | https://github.com/gosnmp/gosnmp/blob/v1.44.0/LICENSE |
+| github.com/mark3labs/mcp-go | MIT | https://github.com/mark3labs/mcp-go/blob/v1.1.1/LICENSE |
+| github.com/m-lab/go | Apache-2.0 | https://github.com/m-lab/go/blob/v0.1.76/LICENSE |
+| github.com/m-lab/locate/api | Apache-2.0 | https://github.com/m-lab/locate/blob/v0.19.0/LICENSE |
+| github.com/m-lab/ndt7-client-go | Apache-2.0 | https://github.com/m-lab/ndt7-client-go/blob/v0.10.1/LICENSE |
+| github.com/m-lab/ndt-server | Apache-2.0 | https://github.com/m-lab/ndt-server/blob/v0.25.0/LICENSE |
+| github.com/m-lab/tcp-info | Apache-2.0 | https://github.com/m-lab/tcp-info/blob/v1.9.0/LICENSE |
+| github.com/remyoudompheng/bigfft | BSD-3-Clause | https://github.com/remyoudompheng/bigfft/blob/24d4a6f8daec/LICENSE |
+| github.com/santhosh-tekuri/jsonschema/v6 | Apache-2.0 | https://github.com/santhosh-tekuri/jsonschema/blob/v6.0.2/LICENSE |
+| github.com/SherClockHolmes/webpush-go | MIT | https://github.com/SherClockHolmes/webpush-go/blob/v1.4.0/LICENSE |
+| github.com/showwin/speedtest-go/speedtest | MIT | https://github.com/showwin/speedtest-go/blob/v1.8.3/LICENSE |
+| github.com/spf13/cast | MIT | https://github.com/spf13/cast/blob/v1.7.1/LICENSE |
+| github.com/yosida95/uritemplate/v3 | BSD-3-Clause | https://github.com/yosida95/uritemplate/blob/v3.0.2/LICENSE |
+| golang.org/x/crypto | BSD-3-Clause | https://cs.opensource.google/go/x/crypto/+/v0.55.0:LICENSE |
+| golang.org/x/net | BSD-3-Clause | https://cs.opensource.google/go/x/net/+/v0.58.0:LICENSE |
+| golang.org/x/sys/unix | BSD-3-Clause | https://cs.opensource.google/go/x/sys/+/v0.47.0:LICENSE |
+| golang.org/x/text | BSD-3-Clause | https://cs.opensource.google/go/x/text/+/v0.41.0:LICENSE |
+| modernc.org/libc | MIT | https://gitlab.com/cznic/libc/blob/v1.74.4/LICENSE-3RD-PARTY.md |
+| modernc.org/memory | BSD-3-Clause | https://gitlab.com/cznic/memory/blob/v1.11.0/LICENSE-GO |
+| modernc.org/sqlite | BSD-3-Clause | https://gitlab.com/cznic/sqlite/blob/v1.56.0/LICENSE |
+| modernc.org/mathutil | BSD-3-Clause¹ | https://gitlab.com/cznic/mathutil/blob/v1.7.1/LICENSE |
+
+## Collector (`collector`)
+
+| Module | License | License URL |
+|---|---|---|
+| github.com/dustin/go-humanize | MIT | https://github.com/dustin/go-humanize/blob/v1.0.1/LICENSE |
+| github.com/google/uuid | BSD-3-Clause | https://github.com/google/uuid/blob/v1.6.0/LICENSE |
+| github.com/remyoudompheng/bigfft | BSD-3-Clause | https://github.com/remyoudompheng/bigfft/blob/24d4a6f8daec/LICENSE |
+| golang.org/x/sys/unix | BSD-3-Clause | https://cs.opensource.google/go/x/sys/+/v0.47.0:LICENSE |
+| modernc.org/libc | MIT | https://gitlab.com/cznic/libc/blob/v1.74.4/LICENSE-3RD-PARTY.md |
+| modernc.org/memory | BSD-3-Clause | https://gitlab.com/cznic/memory/blob/v1.11.0/LICENSE-GO |
+| modernc.org/sqlite | BSD-3-Clause | https://gitlab.com/cznic/sqlite/blob/v1.56.0/LICENSE |
+| modernc.org/mathutil | BSD-3-Clause¹ | https://gitlab.com/cznic/mathutil/blob/v1.7.1/LICENSE |
+
+## Agent (`agent`)
+
+| Module | License | License URL |
+|---|---|---|
+| golang.org/x/net/dns/dnsmessage | BSD-3-Clause | https://cs.opensource.google/go/x/net/+/v0.58.0:LICENSE |
+| modernc.org/mathutil | BSD-3-Clause¹ | https://gitlab.com/cznic/mathutil/blob/v1.7.1/LICENSE |
+
+---
+
+¹ `go-licenses` reports `modernc.org/mathutil` as "Unknown" because its LICENSE file is not recognized by the tool's classifier; the file itself contains the standard BSD-3-Clause text (verified manually).

+ 66 - 0
deploy/gen-third-party.sh

@@ -0,0 +1,66 @@
+#!/bin/sh
+# Regenera THIRD_PARTY.md con go-licenses (issue #1170).
+# Requiere: go install github.com/google/go-licenses@latest
+set -e
+
+cd "$(dirname "$0")/.."
+
+GL="${GO_LICENSES:-go-licenses}"
+GL="$(command -v "$GL" 2>/dev/null || echo "$HOME/go/bin/go-licenses")"
+if [ ! -x "$GL" ]; then
+	echo "go-licenses no encontrado: go install github.com/google/go-licenses@latest" >&2
+	exit 1
+fi
+
+# go-licenses clasifica modernc.org/mathutil como Unknown, pero su LICENSE es
+# BSD-3-Clause (verificado a mano); se corrige aquí al regenerar.
+MATHUTIL='| modernc.org/mathutil | BSD-3-Clause¹ | https://gitlab.com/cznic/mathutil/blob/v1.7.1/LICENSE |'
+
+gen() {
+	(cd "$1" && "$GL" report ./... --ignore github.com/gnacho/netpulse 2>/dev/null \
+		| awk -F',' '{name=$1; lic=$3; url=$2; gsub(/^ +| +$/,"",lic); printf "| %s | %s | %s |\n", name, lic, url}' \
+		| grep -v 'modernc.org/mathutil' | sort -u)
+	printf '%s\n' "$MATHUTIL"
+}
+
+{
+	cat <<'HDR'
+# Third-Party Licenses
+
+NetPulse itself is licensed under the GNU Affero General Public License v3.0 (see `LICENSE`).
+
+The release binaries ship with the following third-party Go modules compiled in. Their licenses are all permissive (MIT / BSD-2-Clause / BSD-3-Clause / Apache-2.0) and require preserving their copyright notices, which this file collects. Full license texts are available at the linked URLs and in the Go module cache used at build time.
+
+Regenerate with `deploy/gen-third-party.sh` (requires `go install github.com/google/go-licenses@latest`).
+
+## Server (`server-go`)
+
+| Module | License | License URL |
+|---|---|---|
+HDR
+	gen server-go
+	cat <<'COL'
+
+## Collector (`collector`)
+
+| Module | License | License URL |
+|---|---|---|
+COL
+	gen collector
+	cat <<'AG'
+
+## Agent (`agent`)
+
+| Module | License | License URL |
+|---|---|---|
+AG
+	gen agent
+	cat <<'FT'
+
+---
+
+¹ `go-licenses` reports `modernc.org/mathutil` as "Unknown" because its LICENSE file is not recognized by the tool's classifier; the file itself contains the standard BSD-3-Clause text (verified manually).
+FT
+} > THIRD_PARTY.md
+
+echo "THIRD_PARTY.md regenerado ($(wc -l < THIRD_PARTY.md) lineas)"