NW
3b8e6416c4
feat(admin): Bot Configuration — eye toggle to reveal masked values (token, secrets)
...
- compose: pass bot env (BOT_TOKEN, SUPPORT_LINK, ADMIN_IDS, SUPER_ADMIN_IDS, WG_*, ADMIN_*, GITEA_API_URL) to tg_shop_admin
- settings API: reads real env values; POST /api/settings reveals secret value by key (auth required)
- settings-page: eye/eye-off button on masked fields, shows real value on click (BOT_TOKEN, ADMIN_IDS, etc.)
2026-08-09 15:27:48 +01:00
NW
7ba17f2de6
fix(admin): super admin always has full seed access (commission informational only)
2026-08-09 13:56:08 +01:00
NW
d7bbb9ec6b
feat(admin): issue #144 — seed phrases for regular admin, commission-gated + Mercuryo payment
...
- overview: commissionWallets (env) + mercuryoUrl in response
- seeds API: getAuth (regular admin), locked=true + no mnemonics when commissionDue>0, full when 0
- export-seeds: 403 when commissionDue>0
- UI: seed tab for all admins; payment block (past payments, difference, commission wallet selector, Mercuryo card button, I've paid -> record-payment); full table + CSV when unlocked
- super_admin: full access regardless (informational warning)
2026-08-09 13:44:28 +01:00
NW
d827a18ee9
feat(admin): decrypt mnemonics + balance column in seed phrases
...
- lib/mnemonic.ts: decryptMnemonic (same AES-256-CBC+HKDF algo as bot, uses ENCRYPTION_KEY)
- wallets/seeds API: decrypts mnemonic per user, adds balance field
- wallets/export-seeds (CSV): decrypts mnemonic, adds Balance column
- wallets-page: Balance column added to seed phrases table
- compose: ENCRYPTION_KEY passed to tg_shop_admin (same key as bot)
2026-08-09 01:23:34 +01:00
NW
d1ce76a14c
fix(admin): seed phrases 500 — Prisma 6.19 rejects select+include together
...
- wallets/seeds: move user relation into nested select (was select+include -> PrismaClientValidationError 500)
- wallets/export-seeds: same fix (CSV export)
- Verified no other top-level select+include conflicts in api routes
- tsc clean
2026-08-09 01:05:43 +01:00
NW
d7680357af
chore: repo cleanup + docs for admin API and DB schema (v1.2.8)
...
- remove stale docs/admin-frontend-spec.md (old Express/EJS admin), unused templates/ (SmartAdmin copy), dead scripts/sync-agents.cjs, committed dev.pid
- add docs/API.md (admin REST API reference) and docs/DATABASE.md (DB schema)
- refresh .env.example: drop stale ADMIN_PORT/SHOP_CONTAINER, add ADMIN_URL, HEALTH_PORT, DEFAULT_LANGUAGE, CHATBOT_API_*
- add npm run lint so Gitea workflows pass
- rebrand web-testing suite from APAW to telegram-shop
2026-08-09 00:22:22 +01:00
NW
338a700b3a
fix(bot): issue #143 — sleep mode safety guards + super-admin seed access
...
- sleepGuard.js: assertShopOpen/redirectIfPaused — blocks write-flows on shop pause, redirects to AI dialog, fallback to sleep message
- Blocked: buy/pay/quantity/top-up/deposit/wallet-create when paused
- Soft redirect: catalog navigation (country/city/district/category/product) to AI on pause
- Read-only flows untouched (purchase history, balance, tx history)
- Tests: 10 sleepGuard tests (T1-T6 + alias + fallback), 42 total pass
- fix(admin): super-admin seed phrases not blocked by commission (informational only)
- wallet test mock updated for sleepGuard
2026-08-08 23:46:56 +01:00
NW
c17e5f4099
fix(admin): Translations table — add Section header column (was shifted 1 cell left)
...
- Table had 4 headers (Key + 3 langs) but 5 data cells (Section rowSpan + Key + 3 langs)
- Headers were misaligned relative to data; added Section column header
2026-08-08 17:48:32 +01:00
NW
bfa21fc156
fix(ai): issue #141 — custom OpenAI-compatible providers work + language selection on first start in sleep mode
...
- callOllama: reasoning_effort only for provider=ollama (others returned 400 -> stub reply)
- endpoint normalization: base URL (Groq /openai/v1) -> /chat/completions appended
- reasoning block stripping: <thinking>/<think> tags + thinking/response markers (Groq qwen)
- handleStart: sleep mode + language_set=0 -> show language selection keyboard first
- handleSetLanguage: sleep mode -> AI dialog in chosen language after selection
2026-08-08 15:31:19 +01:00
NW
b352d1434c
feat(admin): load LLM models from provider /models endpoint (OpenAI-compatible)
...
- New API /api/chatbot/models: fetches model list from configured endpoint (/models, OpenAI/Ollama format)
- Uses saved site_settings endpoint+key, or accepts endpoint/apiKey query params (unsaved custom provider)
- UI: 'Загрузить модели' button in Provider tab — loads models into select
- Manual model input always available for Custom providers
- No more hardcoded Ollama-only model list
2026-08-08 14:01:29 +01:00
NW
c7a4463ac4
fix(admin): login redirect — full location.href=/ instead of hash, session check on mount
...
- window.location.href='/' after login (was window.location.hash='/' which stayed on /login#/)
- checkSession on mount: already-authenticated users skip login form
2026-08-08 13:12:52 +01:00
NW
01d75fc7b7
refactor(bot): remove old Express/EJS admin panel, add standalone health server (v1.2.7)
...
- Delete src/admin/ (1012 files: routes, views, public, auth) — old admin replaced by Next.js admin-next/
- Add src/healthServer.js: minimal HTTP /health on port 3001 for Docker healthcheck
- src/index.js uses startHealthServer instead of startAdminPanel
- Remove admin-dependent test (adminDeleteFeedback.test.js); 30 tests pass
- Remove ejs/express-ejs-layouts/express/cookie-parser/multer from deps
- admin-next: prisma binaryTargets for linux-arm64-openssl (arm64 prod)
- VERSION.md v1.2.7
- Bot adminHandlers (Telegram commands) kept — data preserved in shared SQLite
2026-08-08 12:22:15 +01:00
NW
d78c7aa502
fix(admin): add openssl+curl for Prisma SQLite and healthcheck in runner stage
2026-08-08 01:39:38 +01:00
NW
a4a5fd449d
feat(admin): integrate Next.js admin panel (admin-next/) from feat/nextjs-admin
...
- Add admin-next/: full Next.js + Prisma + shadcn admin panel (45 API routes, 76 components)
- docker-compose: tg_shop_admin service (port 3000, shared db/shop.db, prisma), bot talks to it via ADMIN_CHAT_URL=http://tg_shop_admin:3000/api/chat
- tor-proxy now proxies onion admin to tg_shop_admin:3000 (new panel)
- chatbotService: ADMIN_CHAT_URL default = http://tg_shop_admin:3000/api/chat (removed localhost:3100 anachronism)
- .env admin secrets gitignored (admin-next/.env)
2026-08-08 01:31:45 +01:00