commit
Remove codeberg intergration
diff --git a/.env.example b/.env.example
index 522d697..8ff2282 100644
--- a/.env.example
+++ b/.env.example
@@ -80,15 +80,15 @@ MINIGIT_TRASH_DAYS=30
# repositories are NOT announced unless you opt in.
#
# Mirror status — per repository, you can record where else it is kept on
-# GitHub and Codeberg. dough-git then reports whether those
+# GitHub. dough-git then reports whether those
# copies still exist and whether their refs match, using
# `git ls-remote` only. It never pushes, fetches, repairs
# or creates anything on a remote, and stores no
# credentials for them: a private mirror is marked
# `private` in the repo's `dough-links` file and skipped.
#
-# This means the server makes outbound HTTPS requests to discord.com,
-# github.com and codeberg.org — and, by host allow-list, nowhere else.
+# This means the server makes outbound HTTPS requests to discord.com
+# and github.com — and, by host allow-list, nowhere else.
# --- Single sign-on (Doughmination SSO / auth-server) ---------------------------
# Only needed to sign in to the web UI (private repos, tokens, settings).
diff --git a/src/urls.ts b/src/urls.ts
index 635544e..c883108 100644
--- a/src/urls.ts
+++ b/src/urls.ts
@@ -42,12 +42,11 @@ function parseStrict(
return url;
}
-export const MIRROR_KINDS = ["github", "codeberg"] as const;
+export const MIRROR_KINDS = ["github"] as const;
export type MirrorKind = (typeof MIRROR_KINDS)[number];
const MIRROR_HOSTS: Record<MirrorKind, string> = {
github: "github.com",
- codeberg: "codeberg.org",
};
export function isMirrorKind(value: string): value is MirrorKind {
diff --git a/test/mirror.test.mjs b/test/mirror.test.mjs
index c8b443e..f24edcf 100644
--- a/test/mirror.test.mjs
+++ b/test/mirror.test.mjs
@@ -186,7 +186,7 @@ check(
) === "missing",
);
check(
- "Codeberg credential challenge -> denied (private OR missing; honest)",
+ "credential challenge -> denied (private OR missing; honest)",
cls(
"fatal: could not read Username for 'https://codeberg.org': terminal prompts disabled",
) === "denied",
diff --git a/test/urls.test.mjs b/test/urls.test.mjs
index 7a7ce73..2a36ea5 100644
--- a/test/urls.test.mjs
+++ b/test/urls.test.mjs
@@ -25,25 +25,22 @@ const no = (kind, url, why) =>
console.log("\n-- kinds --");
check("github is a kind", isMirrorKind("github"));
-check("codeberg is a kind", isMirrorKind("codeberg"));
+check("codeberg is not", !isMirrorKind("codeberg"));
check("gitlab is not", !isMirrorKind("gitlab"));
-check("only two kinds exist", MIRROR_KINDS.length === 2);
+check("only one kind exists", MIRROR_KINDS.length === 1);
console.log("\n-- mirrors are given as user/repo --");
ok("github", "user/repo", "https://github.com/user/repo");
-ok("codeberg", "user/repo", "https://codeberg.org/user/repo");
ok("github", "Clove-Web/dough-git", "https://github.com/Clove-Web/dough-git");
ok("github", "user/repo.git", "https://github.com/user/repo");
ok("github", " user/repo ", "https://github.com/user/repo");
ok("github", "user/repo/", "https://github.com/user/repo");
-ok("codeberg", "My-User/my.repo_1", "https://codeberg.org/My-User/my.repo_1");
check("the path form is normalised", mirrorPath("github", " user/repo.git ") === "user/repo");
check("a slug round-trips for display", mirrorSlug("github", mirrorUrl("github", "a/b")) === "a/b");
check("a foreign url is left alone by the slug", mirrorSlug("github", "https://x.test/a/b") === "https://x.test/a/b");
console.log("\n-- profile repositories may start with a dot --");
-ok("codeberg", "Clove-Web/.profile", "https://codeberg.org/Clove-Web/.profile");
ok("github", "Clove-Web/.github", "https://github.com/Clove-Web/.github");
ok("github", ".owner/.repo", "https://github.com/.owner/.repo");
no("github", "user/.", "a bare dot repo");
@@ -68,16 +65,13 @@ no("github", `${"a".repeat(101)}/repo`, "an over-long owner");
console.log("\n-- valid mirror URLs --");
ok("github", "https://github.com/user/repo", "https://github.com/user/repo");
-ok("codeberg", "https://codeberg.org/user/repo", "https://codeberg.org/user/repo");
ok("github", "https://github.com/user/repo.git", "https://github.com/user/repo");
ok("github", "https://github.com/user/repo/", "https://github.com/user/repo");
ok("github", " https://github.com/user/repo ", "https://github.com/user/repo");
ok("github", "https://GitHub.com/user/repo", "https://github.com/user/repo");
-ok("codeberg", "https://codeberg.org/My-User/my.repo_1", "https://codeberg.org/My-User/my.repo_1");
console.log("\n-- wrong host --");
no("github", "https://codeberg.org/user/repo", "codeberg URL under github kind");
-no("codeberg", "https://github.com/user/repo", "github URL under codeberg kind");
no("github", "https://gitlab.com/user/repo", "unrelated forge");
no("github", "https://evil.test/user/repo", "arbitrary host");
no("github", "https://github.com.evil.test/user/repo", "suffixed host");