From 309b77e63cd0be811c58c2d4c09a0bc79899d81b Mon Sep 17 00:00:00 2001 From: loki5512344 Date: Sat, 24 Oct 2026 17:28:14 +0200 Subject: [PATCH] feat(web): add privacy policy page and trim the memory block text --- public/index.html | 1 + scripts/serve.ts | 8 +++++++- src/app.ts | 17 +++++++++++++---- src/i18n/en.ts | 26 +++++++++++++++++++++----- src/i18n/ru.ts | 26 +++++++++++++++++++++----- src/styles.css | 22 ++++++++++++++++++++++ tests/copy.test.ts | 4 ++++ 7 files changed, 89 insertions(+), 15 deletions(-) diff --git a/public/index.html b/public/index.html index 67c33f7..37c1b01 100644 --- a/public/index.html +++ b/public/index.html @@ -63,6 +63,7 @@ >

Клиент и сервер написаны на Rust.

+ Конфиденциальность ( selector: string, root: ParentNode = document, @@ -77,7 +78,7 @@ function landing() {
${tr("projectTitle", "h2", 'id="project-title"')}${tr("projectText", "p")}
${icon("chat", 24)}
${tr("projectNative", "h3")}${tr("projectNativeText", "p")}
${icon("voice", 24)}
${tr("projectServer", "h3")}${tr("projectServerText", "p")}
${tr("projectCentral", "h3")}${tr("projectCentralText", "p")}
-
${tr("lightVnoxName")}${tr("lightAbout")} 120 ${tr("lightUnit")}
${tr("lightElectronName")}${tr("lightElectronValue")}
${tr("lightElectronNote", "p", 'class="meter-note"')}
${tr("lightCaption", "p", 'class="small light-caption"')}${tr("lightScale", "p", 'class="small light-caption"')}
+
${tr("lightTitle", "h2", 'id="light-title"')}${tr("lightText", "p")}
${tr("lightVnoxName")}${tr("lightAbout")} 120 ${tr("lightUnit")}
${tr("lightElectronName")}${tr("lightElectronValue")}
${tr("lightCaption", "p", 'class="small light-caption"')}
${tr("clientTitle", "h2", 'id="client-title"')}${tr("clientText", "p")}
${t(${tr("screenshotCaption", "figcaption")}
${tr("appearanceTitle", "h3")}${tr("appearanceText", "p")}
${tr("identityTitle", "h3")}${tr("identityText", "p")}
${tr("roadmapTitle", "h2", 'id="roadmap-title"')}${tr("roadmapText", "p")}

${tr("available")}

  • ${tr("availableOne")}
  • ${tr("availableTwo")}
  • ${tr("availableThree")}
  • ${tr("availableFour")}
  • ${tr("availableFive")}

${tr("next")}

  • ${tr("nextOne")}
  • ${tr("nextTwo")}
  • ${tr("nextThree")}
${tr("downloadNote", "p", 'class="release-note"')}
${tr("faqTitle", "h2", 'id="faq-title"')}
${(["Server", "Central", "Release"] as const).map((key) => `
${tr(`faq${key}`)}${tr(`faq${key}Answer`, "p")}
`).join("")}
@@ -172,6 +173,10 @@ function renderDiagram() { ); } } +function privacy() { + const sections = ["Collect", "Cookies", "Track", "Other", "Delete"] as const; + main.innerHTML = `
${icon("back", 17)}${tr("back")}${tr("privacyTitle", "h1")}${tr("privacyUpdated", "p", 'class="small"')}${tr("privacyIntro", "p")}${sections.map((key) => `
${tr(`privacy${key}Title` as MessageKey, "h2")}${tr(`privacy${key}Text` as MessageKey, "p")}
`).join("")}
`; +} function account() { main.innerHTML = `
${icon("back", 17)}${tr("back")}
`; renderAccount(); @@ -326,8 +331,10 @@ function setLanguage(next: Language) { /* No authentication data is persisted. */ } document.documentElement.lang = next; - document.title = t(accountPage ? "accountTitle" : "title"); - const pageTitle = t(accountPage ? "accountTitle" : "title"); + const pageTitle = t( + privacyPage ? "privacyTitle" : accountPage ? "accountTitle" : "title", + ); + document.title = pageTitle; find('meta[name="description"]').content = t("description"); find('meta[property="og:title"]').content = pageTitle; find('meta[property="og:description"]').content = @@ -364,13 +371,15 @@ function setLanguage(next: Language) { String(button.dataset.language === next), ), ); + if (privacyPage) return; if (accountPage) renderAccount(); else { renderDiagram(); updateStatus(); } } -if (accountPage) account(); +if (privacyPage) privacy(); +else if (accountPage) account(); else landing(); document .querySelectorAll("[data-language]") diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 92f92b6..0d32230 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -54,6 +54,26 @@ export const en = { projectCentral: "Vnox Central", projectCentralText: "A web account with GitHub sign-in. It is not linked to the desktop client key yet.", + privacyLink: "Privacy", + privacyTitle: "Privacy policy", + privacyUpdated: "Updated 24 October 2026", + privacyIntro: + "This policy covers the website and Vnox Central. Chats on community servers and the desktop client are not part of it, see below.", + privacyCollectTitle: "What we receive", + privacyCollectText: + "When you sign in with GitHub we store the numeric ID, username, display name and avatar link from your public profile. We do not ask for repository access or your private email. The GitHub token is used once to read the profile and is discarded right away.", + privacyCookiesTitle: "Cookies", + privacyCookiesText: + "Only the necessary ones: a short sign-in cookie (10 minutes) and a session cookie (7 days). Both are Secure and HttpOnly, and the database stores only a hash of the session. Signing out ends the session.", + privacyTrackTitle: "Tracking and third parties", + privacyTrackText: + "The website has no analytics, ads or third-party scripts. Your language choice is kept in your browser. The avatar loads from avatars.githubusercontent.com, so GitHub sees your IP address. Sign-in requests are not written to the web server logs.", + privacyOtherTitle: "Community servers and the client", + privacyOtherText: + "VNOX servers are run by their owners. Messages and files on a server are held by its owner, who sets the retention rules. The desktop client keeps your key and settings on your device.", + privacyDeleteTitle: "Deleting your data", + privacyDeleteText: + "There is no delete button yet. To remove your data, open an issue in the server repository and we will delete your record.", lightTitle: "A light client", lightText: "The Rust and Slint client does not carry a browser with it. It uses about 120 MB of memory when idle.", @@ -62,12 +82,8 @@ export const en = { lightVnoxName: "VNOX", lightElectronName: "Discord (Vesktop, Electron)", lightElectronValue: "about 1.3 GB", - lightElectronNote: - "Discord in the Vesktop Electron client, 8 processes, in use: RSS 1333 MB, PSS 1103 MB (about 1.1 GB). Electron clients in general often use from a few hundred MB to a gigabyte and more.", lightCaption: - "Measured on Linux. VNOX: connection screen, release build, RSS 121 MB, PSS 96 MB. Discord: in use.", - lightScale: - "These are two different states: VNOX idle, Discord under load. Bar length: 1.3 GB by RSS.", + "Measured on Linux by RSS: VNOX on the connection screen, Discord (Vesktop) in use.", lightSource: "On Electron in general: PCWorld, December 2025", clientCode: "Client source", serverCode: "Server source", diff --git a/src/i18n/ru.ts b/src/i18n/ru.ts index 14b4ba8..09132a4 100644 --- a/src/i18n/ru.ts +++ b/src/i18n/ru.ts @@ -56,6 +56,26 @@ export const ru: Catalog = { projectCentral: "Vnox Central", projectCentralText: "Веб-аккаунт с входом через GitHub. С ключом настольного клиента он пока не связан.", + privacyLink: "Конфиденциальность", + privacyTitle: "Политика конфиденциальности", + privacyUpdated: "Обновлено 24 октября 2026", + privacyIntro: + "Это политика сайта и Vnox Central. Чаты на серверах сообществ и настольный клиент сюда не входят, о них ниже.", + privacyCollectTitle: "Что мы получаем", + privacyCollectText: + "При входе через GitHub мы сохраняем числовой ID, имя пользователя, отображаемое имя и ссылку на аватар из вашего публичного профиля. Доступ к репозиториям и приватной почте не запрашивается. Токен GitHub используется один раз, чтобы прочитать профиль, и сразу удаляется.", + privacyCookiesTitle: "Cookie", + privacyCookiesText: + "Только необходимые: короткий cookie на время входа (10 минут) и cookie сессии (7 дней). Они защищены флагами Secure и HttpOnly, а в базе хранится только хеш сессии. Выход из аккаунта завершает сессию.", + privacyTrackTitle: "Слежка и сторонние сервисы", + privacyTrackText: + "На сайте нет аналитики, рекламы и сторонних скриптов. Выбранный язык хранится в вашем браузере. Аватар загружается с avatars.githubusercontent.com, поэтому GitHub видит ваш IP-адрес. Запросы входа не попадают в журналы веб-сервера.", + privacyOtherTitle: "Серверы сообществ и клиент", + privacyOtherText: + "Серверы VNOX ведут сами владельцы. Сообщения и файлы на сервере находятся у его владельца, и правила хранения задаёт он. Настольный клиент хранит ваш ключ и настройки на вашем устройстве.", + privacyDeleteTitle: "Удаление данных", + privacyDeleteText: + "Кнопки удаления аккаунта пока нет. Чтобы удалить данные, напишите в issues репозитория сервера, и мы удалим вашу запись.", lightTitle: "Лёгкий клиент", lightText: "Клиент на Rust и Slint не носит с собой браузер. В простое он занимает около 120 МБ памяти.", @@ -64,12 +84,8 @@ export const ru: Catalog = { lightVnoxName: "VNOX", lightElectronName: "Discord (Vesktop, Electron)", lightElectronValue: "около 1,3 ГБ", - lightElectronNote: - "Discord в клиенте Vesktop на Electron, 8 процессов, в работе: RSS 1333 МБ, PSS 1103 МБ (около 1,1 ГБ). Клиенты на Electron вообще часто занимают от нескольких сотен МБ до гигабайта и больше.", lightCaption: - "Замер на Linux. VNOX: экран подключения, release-сборка, RSS 121 МБ, PSS 96 МБ. Discord: в работе.", - lightScale: - "Это два разных состояния: VNOX в простое, Discord под нагрузкой. Длина полосы: 1,3 ГБ по RSS.", + "Замер на Linux по RSS: VNOX на экране подключения, Discord (Vesktop) в работе.", lightSource: "Про Electron в целом: PCWorld, декабрь 2025", clientCode: "Код клиента", serverCode: "Код сервера", diff --git a/src/styles.css b/src/styles.css index 452cbaf..67566a0 100644 --- a/src/styles.css +++ b/src/styles.css @@ -2083,3 +2083,25 @@ p { transition: none !important; } } + +.privacy-section { + padding-block: 40px 100px; + max-width: 760px; +} +.privacy-section h1 { + margin-top: 40px; + font-size: clamp(2rem, 6vw, 3.4rem); + overflow-wrap: anywhere; +} +.privacy-section > p { + margin-top: 16px; +} +.privacy-block { + margin-top: 38px; +} +.privacy-block h2 { + font-size: 1.3rem; +} +.privacy-block p { + margin-top: 10px; +} diff --git a/tests/copy.test.ts b/tests/copy.test.ts index e88aa1e..044eb00 100644 --- a/tests/copy.test.ts +++ b/tests/copy.test.ts @@ -42,6 +42,10 @@ test("every translation key used in code exists and every key is used", async () used.add(`faq${part}`); used.add(`faq${part}Answer`); } + for (const part of ["Collect", "Cookies", "Track", "Other", "Delete"]) { + used.add(`privacy${part}Title`); + used.add(`privacy${part}Text`); + } for (const m of code.matchAll(/\b(?:tr|t)\(\s*"([A-Za-z]+)"/g)) used.add(m[1]!); for (const m of code.matchAll(/\(\[((?:"[a-z]+",?\s*)+)\] as const\)/g))