Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

Packages: only private and public visibility (#21)

Container packages are now private or public, matching Diffinery dropping internal visibility.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ruyx3Qr4jYrZEpPi466deb
Canberk Demirci authored · GitHub committed signed1 parent 70b8cadcommit ec41a5a2dd670b8a2c78324b60891a5795f47eccBrowse files
5 files changed+11−12
Files (5)
modifiedapps/diffinery/src/registry/access.ts+4−4View file
@@ -10,7 +10,7 @@
1010 * - A package linked to a repository shares its permissions: readers pull, writers push,
1111 * admins delete. The owner (the user, or the organization's owners and admins) always
1212 * administers its packages; organization members can push to unlinked ones.
13- * - Packages are private unless made internal (any signed-in account pulls) or public.
13+ * - Packages are private unless made public.
1414 * - A workflow's GITHUB_TOKEN follows the job's `packages` permission. It pulls packages
1515 * of its own owner, pushes to its repository's packages (creating them, linked to the
1616 * repository, on first push) and deletes their versions.
@@ -63,7 +63,7 @@
6363 let hint: string | undefined;
6464 if (pkg) {
6565 const linked = pkg.repo_id === repo.id;
66- if (perm !== "none" && (linked || sameOwner || pkg.visibility !== "private")) role = "pull";
66+ if (perm !== "none" && (linked || sameOwner || pkg.visibility === "public")) role = "pull";
6767 if (perm === "write" && linked) role = "admin";
6868 else if (perm === "write" && sameOwner && !pkg.repo_id) role = "push";
6969 else if (pkg.repo_id && !linked) hint = `${owner.login}/${pkg.name} belongs to the ${owner.login}/${pkg.repo_name ?? "?"} repository, so only its workflows can push to it`;
@@ -107,12 +107,12 @@
107107 }
108108 }
109109 }
110- if (pkg && (pkg.visibility === "public" || pkg.visibility === "internal")) role = max(role, "pull");
110+ if (pkg?.visibility === "public") role = max(role, "pull");
111111
112112 if (p.via === "token") {
113113 if (p.repoIds) {
114114 const rid = pkg ? pkg.repo_id : linkRepo?.id;
115- if (!rid || !p.repoIds.includes(rid)) role = pkg && pkg.visibility !== "private" ? "pull" : "none";
115+ if (!rid || !p.repoIds.includes(rid)) role = pkg?.visibility === "public" ? "pull" : "none";
116116 }
117117 const cap = p.scopes.reduce<PackageRole>((best, s) => max(best, SCOPE_CAP[s]), "none");
118118 role = min(role, cap);
modifiedapps/diffinery/src/registry/api.ts+1−1View file
@@ -115,7 +115,7 @@
115115 const b = (await c.req.json().catch(() => ({}))) as { visibility?: string; repository?: string | null };
116116 const patch: Parameters<RegistryStore["updatePackage"]>[1] = {};
117117 if (b.visibility !== undefined) {
118- if (!["private", "internal", "public"].includes(b.visibility)) throw new HttpError(422, "visibility must be private, internal or public");
118+ if (!["private", "public"].includes(b.visibility)) throw new HttpError(422, "visibility must be private or public");
119119 patch.visibility = b.visibility as PackageRow["visibility"];
120120 }
121121 if (b.repository !== undefined) {
modifiedapps/diffinery/src/registry/store.ts+2−2View file
@@ -10,7 +10,7 @@
1010 name: string;
1111 repo_id: string | null;
1212 repo_name: string | null;
13- visibility: "private" | "internal" | "public";
13+ visibility: "private" | "public";
1414 description: string | null;
1515 created_by: string | null;
1616 created_at: string;
@@ -108,7 +108,7 @@
108108 ors.push(`p.repo_id IN (${filter.repoIds.map(() => "?").join(",")})`);
109109 params.push(...filter.repoIds);
110110 }
111- ors.push("p.visibility != 'private'");
111+ ors.push("p.visibility = 'public'");
112112 where.push(`(${ors.join(" OR ")})`);
113113 }
114114 const q = `SELECT p.*, a.login AS owner_login, a.kind AS owner_kind, r.name AS repo_name,
modifiedapps/diffinery/src/web/packages.tsx+2−3View file
@@ -43,7 +43,7 @@
4343 return { store, pkg, access };
4444 }
4545
46-const VisIcon = ({ v }: { v: string }) => <span class="st faint">{raw(v === "public" ? ICONS.globe : v === "internal" ? ICONS.org : ICONS.lock)}</span>;
46+const VisIcon = ({ v }: { v: string }) => <span class="st faint">{raw(v === "public" ? ICONS.globe : ICONS.lock)}</span>;
4747
4848 const PackageList = ({ c, rows, showRepo, empty }: { c: AppContext; rows: Array<PackageRow & { version_count?: number; tag_count?: number }>; showRepo: boolean; empty: Child }) =>
4949 rows.length ? (
@@ -246,7 +246,6 @@
246246 value={pkg.visibility}
247247 options={[
248248 { value: "private", label: "Private: people with access to the linked repository or the owner" },
249- { value: "internal", label: "Internal: anyone signed in to Diffinery" },
250249 { value: "public", label: "Public: anyone, without signing in" },
251250 ]}
252251 />
@@ -283,7 +282,7 @@
283282 pkgUrl({ owner_login: owner.login, name }),
284283 async () => {
285284 const { store, pkg, access } = await loadPackage(c, owner, name, "admin");
286- const visibility = (["private", "internal", "public"] as const).find((v) => v === f.s("visibility"));
285+ const visibility = (["private", "public"] as const).find((v) => v === f.s("visibility"));
287286 const repoName = f.s("repository").trim();
288287 const repoId = repoName ? (await loadRepo(c, owner.login, repoName, "admin")).repo.id : null;
289288 await store.updatePackage(pkg.id, { visibility, repoId });
modifieddocs/container-registry.md+2−2View file
@@ -117,8 +117,8 @@
117117 an image with the label is pushed.
118118
119119 The link can also be changed on the package's settings page or through the
120-API. Packages are **private** by default. **Internal** lets every signed-in
121-account pull; **public** lets anyone pull without signing in.
120+API. Packages are **private** by default; **public** lets anyone pull without
121+signing in.
122122
123123 Pages:
124124