Вынести дефолтный сервер в конфиг UI и оживить счетчик пароля

This commit is contained in:
AidarKC
2026-06-23 14:11:09 +04:00
parent 95daa230bb
commit 66986b804c
13 changed files with 50 additions and 18 deletions
+2 -1
View File
@@ -27,6 +27,7 @@ import {
saveEncryptedUserSecrets,
saveSessionMaterial,
} from './key-vault.js';
import { defaultServerWs } from '../deploy-config.js';
const BCH_SUFFIX = '001';
const ZERO64 = '0'.repeat(64);
@@ -73,7 +74,7 @@ const CONNECTION_SUBTYPES = Object.freeze({
function normalizeServerUrl(url) {
const value = (url || '').trim();
if (!value) return 'wss://shineup.me/ws';
if (!value) return defaultServerWs;
if (value.startsWith('ws://') || value.startsWith('wss://')) {
try {
const parsed = new URL(value);
+10 -4
View File
@@ -1,9 +1,15 @@
import { readShineUserPda } from './shine-user-pda-service.js';
import {
defaultServerAddress,
defaultServerHttp,
defaultServerLogin,
defaultServerWs,
} from '../deploy-config.js';
export const DEFAULT_SHINE_SERVER_LOGIN = 'shineupme';
export const DEFAULT_SHINE_SERVER_ADDRESS = 'shineup.me';
export const DEFAULT_SHINE_SERVER_HTTP = `https://${DEFAULT_SHINE_SERVER_ADDRESS}`;
export const DEFAULT_SHINE_SERVER_WS = `wss://${DEFAULT_SHINE_SERVER_ADDRESS}/ws`;
export const DEFAULT_SHINE_SERVER_LOGIN = defaultServerLogin;
export const DEFAULT_SHINE_SERVER_ADDRESS = defaultServerAddress;
export const DEFAULT_SHINE_SERVER_HTTP = defaultServerHttp;
export const DEFAULT_SHINE_SERVER_WS = defaultServerWs;
function normalizeHostLike(value) {
const raw = String(value || '').trim();
+2 -1
View File
@@ -1,10 +1,11 @@
import { captureClientError } from './client-error-reporter.js';
import { defaultServerWs } from '../deploy-config.js';
const DEFAULT_TIMEOUT_MS = 12000;
function buildWsUrl(raw) {
const value = (raw || '').trim();
if (!value) return 'wss://shineup.me/ws';
if (!value) return defaultServerWs;
if (value.startsWith('/')) {
const secure = window.location.protocol === 'https:';
const scheme = secure ? 'wss' : 'ws';