From 782a90d85bfbc656c2475aeefb1d5c0d333a9787 Mon Sep 17 00:00:00 2001 From: Damyan Yordanov Date: Mon, 19 Feb 2024 18:19:31 +0100 Subject: [PATCH] Make FeDHCP reuse-compliant (#81) * Make FeDHCP reuse-compliant * Add `reuse` workflow` * Fix typo in bulk license path --- .github/workflows/reuse.yml | 13 +++++++++++++ .reuse/dep5 | 30 ++++++++++++++++++++++++++++++ LICENSE | 4 ++-- LICENSES/MIT.txt | 9 +++++++++ Makefile | 2 +- hack/license-header.txt | 2 ++ hack/tools.go | 15 ++------------- main.go | 9 +++------ plugins/bluefield/plugin.go | 3 +++ plugins/ipam/k8s.go | 3 +++ plugins/ipam/plugin.go | 5 ++--- plugins/onmetal/plugin.go | 5 ++--- plugins/pxeboot/pxeboot.go | 5 ++--- 13 files changed, 74 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/reuse.yml create mode 100644 .reuse/dep5 create mode 100644 LICENSES/MIT.txt create mode 100644 hack/license-header.txt diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml new file mode 100644 index 0000000..728c95d --- /dev/null +++ b/.github/workflows/reuse.yml @@ -0,0 +1,13 @@ +name: REUSE Compliance Check + +on: pull_request + +jobs: + test: + name: reuse + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: REUSE Compliance Check + uses: fsfe/reuse-action@v2 diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 0000000..e836410 --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,30 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: FeDHCP +Upstream-Contact: IronCore authors +Source: https://github.com/ironcore-dev/FeDHCP + +# -------------------------------------------------- +# source code + +Files: + .github/* + .gitignore + .golangci.yaml + Dockerfile + Makefile + config/* + config.yml + go.mod + go.sum + hack/* +Copyright: 2024 SAP SE or an SAP affiliate company and IronCore contributors +License: MIT + +# -------------------------------------------------- +# documentation + +Files: + docs/* + README.md +Copyright: 2024 SAP SE or an SAP affiliate company and IronCore contributors +License: MIT diff --git a/LICENSE b/LICENSE index 9503596..a2f416d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2022 coredhcp, SAP SE +Copyright (c) 2018-2024 coredhcp, SAP SE Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 0000000..333c3b0 --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Makefile b/Makefile index 68e7c8c..4497f7c 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ help: ## Display this help. .PHONY: addlicense addlicense: ## Add license headers to all go files. - find . -name '*.go' -exec go run github.com/google/addlicense -c 'OnMetal authors' {} + + find . -name '*.go' -exec go run github.com/google/addlicense -f hack/license-header.txt {} + .PHONY: checklicense checklicense: ## Check that every file has a license header present. diff --git a/hack/license-header.txt b/hack/license-header.txt new file mode 100644 index 0000000..31febd5 --- /dev/null +++ b/hack/license-header.txt @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +SPDX-License-Identifier: MIT diff --git a/hack/tools.go b/hack/tools.go index 908ad8c..97311c6 100644 --- a/hack/tools.go +++ b/hack/tools.go @@ -1,16 +1,5 @@ -// Copyright 2022 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: MIT //go:build tools diff --git a/main.go b/main.go index 8e67dbc..0ddd458 100644 --- a/main.go +++ b/main.go @@ -1,9 +1,6 @@ -// Copyright 2018-present the CoreDHCP Authors. All rights reserved -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: MIT -// This is a generated file, edits should be made in the corresponding source file -// And this file regenerated using `coredhcp-generator --from core-plugins.txt` package main import ( @@ -21,9 +18,9 @@ import ( pl_mtu "github.com/coredhcp/coredhcp/plugins/mtu" pl_searchdomains "github.com/coredhcp/coredhcp/plugins/searchdomains" pl_serverid "github.com/coredhcp/coredhcp/plugins/serverid" + pl_bluefield "github.com/onmetal/fedhcp/plugins/bluefield" pl_ipam "github.com/onmetal/fedhcp/plugins/ipam" pl_onmetal "github.com/onmetal/fedhcp/plugins/onmetal" - pl_bluefield "github.com/onmetal/fedhcp/plugins/bluefield" pl_pxeboot "github.com/onmetal/fedhcp/plugins/pxeboot" "github.com/sirupsen/logrus" diff --git a/plugins/bluefield/plugin.go b/plugins/bluefield/plugin.go index 321057d..ba2105f 100644 --- a/plugins/bluefield/plugin.go +++ b/plugins/bluefield/plugin.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: MIT + package bluefield import ( diff --git a/plugins/ipam/k8s.go b/plugins/ipam/k8s.go index fb1f1de..d15e94f 100644 --- a/plugins/ipam/k8s.go +++ b/plugins/ipam/k8s.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: MIT + package ipam import ( diff --git a/plugins/ipam/plugin.go b/plugins/ipam/plugin.go index 3826084..5ab29df 100644 --- a/plugins/ipam/plugin.go +++ b/plugins/ipam/plugin.go @@ -1,6 +1,5 @@ -// Copyright 2018-present the CoreDHCP Authors. All rights reserved -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: MIT package ipam diff --git a/plugins/onmetal/plugin.go b/plugins/onmetal/plugin.go index 4f0511a..e6843c6 100644 --- a/plugins/onmetal/plugin.go +++ b/plugins/onmetal/plugin.go @@ -1,6 +1,5 @@ -// Copyright 2018-present the CoreDHCP Authors. All rights reserved -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: MIT package onmetal diff --git a/plugins/pxeboot/pxeboot.go b/plugins/pxeboot/pxeboot.go index 774ed1d..2cd3e3c 100644 --- a/plugins/pxeboot/pxeboot.go +++ b/plugins/pxeboot/pxeboot.go @@ -1,6 +1,5 @@ -// Copyright 2018-present the CoreDHCP Authors. All rights reserved -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: MIT // Package nbp implements handling of an NBP (Network Boot Program) using an // URL, e.g. http://[fe80::abcd:efff:fe12:3456]/my-nbp or tftp://10.0.0.1/my-nbp .