From c76297cbe215921b63c9633ec30b5718a2e6c19b Mon Sep 17 00:00:00 2001 From: Josef Andersson Date: Tue, 9 Jan 2024 23:10:21 +0100 Subject: [PATCH] Add reuse license compliance This PR makes the project license declare licenses according to https://reuse.software/ so that it passes the reuse lint. Even though it is many affected files, the pr is scroll friendly and contains no logic. It should hopefully be a quick general overview before merging it. Basically, it adds license headers in spdx-format, as per the reuse-specification. It also adds a missing reuse LICENSES file, ofl 1.1, and the .reuse/dep5 which takes care of the licening of json files etc. Note: the reuse badge in the README will be green when the project is public Signed-off-by: Josef Andersson --- .editorconfig | 4 ++ .eslintignore | 4 ++ .github/dependabot.yml | 4 ++ .github/workflows/actions.yaml | 4 ++ .gitignore | 4 ++ .reuse/dep5 | 17 ++++++++ LICENSES/OFL-1.1.txt | 43 +++++++++++++++++++ README.md | 4 +- docs/INTRODUCTION.md | 6 +++ examples/supportModal.html | 6 +++ examples/userFeedback.html | 6 +++ examples/userFeedback.jsx | 4 ++ jest.config.js | 4 ++ src/assets/components/iframeElement.js | 4 ++ src/assets/components/supportModalElement.js | 4 ++ src/assets/css/base.css | 6 +++ src/assets/css/iframeElement.css | 6 +++ src/assets/css/supportModalElement.css | 6 +++ src/assets/translations.js | 4 ++ src/embed/iframe/iframeHandler.js | 4 ++ src/embed/iframe/postMessageHandler.js | 4 ++ src/index.js | 4 ++ src/service/supportModal/messageHandlers.js | 4 ++ src/service/supportModal/supportModal.js | 4 ++ src/service/userFeedback/messageHandlers.js | 4 ++ src/service/userFeedback/userFeedback.js | 4 ++ src/util/configManager.js | 4 ++ src/util/fingerprint.js | 4 ++ src/util/i18n.js | 4 ++ .../components/supportModalElement.test.js | 4 ++ test/embed/iframe/iFrameHandler.test.js | 4 ++ test/embed/iframe/postMessageHandler.test.js | 4 ++ test/jest.setup.js | 4 ++ .../service/supportModal/supportModal.test.js | 4 ++ .../userFeedback/messageHandlers.test.js | 4 ++ .../service/userFeedback/userFeedback.test.js | 4 ++ test/service/util/configManager.test.js | 4 ++ webpack.config.js | 4 ++ 38 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 .reuse/dep5 create mode 100644 LICENSES/OFL-1.1.txt diff --git a/.editorconfig b/.editorconfig index 3ce0e76..b141271 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +# +# SPDX-License-Identifier: CC0-1.0 + # EditorConfig is awesome: https://EditorConfig.org # Top-most EditorConfig file diff --git a/.eslintignore b/.eslintignore index b947077..a2c62f2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,6 @@ +# SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +# +# SPDX-License-Identifier: CC0-1.0 + node_modules/ dist/ diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a43db84..fa184ac 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +# +# SPDX-License-Identifier: CC0-1.0 + version: 2 updates: - package-ecosystem: npm diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 78aa7e3..5572235 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +# +# SPDX-License-Identifier: CC0-1.0 + name: CI/CD Pipeline # Trigger the workflow on push or pull request diff --git a/.gitignore b/.gitignore index 4cc654e..f30cb15 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +# +# SPDX-License-Identifier: CC0-1.0 + node_modules/ dist/ diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 0000000..72f4723 --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,17 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: inclusiontoolbox +Source: https://github.com/diggsweden/inclusiontoolbox + +Files: package*.json .eslintrc.json .env examples/*.json +Copyright: Digg - Agency for Digital Government +License: CC0-1.0 + +Files: examples/*.ico docs/Component_diagram_feedback_app_module_in_drop_in_lib.drawio.svg +Copyright: Digg- Agency for Digital Government +License: CC0-1.0 + +# Third-party files + +Files: src/assets/fonts/Lato-Regular.ttf +Copyright: tyPoland Lukasz Dziedzic +License: OFL-1.1 diff --git a/LICENSES/OFL-1.1.txt b/LICENSES/OFL-1.1.txt new file mode 100644 index 0000000..6fe84ee --- /dev/null +++ b/LICENSES/OFL-1.1.txt @@ -0,0 +1,43 @@ +SIL OPEN FONT LICENSE + +Version 1.1 - 26 February 2007 + +PREAMBLE + +The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. + +The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. + +DEFINITIONS + +"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the copyright statement(s). + +"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, or substituting — in part or in whole — any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. + +"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS + +Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. + +5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. + +TERMINATION + +This license becomes null and void if any of the above conditions are not met. + +DISCLAIMER + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/README.md b/README.md index 5c1668a..7f03b47 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,9 @@ SPDX-License-Identifier: MIT # InclusionToolbox lib -[![License: MIT](https://img.shields.io/badge/Licence-MIT-yellow)](https://img.shields.io/badge/Licence-MIT-yellow) [![Standard commitment](https://img.shields.io/badge/Standard_for_public_code-commitment-green)](https://img.shields.io/badge/Standard_for_public_code-commitment-green) +[![License: MIT](https://img.shields.io/badge/Licence-MIT-yellow)](https://img.shields.io/badge/Licence-MIT-yellow) + +[![REUSE status](https://api.reuse.software/badge/github.com/diggsweden/inclusiontoolbox)](https://api.reuse.software/info/github.com/diggsweden/inclusiontoolbox) [![Node: 18.17.0](https://img.shields.io/badge/Node-18.17.0-red)](https://img.shields.io/badge/Node-18.17.0-red) diff --git a/docs/INTRODUCTION.md b/docs/INTRODUCTION.md index 139bf89..3cc939d 100644 --- a/docs/INTRODUCTION.md +++ b/docs/INTRODUCTION.md @@ -1,3 +1,9 @@ + + # Introduction.md ## The journey to a digitally inclusive society diff --git a/examples/supportModal.html b/examples/supportModal.html index f42cc56..15dce82 100644 --- a/examples/supportModal.html +++ b/examples/supportModal.html @@ -1,3 +1,9 @@ + + diff --git a/examples/userFeedback.html b/examples/userFeedback.html index 274acdc..2f71a5b 100644 --- a/examples/userFeedback.html +++ b/examples/userFeedback.html @@ -1,3 +1,9 @@ + + diff --git a/examples/userFeedback.jsx b/examples/userFeedback.jsx index 9808274..88f4a77 100644 --- a/examples/userFeedback.jsx +++ b/examples/userFeedback.jsx @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import React, { useEffect, useRef } from "react"; import { UserFeedback } from "path/to/InclusionToolbox"; diff --git a/jest.config.js b/jest.config.js index cac1d75..b859726 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + /** * For a detailed explanation regarding each configuration property, visit: * https://jestjs.io/docs/configuration diff --git a/src/assets/components/iframeElement.js b/src/assets/components/iframeElement.js index b1f17c4..d37b472 100644 --- a/src/assets/components/iframeElement.js +++ b/src/assets/components/iframeElement.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import "../css/iframeElement.css"; function IframeElement({ diff --git a/src/assets/components/supportModalElement.js b/src/assets/components/supportModalElement.js index 19eba4c..ffc1152 100644 --- a/src/assets/components/supportModalElement.js +++ b/src/assets/components/supportModalElement.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import "../css/base.css"; import "../css/supportModalElement.css"; import "../fonts/Lato-Regular.ttf"; diff --git a/src/assets/css/base.css b/src/assets/css/base.css index fe4c95b..8c0e357 100644 --- a/src/assets/css/base.css +++ b/src/assets/css/base.css @@ -1,3 +1,9 @@ +/* + * SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government + * + * SPDX-License-Identifier: CC0-1.0 + */ + @font-face { font-family: 'Lato'; src: local('Lato'); diff --git a/src/assets/css/iframeElement.css b/src/assets/css/iframeElement.css index a088ef1..4af8841 100644 --- a/src/assets/css/iframeElement.css +++ b/src/assets/css/iframeElement.css @@ -1,3 +1,9 @@ +/* + * SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government + * + * SPDX-License-Identifier: CC0-1.0 + */ + /** * iframe element styles for inclusion toolbox */ diff --git a/src/assets/css/supportModalElement.css b/src/assets/css/supportModalElement.css index c9d83eb..cd56dec 100644 --- a/src/assets/css/supportModalElement.css +++ b/src/assets/css/supportModalElement.css @@ -1,3 +1,9 @@ +/* + * SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government + * + * SPDX-License-Identifier: CC0-1.0 + */ + /** * Reset Button */ diff --git a/src/assets/translations.js b/src/assets/translations.js index 023593e..2529727 100644 --- a/src/assets/translations.js +++ b/src/assets/translations.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + const translations = { en: { translation: { help: "Help" } }, es: { translation: { help: "Ayuda" } }, diff --git a/src/embed/iframe/iframeHandler.js b/src/embed/iframe/iframeHandler.js index 31b90d1..2c97e3c 100644 --- a/src/embed/iframe/iframeHandler.js +++ b/src/embed/iframe/iframeHandler.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import PostMessageHandler from "./postMessageHandler.js"; import IframeElement from "../../assets/components/iframeElement.js"; diff --git a/src/embed/iframe/postMessageHandler.js b/src/embed/iframe/postMessageHandler.js index e72c178..6690844 100644 --- a/src/embed/iframe/postMessageHandler.js +++ b/src/embed/iframe/postMessageHandler.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + /* PostMessageHandler * A class to handle communication via postMessage * diff --git a/src/index.js b/src/index.js index afe4691..e12d34d 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import '@util/i18n.js'; import UserFeedback from '@service/userFeedback/userFeedback.js'; import SupportModal from '@service/supportModal/supportModal.js'; diff --git a/src/service/supportModal/messageHandlers.js b/src/service/supportModal/messageHandlers.js index 182efad..0152a18 100644 --- a/src/service/supportModal/messageHandlers.js +++ b/src/service/supportModal/messageHandlers.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + /** * Message handlers for the embed iframe. * diff --git a/src/service/supportModal/supportModal.js b/src/service/supportModal/supportModal.js index 06b0870..7770be4 100644 --- a/src/service/supportModal/supportModal.js +++ b/src/service/supportModal/supportModal.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import IframeHandler from "@embed/iframe/iframeHandler.js"; import ConfigManager from "@util/configManager.js"; import getFingerprint from "@util/fingerprint.js"; diff --git a/src/service/userFeedback/messageHandlers.js b/src/service/userFeedback/messageHandlers.js index ca71cec..0ed30b6 100644 --- a/src/service/userFeedback/messageHandlers.js +++ b/src/service/userFeedback/messageHandlers.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + /** * Message handlers for the embed iframe. * diff --git a/src/service/userFeedback/userFeedback.js b/src/service/userFeedback/userFeedback.js index 4336362..42bb26a 100644 --- a/src/service/userFeedback/userFeedback.js +++ b/src/service/userFeedback/userFeedback.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import IframeHandler from "@embed/iframe/iframeHandler.js"; import getFingerprint from "@util/fingerprint.js"; import messageHandlers from "./messageHandlers.js"; diff --git a/src/util/configManager.js b/src/util/configManager.js index b3de680..d30bd63 100644 --- a/src/util/configManager.js +++ b/src/util/configManager.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + const DEFAULT_CONFIG_PREFIX = process.env.CONFIG_PREFIX || "INCLUSION_TOOLBOX_"; /* * This is a singleton class that manages long lived configuration for the application. diff --git a/src/util/fingerprint.js b/src/util/fingerprint.js index 61249a2..1afcd15 100644 --- a/src/util/fingerprint.js +++ b/src/util/fingerprint.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import { getCurrentBrowserFingerPrint } from "@rajesh896/broprint.js"; /** diff --git a/src/util/i18n.js b/src/util/i18n.js index 1c20cf0..88ebe9b 100644 --- a/src/util/i18n.js +++ b/src/util/i18n.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import i18next from "i18next"; import LanguageDetector from "i18next-browser-languagedetector"; import translations from "../assets/translations.js"; diff --git a/test/assets/components/supportModalElement.test.js b/test/assets/components/supportModalElement.test.js index 013f019..bcb95bd 100644 --- a/test/assets/components/supportModalElement.test.js +++ b/test/assets/components/supportModalElement.test.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import SupportModalElement from "@src/assets/components/supportModalElement.js"; /** diff --git a/test/embed/iframe/iFrameHandler.test.js b/test/embed/iframe/iFrameHandler.test.js index 1dc6f9c..9e77a16 100644 --- a/test/embed/iframe/iFrameHandler.test.js +++ b/test/embed/iframe/iFrameHandler.test.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import IframeHandler from "@src/embed/iframe/iframeHandler.js"; /** diff --git a/test/embed/iframe/postMessageHandler.test.js b/test/embed/iframe/postMessageHandler.test.js index 0be44a0..95a1ab4 100644 --- a/test/embed/iframe/postMessageHandler.test.js +++ b/test/embed/iframe/postMessageHandler.test.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import PostMessageHandler from "@src/embed/iframe/postMessageHandler.js"; /** diff --git a/test/jest.setup.js b/test/jest.setup.js index ce6e99c..374e9e2 100644 --- a/test/jest.setup.js +++ b/test/jest.setup.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import { jest, describe, diff --git a/test/service/supportModal/supportModal.test.js b/test/service/supportModal/supportModal.test.js index 311ecb6..183e3a3 100644 --- a/test/service/supportModal/supportModal.test.js +++ b/test/service/supportModal/supportModal.test.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import SupportModal from "@src/service/supportModal/supportModal.js"; import IframeHandler from "@embed/iframe/iframeHandler.js"; import ConfigManager from "@util/configManager.js"; diff --git a/test/service/userFeedback/messageHandlers.test.js b/test/service/userFeedback/messageHandlers.test.js index 4fd4827..becd7a6 100644 --- a/test/service/userFeedback/messageHandlers.test.js +++ b/test/service/userFeedback/messageHandlers.test.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import messageHandlers from "@src/service/userFeedback/messageHandlers.js"; /** diff --git a/test/service/userFeedback/userFeedback.test.js b/test/service/userFeedback/userFeedback.test.js index 063c459..6aa7151 100644 --- a/test/service/userFeedback/userFeedback.test.js +++ b/test/service/userFeedback/userFeedback.test.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import UserFeedback from "@src/service/userFeedback/userFeedback.js"; /** diff --git a/test/service/util/configManager.test.js b/test/service/util/configManager.test.js index 591119c..629cc0d 100644 --- a/test/service/util/configManager.test.js +++ b/test/service/util/configManager.test.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import ConfigManager from "@src/util/configManager.js"; /** diff --git a/webpack.config.js b/webpack.config.js index da43434..2dfad99 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Digg - Agency for Digital Government +// +// SPDX-License-Identifier: MIT + import path from "path"; import { fileURLToPath } from "url"; import Dotenv from "dotenv-webpack";