feat(web): add privacy policy page and trim the memory block text

This commit is contained in:
Loki 2026-10-24 17:28:14 +02:00
parent 8ce307e25b
commit 309b77e63c
Signed by: boba
GPG key ID: 253067914055423B
7 changed files with 89 additions and 15 deletions

View file

@ -63,6 +63,7 @@
></a ></a
> >
<p data-i18n="footer">Клиент и сервер написаны на Rust.</p> <p data-i18n="footer">Клиент и сервер написаны на Rust.</p>
<a href="/privacy" data-i18n="privacyLink">Конфиденциальность</a>
<a <a
href="https://www.gnu.org/licenses/gpl-3.0.html" href="https://www.gnu.org/licenses/gpl-3.0.html"
target="_blank" target="_blank"

View file

@ -50,7 +50,13 @@ const server = Bun.serve({
? resolve(root, "src") ? resolve(root, "src")
: resolve(root, "public"); : resolve(root, "public");
let file = resolve(base, sourceStyle ? "styles.css" : `.${path}`); let file = resolve(base, sourceStyle ? "styles.css" : `.${path}`);
if (path === "/" || path === "/account" || path === "/account/") if (
path === "/" ||
path === "/account" ||
path === "/account/" ||
path === "/privacy" ||
path === "/privacy/"
)
file = resolve(base, "index.html"); file = resolve(base, "index.html");
if (!file.startsWith(base + sep)) if (!file.startsWith(base + sep))
return new Response(null, { status: 403 }); return new Response(null, { status: 403 });

View file

@ -14,6 +14,7 @@ let language = detectLanguage(
navigator.languages ?? [navigator.language], navigator.languages ?? [navigator.language],
); );
const accountPage = /^\/account\/?$/.test(location.pathname); const accountPage = /^\/account\/?$/.test(location.pathname);
const privacyPage = /^\/privacy\/?$/.test(location.pathname);
function find<T extends Element = HTMLElement>( function find<T extends Element = HTMLElement>(
selector: string, selector: string,
root: ParentNode = document, root: ParentNode = document,
@ -77,7 +78,7 @@ function landing() {
</div> </div>
</section> </section>
<section class="project-section shell reveal" id="project" aria-labelledby="project-title"><div class="section-intro">${tr("projectTitle", "h2", 'id="project-title"')}${tr("projectText", "p")}<div class="source-links">${external("https://git.wihuk.pro/boba/VNOX-Client", "clientCode")}${external("https://git.wihuk.pro/boba/VNOX-Server", "serverCode")}</div></div><div class="project-points"><article><div class="point-icon">${icon("chat", 24)}</div><div>${tr("projectNative", "h3")}${tr("projectNativeText", "p")}</div></article><article><div class="point-icon">${icon("voice", 24)}</div><div>${tr("projectServer", "h3")}${tr("projectServerText", "p")}</div></article><article><img src="/assets/vnox-mark.svg" alt="" width="40" height="40"><div>${tr("projectCentral", "h3")}${tr("projectCentralText", "p")}</div></article></div></section> <section class="project-section shell reveal" id="project" aria-labelledby="project-title"><div class="section-intro">${tr("projectTitle", "h2", 'id="project-title"')}${tr("projectText", "p")}<div class="source-links">${external("https://git.wihuk.pro/boba/VNOX-Client", "clientCode")}${external("https://git.wihuk.pro/boba/VNOX-Server", "serverCode")}</div></div><div class="project-points"><article><div class="point-icon">${icon("chat", 24)}</div><div>${tr("projectNative", "h3")}${tr("projectNativeText", "p")}</div></article><article><div class="point-icon">${icon("voice", 24)}</div><div>${tr("projectServer", "h3")}${tr("projectServerText", "p")}</div></article><article><img src="/assets/vnox-mark.svg" alt="" width="40" height="40"><div>${tr("projectCentral", "h3")}${tr("projectCentralText", "p")}</div></article></div></section>
<section class="light-section shell reveal" id="light" aria-labelledby="light-title"><div class="light-intro">${tr("lightTitle", "h2", 'id="light-title"')}${tr("lightText", "p")}<div class="source-links"><a class="text-link" href="https://www.pcworld.com/article/3005317/discord-admits-windows-11-app-hogs-ram-tries-solving-it-with-auto-restarts.html" target="_blank" rel="noopener noreferrer">${tr("lightSource")}${icon("external", 15)}</a></div></div><div class="light-meters"><div class="meter vnox"><div class="meter-head">${tr("lightVnoxName")}<strong>${tr("lightAbout")} <span class="count" data-count="120">120</span> ${tr("lightUnit")}</strong></div><div class="meter-track" aria-hidden="true"><i data-w="9.1%"></i></div></div><div class="meter electron"><div class="meter-head">${tr("lightElectronName")}<strong>${tr("lightElectronValue")}</strong></div><div class="meter-track" aria-hidden="true"><i data-w="100%"></i></div>${tr("lightElectronNote", "p", 'class="meter-note"')}</div>${tr("lightCaption", "p", 'class="small light-caption"')}${tr("lightScale", "p", 'class="small light-caption"')}</div></section> <section class="light-section shell reveal" id="light" aria-labelledby="light-title"><div class="light-intro">${tr("lightTitle", "h2", 'id="light-title"')}${tr("lightText", "p")}<div class="source-links"><a class="text-link" href="https://www.pcworld.com/article/3005317/discord-admits-windows-11-app-hogs-ram-tries-solving-it-with-auto-restarts.html" target="_blank" rel="noopener noreferrer">${tr("lightSource")}${icon("external", 15)}</a></div></div><div class="light-meters"><div class="meter vnox"><div class="meter-head">${tr("lightVnoxName")}<strong>${tr("lightAbout")} <span class="count" data-count="120">120</span> ${tr("lightUnit")}</strong></div><div class="meter-track" aria-hidden="true"><i data-w="9.1%"></i></div></div><div class="meter electron"><div class="meter-head">${tr("lightElectronName")}<strong>${tr("lightElectronValue")}</strong></div><div class="meter-track" aria-hidden="true"><i data-w="100%"></i></div></div>${tr("lightCaption", "p", 'class="small light-caption"')}</div></section>
<section class="client-section reveal" id="client" aria-labelledby="client-title"><div class="shell"><div class="client-heading">${tr("clientTitle", "h2", 'id="client-title"')}${tr("clientText", "p")}</div><figure class="client-image"><img src="/assets/client-settings.png" width="1280" height="800" alt="${t("clientScreenshot")}" data-i18n-alt="clientScreenshot" loading="lazy">${tr("screenshotCaption", "figcaption")}</figure><div class="client-details"><article>${tr("appearanceTitle", "h3")}${tr("appearanceText", "p")}</article><article>${tr("identityTitle", "h3")}${tr("identityText", "p")}</article></div></div></section> <section class="client-section reveal" id="client" aria-labelledby="client-title"><div class="shell"><div class="client-heading">${tr("clientTitle", "h2", 'id="client-title"')}${tr("clientText", "p")}</div><figure class="client-image"><img src="/assets/client-settings.png" width="1280" height="800" alt="${t("clientScreenshot")}" data-i18n-alt="clientScreenshot" loading="lazy">${tr("screenshotCaption", "figcaption")}</figure><div class="client-details"><article>${tr("appearanceTitle", "h3")}${tr("appearanceText", "p")}</article><article>${tr("identityTitle", "h3")}${tr("identityText", "p")}</article></div></div></section>
<section class="roadmap shell reveal" id="roadmap" aria-labelledby="roadmap-title"><div class="roadmap-heading">${tr("roadmapTitle", "h2", 'id="roadmap-title"')}${tr("roadmapText", "p")}</div><div class="roadmap-columns"><article><h3><span class="connection-dot" aria-hidden="true"></span>${tr("available")}</h3><ul><li>${tr("availableOne")}</li><li>${tr("availableTwo")}</li><li>${tr("availableThree")}</li><li>${tr("availableFour")}</li><li>${tr("availableFive")}</li></ul></article><article><h3><span class="planned-dot" aria-hidden="true"></span>${tr("next")}</h3><ul><li>${tr("nextOne")}</li><li>${tr("nextTwo")}</li><li>${tr("nextThree")}</li></ul></article></div>${tr("downloadNote", "p", 'class="release-note"')}</section> <section class="roadmap shell reveal" id="roadmap" aria-labelledby="roadmap-title"><div class="roadmap-heading">${tr("roadmapTitle", "h2", 'id="roadmap-title"')}${tr("roadmapText", "p")}</div><div class="roadmap-columns"><article><h3><span class="connection-dot" aria-hidden="true"></span>${tr("available")}</h3><ul><li>${tr("availableOne")}</li><li>${tr("availableTwo")}</li><li>${tr("availableThree")}</li><li>${tr("availableFour")}</li><li>${tr("availableFive")}</li></ul></article><article><h3><span class="planned-dot" aria-hidden="true"></span>${tr("next")}</h3><ul><li>${tr("nextOne")}</li><li>${tr("nextTwo")}</li><li>${tr("nextThree")}</li></ul></article></div>${tr("downloadNote", "p", 'class="release-note"')}</section>
<section class="faq shell reveal" aria-labelledby="faq-title">${tr("faqTitle", "h2", 'id="faq-title"')}<div>${(["Server", "Central", "Release"] as const).map((key) => `<details><summary>${tr(`faq${key}`)}<span aria-hidden="true">+</span></summary>${tr(`faq${key}Answer`, "p")}</details>`).join("")}</div></section> <section class="faq shell reveal" aria-labelledby="faq-title">${tr("faqTitle", "h2", 'id="faq-title"')}<div>${(["Server", "Central", "Release"] as const).map((key) => `<details><summary>${tr(`faq${key}`)}<span aria-hidden="true">+</span></summary>${tr(`faq${key}Answer`, "p")}</details>`).join("")}</div></section>
@ -172,6 +173,10 @@ function renderDiagram() {
); );
} }
} }
function privacy() {
const sections = ["Collect", "Cookies", "Track", "Other", "Delete"] as const;
main.innerHTML = `<section class="privacy-section shell"><a href="/" class="text-link back-link">${icon("back", 17)}${tr("back")}</a>${tr("privacyTitle", "h1")}${tr("privacyUpdated", "p", 'class="small"')}${tr("privacyIntro", "p")}${sections.map((key) => `<div class="privacy-block">${tr(`privacy${key}Title` as MessageKey, "h2")}${tr(`privacy${key}Text` as MessageKey, "p")}</div>`).join("")}</section>`;
}
function account() { function account() {
main.innerHTML = `<section class="account-section shell"><a href="/" class="text-link back-link">${icon("back", 17)}${tr("back")}</a><div class="account-layout"><div class="account-intro"><img class="account-mark" src="/assets/vnox-mark.svg" alt="" width="76" height="76">${tr("accountHeading", "h1")}${tr("accountIntro", "p")}<div class="account-explanation">${tr("accountStage", "p")}</div></div><div id="account-content" class="account-panel" aria-live="polite"></div></div></section>`; main.innerHTML = `<section class="account-section shell"><a href="/" class="text-link back-link">${icon("back", 17)}${tr("back")}</a><div class="account-layout"><div class="account-intro"><img class="account-mark" src="/assets/vnox-mark.svg" alt="" width="76" height="76">${tr("accountHeading", "h1")}${tr("accountIntro", "p")}<div class="account-explanation">${tr("accountStage", "p")}</div></div><div id="account-content" class="account-panel" aria-live="polite"></div></div></section>`;
renderAccount(); renderAccount();
@ -326,8 +331,10 @@ function setLanguage(next: Language) {
/* No authentication data is persisted. */ /* No authentication data is persisted. */
} }
document.documentElement.lang = next; document.documentElement.lang = next;
document.title = t(accountPage ? "accountTitle" : "title"); const pageTitle = t(
const pageTitle = t(accountPage ? "accountTitle" : "title"); privacyPage ? "privacyTitle" : accountPage ? "accountTitle" : "title",
);
document.title = pageTitle;
find<HTMLMetaElement>('meta[name="description"]').content = t("description"); find<HTMLMetaElement>('meta[name="description"]').content = t("description");
find<HTMLMetaElement>('meta[property="og:title"]').content = pageTitle; find<HTMLMetaElement>('meta[property="og:title"]').content = pageTitle;
find<HTMLMetaElement>('meta[property="og:description"]').content = find<HTMLMetaElement>('meta[property="og:description"]').content =
@ -364,13 +371,15 @@ function setLanguage(next: Language) {
String(button.dataset.language === next), String(button.dataset.language === next),
), ),
); );
if (privacyPage) return;
if (accountPage) renderAccount(); if (accountPage) renderAccount();
else { else {
renderDiagram(); renderDiagram();
updateStatus(); updateStatus();
} }
} }
if (accountPage) account(); if (privacyPage) privacy();
else if (accountPage) account();
else landing(); else landing();
document document
.querySelectorAll<HTMLElement>("[data-language]") .querySelectorAll<HTMLElement>("[data-language]")

