SHA256
Добавить согласие с лицензиями перед регистрацией
This commit is contained in:
@@ -72,6 +72,7 @@ import * as registrationIntroView from './pages/registration-intro-view.js';
|
||||
import * as registrationChoiceView from './pages/registration-choice-view.js';
|
||||
import * as registrationSuccessView from './pages/registration-success-view.js';
|
||||
import * as registrationEmailView from './pages/registration-email-view.js?v=20261104';
|
||||
import * as registrationLicensesView from './pages/registration-licenses-view.js';
|
||||
import * as registrationUpgradeView from './pages/registration-upgrade-view.js';
|
||||
import * as registrationFaqView from './pages/registration-faq-view.js?v=202610072303';
|
||||
import * as registrationPaymentView from './pages/registration-payment-view.js?v=20261104';
|
||||
@@ -160,6 +161,7 @@ const routes = {
|
||||
'registration-choice-view': registrationChoiceView,
|
||||
'registration-success-view': registrationSuccessView,
|
||||
'registration-email-view': registrationEmailView,
|
||||
'registration-licenses-view': registrationLicensesView,
|
||||
'registration-upgrade-view': registrationUpgradeView,
|
||||
'registration-faq-view': registrationFaqView,
|
||||
'registration-payment-view': registrationPaymentView,
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
"confirm_001": "If you have already added funds to this wallet, do not change your username or password: doing so changes its address. Return to the password step?"
|
||||
},
|
||||
"server_settings_view": {
|
||||
"test_mode": "Test server",
|
||||
"test_mode": "Test server",
|
||||
"alert_001": "Text for developers: A server account login is entered for SHiNE. The client reads its PDA, takes server address, shows the exact https address and checks the availability of the WS channel automatically."
|
||||
},
|
||||
"wallet_view": {
|
||||
@@ -4428,6 +4428,24 @@
|
||||
"network_membership": "This server is part of the SHiNE network.",
|
||||
"owner_label": "This server is owned by:",
|
||||
"software_description": "SHiNE — 0.9 Alpha\nServer and software version: 0.9 Alpha\n\nSHiNE is in alpha testing and active development.\n\nProtocol\n• The basic SHiNE protocol has been established.\n• The core user blockchain functions are implemented and operational.\n• SHiNE DAO has been launched:\nhttps://v2.realms.today/dao/FcMg5G3RpAYvW3vvztrcMuFXifWYR3HYiTuPfVgwuN4K/\n\nServer\n• The core server functionality is implemented and operational for a small number of users.\n• Scaling will require further optimization of the server software.\n\nClient application\n• The core functionality is implemented and in alpha testing.\n• The user interface and visual design are under development.\n• Audio and video calls operate in a limited mode."
|
||||
},
|
||||
"registration_licenses": {
|
||||
"title": "Licensing public materials",
|
||||
"intro": "In SHiNE, your public materials are stored in a decentralized blockchain designed for permanent preservation.",
|
||||
"rights": "When you publish, you retain your copyright and grant rights to use and distribute your public materials under two independent licenses.",
|
||||
"cc_description": "Anyone may use, copy, adapt, and share your public materials for noncommercial purposes with attribution.",
|
||||
"scdl_description": "Compatible participants in the decentralized SHiNE social network may use and distribute your public materials commercially under the terms of this license.",
|
||||
"original": "Original license — English",
|
||||
"russian": "Russian translation",
|
||||
"important": "Important to know",
|
||||
"copyright": "You retain your copyright and may use your works independently.",
|
||||
"irrevocable": "The rights granted under these licenses are irrevocable to the extent permitted by applicable law.",
|
||||
"permanent": "Public materials may remain stored and shared even after you delete a post or your account.",
|
||||
"owned_rights": "You can grant only rights you hold.",
|
||||
"private_messages": "Your private messages remain encrypted, are not published to the public blockchain, and are not licensed under these terms.",
|
||||
"confirmation": "By continuing registration, you confirm that you understand the permanent storage of public materials, accept the license terms, and grant the rights they describe.",
|
||||
"signature": "After registration, your acceptance is recorded by your digital signature in HEADER block 0 of your user blockchain, which identifies the English license texts.",
|
||||
"accept": "Accept and continue"
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
"confirm_001": "Если вы уже пополнили этот кошелёк, не меняйте логин и пароль: это изменит адрес кошелька. Вернуться к паролю?"
|
||||
},
|
||||
"server_settings_view": {
|
||||
"test_mode": "Тестовый сервер",
|
||||
"test_mode": "Тестовый сервер",
|
||||
"alert_001": "Текст для разработчиков: для Сияния вводится логин серверного аккаунта. Клиент читает его PDA, берёт server_address, показывает точный https-адрес и проверяет доступность WS-канала автоматически."
|
||||
},
|
||||
"settings_view": {
|
||||
@@ -4428,6 +4428,24 @@
|
||||
"network_membership": "Этот сервер является частью Сияния.",
|
||||
"owner_label": "Данный сервер принадлежит:",
|
||||
"software_description": "SHiNE — 0.9 Alpha\nВерсия сервера и программного обеспечения: 0.9 Alpha\n\nSHiNE находится на стадии альфа-тестирования и активной разработки.\n\nПротокол\n• Базовый протокол SHiNE сформирован.\n• Основные функции пользовательского блокчейна реализованы и работают.\n• SHiNE DAO запущено:\nhttps://v2.realms.today/dao/FcMg5G3RpAYvW3vvztrcMuFXifWYR3HYiTuPfVgwuN4K/\n\nСервер\n• Основной серверный функционал реализован и работает при небольшом количестве пользователей.\n• Для масштабирования потребуется дальнейшая оптимизация серверного программного обеспечения.\n\nКлиентское приложение\n• Основной функционал реализован и находится на стадии альфа-тестирования.\n• Пользовательский интерфейс и дизайн находятся в разработке.\n• Аудио- и видеозвонки работают в ограниченном режиме."
|
||||
},
|
||||
"registration_licenses": {
|
||||
"title": "Лицензирование публичных материалов",
|
||||
"intro": "В Сиянии (SHiNE) ваши публичные материалы сохраняются в децентрализованном блокчейне, предназначенном для постоянного хранения информации.",
|
||||
"rights": "Публикуя материалы, вы сохраняете свои авторские права и предоставляете права на использование и распространение этих материалов на условиях двух независимых лицензий.",
|
||||
"cc_description": "В некоммерческих целях любой человек может использовать, копировать, перерабатывать и распространять ваши публичные материалы с указанием авторства.",
|
||||
"scdl_description": "Совместимые участники децентрализованной социальной сети Сияние (SHiNE) могут использовать и распространять ваши публичные материалы в коммерческих целях в соответствии с условиями лицензии.",
|
||||
"original": "Оригинал лицензии — English",
|
||||
"russian": "Русский перевод",
|
||||
"important": "Важно знать",
|
||||
"copyright": "Вы сохраняете авторские права и можете самостоятельно распоряжаться своими произведениями.",
|
||||
"irrevocable": "Предоставленные лицензии являются безотзывными в пределах применимого законодательства.",
|
||||
"permanent": "Публичные материалы могут сохраняться и распространяться даже после удаления публикации или учётной записи.",
|
||||
"owned_rights": "Вы можете предоставлять только те права, которыми обладаете.",
|
||||
"private_messages": "Ваша личная переписка остаётся защищённой шифрованием, не публикуется в публичном блокчейне, и права на её использование по указанным лицензиям не предоставляются.",
|
||||
"confirmation": "Продолжая регистрацию, вы подтверждаете, что понимаете особенности постоянного хранения публичных материалов, принимаете условия указанных лицензий и предоставляете предусмотренные ими права.",
|
||||
"signature": "После регистрации принятие лицензий фиксируется вашей цифровой подписью в блоке HEADER №0 пользовательского блокчейна с указанием идентификаторов английских текстов лицензий.",
|
||||
"accept": "Принять и продолжить"
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
|
||||
@@ -338,7 +338,8 @@ export function render({ navigate }) {
|
||||
function finishIdentity(status) {
|
||||
try {
|
||||
savePendingHeaderIdentity(draft.login, draft.preGeneratedKeyBundle?.blockchainPair?.publicKeyB64, draft);
|
||||
navigate(flowType === 'free' ? 'registration-email-view' : 'registration-payment-view');
|
||||
draft.licensesAccepted = false;
|
||||
navigate('registration-licenses-view');
|
||||
} catch (error) { status.textContent = error.message; }
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ export function render({ navigate }) {
|
||||
const form = document.createElement('div');
|
||||
form.className = 'card stack registration-form signup-wizard__body';
|
||||
const draft = state.registrationDraft;
|
||||
if (!state.registrationDraft.licensesAccepted) {
|
||||
queueMicrotask(() => navigate('registration-licenses-view')); return screen;
|
||||
}
|
||||
if (![0, 1].includes(draft.accountType) || !draft.preGeneratedKeyBundle) {
|
||||
queueMicrotask(() => navigate('register-view')); return screen;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
import { t } from '../i18n/index.js';
|
||||
import { createTopBar } from '../components/topbar.js';
|
||||
import { state } from '../state.js';
|
||||
|
||||
const LICENSES = [
|
||||
{ name: 'CC BY-NC 4.0', original: 'https://arweave.net/Xtym3vUAyt7OgFBINBh1ene-5360Ah76c6D-O9ywxVE', russian: 'https://creativecommons.org/licenses/by-nc/4.0/legalcode.ru' },
|
||||
{ name: 'SCDL 1.0', original: 'https://arweave.net/NPckIo-nQUP2-ZM6PIoDYnx-6wwLeErH39jXCddOxPE', russian: './static-sites/licenses/SHiNE-SCDL-1.0-ru.html' },
|
||||
];
|
||||
|
||||
export const pageMeta = { id: 'registration-licenses-view', get title() { return t('screens.registration_licenses.title'); }, showAppChrome: false };
|
||||
|
||||
export function render({ navigate }) {
|
||||
const draft = state.registrationDraft;
|
||||
const screen = document.createElement('section');
|
||||
screen.className = 'stack registration-screen signup-wizard';
|
||||
if (!['free', 'paid'].includes(draft.flowType) || !draft.login || !draft.preGeneratedKeyBundle || ![0, 1].includes(draft.accountType)) {
|
||||
queueMicrotask(() => navigate('register-view'));
|
||||
return screen;
|
||||
}
|
||||
const body = document.createElement('div');
|
||||
body.className = 'card stack registration-form signup-wizard__body';
|
||||
const back = () => navigate('register-view');
|
||||
screen.append(createTopBar({ title: t('screens.registration_licenses.title'), back: { label: '←', onClick: back } }), body);
|
||||
const heading = document.createElement('h1'); heading.className = 'signup-title'; heading.textContent = t('screens.registration_licenses.title'); body.append(heading);
|
||||
const paragraph = (key, className = '') => { const p = document.createElement('p'); if (className) p.className = className; p.textContent = t(`screens.registration_licenses.${key}`); body.append(p); };
|
||||
paragraph('intro'); paragraph('rights');
|
||||
for (const [index, license] of LICENSES.entries()) {
|
||||
const title = document.createElement('h2'); title.textContent = license.name; body.append(title);
|
||||
paragraph(index === 0 ? 'cc_description' : 'scdl_description');
|
||||
const links = document.createElement('p'); links.className = 'signup-guidance';
|
||||
const original = document.createElement('a'); original.href = license.original; original.target = '_blank'; original.rel = 'noopener noreferrer'; original.textContent = t('screens.registration_licenses.original');
|
||||
const russian = document.createElement('a'); russian.href = license.russian; russian.target = '_blank'; russian.rel = 'noopener noreferrer'; russian.textContent = t('screens.registration_licenses.russian');
|
||||
links.append(original, document.createTextNode(' · '), russian); body.append(links);
|
||||
}
|
||||
const important = document.createElement('h2'); important.textContent = t('screens.registration_licenses.important'); body.append(important);
|
||||
const list = document.createElement('ul');
|
||||
for (const key of ['copyright', 'irrevocable', 'permanent', 'owned_rights', 'private_messages']) {
|
||||
const item = document.createElement('li'); item.textContent = t(`screens.registration_licenses.${key}`); list.append(item);
|
||||
}
|
||||
body.append(list);
|
||||
paragraph('confirmation'); paragraph('signature');
|
||||
const accept = document.createElement('button'); accept.type = 'button'; accept.className = 'primary-btn signup-next'; accept.textContent = t('screens.registration_licenses.accept');
|
||||
accept.addEventListener('click', () => { draft.licensesAccepted = true; navigate(draft.flowType === 'free' ? 'registration-email-view' : 'registration-payment-view'); });
|
||||
body.append(accept);
|
||||
return screen;
|
||||
}
|
||||
@@ -92,6 +92,7 @@ function clamp(value, min, max) {
|
||||
|
||||
export async function completeRegistrationLogin({ navigate, keyBundle }) {
|
||||
const draft = state.registrationDraft;
|
||||
if (!draft.licensesAccepted) throw new Error('Registration licenses not accepted');
|
||||
if (![0, 1].includes(draft.accountType)) throw new Error('Missing registration account type');
|
||||
// Финальный вход регистрации нельзя повторять на сокете, который мог
|
||||
// стать авторизованным после частично успешной предыдущей попытки.
|
||||
@@ -168,6 +169,9 @@ export async function completeRegistrationLogin({ navigate, keyBundle }) {
|
||||
export function render({ navigate }) {
|
||||
const screen = document.createElement('section');
|
||||
screen.className = 'stack';
|
||||
if (!state.registrationDraft.licensesAccepted) {
|
||||
queueMicrotask(() => navigate('registration-licenses-view')); return screen;
|
||||
}
|
||||
if (![0, 1].includes(state.registrationDraft.accountType) || !state.registrationDraft.preGeneratedKeyBundle) {
|
||||
queueMicrotask(() => navigate('register-view')); return screen;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ const PRETTY_PATHS = new Map([
|
||||
['registration-choice-view', 'register/choose'],
|
||||
['registration-success-view', 'register/success'],
|
||||
['registration-email-view', 'register/email'],
|
||||
['registration-licenses-view', 'register/licenses'],
|
||||
['registration-upgrade-view', 'settings/solana-upgrade'],
|
||||
['registration-faq-view', 'register/faq'],
|
||||
['registration-payment-view', 'register/payment'],
|
||||
@@ -83,6 +84,7 @@ export const PRE_AUTH_PAGES = [
|
||||
'registration-intro-view',
|
||||
'registration-choice-view',
|
||||
'registration-email-view',
|
||||
'registration-licenses-view',
|
||||
'registration-faq-view',
|
||||
'registration-payment-view',
|
||||
'registration-draft-keys-view',
|
||||
@@ -253,6 +255,7 @@ export function parseRouteFromPath(pathname = '') {
|
||||
if (sub === 'choose') return { pageId: 'registration-choice-view', params: {} };
|
||||
if (sub === 'success') return { pageId: 'registration-success-view', params: {} };
|
||||
if (sub === 'email') return { pageId: 'registration-email-view', params: {} };
|
||||
if (sub === 'licenses') return { pageId: 'registration-licenses-view', params: {} };
|
||||
if (sub === 'faq') return { pageId: 'registration-faq-view', params: {} };
|
||||
if (sub === 'payment') return { pageId: 'registration-payment-view', params: {} };
|
||||
if (sub === 'draft-keys') return { pageId: 'registration-draft-keys-view', params: {} };
|
||||
|
||||
@@ -34,6 +34,7 @@ const INVALID_SESSION_CODES = new Set([
|
||||
function createEmptyRegistrationDraft() {
|
||||
return {
|
||||
uiStep: 1,
|
||||
licensesAccepted: false,
|
||||
accountType: null,
|
||||
previousAccounts: [],
|
||||
flowType: '',
|
||||
|
||||
Reference in New Issue
Block a user