Commit 2699bbde3c

2699bbde3c0f0959907febea96062fd1f91bb85c

parent: bb48e9eeb6

Unsigned

Alicia Sykes <alicia@omg.lol> ยท 2026-06-05 19:34 UTC

Adds support for CodeBerg and generig git hosts

Layout: unified ยท split

.github/CONTRIBUTING.md +27 โˆ’20
@@ -130,6 +130,8 @@ classDiagram
130130 +description: string
131131 +url: string
132132 +github: string?
133 +codeberg: string?
134 +git: string?
133135 +icon: string?
134136 +followWith: string?
135137 +securityAudited: boolean?
@@ -155,26 +157,26 @@ At a high-level, the file exports an array of categories, each containing a `nam
155157categories:
156158 - name: Essentials
157159 sections: []
158- name: Communication
160 - name: Communication
159161 sections: []
160 - name: Security Tools
162 - name: Security Tools
161163 sections: []
162164```
163165
164166Each category contains a `name` an array of `sections` (like sub-categories)
165167
166168```yaml
167 - name: Communication
168 sections:
169 - name: Encrypted Messaging
170 services: []
171 - name: P2P Messaging
172 intro: ...
173 services: []
174 - name: Encrypted Email
175 services: []
176 - name: Email Clients
177 services: []
169 - name: Communication
170 sections:
171 - name: Encrypted Messaging
172 services: []
173 - name: P2P Messaging
174 intro: ...
175 services: []
176 - name: Encrypted Email
177 services: []
178 - name: Email Clients
179 services: []
178180```
179181
180182And within each section, we find a list of `services`, each containing a listing. For example:
@@ -213,6 +215,9 @@ Each service (aka an app/website/software) has the following fields:
213215| `url` | The fully qualified domain name of the listing's homepage | `string` | Required |
214216| `icon` | A path to an icon file for the listing's logo. Must be square, no less than 64x64 and no larger than 512x512 pixels | `string` | Required |
215217| `github` | The GitHub repository hosting the listing's source code. In the format of `[owner]/[repo]` | `string` | Optional |
218| `codeberg` | The Codeberg repository hosting the listing's source code. In the format of `[owner]/[repo]` | `string` | Optional |
219| `git` | Full URL to the listing's source repository on any other git host (GitLab, Gitea, self-hosted, etc.) | `string` | Optional |
220| `followWith` | Short text shown in parentheses after the listing's name, e.g. its platform, if not cross-platform | `string` | Optional |
216221| `securityAudited` | Has the listing been audited by an accredited security researcher, with the report publicly published? | `bool` | Optional |
217222| `acceptsCrypto` | If payment is required/accepted, do they accept anonymous payments using cryptocurrency, such as Monero? | `bool` | Optional |
218223| `openSource` | Is the source code in its entirety published somewhere accessible so it can be built-from-source or self-hosted? | `bool` | Optional |
@@ -266,9 +271,11 @@ Below is the full list of checks - it's basically the same as what is listed in
266271 - ๐ŸŸก **Duplicate name** - Service name must not already exist
267272 - ๐ŸŸก **Duplicate URL** - Service URL must not already exist
268273 - ๐ŸŸก **Description length** - Should be 50โ€“250 characters
269 - ๐ŸŸก **Open source + GitHub** - If marked open source, must include `github` field
274 - ๐ŸŸก **Open source + repo** - If marked open source, must include a `github`, `codeberg` or `git` field
270275- **Project Health**
271276 - ๐ŸŸก **Links reachable** - Service URL and icon must not return 404
277 - ๐ŸŸก **Repo exists** - The linked GitHub repository must not return a 404
278 - ๐ŸŸก **New account** - Flags PRs from very recently created GitHub accounts
272279 - ๐ŸŸก **Author disclosure** - If PR author owns the repo, they should disclose it
273280 - ๐ŸŸก **Not inactive** - Repo should have a push within the last 90 days
274281 - ๐ŸŸก **Minimum age** - Repo should be โ‰ฅ4 months old
@@ -278,13 +285,13 @@ Below is the full list of checks - it's basically the same as what is listed in
278285 - ๐ŸŸก **Not archived** - Repo must not be archived
279286 - ๐ŸŸก **No security alerts** - No open critical/high Dependabot alerts
280287 - ๐ŸŸก **Minimum stars** - Repo should have โ‰ฅ100 stars
281 - ๐ŸŸก **Spam detection** - Flags if user opened โ‰ฅ5 PRs to other awesome-* repos in 24h
288 - ๐ŸŸก **Spam detection** - Flags if the author opened โ‰ฅ3 PRs to other awesome-* repos, or PRs across โ‰ฅ7 distinct repos, in the last 2 days
282289- **Addition Info** (fyi only, no pass/fail requirements or warnings)
283 - ๐Ÿ”ต **Website check** (if has `website`) - Quickly checks for basic security requirements for website
284 - ๐Ÿ”ต **Source check** (if has `github`) - Brief audit of core GitHub metrics from submitted the repo
285 - ๐Ÿ”ต **Android check** (if has `android`) - Lists the trackers, permissions and stats for the Android app
286 - ๐Ÿ”ต **iOS check** (if has `ios`) - Shows average rating, and app stats from the Apple App Store
287 - ๐Ÿ”ต **Privacy Policy check** (if has `tosdr`) - Outputs the privacy score from ToS;DR and links to policy
290 - ๐Ÿ”ต **Website check** (if has `url`) - Quickly checks for basic security requirements for website
291 - ๐Ÿ”ต **Source check** (if has `github`) - Brief audit of core GitHub metrics from the submitted repo
292 - ๐Ÿ”ต **Android check** (if has `androidApp`) - Lists the trackers, permissions and stats for the Android app
293 - ๐Ÿ”ต **iOS check** (if has `iosApp`) - Shows average rating, and app stats from the Apple App Store
294 - ๐Ÿ”ต **Privacy Policy check** (if has `tosdrId`) - Outputs the privacy score from ToS;DR and links to policy
288295
289296</details>
290297
api/open-api-spec.yml +4
@@ -152,6 +152,10 @@ components:
152152 properties:
153153 github:
154154 type: string
155 codeberg:
156 type: string
157 git:
158 type: string
155159 icon:
156160 type: string
157161 followWith:
api/src/types.ts +2
@@ -7,6 +7,8 @@ export interface ShortService {
77
88export interface Service extends ShortService {
99 github?: string;
10 codeberg?: string;
11 git?: string;
1012 icon?: string;
1113 followWith?: string;
1214 securityAudited?: boolean;
lib/checks/check-additions.py +10 โˆ’4
@@ -21,6 +21,7 @@ SCHEMA_ERRORS_PATH = "/tmp/schema-errors.json"
2121MAX_SCHEMA_ERRORS_SHOWN = 10
2222
2323REQUIRED_FIELDS = ("name", "description", "url", "icon")
24REPO_FIELDS = ("github", "codeberg", "git")
2425
2526CONTRIBUTING = "https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md"
2627
@@ -57,11 +58,16 @@ DESC_LENGTH_MSG = (
5758 f" character range. Please see our [Contributing Guidelines]({CONTRIBUTING}#description)"
5859)
5960OPENSOURCE_GITHUB_MSG = (
60 "You marked this service as open source but didn't include a `github` field."
61 " Please add the repository link"
61 "You marked this service as open source but didn't include a repository link."
62 " Please add a `github`, `codeberg` or `git` field"
6263)
6364
6465
66def _has_repo(fields):
67 """Return True if a service has any source-repository field set."""
68 return any(fields.get(f) for f in REPO_FIELDS)
69
70
6571def load_json(path):
6672 """Load JSON from a file, returning None on any error."""
6773 try:
@@ -140,7 +146,7 @@ def check_open_source(diff):
140146 """Return a finding if an added service has openSource missing or not true."""
141147 for svc in diff.get("services", {}).get("added", []):
142148 fields = svc.get("fields", {})
143 if fields.get("openSource") is not True and not fields.get("github"):
149 if fields.get("openSource") is not True and not _has_repo(fields):
144150 return OPENSOURCE_MSG
145151 return None
146152
@@ -239,7 +245,7 @@ def check_opensource_github(diff):
239245 """Return a finding if an added service is open source but has no github field."""
240246 for svc in diff.get("services", {}).get("added", []):
241247 fields = svc.get("fields", {})
242 if fields.get("openSource") is True and not fields.get("github"):
248 if fields.get("openSource") is True and not _has_repo(fields):
243249 return OPENSOURCE_GITHUB_MSG
244250 return None
245251
lib/review-listings.py +9 โˆ’5
@@ -6,7 +6,7 @@ Checks:
66- https-url: homepage URL uses HTTPS
77- icon-reachable: icon URL does not 404
88- description-len: description is 50 to 280 chars (over 420 escalates to warn)
9- opensource-github: openSource listings include a github field
9- opensource-github: openSource listings include a github, codeberg or git field
1010- duplicate-url: no URL appears in more than one listing
1111- androidApp-valid: androidApp is a package name, not a URL
1212- iosApp-reachable: App Store URL resolves
@@ -222,10 +222,14 @@ def _description_len(entry: Entry, ctx: Context) -> Iterable[Finding]:
222222
223223@check("opensource-github")
224224def _opensource_github(entry: Entry, ctx: Context) -> Iterable[Finding]:
225 """openSource: true services must include a github field."""
226 if entry.service.get("openSource") is True and not entry.service.get("github"):
227 yield _finding(entry, "opensource-github", "warn",
228 "marked openSource but missing `github` field")
225 """openSource: true services must include a github, codeberg or git field."""
226 svc = entry.service
227 if svc.get("openSource") is True and not (
228 svc.get("github") or svc.get("codeberg") or svc.get("git")
229 ):
230 yield _finding(entry, "opensource-github", "error",
231 "marked openSource but missing a repository link "
232 "(`github`, `codeberg` or `git`)")
229233
230234
231235@check("androidApp-valid")
lib/schema.json +8
@@ -32,6 +32,14 @@
3232 "type": ["string", "null"],
3333 "pattern": "^([a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+|https://github\\.com/.+)$"
3434 },
35 "codeberg": {
36 "type": ["string", "null"],
37 "pattern": "^([a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+|https://codeberg\\.org/.+)$"
38 },
39 "git": {
40 "type": ["string", "null"],
41 "pattern": "^https?://.+"
42 },
3543 "icon": {
3644 "type": ["string", "null"],
3745 "pattern": "^https?://.+"
lib/validate-awesome-privacy.py +3 โˆ’1
@@ -57,7 +57,9 @@ def resolve_path(data, path_parts):
5757FIELD_HINTS = {
5858 "url": "must start with http:// or https://",
5959 "icon": "must start with http:// or https://",
60 "github": "must be `user/repo` or a full https://github.com/... URL",
60 "github": "must be `user/repo`",
61 "codeberg": "must be `user/repo`",
62 "git": "must be a full http(s):// URL to the source repository",
6163 "iosApp": "must be a full https://apps.apple.com/... URL",
6264 "androidApp": "must be a package name like `com.example.app`",
6365 "discordInvite": "must be a discord invite code or https://discord.gg/... URL",
web/src/components/things/ChangelogTimeline.svelte +4 โˆ’4
@@ -611,16 +611,16 @@
611611 color: var(--changelog-add);
612612 }
613613 &.rem {
614 background: color-mix(in srgb, var(--changelog-rem) 33%, transparent);
615 color: var(--changelog-rem);
614 background: color-mix(in srgb, var(--changelog-rej) 33%, transparent);
615 color: var(--changelog-rej);
616616 }
617617 &.mod {
618618 background: color-mix(in srgb, var(--changelog-mod) 33%, transparent);
619619 color: var(--changelog-mod);
620620 }
621621 &.rej {
622 background: color-mix(in srgb, var(--changelog-rej) 33%, transparent);
623 color: var(--changelog-rej);
622 background: color-mix(in srgb, var(--changelog-rem) 33%, transparent);
623 color: var(--changelog-rem);
624624 }
625625 }
626626
web/src/components/things/ListingHero.astro +14 โˆ’2
@@ -1,7 +1,7 @@
11---
22import type { Section, Service } from '../../types/Service';
33import { slugify } from '@utils/fetch-data';
4import { parseMarkdown, formatLink } from '@utils/parse-markdown';
4import { parseMarkdown, formatLink, codebergUrl } from '@utils/parse-markdown';
55import FontAwesome from '@components/form/FontAwesome.svelte';
66import SaveListing from '@components/things/SaveListing.svelte';
77import ServiceIcon from '@components/things/ServiceIcon.astro';
@@ -19,6 +19,8 @@ const {
1919 description,
2020 url,
2121 github,
22 codeberg,
23 git,
2224 tosdrId,
2325 iosApp,
2426 androidApp,
@@ -46,6 +48,16 @@ const infoLinks = [
4648 href: `https://github.com/${github}`,
4749 text: `github.com/${github}`,
4850 },
51 codeberg && {
52 label: 'Codeberg',
53 href: codebergUrl(codeberg),
54 text: formatLink(codebergUrl(codeberg)),
55 },
56 git && {
57 label: 'Source',
58 href: git,
59 text: formatLink(git),
60 },
4961 tosdrId && {
5062 label: 'Privacy',
5163 href: privacyPolicyLink,
@@ -104,7 +116,7 @@ const highlights = [
104116 cls: 'warning',
105117 title: `${name} is not open source`,
106118 },
107 (openSource || (github && openSource !== false)) && {
119 (openSource || ((github || codeberg || git) && openSource !== false)) && {
108120 icon: 'openSource',
109121 text: 'Open Source',
110122 cls: 'great',
web/src/components/things/ServiceCard.astro +15 โˆ’1
@@ -1,5 +1,5 @@
11---
2import { formatLink } from '@utils/parse-markdown';
2import { formatLink, codebergUrl } from '@utils/parse-markdown';
33import type { Service } from 'src/types/Service';
44import FontAwesome from '@components/form/FontAwesome.svelte';
55import SaveListing from '@components/things/SaveListing.svelte';
@@ -54,6 +54,20 @@ const { service, sectionName, categoryName } = Astro.props;
5454 </a>
5555 )
5656 }
57 {
58 service.codeberg && (
59 <a class="link" href={codebergUrl(service.codeberg)}>
60 <FontAwesome iconName="sourceCode" /> Codeberg
61 </a>
62 )
63 }
64 {
65 service.git && (
66 <a class="link" href={service.git}>
67 <FontAwesome iconName="sourceCode" /> Source
68 </a>
69 )
70 }
5771 <a
5872 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}
5973 >
web/src/components/things/ServiceCard.svelte +21 โˆ’1
@@ -2,7 +2,7 @@
22 import FontAwesome from '@components/form/FontAwesome.svelte';
33 import SaveListing from '@components/things/SaveListing.svelte';
44 import { slugify } from '@utils/fetch-data';
5 import { formatLink } from '@utils/parse-markdown';
5 import { formatLink, codebergUrl } from '@utils/parse-markdown';
66 import type { Service } from 'src/types/Service';
77
88 interface Props {
@@ -70,6 +70,26 @@
7070 <FontAwesome iconName="sourceCode" /> GitHub
7171 </a>
7272 {/if}
73 {#if service.codeberg}
74 <a
75 class="link"
76 href={codebergUrl(service.codeberg)}
77 target="_blank"
78 rel="noopener noreferrer"
79 >
80 <FontAwesome iconName="sourceCode" /> Codeberg
81 </a>
82 {/if}
83 {#if service.git}
84 <a
85 class="link"
86 href={service.git}
87 target="_blank"
88 rel="noopener noreferrer"
89 >
90 <FontAwesome iconName="sourceCode" /> Source
91 </a>
92 {/if}
7393 <a href={`/${categorySlug}/${sectionSlug}/${serviceRef}`}>
7494 <FontAwesome iconName="viewReport" /> View Report โž”
7595 </a>
web/src/components/things/ServiceList.astro +24 โˆ’2
@@ -1,6 +1,6 @@
11---
22import Button from '@components/form/Button.astro';
3import { parseMarkdown, formatLink } from '@utils/parse-markdown';
3import { parseMarkdown, formatLink, codebergUrl } from '@utils/parse-markdown';
44import type { Service } from 'src/types/Service';
55import FontAwesome from '@components/form/FontAwesome.svelte';
66import DeleteListing from '@components/things/DeleteListing.svelte';
@@ -111,7 +111,8 @@ const sortedServices = [...(services || [])].sort((a, b) =>
111111 </span>
112112 )}
113113 {service.openSource ||
114 (service.github && service.openSource !== false) ? (
114 ((service.github || service.codeberg || service.git) &&
115 service.openSource !== false) ? (
115116 <span
116117 class="meta-item great"
117118 title={`${service.name} is open source`}
@@ -135,6 +136,27 @@ const sortedServices = [...(services || [])].sort((a, b) =>
135136 </a>
136137 </span>
137138 )}
139 {service.codeberg && (
140 <span
141 class="meta-item"
142 title={`View ${service.name} on Codeberg`}
143 >
144 <a href={codebergUrl(service.codeberg)} target="_blank">
145 <FontAwesome iconName="sourceCode" />{' '}
146 {formatLink(codebergUrl(service.codeberg))}
147 </a>
148 </span>
149 )}
150 {service.git && (
151 <span
152 class="meta-item"
153 title={`View ${service.name} source code`}
154 >
155 <a href={service.git} target="_blank">
156 <FontAwesome iconName="sourceCode" /> Source
157 </a>
158 </span>
159 )}
138160 </div>
139161 <div class="view-service">
140162 <a
web/src/pages/[...listing].astro +9 โˆ’1
@@ -15,6 +15,7 @@ import SocialShare from '@components/form/Social.astro';
1515import DataActions from '@components/things/DataActions.svelte';
1616import type { AwesomePrivacy, Section, Service } from '../types/Service';
1717import { fetchData, slugify } from '@utils/fetch-data';
18import { codebergUrl } from '@utils/parse-markdown';
1819import { fetchChangelog } from '@utils/fetch-changelog';
1920import { fetchGitHubStats } from '@utils/fetch-repo-info';
2021import { fetchTosdrPrivacy } from '@utils/fetch-privacy-policy';
@@ -39,6 +40,8 @@ const {
3940 description,
4041 url,
4142 github,
43 codeberg,
44 git,
4245 tosdrId,
4346 discordInvite,
4447 subreddit,
@@ -235,6 +238,11 @@ const makeSoftwareSchema = () => {
235238 .replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
236239 .replace(/[*_`~]/g, '')
237240 .trim();
241 const codeRepository = github
242 ? `https://github.com/${github}`
243 : codeberg
244 ? codebergUrl(codeberg)
245 : git || null;
238246 return {
239247 '@context': 'https://schema.org',
240248 '@type': 'SoftwareApplication',
@@ -245,7 +253,7 @@ const makeSoftwareSchema = () => {
245253 ...(operatingSystem.length && {
246254 operatingSystem: operatingSystem.join(', '),
247255 }),
248 ...(github && { codeRepository: `https://github.com/${github}` }),
256 ...(codeRepository && { codeRepository }),
249257 };
250258};
251259---
web/src/types/Service.ts +2
@@ -9,6 +9,8 @@ export interface Service {
99 description: string;
1010 url: string;
1111 github?: string;
12 codeberg?: string;
13 git?: string;
1214 icon?: string;
1315 links?: Array<{
1416 title: string;
web/src/utils/do-searchy-searchy.ts +6
@@ -9,6 +9,8 @@ export interface SearchItem {
99 name?: string;
1010 url?: string;
1111 github?: string;
12 codeberg?: string;
13 git?: string;
1214 logo?: string;
1315}
1416
@@ -42,6 +44,8 @@ export const prepareSearchItems = (categories: Category[]): SearchItem[] => {
4244 description: service.description,
4345 url: service.url,
4446 github: service.github || '',
47 codeberg: service.codeberg || '',
48 git: service.git || '',
4549 category: category.name,
4650 sectionName: section.name,
4751 logo: service.icon || '',
@@ -61,6 +65,8 @@ export const searchOptions = {
6165 { name: 'notableMentions', weight: 0.5 },
6266 { name: 'alternativeTo', weight: 0.5 },
6367 { name: 'github', weight: 0.4 },
68 { name: 'codeberg', weight: 0.4 },
69 { name: 'git', weight: 0.3 },
6470 { name: 'url', weight: 0.2 },
6571 { name: 'description', weight: 0.1 },
6672 { name: 'intro', weight: 0.1 },
web/src/utils/parse-markdown.ts +4
@@ -44,3 +44,7 @@ export const formatLink = (link: string) => {
4444 .replace(/^(https?:\/\/)?(www\.)?/, '')
4545 .replace(/\/+$/, '');
4646};
47
48// Resolve a `codeberg` field (either `owner/repo` shorthand or a full URL) to a full URL.
49export const codebergUrl = (codeberg: string) =>
50 /^https?:\/\//.test(codeberg) ? codeberg : `https://codeberg.org/${codeberg}`;