Commit 282e3bc060

282e3bc060068a9acefd87fad8c50b662470257d

parent: 043dbc4f27

Unsigned

Alicia Sykes <alicia@omg.lol> · 2024-03-05 23:15 UTC

Adds edit/remove capabilities, improves responsivness, makes service name hoverable, implements new screenshot service

Layout: unified · split

web/src/components/form/FontAwesome.svelte +4
@@ -23,6 +23,10 @@
2323 faceMeh: solidIcons.faMeh,
2424 faceBad: solidIcons.faFrown,
2525
26 // Service actions
27 delete: solidIcons.faTrash,
28 edit: solidIcons.faPenToSquare,
29
2630 // Website Detailed Stats
2731 blacklistFound: solidIcons.faDoNotEnter,
2832 blacklistNotFound: solidIcons.faShieldCheck,
web/src/components/things/GitHubDetailedInfo.astro +20 −15
@@ -13,7 +13,6 @@ const { gitHubData, repo } = Astro.props;
1313
1414
1515function generateChartData(languages: Record<string, number>): string {
16
1716 const colorMap: { [key: string]: string } = {
1817 'TypeScript': '#2b7489',
1918 'Objective-C++': '#6866fb',
@@ -21,26 +20,26 @@ function generateChartData(languages: Record<string, number>): string {
2120 'Dart': '#00B4AB',
2221 'Shell': '#89e051',
2322 'Elixir': '#6e4a7e',
24 'Kotlin': '#F18E33',
23 'Kotlin': '#7F52FF',
2524 'Objective-C': '#438eff',
26 'Ruby': '#701516',
27 'Go': '#375eab',
25 'Ruby': '#CC342D',
26 'Go': '#00ADD8',
2827 'PHP': '#4F5D95',
2928 'Java': '#b07219',
3029 'Scala': '#DC322F',
3130 'Makefile': '#427819',
32 'Perl': '#0298c3',
33 'Lua': '#000080',
34 'Vue': '#2c3e50',
35 'HTML': '#e44b23',
36 'Swift': '#ffac45',
37 'C': '#555555',
31 'Perl': '#39457E',
32 'Lua': '#2C2D72',
33 'Vue': '#4FC08D',
34 'HTML': '#E34F26',
35 'Swift': '#F05138',
36 'C': '#A8B9CC',
3837 'C#': '#097c01',
3938 'Clojure': '#db5855',
4039 'Rust': '#dea584',
4140 'Assembly': '#6E4C13',
4241 'Arduino': '#bd79d1',
43 'C Sharp': '#178600',
42 'C Sharp': '#512BD4',
4443 'CSS': '#563d7c',
4544 'TeX': '#3D6117',
4645 'OCaml': '#3be133',
@@ -55,7 +54,9 @@ function generateChartData(languages: Record<string, number>): string {
5554 'Common Lisp': '#3fb68b',
5655 'Groovy': '#e69f56',
5756 'Julia': '#a270ba',
58 'cpp': '#f34b7d',
57 'cpp': '#00599C',
58 'C++': '#00599C',
59 'Dockerfile': '#2496ED',
5960 };
6061
6162 // Arrays to hold the data, labels, and colors
@@ -131,7 +132,7 @@ const languageChart = `https://quickchart.io/chart?c=${generateChartData(gitHubD
131132 <h4>Author</h4>
132133 <p>
133134 <img src={gitHubData.info.ownerAvatar} width="20" height="20" />
134 <a href={`https://github.com/${gitHubData.info.ownerUsername}`}>
135 <a target="_blank" href={`https://github.com/${gitHubData.info.ownerUsername}`}>
135136 {gitHubData.info.ownerUsername}
136137 </a>
137138 </p>
@@ -184,7 +185,9 @@ const languageChart = `https://quickchart.io/chart?c=${generateChartData(gitHubD
184185 {gitHubData.contributors.map((contributor) => (
185186 <li>
186187 <img src={contributor.avatar} width="20" height="20" />
187 <a href={`https://github.com/${contributor.username}`}>@{contributor.username}</a> ({contributor.contributions})
188 <a href={`https://github.com/${contributor.username}`} target="_blank">
189 @{contributor.username}
190 </a> ({contributor.contributions})
188191 </li>
189192 ))}
190193 </ul>
@@ -195,7 +198,9 @@ const languageChart = `https://quickchart.io/chart?c=${generateChartData(gitHubD
195198 {gitHubData.commits.map((commit) => (
196199 <li>
197200 <img src={commit.authorAvatar} width="20" height="20" />
198 <a href={`https://github.com/${commit.authorUsername}`}>{commit.authorName}</a>
201 <a href={`https://github.com/${commit.authorUsername}`} target="_blank">
202 {commit.authorName}
203 </a>
199204 <span class="date" title={timeAgo(commit.authorDate)}>({formatDate(commit.authorDate)})</span>
200205 <p class="commit-msg">{commit.message}</p>
201206 </li>
web/src/components/things/ItemGitHubMetrics.astro +1 −1
@@ -90,7 +90,7 @@ const {
9090 <FontAwesome iconName="openSource" /> Open Source
9191 </span> -->
9292 <span title={`GitHub repository: ${github}`}>
93 <a href={`https://github.com/${github}`}><FontAwesome iconName="github" /> {github}</a>
93 <a href={`https://github.com/${github}`} target="_blank"><FontAwesome iconName="github" /> {github}</a>
9494 </span>
9595 { stats.statusCode === 200 && stats.data && (
9696 <span title={`GitHub Star Count: ${stargazers_count}`}>
web/src/components/things/ServiceList.astro +32 −12
@@ -4,6 +4,7 @@ import Button from '@components/form/Button.astro';
44import { parseMarkdown, formatLink } from '@utils/parse-markdown';
55import type { Service } from 'src/types/Service';
66import FontAwesome from '@components/form/FontAwesome.svelte';
7import DeleteListing from '@components/things/DeleteListing.svelte';
78import { slugify } from '@utils/fetch-data';
89
910import GitHubMetrics from '@components/things/ItemGitHubMetrics.astro';
@@ -52,9 +53,7 @@ const {
5253 <ul>
5354 {services.map((service: Service) => (
5455 <li id={slugify(service.name)}>
55 <div class="actions">
56
57 </div>
56 <DeleteListing client:load categoryName={categoryName} sectionName={sectionName} serviceName={service.name} />
5857 <div class="service-head">
5958 <img
6059 width="40"
@@ -106,7 +105,7 @@ const {
106105 { service.github && !noGitHubMetrics && <GitHubMetrics github={service.github} /> }
107106 { service.github && noGitHubMetrics && (
108107 <span class="meta-item" title={`View ${service.name} on GitHub`}>
109 <a href={`https://github.com/${service.github}`}>
108 <a href={`https://github.com/${service.github}`} target="_blank">
110109 <FontAwesome iconName="github" /> {service.github}
111110 </a>
112111 </span>
@@ -155,6 +154,7 @@ const {
155154 margin: 0 0 3rem 0;
156155 li {
157156 margin-bottom: 1rem;
157 position: relative;
158158 .service-head {
159159 display: flex;
160160 align-items: center;
@@ -167,6 +167,24 @@ const {
167167 margin: 0;
168168 font-size: 1.6rem;
169169 }
170
171 position: relative;
172 &:after {
173 background: none repeat scroll 0 0 transparent;
174 bottom: 0;
175 content: "";
176 display: block;
177 height: 3px;
178 left: 50%;
179 position: absolute;
180 background: var(--accent-3);
181 transition: width 0.3s ease 0s, left 0.3s ease 0s;
182 width: 0;
183 }
184 &:hover:after {
185 width: 100%;
186 left: 0;
187 }
170188 }
171189
172190 .service-icon {
@@ -275,14 +293,16 @@ const {
275293 }
276294 }
277295
296 section :global(.view-all) {
297 width: fit-content;
298 position: absolute;
299 right: 1rem;
300 margin-top: -2.5rem;
301 background: var(--accent-3);
302 }
278303
279
280section :global(.view-all) {
281 width: fit-content;
282 position: absolute;
283 right: 1rem;
284 margin-top: -2.5rem;
285 background: var(--accent-3);
286}
304 li:hover :global(.actions) {
305 opacity: 0.5;
306 }
287307
288308</style>
web/src/components/things/WebsiteDetailedInfo.astro +1 −5
@@ -39,11 +39,7 @@ else if (risk < 50) riskText = 'risky';
3939else if (risk < 75) riskText = 'dangerous';
4040else if (risk >= 75) riskText = 'very dangerous';
4141
42
43const clientSideKey = 'cd02a8520c90410bbc32440950bd3b7e';
44const screenshotOptions = 'format=png&width=960&height=540&ttl=2419200&response_type=image&no_cookie_banners=true&no_ads=true';
45const screenshotEndpoint = 'https://api.apiflash.com/v1';
46const screenshotUrl = `${screenshotEndpoint}/urltoimage?access_key=${clientSideKey}&url=${encodeURIComponent(url)}&${screenshotOptions}`;
42const screenshotUrl = `https://screenshot-cache.as93.workers.dev/${url}`;
4743
4844---
4945
web/src/pages/[...listing].astro +82 −4
@@ -6,6 +6,7 @@ import Comments from '@components/things/Comments.svelte';
66import GitHubDetailedInfo from '@components/things/GitHubDetailedInfo.astro';
77import PrivacyPolicyDetails from '@components/things/PrivacyPolicyDetails.astro';
88import WebsiteDetailedInfo from '@components/things/WebsiteDetailedInfo.astro';
9import DataActions from '@components/things/DataActions.svelte';
910import type { AwesomePrivacy, Section, Service } from '../types/Service';
1011import { fetchData, slugify } from '@utils/fetch-data';
1112import { fetchGitHubStats } from '@utils/fetch-repo-info';
@@ -123,6 +124,10 @@ const githubData = github ? await fetchGitHubStats(github) : null;
123124const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null;
124125const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignoredSite))) ? await fetchWebsiteInfo(url) : null;
125126
127const getApiEndpoint = () => {
128 return `https://api.awesome-privacy.xyz/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`;
129}
130
126131---
127132
128133<Layout title={makePageTitle()} keywords={makeKeyWordTag()} description={makeDescriptionTag()} >
@@ -171,7 +176,7 @@ const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignor
171176 )}
172177 { tosdrId && (
173178 <li>
174 <b>ToS;DR:</b>
179 <b>Privacy:</b>
175180 <a href={`https://tosdr.org/en/service/${tosdrId}`}>{`tosdr.org/en/service/${tosdrId}`}</a>
176181 </li>
177182 )}
@@ -247,6 +252,29 @@ const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignor
247252 sectionName={parentSection.name}
248253 />
249254 </section>
255 <section>
256 <h3>About the Data: {name}</h3>
257 <DataActions client:load categoryName={categoryName} sectionName={parentSection.name} serviceName={name} />
258 <h4>API</h4>
259 <p>
260 You can access {name}'s data programmatically via our API.
261 Simply make a <code>GET</code> request to:
262 </p>
263 <pre><a href={getApiEndpoint()}><code>{getApiEndpoint()}</code></a></pre>
264 <p>
265 The REST API is free, no-auth and CORS-enabled.
266 To learn more, view the <a href="/api/docs">Swagger Docs</a> or read the <a href="/about#our-api">API Usage Guide</a>.
267 </p>
268
269 <h4>About the Data</h4>
270 <p>
271 Beyond the user-submitted YAML you see above, we also augment each listing with
272 additional data dynamically fetched from several sources.
273 To learn more about where the rest of data included in this page comes from,
274 and how it is computed,
275 see the <a href="/about#our-data">About the Data</a> section of our About page.
276 </p>
277 </section>
250278
251279 <div class="pagination-navigation">
252280 { previous ? (
@@ -276,6 +304,11 @@ main {
276304 width: 1000px;
277305 max-width: calc(100% - 5rem);
278306 position: relative;
307 @media(max-width: 768px) {
308 max-width: 95%;
309 padding: 0.5rem;
310 margin: 0 auto;
311 }
279312}
280313
281314section {
@@ -289,6 +322,10 @@ section {
289322
290323}
291324
325p {
326 margin: 0.25rem 0 0.5rem 0;
327}
328
292329h3 {
293330 font-size: 2rem;
294331 margin: -2rem 0 1rem -2rem;
@@ -297,12 +334,18 @@ h3 {
297334 color: var(--accent-fg);
298335 width: fit-content;
299336 padding: 0.25rem 0.5rem;
337 @media(max-width: 768px) {
338 margin: -2rem auto 2rem auto;
339 }
300340 }
301341
302342.service-head {
303343 h2 {
304344 font-size: 3rem;
305345 margin: 0;
346 @media(max-width: 768px) {
347 text-align: center;
348 }
306349 }
307350 .url-wrap {
308351 display: flex;
@@ -315,6 +358,9 @@ h3 {
315358 font-style: italic;
316359 opacity: 0.6;
317360 }
361 @media(max-width: 768px) {
362 flex-direction: column;
363 }
318364 }
319365
320366}
@@ -333,6 +379,14 @@ h3 {
333379 color: var(--accent);
334380 }
335381 }
382 @media(max-width: 768px) {
383 display: none;
384 }
385}
386
387h4 {
388 font-size: 1.4rem;
389 margin-bottom: 0;
336390}
337391
338392.intro {
@@ -341,12 +395,15 @@ h3 {
341395 opacity: 0.9;
342396 display: flex;
343397 gap: 0.5rem;
398 @media(max-width: 768px) {
399 flex-direction: column;
400 }
344401 .service-icon {
345402 border-radius: var(--curve-md);
346403 margin-top: 1rem;
347 }
348 h4 {
349 margin-bottom: 0;
404 @media(max-width: 768px) {
405 margin: 1rem auto 0 auto;
406 }
350407 }
351408 ul {
352409 padding-left: 1rem;
@@ -359,6 +416,10 @@ h3 {
359416 font-weight: 400;
360417 min-width: 85px;
361418 display: inline-block;
419 @media(max-width: 768px) {
420 width: auto;
421 display: block;
422 }
362423 }
363424 }
364425}
@@ -439,6 +500,23 @@ h3 {
439500 }
440501}
441502
503pre {
504 a {
505 text-decoration: none;
506 color: var(--foreground);
507 code {
508 background: #acabb782;
509 padding: 0.2rem 0.4rem;
510 border-radius: var(--curve-sm);
511 font-family: Courier New;
512 font-size: 0.9rem;
513 @media(max-width: 768px) {
514 white-space: break-spaces;
515 }
516 }
517 }
518}
519
442520.highlights {
443521 display: flex;
444522 gap: 1rem;
web/src/pages/about.astro +62 −4
@@ -32,6 +32,41 @@ const licenseContent = async () => {
3232 return await response.text();
3333};
3434
35const aboutOurData = `
36All data is stored in
37[\`awesome-privacy.yml\`](https://github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml).
38
39This file is then pulled into the website at build-time, and also used to generate
40the repositories README file.
41We use this method in the interest of transparency and data integrity,
42as Git makes it possible to maintain a full log of what was changed, when, by who and why.
43
44### Augmention
45The data is augmented with some extra info, to add additional context to each service.
46The aim of this is to give you a broader picture of each service, to help you make a more informed decision.
47Currently, this extra data is pulled from:
48
49- **GitHub API** - To fetch info about each project's repository
50 - Including author & contributors, creation & last updated date, languages, license and star count
51- **Web Check** - To fetch info about each project's website
52 - Including SSL chain, WHOIS, server location, blacklist check and a screenshot
53- **ToS;DR** - To fetch a summerized version of each services Privacy Policy
54 - Including policy and terms of service links, postives + negatives and privacy score
55- **User Reviews** - User-submitted comments + feedback on a given service
56 - Implemented using self-hosted instance of Remark42
57- **Portainer Templates** - To fetch info about each project's Docker image (if it's self-hosted)
58 - Including supported architectures, run command, pull count, last updated and config options
59
60### API
61We also have a free, no-auth, CORS-enabled RESR API,
62which you can use to access Awesome Privacy's data programmatically,
63or to build your own apps on top of it.
64
65The [Swagger Spec](#) outlines all endpoints, usage and examples.
66
67The host is: \`https://api.awesome-privacy.xyz\`
68`;
69
3570const projectRequrements = `
3671For software to be included in this list, it must meet the following requirements:
3772
@@ -43,13 +78,16 @@ For software to be included in this list, it must meet the following requirement
4378 - The software must be secure by default, without requiring additional configuration
4479 - There should be no current, critical security issues
4580 - The handling of past issues must have been prompt, transparent and effective
81 - Ideally hosted services should have been security audited, with the report published publicly
4682- **Open Source**
4783 - The full source code should be released under an open source license
4884 - Ideally it should be possible for the user to build and run/deploy the software themselves from source
4985- **Actively Maintained**
5086 - The developers should address dependency updates and security patches in a timely manner
87 - Ideally the source should have been updated within the last 12 months
5188- **Transparent**
5289 - It should be clear who is behind the project, what their motives are, and what (if any) the funding model is
90 - For hosted solutions, the privacy policy should clearly state what data is collected, how it's used and how long it's stored
5391- **Ethical**
5492 - Must not suppress free speech, discriminate or disregard any human rights
5593- **Relevant**
@@ -176,6 +214,10 @@ const description = 'Privacy is a fundamental human right; '
176214 <div class="software-requirements"><p set:html={parseMarkdown(projectRequrements)}></p></div>
177215 <hr />
178216
217 <h2 id="our-data">Our Data</h2>
218 <div class="about-the-data"><p set:html={parseMarkdown(aboutOurData)}></p></div>
219 <hr />
220
179221 <h2 id="contributing">Contributing</h2>
180222 <p>
181223 Awesome Privacy (including all data and code) is fully open source,
@@ -305,7 +347,7 @@ h2 {
305347 margin: 2rem 0 1rem 0;
306348}
307349p {
308 font-size: 1.4rem;
350 font-size: 1.2rem;
309351}
310352hr {
311353 margin: 2rem 0;
@@ -323,14 +365,15 @@ h3 {
323365 font-size: 1.6rem;
324366}
325367
326.software-requirements {
368.software-requirements, .about-the-data {
327369 :global(p) {
328 font-size: 1.4rem;
370 font-size: 1.2rem;
371 margin: 0 0 0.5rem 0;
329372 }
330373 :global(ul) {
331374 padding-left: 0.5rem;
332375 list-style: none;
333 font-size: 1.1rem;
376 font-size: 1.2rem;
334377 :global(li ul) {
335378 padding: 0 0 0.5rem 1rem;
336379 list-style: circle;
@@ -341,6 +384,20 @@ h3 {
341384 transition: color 0.2s ease-in-out;
342385 color: var(--accent-3);
343386 }
387 :global(h3) {
388 font-size: 1.6rem;
389 margin-bottom: 0;
390 }
391 :global(strong) {
392 font-weight: 500;
393 }
394 :global(code) {
395 font-family: 'Courier New', Courier, monospace;
396 background: #acabb782;
397 padding: 0.2rem 0.4rem;
398 border-radius: var(--curve-sm);
399 font-size: 0.9rem;
400 }
344401}
345402
346403.user-list {
@@ -401,6 +458,7 @@ h3 {
401458 max-width: 550px;
402459 margin: 0 auto;
403460 }
461
404462 small {
405463 font-size: 1rem;
406464 margin: 1rem 0;
web/src/styles/typography.css +1 −1
@@ -84,7 +84,7 @@ code {
8484 font-style: normal;
8585}
8686
87html, body, p, a, ul, ol, li, blockquote, pre, code, strong, i {
87html, body, p, a, ul, ol, li, blockquote, pre, strong, i {
8888 font-family: "Rubik", sans-serif;
8989}
9090