Files
telegram-shop/.env.example
NW 49945d9d81 security(csv-export): harden mnemonic export with super admin, audit, watermark (#48)
- Add SUPER_ADMIN_IDS config (fallback to ADMIN_IDS if not set)
- Add isSuperAdmin() to middleware/auth.js
- Create auditService.js for structured audit logging (DB + pino)
- Create migration 005_audit_log.js
- Add confirmation dialog before CSV export (confirm_export_ callback)
- Check isSuperAdmin before export — block non-super admins
- Audit log every export: admin ID, wallet type, wallet count
- Add exported_by watermark column to CSV with admin telegram ID
- Notify all other super admins when export occurs
- Add SUPER_ADMIN_IDS to .env.example

8 files changed, 154 insertions, 39 deletions
2026-06-22 10:07:58 +01:00

44 lines
1.3 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================
# Telegram Shop - Environment Configuration (TEMPLATE)
# ============================================================
# Копируй этот файл в .env и заполни реальными значениями.
# ВНИМАНИЕ: .env файлы НЕ коммитятся — они в .gitignore.
# ============================================================
# --- Telegram Bot ---
BOT_TOKEN=your_bot_token_here
ADMIN_IDS=123456789,987654321
SUPER_ADMIN_IDS=123456789
SUPPORT_LINK=https://t.me/your_support
# --- Catalog ---
CATALOG_PATH=./catalog
# --- Encryption (ОБЯЗАТЕЛЬНО! Без этого приложение упадёт) ---
# Сгенерируй надёжный ключ: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
ENCRYPTION_KEY=
# --- Commission ---
COMMISSION_ENABLED=true
COMMISSION_PERCENT=5
# --- Commission Wallets ---
COMMISSION_WALLET_BTC=
COMMISSION_WALLET_LTC=
COMMISSION_WALLET_USDT=
COMMISSION_WALLET_USDC=
COMMISSION_WALLET_ETH=
# --- WireGuard ---
WG_ENABLED=false
WG_PRIVATE_KEY=
WG_PUBLIC_KEY=
WG_PRESHARED_KEY=
WG_ENDPOINT=
WG_ADDRESS=
WG_DNS=
WG_ALLOWED_IPS=0.0.0.0/0,::/0
# --- Gitea API (для CI/CD и пайплайна) ---
GITEA_API_URL=https://git.softuniq.eu/api/v1
GITEA_TOKEN=