From f6dfce4f4cf45166d7ee6eb4d0ce070554d2d9f6 Mon Sep 17 00:00:00 2001 From: Yoriyasu Yano <430092+yorinasub17@users.noreply.github.com> Date: Sat, 30 Sep 2023 10:24:23 -0500 Subject: [PATCH] Add copyright header to all files Signed-off-by: Yoriyasu Yano <430092+yorinasub17@users.noreply.github.com> --- config/custom-environment-variables.json5 | 4 ++++ config/default.json5 | 4 ++++ deployments/dev/app.docker-compose.yml | 3 +++ deps.ts | 3 +++ fskconfig/loader_github.ts | 3 +++ fskconfig/loader_github_test.ts | 3 +++ fskconfig/mod.ts | 3 +++ fskconfig/parser.ts | 3 +++ fskconfig/parser_test.ts | 3 +++ ghauth/app.ts | 3 +++ ghauth/mod.ts | 3 +++ ghauth/rest_test.ts | 3 +++ ghauth/webhooks.ts | 3 +++ ghevent/checks.ts | 3 +++ ghevent/handler.ts | 3 +++ ghevent/installation.ts | 3 +++ ghevent/marketplace.ts | 3 +++ ghevent/mod.ts | 3 +++ ghevent/pullrequest.ts | 3 +++ main.ts | 3 +++ middlewares/base.ts | 3 +++ middlewares/ghevent.ts | 3 +++ middlewares/ghevent_test.ts | 3 +++ middlewares/mod.ts | 3 +++ mod.ts | 3 +++ patch/from.ts | 3 +++ patch/from_github.ts | 3 +++ patch/from_github_test.ts | 3 +++ patch/mod.ts | 3 +++ patch/patch.ts | 3 +++ patch/patch_types.ts | 3 +++ scripts/add_copyright.sh | 21 +++++++++++++++++++++ scripts/copyright.txt | 4 ++++ svcdata/mod.ts | 3 +++ svcdata/models.ts | 3 +++ svcdata/queue.ts | 3 +++ svcdata/store.ts | 3 +++ svcdata/svc.ts | 3 +++ test_deps.ts | 3 +++ udr/compile.ts | 3 +++ udr/interpreter.ts | 3 +++ udr/interpreter_test.ts | 3 +++ udr/mod.ts | 3 +++ web/app.ts | 3 +++ web/mod.ts | 3 +++ web/routes.ts | 3 +++ worker/app.ts | 3 +++ worker/mod.ts | 3 +++ 48 files changed, 165 insertions(+) create mode 100644 scripts/add_copyright.sh create mode 100644 scripts/copyright.txt diff --git a/config/custom-environment-variables.json5 b/config/custom-environment-variables.json5 index fc6c6ab..043ef40 100644 --- a/config/custom-environment-variables.json5 +++ b/config/custom-environment-variables.json5 @@ -1,3 +1,7 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + + { configFileSizeLimit: { __name: "FENSAK_CONFIG_FILE_SIZE_LIMIT", diff --git a/config/default.json5 b/config/default.json5 index e677df0..7f4c13d 100644 --- a/config/default.json5 +++ b/config/default.json5 @@ -1,3 +1,7 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + + // NOTE // Many of these are secrets, and thus are sourced from environment variables // (see ./custom-environment-variables.json5). diff --git a/deployments/dev/app.docker-compose.yml b/deployments/dev/app.docker-compose.yml index f98900a..b619c6a 100644 --- a/deployments/dev/app.docker-compose.yml +++ b/deployments/dev/app.docker-compose.yml @@ -1,3 +1,6 @@ +# Copyright (c) Fensak, LLC. +# SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + # Docker compose file for starting a dev environment of the full fensak application. Depends on db.docker-compose.yml to # provide the database. version: "3.9" diff --git a/deps.ts b/deps.ts index 74f08b5..bade749 100644 --- a/deps.ts +++ b/deps.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + export { crypto, toHashString, diff --git a/fskconfig/loader_github.ts b/fskconfig/loader_github.ts index f57eb46..c6394d8 100644 --- a/fskconfig/loader_github.ts +++ b/fskconfig/loader_github.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { base64, config, Octokit, path } from "../deps.ts"; import { compileRuleFn, RuleFnSourceLang } from "../udr/mod.ts"; diff --git a/fskconfig/loader_github_test.ts b/fskconfig/loader_github_test.ts index c9a6a57..5bce23a 100644 --- a/fskconfig/loader_github_test.ts +++ b/fskconfig/loader_github_test.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { assert, assertEquals, diff --git a/fskconfig/mod.ts b/fskconfig/mod.ts index e154e36..d775326 100644 --- a/fskconfig/mod.ts +++ b/fskconfig/mod.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + /** * fskconfig * Contains the routines for parsing the Fensak Config. Supports loading from: diff --git a/fskconfig/parser.ts b/fskconfig/parser.ts index 8fb2d53..53fb0ee 100644 --- a/fskconfig/parser.ts +++ b/fskconfig/parser.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { Ajv, path, toml, yaml } from "../deps.ts"; import { RuleFnSourceLang } from "../udr/mod.ts"; diff --git a/fskconfig/parser_test.ts b/fskconfig/parser_test.ts index 335d4c9..4e9f69a 100644 --- a/fskconfig/parser_test.ts +++ b/fskconfig/parser_test.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { assertEquals, assertThrows, path } from "../test_deps.ts"; import { parseConfigFile } from "./parser.ts"; import { RuleFnSourceLang } from "../udr/mod.ts"; diff --git a/ghauth/app.ts b/ghauth/app.ts index ebdcb58..c3c04df 100644 --- a/ghauth/app.ts +++ b/ghauth/app.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { base64, config, Octokit, octokitCreateAppAuth } from "../deps.ts"; const privateKeyBytes = base64.decode(config.get("github.app.privateKey")); diff --git a/ghauth/mod.ts b/ghauth/mod.ts index 5598fc9..6784ce7 100644 --- a/ghauth/mod.ts +++ b/ghauth/mod.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + /** * ghauth * Contains utilities and constants for authenticating to GitHub API and Webhooks. diff --git a/ghauth/rest_test.ts b/ghauth/rest_test.ts index 4b1306b..7d21fae 100644 --- a/ghauth/rest_test.ts +++ b/ghauth/rest_test.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { config, Octokit } from "../deps.ts"; const token = config.get("github.apiToken"); diff --git a/ghauth/webhooks.ts b/ghauth/webhooks.ts index b856d7e..011a268 100644 --- a/ghauth/webhooks.ts +++ b/ghauth/webhooks.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { config, GitHubWebhooks } from "../deps.ts"; const secret = config.get("github.webhookSecret"); diff --git a/ghevent/checks.ts b/ghevent/checks.ts index 2e8e0c6..9693cf6 100644 --- a/ghevent/checks.ts +++ b/ghevent/checks.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { Octokit } from "../deps.ts"; import { IRuleLogEntry } from "../udr/mod.ts"; diff --git a/ghevent/handler.ts b/ghevent/handler.ts index d92fb4d..a256842 100644 --- a/ghevent/handler.ts +++ b/ghevent/handler.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { GitHubInstallationEvent, GitHubMarketplacePurchaseEvent, diff --git a/ghevent/installation.ts b/ghevent/installation.ts index 4d3af46..4257385 100644 --- a/ghevent/installation.ts +++ b/ghevent/installation.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { config } from "../deps.ts"; import type { GitHubInstallationEvent } from "../deps.ts"; diff --git a/ghevent/marketplace.ts b/ghevent/marketplace.ts index 601c510..6285e65 100644 --- a/ghevent/marketplace.ts +++ b/ghevent/marketplace.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { config } from "../deps.ts"; import type { GitHubMarketplacePurchaseEvent } from "../deps.ts"; diff --git a/ghevent/mod.ts b/ghevent/mod.ts index 8079476..a0dfc53 100644 --- a/ghevent/mod.ts +++ b/ghevent/mod.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + /** * ghevent * Contains handlers for GitHub webhook events that can be loaded into the Webhooks object to process the events. diff --git a/ghevent/pullrequest.ts b/ghevent/pullrequest.ts index c07cde4..8e3d22b 100644 --- a/ghevent/pullrequest.ts +++ b/ghevent/pullrequest.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { config, Octokit } from "../deps.ts"; import type { GitHubPullRequestEvent, diff --git a/main.ts b/main.ts index 39054b9..f092312 100644 --- a/main.ts +++ b/main.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { startWorker } from "./worker/mod.ts"; import { startWebServer } from "./web/mod.ts"; diff --git a/middlewares/base.ts b/middlewares/base.ts index 7774261..7ff225a 100644 --- a/middlewares/base.ts +++ b/middlewares/base.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { Context, crypto, Status } from "../deps.ts"; import type { Middleware, Next } from "../deps.ts"; diff --git a/middlewares/ghevent.ts b/middlewares/ghevent.ts index ba8b706..9b78c17 100644 --- a/middlewares/ghevent.ts +++ b/middlewares/ghevent.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { Context, Status } from "../deps.ts"; import type { Middleware, Next } from "../deps.ts"; import { githubWebhooks } from "../ghauth/mod.ts"; diff --git a/middlewares/ghevent_test.ts b/middlewares/ghevent_test.ts index 2ba9e21..3acd07e 100644 --- a/middlewares/ghevent_test.ts +++ b/middlewares/ghevent_test.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { assertEquals, assertNotEquals, diff --git a/middlewares/mod.ts b/middlewares/mod.ts index 3a9a7d7..1cb6cdf 100644 --- a/middlewares/mod.ts +++ b/middlewares/mod.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + /** * middlewares * Contains middlewares used by the web server. diff --git a/mod.ts b/mod.ts index af00954..ce90821 100644 --- a/mod.ts +++ b/mod.ts @@ -1,2 +1,5 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + export * from "./udr/mod.ts"; export * from "./patch/mod.ts"; diff --git a/patch/from.ts b/patch/from.ts index 4de28f1..3ef69be 100644 --- a/patch/from.ts +++ b/patch/from.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + export enum SourcePlatform { GitHub = "gh", } diff --git a/patch/from_github.ts b/patch/from_github.ts index 2223950..fd0c819 100644 --- a/patch/from_github.ts +++ b/patch/from_github.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { crypto, hex, Octokit, toHashString } from "../deps.ts"; import { parseUnifiedDiff } from "./patch.ts"; diff --git a/patch/from_github_test.ts b/patch/from_github_test.ts index a670386..e6c934e 100644 --- a/patch/from_github_test.ts +++ b/patch/from_github_test.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { assertEquals, assertNotEquals } from "../test_deps.ts"; import { octokitRestTestClt } from "../ghauth/rest_test.ts"; diff --git a/patch/mod.ts b/patch/mod.ts index 37ac32d..7e61609 100644 --- a/patch/mod.ts +++ b/patch/mod.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + /** * patch * Contains types, functions, and utilities for defining and fetching patches to be used by the different rules. diff --git a/patch/patch.ts b/patch/patch.ts index 5bb6ba3..89d24ea 100644 --- a/patch/patch.ts +++ b/patch/patch.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { IHunk, ILineDiff, LineOp } from "./patch_types.ts"; /** diff --git a/patch/patch_types.ts b/patch/patch_types.ts index 109faf1..a3b25aa 100644 --- a/patch/patch_types.ts +++ b/patch/patch_types.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + /** * The operation on a line in a hunk of a patch. * @property Unknown Unknown operation. diff --git a/scripts/add_copyright.sh b/scripts/add_copyright.sh new file mode 100644 index 0000000..0d55b35 --- /dev/null +++ b/scripts/add_copyright.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Copyright (c) Fensak, LLC. +# SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + +function add_copyright { + local -r pattern="$1" + + for i in $(find . -name "$pattern") + do + if ! grep -q Copyright $i + then + cat copyright.txt $i >$i.new && mv $i.new $i + fi + done + + deno fmt . +} + +add_copyright '*.ts' +add_copyright '*.json5' diff --git a/scripts/copyright.txt b/scripts/copyright.txt new file mode 100644 index 0000000..828ed99 --- /dev/null +++ b/scripts/copyright.txt @@ -0,0 +1,4 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + + diff --git a/svcdata/mod.ts b/svcdata/mod.ts index c1c1196..0234755 100644 --- a/svcdata/mod.ts +++ b/svcdata/mod.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + /** * svcdata * Contains functions for interacting with persistent storage backed by deno kv. diff --git a/svcdata/models.ts b/svcdata/models.ts index caa8e64..7c4abd4 100644 --- a/svcdata/models.ts +++ b/svcdata/models.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { RuleFnSourceLang } from "../udr/mod.ts"; /** diff --git a/svcdata/queue.ts b/svcdata/queue.ts index 2310433..81dfb49 100644 --- a/svcdata/queue.ts +++ b/svcdata/queue.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { GitHubWebhookEvent, GitHubWebhookEventName } from "../deps.ts"; import { mainKV } from "./svc.ts"; diff --git a/svcdata/store.ts b/svcdata/store.ts index 3aba996..fae5dd4 100644 --- a/svcdata/store.ts +++ b/svcdata/store.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { crypto } from "../deps.ts"; import { mainKV } from "./svc.ts"; diff --git a/svcdata/svc.ts b/svcdata/svc.ts index 6ad9dc9..3513c32 100644 --- a/svcdata/svc.ts +++ b/svcdata/svc.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + // Export a handle to the main KV store. This is only used internal to the package to ensure the same handle is being // used by all the functions (and thus is not reexported in mod.ts like all other functions). export const mainKV = await Deno.openKv(); diff --git a/test_deps.ts b/test_deps.ts index dd8c599..f1c430d 100644 --- a/test_deps.ts +++ b/test_deps.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + export { assert, assertEquals, diff --git a/udr/compile.ts b/udr/compile.ts index 1ca6ed8..2acda41 100644 --- a/udr/compile.ts +++ b/udr/compile.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { babel, babelPresetEnv, diff --git a/udr/interpreter.ts b/udr/interpreter.ts index b0d5782..ab6f5ec 100644 --- a/udr/interpreter.ts +++ b/udr/interpreter.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { Interpreter, Octokit } from "../deps.ts"; import { IPatch } from "../patch/mod.ts"; diff --git a/udr/interpreter_test.ts b/udr/interpreter_test.ts index a682d6e..5099263 100644 --- a/udr/interpreter_test.ts +++ b/udr/interpreter_test.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { assert, assertEquals, diff --git a/udr/mod.ts b/udr/mod.ts index 964d9ee..10e897a 100644 --- a/udr/mod.ts +++ b/udr/mod.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + /** * udr - User Defined Rules * Contains functions and utilities for running user defined rules in Fensak. diff --git a/web/app.ts b/web/app.ts index 7af6705..e3bf95d 100644 --- a/web/app.ts +++ b/web/app.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { Application, Router } from "../deps.ts"; import * as middlewares from "../middlewares/mod.ts"; diff --git a/web/mod.ts b/web/mod.ts index ceca836..9932314 100644 --- a/web/mod.ts +++ b/web/mod.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + /** * web * Contains the core application code for the webserver driving Fensak. diff --git a/web/routes.ts b/web/routes.ts index cf52ef5..80b2031 100644 --- a/web/routes.ts +++ b/web/routes.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { Context, GitHubWebhookEventName, Router, Status } from "../deps.ts"; import * as middlewares from "../middlewares/mod.ts"; diff --git a/worker/app.ts b/worker/app.ts index b58b7bf..359d409 100644 --- a/worker/app.ts +++ b/worker/app.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + import { handleGitHubEvent } from "../ghevent/mod.ts"; import { enqueueMsg, diff --git a/worker/mod.ts b/worker/mod.ts index 6bcdb2b..88f5f54 100644 --- a/worker/mod.ts +++ b/worker/mod.ts @@ -1,3 +1,6 @@ +// Copyright (c) Fensak, LLC. +// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1 + /** * worker * Contains the core application code for the Deno KV Queue backed worker driving Fensak.