View file

@ -54,6 +54,26 @@ export const en = {
projectCentral: "Vnox Central", projectCentral: "Vnox Central",
projectCentralText: projectCentralText:
"A web account with GitHub sign-in. It is not linked to the desktop client key yet.", "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", lightTitle: "A light client",
lightText: lightText:
"The Rust and Slint client does not carry a browser with it. It uses about 120 MB of memory when idle.", "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", lightVnoxName: "VNOX",
lightElectronName: "Discord (Vesktop, Electron)", lightElectronName: "Discord (Vesktop, Electron)",
lightElectronValue: "about 1.3 GB", 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: lightCaption:
"Measured on Linux. VNOX: connection screen, release build, RSS 121 MB, PSS 96 MB. Discord: in use.", "Measured on Linux by RSS: VNOX on the connection screen, Discord (Vesktop) in use.",
lightScale:
"These are two different states: VNOX idle, Discord under load. Bar length: 1.3 GB by RSS.",
lightSource: "On Electron in general: PCWorld, December 2025", lightSource: "On Electron in general: PCWorld, December 2025",
clientCode: "Client source", clientCode: "Client source",
serverCode: "Server source", serverCode: "Server source",

View file

@ -56,6 +56,26 @@ export const ru: Catalog = {
projectCentral: "Vnox Central", projectCentral: "Vnox Central",
projectCentralText: projectCentralText:
"Веб-аккаунт с входом через GitHub. С ключом настольного клиента он пока не связан.", "Веб-аккаунт с входом через 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: "Лёгкий клиент", lightTitle: "Лёгкий клиент",
lightText: lightText:
"Клиент на Rust и Slint не носит с собой браузер. В простое он занимает около 120 МБ памяти.", "Клиент на Rust и Slint не носит с собой браузер. В простое он занимает около 120 МБ памяти.",
@ -64,12 +84,8 @@ export const ru: Catalog = {
lightVnoxName: "VNOX", lightVnoxName: "VNOX",
lightElectronName: "Discord (Vesktop, Electron)", lightElectronName: "Discord (Vesktop, Electron)",
lightElectronValue: "около 1,3 ГБ", lightElectronValue: "около 1,3 ГБ",
lightElectronNote:
"Discord в клиенте Vesktop на Electron, 8 процессов, в работе: RSS 1333 МБ, PSS 1103 МБ (около 1,1 ГБ). Клиенты на Electron вообще часто занимают от нескольких сотен МБ до гигабайта и больше.",
lightCaption: lightCaption:
"Замер на Linux. VNOX: экран подключения, release-сборка, RSS 121 МБ, PSS 96 МБ. Discord: в работе.", "Замер на Linux по RSS: VNOX на экране подключения, Discord (Vesktop) в работе.",
lightScale:
"Это два разных состояния: VNOX в простое, Discord под нагрузкой. Длина полосы: 1,3 ГБ по RSS.",
lightSource: "Про Electron в целом: PCWorld, декабрь 2025", lightSource: "Про Electron в целом: PCWorld, декабрь 2025",
clientCode: "Код клиента", clientCode: "Код клиента",
serverCode: "Код сервера", serverCode: "Код сервера",

View file

@ -2083,3 +2083,25 @@ p {
transition: none !important; 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;
}

View file

@ -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}`);
used.add(`faq${part}Answer`); 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)) for (const m of code.matchAll(/\b(?:tr|t)\(\s*"([A-Za-z]+)"/g))
used.add(m[1]!); used.add(m[1]!);
for (const m of code.matchAll(/\(\[((?:"[a-z]+",?\s*)+)\] as const\)/g)) for (const m of code.matchAll(/\(\[((?:"[a-z]+",?\s*)+)\] as const\)/g))