diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 495779bf..6289982a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,13 @@ concurrency: cancel-in-progress: false jobs: + reuse-compliance: + name: REUSE License Compliance + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: fsfe/reuse-action@v5 + checks: runs-on: ubuntu-latest steps: diff --git a/LICENSES/FSL-1.1-ALv2.md b/LICENSES/FSL-1.1-ALv2.md new file mode 100644 index 00000000..e4a61ef2 --- /dev/null +++ b/LICENSES/FSL-1.1-ALv2.md @@ -0,0 +1,105 @@ +# Functional Source License, Version 1.1, ALv2 Future License + +## Abbreviation + +FSL-1.1-ALv2 + +## Notice + +Copyright 2025 Platform Engineering Labs Inc. + +## Terms and Conditions + +### Licensor ("We") + +The party offering the Software under these Terms and Conditions. + +### The Software + +The "Software" is each version of the software that we make available under +these Terms and Conditions, as indicated by our inclusion of these Terms and +Conditions with the Software. + +### License Grant + +Subject to your compliance with this License Grant and the Patents, +Redistribution and Trademark clauses below, we hereby grant you the right to +use, copy, modify, create derivative works, publicly perform, publicly display +and redistribute the Software for any Permitted Purpose identified below. + +### Permitted Purpose + +A Permitted Purpose is any purpose other than a Competing Use. A Competing Use +means making the Software available to others in a commercial product or +service that: + +1. substitutes for the Software; + +2. substitutes for any other product or service we offer using the Software + that exists as of the date we make the Software available; or + +3. offers the same or substantially similar functionality as the Software. + +Permitted Purposes specifically include using the Software: + +1. for your internal use and access; + +2. for non-commercial education; + +3. for non-commercial research; and + +4. in connection with professional services that you provide to a licensee + using the Software in accordance with these Terms and Conditions. + +### Patents + +To the extent your use for a Permitted Purpose would necessarily infringe our +patents, the license grant above includes a license under our patents. If you +make a claim against any party that the Software infringes or contributes to +the infringement of any patent, then your patent license to the Software ends +immediately. + +### Redistribution + +The Terms and Conditions apply to all copies, modifications and derivatives of +the Software. + +If you redistribute any copies, modifications or derivatives of the Software, +you must include a copy of or a link to these Terms and Conditions and not +remove any copyright notices provided in or with the Software. + +### Disclaimer + +THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR +PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT. + +IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE +SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, +EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE. + +### Trademarks + +Except for displaying the License Details and identifying us as the origin of +the Software, you have no right under these Terms and Conditions to use our +trademarks, trade names, service marks or product names. + +## Grant of Future License + +We hereby irrevocably grant you an additional license to use the Software under +the Apache License, Version 2.0 that is effective on the second anniversary of +the date we make the Software available. On or after that date, you may use the +Software under the Apache License, Version 2.0, in which case the following +will apply: + +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. diff --git a/Makefile b/Makefile index 93413618..1083e165 100644 --- a/Makefile +++ b/Makefile @@ -57,6 +57,14 @@ test-integration: lint: golangci-lint run +## lint-reuse: Check REUSE license compliance +lint-reuse: + ./scripts/lint_reuse.sh + +## add-license: Add license headers to source files (idempotent) +add-license: + ./scripts/add_license.sh + ## verify-schema: Validate PKL schema files ## Checks that schema files are well-formed and follow formae conventions. verify-schema: diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 00000000..02b430d0 --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,37 @@ +version = 1 + +# Configuration files +[[annotations]] +path = ["**/*.yml", "**/*.yaml", "**/*.json", "**/*.mod", "**/*.sum", "**/*.lock", "**/*.toml", ".gitignore", "**/.gitignore", "Makefile", "**/PklProject", "Opkgfile"] +SPDX-FileCopyrightText = "© 2025 Platform Engineering Labs Inc." +SPDX-License-Identifier = "FSL-1.1-ALv2" + +# Shell scripts in scripts/ directory +[[annotations]] +path = ["scripts/**/*.sh"] +SPDX-FileCopyrightText = "© 2025 Platform Engineering Labs Inc." +SPDX-License-Identifier = "FSL-1.1-ALv2" + +# Documentation files +[[annotations]] +path = ["**/*.md", "**/*.html"] +SPDX-FileCopyrightText = "© 2025 Platform Engineering Labs Inc." +SPDX-License-Identifier = "FSL-1.1-ALv2" + +# Binary and generated test files +[[annotations]] +path = ["**/*.zip", "**/*.pcf", "**/*.log", "**/*.txt"] +SPDX-FileCopyrightText = "© 2025 Platform Engineering Labs Inc." +SPDX-License-Identifier = "FSL-1.1-ALv2" + +# Misc plain-text and example/env files +[[annotations]] +path = [".env.example", "**/VERSION"] +SPDX-FileCopyrightText = "© 2025 Platform Engineering Labs Inc." +SPDX-License-Identifier = "FSL-1.1-ALv2" + +# Dockerfile +[[annotations]] +path = ["**/Dockerfile*"] +SPDX-FileCopyrightText = "© 2025 Platform Engineering Labs Inc." +SPDX-License-Identifier = "FSL-1.1-ALv2" diff --git a/examples/debug-stack.pkl b/examples/debug-stack.pkl index 92016280..3b3e8cc7 100644 --- a/examples/debug-stack.pkl +++ b/examples/debug-stack.pkl @@ -1,3 +1,9 @@ +/* + * © 2025 Platform Engineering Labs Inc. + * + * SPDX-License-Identifier: FSL-1.1-ALv2 + */ + amends "@formae/forma.pkl" import "@formae/formae.pkl" import "@aws/aws.pkl" diff --git a/examples/stack-test.pkl b/examples/stack-test.pkl index 9127ad7b..911adf4c 100644 --- a/examples/stack-test.pkl +++ b/examples/stack-test.pkl @@ -1,3 +1,9 @@ +/* + * © 2025 Platform Engineering Labs Inc. + * + * SPDX-License-Identifier: FSL-1.1-ALv2 + */ + amends "@formae/forma.pkl" import "@formae/formae.pkl" import "@aws/aws.pkl" diff --git a/examples/test-stack.pkl b/examples/test-stack.pkl index 6f533a23..e55e365e 100644 --- a/examples/test-stack.pkl +++ b/examples/test-stack.pkl @@ -1,3 +1,9 @@ +/* + * © 2025 Platform Engineering Labs Inc. + * + * SPDX-License-Identifier: FSL-1.1-ALv2 + */ + amends "@formae/forma.pkl" import "@formae/formae.pkl" diff --git a/scripts/add_license.sh b/scripts/add_license.sh new file mode 100755 index 00000000..c5544625 --- /dev/null +++ b/scripts/add_license.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Add license headers to source files (idempotent) + +if ! command -v reuse >/dev/null 2>&1; then + echo "Error: REUSE tool not installed." + echo "Install with: pipx install reuse" + exit 1 +fi + +echo "Adding license headers to source files (this is idempotent)..." + +echo "Processing Go files..." +find . -name "*.go" -not -path "*/.git/*" | \ + xargs reuse annotate --copyright="Platform Engineering Labs Inc." --year=2025 \ + --copyright-prefix=symbol --license=FSL-1.1-ALv2 + +echo "Processing Pkl files..." +find . -name "*.pkl" -not -path "*/.git/*" | \ + xargs reuse annotate --copyright="Platform Engineering Labs Inc." --year=2025 \ + --copyright-prefix=symbol --license=FSL-1.1-ALv2 --style c + +echo "Processing Python files..." +find . -name "*.py" -not -path "*/.git/*" | \ + xargs reuse annotate --copyright="Platform Engineering Labs Inc." --year=2025 \ + --copyright-prefix=symbol --license=FSL-1.1-ALv2 || true + +echo "Processing Shell scripts..." +find . -name "*.sh" -not -path "*/.git/*" -not -path "*/scripts/*" | \ + xargs reuse annotate --copyright="Platform Engineering Labs Inc." --year=2025 \ + --copyright-prefix=symbol --license=FSL-1.1-ALv2 || true + +echo "Done! Run 'make lint-reuse' to verify" + diff --git a/scripts/lint_reuse.sh b/scripts/lint_reuse.sh new file mode 100755 index 00000000..bb585208 --- /dev/null +++ b/scripts/lint_reuse.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Check REUSE compliance (optional for developers, required in CI) + +if ! command -v reuse >/dev/null 2>&1; then + echo "REUSE tool not installed. Install with: pipx install reuse" + echo "Skipping local check - CI will catch any issues." + exit 0 +fi + +echo "Checking REUSE compliance..." +reuse lint +