diff --git a/README.fr.md b/README.fr.md index 2e434be..6341235 100644 --- a/README.fr.md +++ b/README.fr.md @@ -51,6 +51,8 @@ Pour ouvrir l'instance à la famille depuis Internet, placez un reverse proxy HT Une instance auto-hébergée n'envoie aucune mesure d'audience : le suivi d'usage de parenthese.io ne s'active que si une clé PostHog est fournie au build, ce que cette configuration ne fait pas. +Les liens d'aide et de vie privée de l'application mènent à parenthese.io. Pour pointer vers vos propres pages, renseignez `VITE_HELP_URL` et `VITE_PRIVACY_URL` quand vous construisez vous-même le front (voir `frontend/.env.example`). + Commandes utiles : ```bash diff --git a/README.md b/README.md index 0c3deed..d109af9 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ To open the instance to your family over the Internet, put an HTTPS reverse prox A self-hosted instance sends no analytics. Usage tracking on parenthese.io only turns on when a PostHog key is provided at build time, which this setup does not do. +The help and privacy links in the app point to parenthese.io. To use your own pages, set `VITE_HELP_URL` and `VITE_PRIVACY_URL` when you build the front end yourself (see `frontend/.env.example`). + Useful commands: ```bash diff --git a/frontend/.env.example b/frontend/.env.example index 5ba2327..ab34a48 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -3,3 +3,6 @@ VITE_API_BASE_URL=http://localhost:4000 VITE_TREE_ID= VITE_POSTHOG_KEY= VITE_POSTHOG_HOST=https://us.i.posthog.com +# Optional: your own help and privacy pages (default: the parenthese.io pages, in the interface language) +VITE_HELP_URL= +VITE_PRIVACY_URL= diff --git a/frontend/index.html b/frontend/index.html index 096a735..fe58914 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -8,9 +8,6 @@ - - -
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 5702a7b..e6772c1 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -430,22 +430,6 @@ function buildContribChangesList(draft = {}) { return items } -// Anciennes copies locales du mot de passe (avant qu'il soit gardé par le serveur) : on les efface, -// elles pouvaient montrer un mot de passe changé depuis un autre appareil. -function clearLegacyInvitePasswords(treeId) { - if (!treeId) { - return - } - - try { - for (const role of ['share', 'contributor', 'visitor']) { - localStorage.removeItem(`invite_password_${treeId}_${role}`) - } - } catch { - // Ignore localStorage failures - } -} - function App() { const auth = useAuth() const tree = useTreeAccess() @@ -1283,7 +1267,6 @@ function App() { const handleOpenContributionPanel = useCallback(async () => { const treeId = tree.treeContext.treeId - clearLegacyInvitePasswords(treeId) await resolveContributionShareUrl() let share = '' const accessToken = auth.userAuth.token || tree.treeContext.accessToken @@ -1873,8 +1856,8 @@ function App() { let resolvedTreeId = TREE_ID_FROM_ENV let resolvedTreeName = '' let resolvedTreeDescription = '' - let resolvedTreeOwnerName = '' - let resolvedTreeOwnerEmail = '' + const resolvedTreeOwnerName = '' + const resolvedTreeOwnerEmail = '' // Root app: // - not connected => demo by default @@ -1895,8 +1878,6 @@ function App() { resolvedTreeId = treeInfo.id resolvedTreeName = treeInfo.name || '' resolvedTreeDescription = treeInfo.description || '' - resolvedTreeOwnerName = treeInfo.ownerName || '' - resolvedTreeOwnerEmail = treeInfo.ownerEmail || '' } catch (error) { if (!active) return tree.setBootState('need-access') diff --git a/frontend/src/api/treeApi.js b/frontend/src/api/treeApi.js index 7825add..8172a74 100644 --- a/frontend/src/api/treeApi.js +++ b/frontend/src/api/treeApi.js @@ -8,8 +8,6 @@ export async function resolveTreeBySlug(slug) { slug: data?.tree?.slug || '', name: data?.tree?.name || '', description: data?.tree?.description || null, - ownerName: data?.tree?.ownerName || null, - ownerEmail: data?.tree?.ownerEmail || null, } } diff --git a/frontend/src/assets/fonts/OFL-DMSans.txt b/frontend/src/assets/fonts/OFL-DMSans.txt new file mode 100644 index 0000000..441171d --- /dev/null +++ b/frontend/src/assets/fonts/OFL-DMSans.txt @@ -0,0 +1,93 @@ +Copyright 2014 The DM Sans Project Authors (https://github.com/googlefonts/dm-fonts) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/frontend/src/assets/fonts/OFL-Newsreader.txt b/frontend/src/assets/fonts/OFL-Newsreader.txt new file mode 100644 index 0000000..d2d4f40 --- /dev/null +++ b/frontend/src/assets/fonts/OFL-Newsreader.txt @@ -0,0 +1,93 @@ +Copyright 2020 The Newsreader Project Authors (http://github.com/productiontype/Newsreader) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/frontend/src/assets/fonts/dm-sans-latin-ext.woff2 b/frontend/src/assets/fonts/dm-sans-latin-ext.woff2 new file mode 100644 index 0000000..6e84cba Binary files /dev/null and b/frontend/src/assets/fonts/dm-sans-latin-ext.woff2 differ diff --git a/frontend/src/assets/fonts/dm-sans-latin.woff2 b/frontend/src/assets/fonts/dm-sans-latin.woff2 new file mode 100644 index 0000000..c75f7bf Binary files /dev/null and b/frontend/src/assets/fonts/dm-sans-latin.woff2 differ diff --git a/frontend/src/assets/fonts/fonts.css b/frontend/src/assets/fonts/fonts.css new file mode 100644 index 0000000..bedf82e --- /dev/null +++ b/frontend/src/assets/fonts/fonts.css @@ -0,0 +1,77 @@ +/* Newsreader et DM Sans servies par l'app, sans appel à Google Fonts. + Fichiers woff2 de Google Fonts (Newsreader v26, DM Sans v17), licence SIL OFL 1.1 (OFL-*.txt). + Axes et découpage identiques à l'ancien lien Google Fonts : Newsreader romain 300-600, + italique 300-500, DM Sans 400-600, opsz variable. Le sous-ensemble vietnamien reste pour + les noms saisis par les familles, il n'est téléchargé que si un caractère le demande. */ +/* latin-ext */ +@font-face { + font-family: 'DM Sans'; + font-style: normal; + font-weight: 400 600; + font-display: swap; + src: url('./dm-sans-latin-ext.woff2') format('woff2'); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'DM Sans'; + font-style: normal; + font-weight: 400 600; + font-display: swap; + src: url('./dm-sans-latin.woff2') format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Newsreader'; + font-style: italic; + font-weight: 300 500; + font-display: swap; + src: url('./newsreader-italic-vietnamese.woff2') format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Newsreader'; + font-style: italic; + font-weight: 300 500; + font-display: swap; + src: url('./newsreader-italic-latin-ext.woff2') format('woff2'); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Newsreader'; + font-style: italic; + font-weight: 300 500; + font-display: swap; + src: url('./newsreader-italic-latin.woff2') format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Newsreader'; + font-style: normal; + font-weight: 300 600; + font-display: swap; + src: url('./newsreader-vietnamese.woff2') format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Newsreader'; + font-style: normal; + font-weight: 300 600; + font-display: swap; + src: url('./newsreader-latin-ext.woff2') format('woff2'); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Newsreader'; + font-style: normal; + font-weight: 300 600; + font-display: swap; + src: url('./newsreader-latin.woff2') format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} diff --git a/frontend/src/assets/fonts/newsreader-italic-latin-ext.woff2 b/frontend/src/assets/fonts/newsreader-italic-latin-ext.woff2 new file mode 100644 index 0000000..101eadc Binary files /dev/null and b/frontend/src/assets/fonts/newsreader-italic-latin-ext.woff2 differ diff --git a/frontend/src/assets/fonts/newsreader-italic-latin.woff2 b/frontend/src/assets/fonts/newsreader-italic-latin.woff2 new file mode 100644 index 0000000..d8b3029 Binary files /dev/null and b/frontend/src/assets/fonts/newsreader-italic-latin.woff2 differ diff --git a/frontend/src/assets/fonts/newsreader-italic-vietnamese.woff2 b/frontend/src/assets/fonts/newsreader-italic-vietnamese.woff2 new file mode 100644 index 0000000..85f53fe Binary files /dev/null and b/frontend/src/assets/fonts/newsreader-italic-vietnamese.woff2 differ diff --git a/frontend/src/assets/fonts/newsreader-latin-ext.woff2 b/frontend/src/assets/fonts/newsreader-latin-ext.woff2 new file mode 100644 index 0000000..a40ea8c Binary files /dev/null and b/frontend/src/assets/fonts/newsreader-latin-ext.woff2 differ diff --git a/frontend/src/assets/fonts/newsreader-latin.woff2 b/frontend/src/assets/fonts/newsreader-latin.woff2 new file mode 100644 index 0000000..c6e5b0e Binary files /dev/null and b/frontend/src/assets/fonts/newsreader-latin.woff2 differ diff --git a/frontend/src/assets/fonts/newsreader-vietnamese.woff2 b/frontend/src/assets/fonts/newsreader-vietnamese.woff2 new file mode 100644 index 0000000..1f4448c Binary files /dev/null and b/frontend/src/assets/fonts/newsreader-vietnamese.woff2 differ diff --git a/frontend/src/components/MediaViewer.jsx b/frontend/src/components/MediaViewer.jsx index 3a17b39..d666fc6 100644 --- a/frontend/src/components/MediaViewer.jsx +++ b/frontend/src/components/MediaViewer.jsx @@ -135,15 +135,17 @@ const MediaViewer = ({ media, person, onClose }) => { // Extract YouTube video ID and build embed URL const watchMatch = mediaUrl.match(/[?&]v=([^&]+)/) const shortMatch = mediaUrl.match(/youtu\.be\/([^/?]+)/) - const videoId = (watchMatch?.[1] || shortMatch?.[1] || '').split('?')[0] - if (!videoId) { + const videoId = (watchMatch?.[1] || shortMatch?.[1] || '').split(/[?#]/)[0] + // Un identifiant YouTube fait 11 caractères : tout le reste est refusé plutôt qu'intégré + if (!/^[A-Za-z0-9_-]{11}$/.test(videoId)) { return (
{t('Lien YouTube invalide')}
) } - const embedUrl = `https://www.youtube.com/embed/${videoId}` + // youtube-nocookie : pas de cookie YouTube tant que la vidéo n'est pas lancée + const embedUrl = `https://www.youtube-nocookie.com/embed/${videoId}` return (