From f1bec11ae78990386b18513cd9f4d973d47fee65 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Sat, 6 Apr 2024 13:21:04 +0200 Subject: [PATCH] chore: Added web-of-trust --- config/trustees.mjs | 35 + markdown/dev/reference/trust/en.md | 62 + sites/dev/components/web-of-trust.mjs | 9512 +++++++++++++++++++++++++ sites/shared/components/icons.mjs | 7 + sites/shared/components/mdx/index.mjs | 4 + sites/shared/styles/globals.css | 15 + 6 files changed, 9635 insertions(+) create mode 100644 config/trustees.mjs create mode 100644 markdown/dev/reference/trust/en.md create mode 100644 sites/dev/components/web-of-trust.mjs diff --git a/config/trustees.mjs b/config/trustees.mjs new file mode 100644 index 00000000000..652f6bdf21e --- /dev/null +++ b/config/trustees.mjs @@ -0,0 +1,35 @@ +/* + * This defines the FreeSewing web of trust + * See: https://FreeSewing.dev/reference/trust + */ +export const trustees = { + 1: { + x: 1306, + y: 319, + title: 'joost', + in: 'Antwerp', + }, + 132: { + x: 457, + y: 345, + title: 'woutervdub', + in: 'Seattle', + }, + 13050: { + x: 668, + y: 399, + title: 'karen', + in: 'Chicago', + }, +} + +/* + * These are the connections between the trustees + * See: https://FreeSewing.dev/reference/trust + */ +export const connections = [ + [1, 132], + [1, 13050], +] + +export const lastUpdate = '20240402' diff --git a/markdown/dev/reference/trust/en.md b/markdown/dev/reference/trust/en.md new file mode 100644 index 00000000000..a7315972fc5 --- /dev/null +++ b/markdown/dev/reference/trust/en.md @@ -0,0 +1,62 @@ +--- +title: Web of Trust +--- + +In the wake of [the March 2024 supply-chain attack on XZ +Utils](https://www.wired.com/story/xz-backdoor-everything-you-need-to-know/) -- +which attempted to smuggle a backdoor into Linux distributions -- FreeSewing has +taken steps to guard against the attack vector where a contributor gains trust +over a long period of time, with the end goal to smuggle malicious code into the project. + +__Elevated permissions or access will only be granted to people who are in FreeSewing's web of trust__. + +We have established an initial web of trust (more on this below) and have +revoked elevated permissions from all other contributors. + + + +##### Paranoia much? + +We appreciate that -- given to the nature of software FreeSewing provides -- the chances of a supply chain attack by an adversary willing to invest months or even years to gain our trust are vanishingly small. + +Still, we are a small part of the larger open source ecosystem, and we cannot foresee the ways in which others may end up using our software. +In addition, we want to help normalize this approach, and help raise awareness of the risks involved in trusting pseudo-anonymous contributions. + + + +## Defining trust + +To understand what we mean by a _web of trust_, we need to keep in mind what we want to guard against. +In other words, the web of trust should prevent: + +**Someone attempting to gain our trust -- possibly over a prolonged period of time -- to achieve a malicious goal.** + +Right from the start, you can see that this is impossible. There is no real way to know people's true intentions, so we cannot guard against that. +However, if we assume people try to pull this off without giving up their real identity, we can instead just focus on identity instead. + +The FreeSewing community exists almost exclusively online. +In contrast, **FreeSewing's web of trust is made up of people who know and have verified each others _real_ identities**. + +In other words, to gain elevated permissions or access in FreeSewing, we need to know who you are and where you live. + +## Joining the web of trust + +To join FreeSewing's web of trust, you should: + +- Be a contributor +- Reach out to one of the current trustees +- Meet up with them -- physically, in the real world -- and verify each other's identities. +- Once the current trustee vouches for your identity, you can be added to the web of trust + + +Being a trustee is a requirement to be granted elevated privileges. It ddoes not automatically grant them. + + +## FreeSewing's web of trust + + + +## Trustees + + + diff --git a/sites/dev/components/web-of-trust.mjs b/sites/dev/components/web-of-trust.mjs new file mode 100644 index 00000000000..cb4eb190860 --- /dev/null +++ b/sites/dev/components/web-of-trust.mjs @@ -0,0 +1,9512 @@ +// Dependencies +import { trustees, connections, lastUpdate } from 'config/trustees.mjs' +import { shortDate } from 'shared/utils.mjs' +// Hooks +import { useState, useContext } from 'react' +// Context +import { ModalContext } from 'shared/context/modal-context.mjs' +import { PanZoomContext } from 'shared/components/workbench/pattern/pan-zoom-context.mjs' +// Components +import { Point } from '@freesewing/core' +import { ModalWrapper } from 'shared/components/wrappers/modal.mjs' +import { WebLink, linkClasses } from 'shared/components/link.mjs' +import { TransformWrapper, TransformComponent } from 'react-zoom-pan-pinch' +import { UserIcon, MapMarkerIcon, FingerprintIcon, LinkIcon } from 'shared/components/icons.mjs' + +/** + * This displays the trustees as a table + */ +export const WebOfTrustTable = () => { + const { setModal } = useContext(ModalContext) + + return ( + + + + + + + + + {Object.keys(trustees).map((id) => ( + + + + + ))} + +
UserLocation
+ + {trustees[id].in}
+ ) +} + +/** + * Helper method to draw a connection between two trustees on the map + * + * @param {object} from - An objectt with x and y coordinates + * @param {object} to - An objectt with x and y coordinates + * @return {string} pathString - The path string to draw the path + */ +const fromToPath = (from, to) => { + const p = {} + const angle = 35 + const shift = 0.5 + p.from = new Point(from.x, from.y) + p.to = new Point(to.x, to.y) + p.fromCp = p.from.shiftFractionTowards(p.to, shift).rotate(-1 * angle, p.from) + p.toCp = p.to.shiftFractionTowards(p.from, shift).rotate(angle, p.to) + + return `M ${p.from.x},${p.from.y} C ${p.fromCp.x}, ${p.fromCp.y} ${p.toCp.x}, ${p.toCp.y} ${p.to.x}, ${p.to.y}` +} + +/** + * This component shows the trustee details, typically loaded in a modal window + * + * @param {number} props.id - The id (FreeSewing user id) of the trustee + */ +const Details = ({ id }) => ( + <> +

Trustee Details

+
    +
  • + {trustees[id].title} +
  • +
  • + {trustees[id].in} +
  • +
  • + + + {`FreeSewing.org/users/user?id=${id}`} + +
  • +
+ +) + +/** + * This displays the trustees as a map + */ +export const WebOfTrustMap = () => { + const [fullMap, setFullMap] = useState(false) + const { setModal } = useContext(ModalContext) + + const { onTransformed, setZoomFunctions } = useContext(PanZoomContext) + + return ( + <> +
+ + + + {world} + {connections.map(([from, to], i) => ( + + ))} + {Object.keys(trustees).map((id) => ( + + setModal( + +
+
+ ) + } + > + +
+ ))} +
+
+
+
+
+ + Last update:{' '} + + {shortDate( + 'en', + new Date( + new Date( + lastUpdate.substr(0, 4), + lastUpdate.substr(4, 2) - 1, + lastUpdate.substr(6, 2) + ) + ), + false + )} + + + +
+ + ) +} + +/* + * React version of https://upload.wikimedia.org/wikipedia/commons/b/bc/BlankMap-World-Compact.svg + */ +const world = ( + <> + + + + + + + + Sudan + + + South Sudan + + + Georgia + + + Abkhazia + + + + South Ossetia + + + + + Peru + + + Burkina Faso + + + France + + + + + + + + + + Guadeloupe + + + + + + + + Martinique + + + + Reunion + + + + Mayotte + + + + French Guiana + + + + Libya + + + Belarus + + + Pakistan + + + Azad Kashmir + + + + Indonesia + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Yemen + + + + + + + Madagascar + + + + + + Bolivia, Plurinational State of + + + + + Serbia + + + Kosovo + + + + + Cote d'Ivoire + + + Algeria + + + Switzerland + + + Cameroon + + + North Macedonia + + + Botswana + + + Kenya + + + Jordan + + + Mexico + + + + + + + + + + + + + + + + + + United Arab Emirates + + + + + Belize + + + + + Brazil + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sierra Leone + + + + + Mali + + + Congo, Democratic Republic of the + + + Italy + + + + + + + + Somalia + + + Somaliland + + + + Afghanistan + + + Bangladesh + + + + + + + + + + + + + + Dominican Republic + + + + + Guinea-Bissau + + + + + + + + + + + Ghana + + + Austria + + + Sweden + + + + + + + + + + + + + + + Turkey + + + + + + Uganda + + + Mozambique + + + + + + + Japan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New Zealand + + + + + + + + + + + + Cuba + + + + + + + + + + + Venezuela, Bolivarian Republic of + + + + + + + + + + + + + + + + Portugal + + + + + + + + + + + Colombia + + + Mauritania + + + + + Angola + + + + + Germany + + + + + + + + Thailand + + + + + + + + + + + + Australia + + + + + + + + + + + + + + + + + + + + + + + Papua New Guinea + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Iraq + + + Croatia + + + + + + + + + + + + + + + + + + + + + Greenland + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Niger + + + Denmark + + + + + + + + + + + + + + + + + + Latvia + + + Romania + + + Zambia + + + Myanmar + + + + + + + + + + + + + + + + + + + + + + + Ethiopia + + + Guatemala + + + Suriname + + + Czech Republic + + + Chad + + + Albania + + + Finland + + + + + + + + + + + + + + + + + + + + + + Syrian Arab Republic + + + Kyrgyzstan + + + Solomon Islands + + + + + + + + + + + + + + + + + + + + + + + + + + + Oman + + + + + + Panama + + + + + + + + Argentina + + + + + + + + United Kingdom of Great Britain and Northern Ireland + + + + + + + + + + + + + + + + + + + + + + + + + + + + Costa Rica + + + Paraguay + + + Guinea + + + + + Ireland + + + + + + Nigeria + + + + + + Tunisia + + + + + Poland + + + Namibia + + + South Africa + + + Egypt + + + Tanzania, United Republic of + + + + + + + Saudi Arabia + + + + + + + + Viet Nam + + + + + + + + + + + + + Russian Federation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Crimea + + + + Haiti + + + + + + + Bosnia and Herzegovina + + + India + + + + + + + + + + + + + + + China + + + + + + + + + + + + + + + + + + + + + + + + Hong Kong + + + + + + + + Macao + + + + Taiwan + + + + + + Canada + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + El Salvador + + + Guyana + + + Belgium + + + Equatorial Guinea + + + + + Lesotho + + + Bulgaria + + + Burundi + + + Djibouti + + + Azerbaijan + + + + + + Nagorno-Karabakh + + + + + Iran, Islamic Republic of + + + + + + + Malaysia + + + + + + + + + + + + + + + + + + Philippines + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Uruguay + + + Congo + + + Montenegro + + + + Estonia + + + + + + + + Rwanda + + + Armenia + + + Senegal + + + Togo + + + Spain + + + + + + + + + + + + + + + Gabon + + + + + Hungary + + + Malawi + + + Tajikistan + + + Cambodia + + + + + + + Korea, Republic of + + + + + + + + + + + + Honduras + + + + + Iceland + + + Nicaragua + + + Chile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Morocco + + + + Western Sahara + + + Sahrawi Arab Democratic Republic (Free Zone) + + + + + Liberia + + + Netherlands + + + + + + + + + + + + Bonaire, Sint Eustatius and Saba + + + + + Central African Republic + + + Slovakia + + + Lithuania + + + Zimbabwe + + + Sri Lanka + + + + + + Israel + + + + + Gaza Strip (State of Palestine) + + + West Bank (State of Palestine) + + + + + + + Lao People's Democratic Republic + + + Korea, Democratic People's Republic of + + + Greece + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Turkmenistan + + + Ecuador + + + + + + + + + + + + + Benin + + + Slovenia + + + Norway + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Moldova, Republic of + + + Transnistria + + + + + Ukraine + + + Donetsk People's Republic + + + + Luhansk People's Republic + + + + + Lebanon + + + + Nepal + + + Eritrea + + + + + United States of America + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Kazakhstan + + + + + French Southern Territories + + + + Eswatini + + + + Uzbekistan + + + Mongolia + + + Bhutan + + + New Caledonia + + + + + + + + + + + Fiji + + + + + + + + + + + + + Kuwait + + + + + + + Timor-Leste + + + + + + + Bahamas + + + + + + + + + + + + + + + + + + + + + + + Vanuatu + + + + + + + + + + + + + + + + + + + Falkland Islands (Malvinas) + + + + + + + + + + + + + South Georgia and the South Sandwich Islands + + + + + + Gambia, Republic of The + + + + Qatar + + + + Jamaica + + + + Cyprus + + + + + Northern Cyprus + + + + + Puerto Rico + + + + Brunei Darussalam + + + + + + + Trinidad and Tobago + + + + + + + Cabo Verde + + + + + + + + + + + + + French Polynesia + + + + + + + + + + + + + Samoa + + + + + + + Luxembourg + + + + Comoros + + + + + + + + Mauritius + + + + Faroe Islands + + + + + + + + + + + Sao Tome and Principe + + + + + + + Virgin Islands, U.S. + + + + + + + Curacao + + + + Sint Maarten (Dutch Part) + + + + Dominica + + + + Tonga + + + + + + + Kiribati + + + + + + + Micronesia, Federated States of + + + + Bahrain + + + + + Northern Mariana Islands + + + + Palau + + + + Seychelles + + + + Antigua and Barbuda + + + + + + + Barbados + + + + Turks and Caicos Islands + + + + + + + + Saint Vincent and the Grenadines + + + + Saint Lucia + + + + Grenada + + + + Malta + + + + Maldives + + + + Cayman Islands + + + + Saint Kitts and Nevis + + + + + + + Montserrat + + + + Saint Barthelemy + + + + Niue + + + + Saint Pierre and Miquelon + + + + Cook Islands + + + + + + + Wallis and Futuna + + + + American Samoa + + + + Marshall Islands + + + + Aruba + + + + Liechtenstein + + + + Virgin Islands, British + + + + + + + Saint Helena, Ascension and Tristan Da Cunha + + + + Jersey + + + + Anguilla + + + + Saint Martin (French Part) + + + + Guernsey + + + + San Marino + + + + Bermuda + + + + Tuvalu + + + + Nauru + + + + Gibraltar + + + + Pitcairn + + + + Monaco + + + + Holy See (Vatican City State) + + + + Isle of Man + + + + Guam + + + + Singapore + + + + Norfolk Island + + + + Tokelau + + + +) diff --git a/sites/shared/components/icons.mjs b/sites/shared/components/icons.mjs index a1069541af7..bbff1da1995 100644 --- a/sites/shared/components/icons.mjs +++ b/sites/shared/components/icons.mjs @@ -455,6 +455,13 @@ export const LockIcon = (props) => ( ) +export const MapMarkerIcon = (props) => ( + + + + +) + export const MastodonIcon = (props) => ( diff --git a/sites/shared/components/mdx/index.mjs b/sites/shared/components/mdx/index.mjs index 70aa30baacf..f9ba3f7206b 100644 --- a/sites/shared/components/mdx/index.mjs +++ b/sites/shared/components/mdx/index.mjs @@ -19,6 +19,8 @@ import { MeasieImage } from 'shared/components/measurements/image.mjs' // Dev/Org jargon import { Term as SharedTerm, termList } from 'shared/components/jargon.mjs' import { jargon, site } from 'site/prebuild/jargon.mjs' +// Dev web of trust +import { WebOfTrustMap, WebOfTrustTable } from '../../../dev/components/web-of-trust.mjs' export const Term = ({ children }) => export const TermList = termList(jargon, site) @@ -69,6 +71,8 @@ export const components = (site = 'org', slug = []) => { ...extra, Method: HttpMethod, StatusCode: HttpStatusCode, + WebOfTrustTable, + WebOfTrustMap, } const specific = {} diff --git a/sites/shared/styles/globals.css b/sites/shared/styles/globals.css index 6d736bc118d..498005da0ac 100644 --- a/sites/shared/styles/globals.css +++ b/sites/shared/styles/globals.css @@ -663,3 +663,18 @@ details[open] > summary > svg.summary-chevron { details > summary:hover > svg.summary-chevron { stroke-width: 5; } + +svg.svg-world path { + fill: currentColor; + fill: theme('colors.primary'); + fill-opacity: 0.2; + stroke: theme('colors.primary'); + stroke-opacity: 0.666; +} + +svg.svg-world circle.user, +svg.svg-world path.connection { + fill: none; + stroke: theme('colors.accent'); + stroke-opacity: 0.666; +}