diff --git a/protobuf/Makefile b/protobuf/Makefile index 9297546..680c490 100644 --- a/protobuf/Makefile +++ b/protobuf/Makefile @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2024 Authors of SentryFlow + PROTOS:="sentryflow.proto sentryflow_metrics.proto" .PHONY: help diff --git a/scripts/add-license-header b/scripts/add-license-header new file mode 100755 index 0000000..01e0c69 --- /dev/null +++ b/scripts/add-license-header @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2023 Authors of SentryFlow + +if ! command -v addlicense >/dev/null; then + echo "Installing addlicense..." + go install github.com/google/addlicense@latest +fi + +GIT_ROOT=$(git rev-parse --show-toplevel) +LICENSE_HEADER=${GIT_ROOT}/scripts/license.header + +if [ -z "$1" ]; then + echo "No Argument Supplied, Checking and Fixing all files from project root" + addlicense -f "${LICENSE_HEADER}" -v "${GIT_ROOT}"/**/*.sh "${GIT_ROOT}"/**/*.go + echo "Done" +else + addlicense -f "${LICENSE_HEADER}" -v "$1" + echo "Done" +fi diff --git a/scripts/license.header b/scripts/license.header new file mode 100644 index 0000000..d7c0bd6 --- /dev/null +++ b/scripts/license.header @@ -0,0 +1,2 @@ +SPDX-License-Identifier: Apache-2.0 +Copyright 2024 Authors of SentryFlow diff --git a/sentryflow/Dockerfile b/sentryflow/Dockerfile index 6b89c84..799bec6 100644 --- a/sentryflow/Dockerfile +++ b/sentryflow/Dockerfile @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2024 Authors of SentryFlow + FROM golang:1.23 AS builder RUN mkdir -p /protobuf/golang diff --git a/sentryflow/Makefile b/sentryflow/Makefile index 941ecec..5c79658 100644 --- a/sentryflow/Makefile +++ b/sentryflow/Makefile @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2024 Authors of SentryFlow + BINARY_NAME ?= sentryflow REGISTRY ?= docker.io/5gsec VERSION ?= $(shell git rev-parse HEAD) diff --git a/sentryflow/cmd/root.go b/sentryflow/cmd/root.go index f454ff2..710509a 100644 --- a/sentryflow/cmd/root.go +++ b/sentryflow/cmd/root.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package cmd import ( diff --git a/sentryflow/cmd/version.go b/sentryflow/cmd/version.go index 5a78250..481032f 100644 --- a/sentryflow/cmd/version.go +++ b/sentryflow/cmd/version.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package cmd import ( diff --git a/sentryflow/config/default.yaml b/sentryflow/config/default.yaml index 6179851..e841f17 100644 --- a/sentryflow/config/default.yaml +++ b/sentryflow/config/default.yaml @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2024 Authors of SentryFlow + receivers: # aka sources serviceMeshes: - name: istio-sidecar diff --git a/sentryflow/main.go b/sentryflow/main.go index 6163445..87ed3e2 100644 --- a/sentryflow/main.go +++ b/sentryflow/main.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package main import ( diff --git a/sentryflow/pkg/config/config.go b/sentryflow/pkg/config/config.go index 0cf5ab0..1b3ffd3 100644 --- a/sentryflow/pkg/config/config.go +++ b/sentryflow/pkg/config/config.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package config import ( diff --git a/sentryflow/pkg/core/sentryflow.go b/sentryflow/pkg/core/sentryflow.go index 526e753..4461db9 100644 --- a/sentryflow/pkg/core/sentryflow.go +++ b/sentryflow/pkg/core/sentryflow.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package core import ( diff --git a/sentryflow/pkg/core/server.go b/sentryflow/pkg/core/server.go index 596eaf7..8da4983 100644 --- a/sentryflow/pkg/core/server.go +++ b/sentryflow/pkg/core/server.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package core import ( diff --git a/sentryflow/pkg/exporter/exporter.go b/sentryflow/pkg/exporter/exporter.go index 5cd3cb7..2373ae2 100644 --- a/sentryflow/pkg/exporter/exporter.go +++ b/sentryflow/pkg/exporter/exporter.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package exporter import ( diff --git a/sentryflow/pkg/k8s/client.go b/sentryflow/pkg/k8s/client.go index b6b0e8d..9d74f60 100644 --- a/sentryflow/pkg/k8s/client.go +++ b/sentryflow/pkg/k8s/client.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package k8s import ( diff --git a/sentryflow/pkg/receiver/receiver.go b/sentryflow/pkg/receiver/receiver.go index 396629d..c1082ee 100644 --- a/sentryflow/pkg/receiver/receiver.go +++ b/sentryflow/pkg/receiver/receiver.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package receiver import ( diff --git a/sentryflow/pkg/receiver/svcmesh/istio/sidecar/sidecar.go b/sentryflow/pkg/receiver/svcmesh/istio/sidecar/sidecar.go index 945aafc..b97b406 100644 --- a/sentryflow/pkg/receiver/svcmesh/istio/sidecar/sidecar.go +++ b/sentryflow/pkg/receiver/svcmesh/istio/sidecar/sidecar.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package sidecar import ( diff --git a/sentryflow/pkg/util/util.go b/sentryflow/pkg/util/util.go index eeba8bb..f52d8ea 100644 --- a/sentryflow/pkg/util/util.go +++ b/sentryflow/pkg/util/util.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Authors of SentryFlow + package util import (