### Install Node.js and Build Frontend (NPM)
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/setup.mdx
Install Node.js using NVM, then build the frontend project using npm. The built files will be in the 'dist/' directory.
```bash
# Установка NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
# Установка Node.js LTS
nvm install --lts
git clone https://github.com/BEDOLAGA-DEV/bedolaga-cabinet.git
cd bedolaga-cabinet
cp .env.example .env
# Отредактируйте .env (VITE_API_URL, VITE_TELEGRAM_BOT_USERNAME и т.д.)
npm install
npm run build
```
--------------------------------
### Install Mintlify CLI
Source: https://github.com/bedolaga-dev/docs/blob/main/README.md
Installs the Mintlify Command Line Interface globally. This tool is used to preview documentation changes locally.
```bash
npm i -g mint
```
--------------------------------
### Reverse Proxy Configuration with Caddy
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/payments.mdx
Example configuration for Caddy to route webhook requests to the payment bot. Ensure the domain and port match your setup.
```nginx
hooks.domain.com {
reverse_proxy bot:8080
}
```
--------------------------------
### Start Local Development Server
Source: https://github.com/bedolaga-dev/docs/blob/main/README.md
Runs the Mintlify development server from the root of your documentation project. Ensure your `docs.json` file is present in this directory.
```bash
mint dev
```
--------------------------------
### Environment Variables for Cabinet, Telegram Widget, and OIDC
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/telegram-oidc.mdx
This .env file example shows the necessary configurations for enabling Cabinet, customizing the Telegram widget, and setting up Telegram OIDC.
```env
# === CABINET (обязательно) ===
CABINET_ENABLED=true
CABINET_URL=https://cabinet.example.com
CABINET_JWT_SECRET=your_jwt_secret_here
CABINET_ALLOWED_ORIGINS=https://cabinet.example.com
# === TELEGRAM WIDGET (кастомизация) ===
TELEGRAM_WIDGET_SIZE=large
TELEGRAM_WIDGET_RADIUS=8
TELEGRAM_WIDGET_USERPIC=true
TELEGRAM_WIDGET_REQUEST_ACCESS=true
# === TELEGRAM OIDC (рекомендуется) ===
TELEGRAM_OIDC_ENABLED=true
TELEGRAM_OIDC_CLIENT_ID=1234567890
TELEGRAM_OIDC_CLIENT_SECRET=your_oidc_secret
```
--------------------------------
### Web Link for MiniApp
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/campaigns.mdx
An alternative format for campaign links when used with a MiniApp. It appends the campaign start parameter to a custom MiniApp URL.
```URL
{MINIAPP_CUSTOM_URL}/?campaign={start_parameter}
```
--------------------------------
### Add Mintlify AI Skill
Source: https://github.com/bedolaga-dev/docs/blob/main/README.md
Installs Mintlify's documentation skill for AI coding tools. This skill provides component references, writing standards, and workflow guidance.
```bash
npx skills add https://mintlify.com/docs
```
--------------------------------
### GET /addons
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/sales-stats.mdx
Retrieves statistics on add-on service sales.
```APIDOC
## GET /addons
### Description
Retrieves statistics for sales of additional services (add-ons).
### Method
GET
### Endpoint
/cabinet/admin/stats/sales/addons
### Parameters
#### Query Parameters
- **days** (int) - Optional - Preset period: 7, 30, 90, 0 (all time)
- **start_date** (string) - Optional - Start of the period (ISO format)
- **end_date** (string) - Optional - End of the period (ISO format)
If `start_date` and `end_date` are provided, the `days` parameter is ignored. The maximum range is 730 days.
### Response
#### Success Response (200)
- **addon_stats** (object) - Contains statistics on add-on service sales.
```
--------------------------------
### Reload Web Server Configuration
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/setup.mdx
Reload the configuration for Caddy or Nginx to apply changes after setup.
```bash
# Перезагрузите Caddy
docker exec caddy reload --config /etc/caddy/Caddyfile
# Или Nginx
docker exec nginx -s reload
```
--------------------------------
### GET /deposits
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/sales-stats.mdx
Retrieves statistics on user deposits and top-ups.
```APIDOC
## GET /deposits
### Description
Retrieves statistics on user deposits and top-ups, broken down by payment systems.
### Method
GET
### Endpoint
/cabinet/admin/stats/sales/deposits
### Parameters
#### Query Parameters
- **days** (int) - Optional - Preset period: 7, 30, 90, 0 (all time)
- **start_date** (string) - Optional - Start of the period (ISO format)
- **end_date** (string) - Optional - End of the period (ISO format)
If `start_date` and `end_date` are provided, the `days` parameter is ignored. The maximum range is 730 days.
### Response
#### Success Response (200)
- **deposit_stats** (object) - Contains statistics on deposits, potentially including breakdown by payment systems.
```
--------------------------------
### GET /summary
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/sales-stats.mdx
Retrieves summary metrics for sales statistics.
```APIDOC
## GET /summary
### Description
Retrieves a summary of key sales metrics.
### Method
GET
### Endpoint
/cabinet/admin/stats/sales/summary
### Parameters
#### Query Parameters
- **days** (int) - Optional - Preset period: 7, 30, 90, 0 (all time)
- **start_date** (string) - Optional - Start of the period (ISO format)
- **end_date** (string) - Optional - End of the period (ISO format)
If `start_date` and `end_date` are provided, the `days` parameter is ignored. The maximum range is 730 days.
### Response
#### Success Response (200)
- **metrics** (object) - Contains various summary sales metrics.
```
--------------------------------
### Bonus for First Top-up
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/referral-program.mdx
When a referred user makes their first top-up of at least REFERRAL_MINIMUM_TOPUP_KOPEKS, both the referrer and the referred user receive bonuses. The referrer gets a bonus that is the maximum of a fixed amount or a commission percentage.
```markdown
| Получатель | Бонус |
| ---------- | ----- |
| **Реферал** (новый пользователь) | `REFERRAL_FIRST_TOPUP_BONUS_KOPEKS` на баланс |
| **Реферер** (пригласивший) | `max(REFERRAL_INVITER_BONUS_KOPEKS, комиссия%)` |
```
--------------------------------
### Set Connect Button Mode to MiniApp Subscription
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/interface-settings.mdx
Configures the 'Connect' button to open the subscription link within the MiniApp. Other modes include 'guide', 'miniapp_custom', 'link', and 'happ_cryptolink'.
```env
CONNECT_BUTTON_MODE=miniapp_subscription
```
--------------------------------
### GET /subscriptions
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/sales-stats.mdx
Retrieves statistics on sales and subscriptions.
```APIDOC
## GET /subscriptions
### Description
Retrieves statistics on sales and active subscriptions.
### Method
GET
### Endpoint
/cabinet/admin/stats/sales/subscriptions
### Parameters
#### Query Parameters
- **days** (int) - Optional - Preset period: 7, 30, 90, 0 (all time)
- **start_date** (string) - Optional - Start of the period (ISO format)
- **end_date** (string) - Optional - End of the period (ISO format)
If `start_date` and `end_date` are provided, the `days` parameter is ignored. The maximum range is 730 days.
### Response
#### Success Response (200)
- **subscription_stats** (object) - Contains sales and subscription statistics.
```
--------------------------------
### Get Animation Configuration
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/backgrounds.mdx
Retrieves the current configuration for background animations.
```APIDOC
## GET /cabinet/branding/animation-config
### Description
Retrieves the current configuration for background animations.
### Method
GET
### Endpoint
/cabinet/branding/animation-config
### Response
#### Success Response (200)
- **enabled** (boolean) - Indicates if the animation is enabled.
- **type** (string) - The type of animation (e.g., "aurora", "none").
- **settings** (object) - Specific settings for the animation type.
- **color1** (string) - Primary color.
- **color2** (string) - Secondary color.
- **color3** (string) - Tertiary color.
- **speed** (string) - Animation speed (e.g., "normal").
- **opacity** (number) - The opacity of the animation.
- **blur** (number) - The blur effect applied to the animation.
- **reducedOnMobile** (boolean) - Whether the animation is reduced on mobile devices.
```
--------------------------------
### Update Mintlify CLI
Source: https://github.com/bedolaga-dev/docs/blob/main/README.md
Ensures you have the most recent version of the Mintlify CLI installed. Use this command if your development environment is not running correctly.
```bash
mint update
```
--------------------------------
### GET /trials
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/sales-stats.mdx
Retrieves statistics related to trial periods.
```APIDOC
## GET /trials
### Description
Retrieves statistics for user trials.
### Method
GET
### Endpoint
/cabinet/admin/stats/sales/trials
### Parameters
#### Query Parameters
- **days** (int) - Optional - Preset period: 7, 30, 90, 0 (all time)
- **start_date** (string) - Optional - Start of the period (ISO format)
- **end_date** (string) - Optional - End of the period (ISO format)
If `start_date` and `end_date` are provided, the `days` parameter is ignored. The maximum range is 730 days.
### Response
#### Success Response (200)
- **trial_stats** (object) - Contains statistics related to trials.
```
--------------------------------
### GET /cabinet/branding/telegram-widget
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/telegram-oidc.mdx
Retrieves the configuration for the login page, used to determine whether to use OIDC or the legacy widget for authentication.
```APIDOC
## GET /cabinet/branding/telegram-widget
### Description
Public endpoint (no authorization required). Returns the configuration for the login page.
### Method
GET
### Endpoint
/cabinet/branding/telegram-widget
### Parameters
None
### Request Example
None
### Response
#### Success Response (200)
- **bot_username** (string) - Username of the bot (without '@')
- **size** (string) - Widget size: `large`, `medium`, `small`
- **radius** (number) - Corner rounding (0-20)
- **userpic** (boolean) - Show avatar
- **request_access** (boolean) - Request write access
- **oidc_enabled** (boolean) - Whether OIDC is enabled
- **oidc_client_id** (string) - Client ID (empty if OIDC is disabled)
#### Response Example
```json
{
"bot_username": "my_vpn_bot",
"size": "large",
"radius": 8,
"userpic": true,
"request_access": true,
"oidc_enabled": true,
"oidc_client_id": "1234567890"
}
```
```
--------------------------------
### Clone and Configure Frontend Source (Docker Build)
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/setup.mdx
Clone the frontend repository, set up the .env file, and prepare for building the Docker image.
```bash
git clone https://github.com/BEDOLAGA-DEV/bedolaga-cabinet.git
cd bedolaga-cabinet
cp .env.example .env
```
```env
VITE_API_URL=/api
VITE_TELEGRAM_BOT_USERNAME=your_bot_username
VITE_APP_NAME=My VPN
VITE_APP_LOGO=V
```
```bash
docker compose build
docker create --name tmp_cabinet cabinet_frontend
docker cp tmp_cabinet:/usr/share/nginx/html ./cabinet-dist
docker rm tmp_cabinet
```
--------------------------------
### GET /renewals
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/sales-stats.mdx
Retrieves statistics on subscription renewals.
```APIDOC
## GET /renewals
### Description
Retrieves statistics related to subscription renewals.
### Method
GET
### Endpoint
/cabinet/admin/stats/sales/renewals
### Parameters
#### Query Parameters
- **days** (int) - Optional - Preset period: 7, 30, 90, 0 (all time)
- **start_date** (string) - Optional - Start of the period (ISO format)
- **end_date** (string) - Optional - End of the period (ISO format)
If `start_date` and `end_date` are provided, the `days` parameter is ignored. The maximum range is 730 days.
### Response
#### Success Response (200)
- **renewal_stats** (object) - Contains statistics on subscription renewals.
```
--------------------------------
### Copy Built Frontend Files to Server
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/setup.mdx
Copy the compiled frontend distribution files to the designated server directory.
```bash
sudo mkdir -p /srv/cabinet
sudo cp -r ./dist/* /srv/cabinet/
```
```bash
# Скопируйте файлы
sudo cp -r ./cabinet-dist/* /srv/cabinet/
```
--------------------------------
### Enable Referral Program
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/referral-program.mdx
Enable the referral program by setting the REFERRAL_PROGRAM_ENABLED environment variable to true. This will show referral-related options in the user menu.
```env
REFERRAL_PROGRAM_ENABLED=true
```
--------------------------------
### Initialize Telegram Login SDK
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/telegram-oidc.mdx
Initialize the Telegram Login SDK with your client ID, requested access scopes, language, and a callback function. This is typically done on the frontend.
```javascript
Telegram.Login.init({
client_id: 1234567890,
request_access: ['write'],
lang: 'ru'
}, callback)
```
--------------------------------
### Payment Service Name and Descriptions
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/payments.mdx
Configure the name of your service and the descriptions for balance top-ups and subscription payments. These are used in payment descriptions.
```env
PAYMENT_SERVICE_NAME=Интернет-сервис
PAYMENT_BALANCE_DESCRIPTION=Пополнение баланса
PAYMENT_SUBSCRIPTION_DESCRIPTION=Оплата подписки
PAYMENT_BALANCE_TEMPLATE={service_name} - {description}
PAYMENT_SUBSCRIPTION_TEMPLATE={service_name} - {description}
```
--------------------------------
### Enable Automatic Backups
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/maintenance.mdx
Configure automatic database backups by setting the enabled flag, interval, time, and maximum number of backups to keep.
```env
BACKUP_AUTO_ENABLED=true
BACKUP_INTERVAL_HOURS=24
BACKUP_TIME=03:00
BACKUP_MAX_KEEP=7
```
--------------------------------
### GET /cabinet/branding/telegram-widget API Response
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/telegram-oidc.mdx
This JSON response provides the configuration for the login page, including settings for the Telegram widget and OIDC.
```json
{
"bot_username": "my_vpn_bot",
"size": "large",
"radius": 8,
"userpic": true,
"request_access": true,
"oidc_enabled": true,
"oidc_client_id": "1234567890"
}
```
--------------------------------
### Set MiniApp Service Description (EN)
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/interface-settings.mdx
Sets the service description displayed within the MiniApp for English language users. Requires Cabinet WebApp.
```env
MINIAPP_SERVICE_DESCRIPTION_EN=Secure & Fast Connection
```
--------------------------------
### Enable Cabinet API in Bot .env
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/setup.mdx
Configure your backend bot's .env file to enable the Cabinet API and set JWT secrets and allowed origins.
```env
# Включить Cabinet API
CABINET_ENABLED=true
# JWT секрет (сгенерируйте: openssl rand -hex 32)
CABINET_JWT_SECRET=your_random_secret_key_here
# Домен кабинета для CORS
CABINET_ALLOWED_ORIGINS=https://cabinet.example.com
```
--------------------------------
### Payment Provider Health Status
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/payments.mdx
This JSON response indicates the operational status of various payment providers. It's returned by the GET /health/payment-webhooks endpoint.
```json
{
"status": "ok",
"tribute_enabled": false,
"mulenpay_enabled": false,
"cryptobot_enabled": true,
"yookassa_enabled": true,
"wata_enabled": false,
"heleket_enabled": false,
"pal24_enabled": false,
"platega_enabled": false,
"cloudpayments_enabled": false,
"freekassa_enabled": false,
"kassa_ai_enabled": false,
"riopay_enabled": false,
"severpay_enabled": false
}
```
--------------------------------
### Telegram Deep Link Structure
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/campaigns.mdx
This is the standard format for a Telegram Deep Link used in campaigns. It includes the bot username and a unique start parameter for tracking.
```URL
https://t.me/{bot_username}?start={start_parameter}
```
--------------------------------
### Configure Daily Admin Reports
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/admin-notifications.mdx
Enable and configure daily administrative reports by setting the chat ID, topic ID, and send time.
```env
ADMIN_REPORTS_ENABLED=true
ADMIN_REPORTS_CHAT_ID=-1001234567890
ADMIN_REPORTS_TOPIC_ID=456
ADMIN_REPORTS_SEND_TIME=09:00
```
--------------------------------
### Set MiniApp Service Description (RU)
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/interface-settings.mdx
Sets the service description displayed within the MiniApp for Russian language users. Requires Cabinet WebApp.
```env
MINIAPP_SERVICE_DESCRIPTION_RU=Безопасное и быстрое подключение
```
--------------------------------
### Configure Auto-Synchronization
Source: https://github.com/bedolaga-dev/docs/blob/main/getting-started/initial-setup.mdx
Enable and set the times for automatic synchronization of users. This is an optional step.
```env
REMNAWAVE_AUTO_SYNC_ENABLED=true
REMNAWAVE_AUTO_SYNC_TIMES=03:00,15:00
```
--------------------------------
### Pull and Extract Frontend Docker Image
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/setup.mdx
Recommended method to obtain frontend files by pulling the latest Docker image and extracting the static assets.
```bash
docker pull ghcr.io/bedolaga-dev/bedolaga-cabinet:latest
# Извлечь статику
docker create --name tmp_cabinet ghcr.io/bedolaga-dev/bedolaga-cabinet:latest
docker cp tmp_cabinet:/usr/share/nginx/html ./cabinet-dist
docker rm tmp_cabinet
```
--------------------------------
### Example Decoded id_token from Telegram OIDC
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/telegram-oidc.mdx
This JSON represents a decoded JWT id_token received after a successful Telegram OIDC authorization. It contains essential user information and token metadata like issuer, audience, subject, and validity periods.
```json
{
"iss": "https://oauth.telegram.org",
"aud": "1234567890",
"sub": "1234123412341234123",
"iat": 1700000000,
"exp": 1700003600,
"id": 987654321,
"name": "John Doe",
"preferred_username": "johndoe",
"picture": "https://cdn4.telesco.pe/file/..."
}
```
--------------------------------
### Tribute Required Settings
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/payments.mdx
Essential environment variables for integrating with the Tribute payment platform. You need an API key and your donation link.
```env
TRIBUTE_ENABLED=true
TRIBUTE_API_KEY=your_api_key
TRIBUTE_DONATE_LINK=https://tribute.ru/your_link
```
--------------------------------
### Displaying Tariffs to Users
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/tariffs.mdx
Shows how tariffs are presented to users, including name, traffic, devices, and minimum price. This format helps users quickly compare options.
```text
Базовый — 100ГБ / 3 устройства от 179₽
Премиум — Безлимит / 10 устройств от 499₽
Суточный — 50ГБ / 1 устройство 50₽/день
```
--------------------------------
### Set Main Menu Mode to Default
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/interface-settings.mdx
Configures the bot's main menu to use the classic display mode with standard inline buttons and callback handlers.
```env
MAIN_MENU_MODE=default
```
--------------------------------
### Enable Dynamic Menu Layout
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/interface-settings.mdx
When enabled, the menu structure is managed via API, allowing for visual customization through the menu editor instead of being hardcoded.
```env
MENU_LAYOUT_ENABLED=false
```
--------------------------------
### Enable Swagger API Documentation
Source: https://github.com/bedolaga-dev/docs/blob/main/getting-started/initial-setup.mdx
Enable access to API documentation endpoints like Swagger UI, ReDoc, and OpenAPI specification. It is recommended to disable this in production or protect it with authorization.
```env
WEB_API_DOCS_ENABLED=true
```
--------------------------------
### Configure Admin Notifications
Source: https://github.com/bedolaga-dev/docs/blob/main/getting-started/initial-setup.mdx
Enable notifications for administrators and specify the chat and topic IDs for different event types. This is an optional step.
```env
ADMIN_NOTIFICATIONS_ENABLED=true
ADMIN_NOTIFICATIONS_CHAT_ID=-1001234567890
ADMIN_NOTIFICATIONS_TOPIC_ID=123
ADMIN_NOTIFICATIONS_TICKET_TOPIC_ID=126
```
--------------------------------
### Configure Backup Notifications
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/admin-notifications.mdx
Set up backup file notifications by specifying the chat ID and topic ID for backup messages. Also configures the auto-backup interval and time.
```env
BACKUP_SEND_CHAT_ID=-1001234567890
BACKUP_SEND_TOPIC_ID=789
# Интервал автобэкапов
BACKUP_INTERVAL_HOURS=24
BACKUP_TIME=03:00
```
--------------------------------
### Docker Compose Configuration for Cabinet Frontend
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/setup.mdx
Defines the Cabinet frontend service within a docker-compose.yml file, specifying the image and network.
```yaml
services:
cabinet-frontend:
image: ghcr.io/bedolaga-dev/bedolaga-cabinet:latest
container_name: cabinet_frontend
restart: unless-stopped
networks:
- bot_network
networks:
bot_network:
external: true
name: remnawave-bedolaga-telegram-bot_bot_network
```
--------------------------------
### Enable Telegram OIDC in .env
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/telegram-oidc.mdx
Set TELEGRAM_OIDC_ENABLED to true to activate OIDC authorization. Ensure TELEGRAM_OIDC_CLIENT_ID and TELEGRAM_OIDC_CLIENT_SECRET are correctly configured with your bot's ID and secret from BotFather.
```env
# Включить OIDC авторизацию
TELEGRAM_OIDC_ENABLED=true
# Client ID (числовой ID бота)
TELEGRAM_OIDC_CLIENT_ID=1234567890
# Client Secret от BotFather
TELEGRAM_OIDC_CLIENT_SECRET=your_oidc_client_secret_here
```
--------------------------------
### Heleket Required Settings
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/payments.mdx
Configure these environment variables to enable and connect to the Heleket payment gateway. Ensure you have your merchant ID and API key.
```env
HELEKET_ENABLED=true
HELEKET_MERCHANT_ID=your_merchant_id
HELEKET_API_KEY=your_api_key
```
--------------------------------
### MulenPay Required Settings
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/payments.mdx
Set up these environment variables for MulenPay integration. This includes the API key, secret key for webhook signature verification, and your shop ID.
```env
MULENPAY_ENABLED=true
MULENPAY_API_KEY=your_api_key
MULENPAY_SECRET_KEY=your_secret_key
MULENPAY_SHOP_ID=12345
```
--------------------------------
### Troubleshoot Container Network Connectivity
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/setup.mdx
Commands to inspect a container's network connections and connect it to a specific Docker network if issues arise.
```bash
# Проверить сети контейнера
docker inspect --format='{{json .NetworkSettings.Networks}}' | python3 -m json.tool
# Подключить к нужной сети
docker network connect
```
--------------------------------
### Tariff Switch Environment Variables
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/tariffs.mdx
Details the environment variables that control whether users can upgrade or downgrade their tariffs. These settings determine the flexibility of tariff changes.
```ini
TARIFF_SWITCH_UPGRADE_ENABLED=true
TARIFF_SWITCH_DOWNGRADE_ENABLED=true
```
--------------------------------
### Caddyfile Configuration for Cabinet Proxy
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/setup.mdx
Configures Caddy to proxy API requests to the backend bot and frontend requests to the Cabinet frontend Docker container.
```caddy
https://cabinet.example.com {
encode gzip zstd
# API запросы → backend бота
handle /api/* {
uri strip_prefix /api
reverse_proxy remnawave_bot:8080
}
# Frontend → nginx контейнер (порт 80 внутри Docker сети)
handle {
reverse_proxy cabinet_frontend:80
}
}
```
--------------------------------
### Enable Referral Fund Withdrawal
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/referral-program.mdx
Enable fund withdrawal for referral earnings by setting REFERRAL_WITHDRAWAL_ENABLED to true. Configure the minimum withdrawal amount and cooldown period using environment variables.
```env
REFERRAL_WITHDRAWAL_ENABLED=true
REFERRAL_WITHDRAWAL_MIN_AMOUNT_KOPEKS=50000 # 500 руб
REFERRAL_WITHDRAWAL_COOLDOWN_DAYS=30
```
--------------------------------
### Check Configuration API Call
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/telegram-oidc.mdx
This bash command checks the Telegram widget configuration endpoint. The response should indicate if OIDC is enabled and provide the client ID.
```bash
curl -s https://hooks.example.com/cabinet/branding/telegram-widget | jq
```
--------------------------------
### Maintenance Mode Configuration
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/maintenance.mdx
Configure the initial state of maintenance mode, the interval for checking the API, and whether to automatically enable maintenance mode after a certain number of failures.
```env
MAINTENANCE_MODE=false
MAINTENANCE_CHECK_INTERVAL=30
MAINTENANCE_AUTO_ENABLE=true
MAINTENANCE_MONITORING_ENABLED=true
MAINTENANCE_RETRY_ATTEMPTS=1
MAINTENANCE_MESSAGE=Ведутся технические работы...
```
--------------------------------
### Purchase Gift Subscription with Balance
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/gift-subscriptions.mdx
Initiates a gift subscription purchase using the user's balance. The API returns a purchase token and indicates that only a code will be generated.
```mermaid
graph TD
A[Buyer] -- 1. Select plan, pay (no recipient) --> B(Cabinet)
B -- 2. POST /gift/purchase {payment_mode: balance} (no recipient_*) --> C(Bot API)
C -- 3. Deduct from balance
4. Generate code --> B
B -- {status: "ok", is_code_only: true, purchase_token: "XXXX"} --> C
C -- 5. Display code for transfer --> B
B -- Display code --> A
```
--------------------------------
### Set MiniApp Service Name (EN)
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/interface-settings.mdx
Sets the service name displayed within the MiniApp for English language users. Requires Cabinet WebApp.
```env
MINIAPP_SERVICE_NAME_EN=Bedolaga VPN
```
--------------------------------
### Log Gift Activation Events
Source: https://github.com/bedolaga-dev/docs/blob/main/cabinet/gift-subscriptions.mdx
To troubleshoot gift activation issues, filter bot logs for 'gift' and 'activate' events. Replace `` with your actual bot container name.
```bash
docker logs 2>&1 | grep -i "gift.*activate"
```
--------------------------------
### Set MiniApp Service Name (RU)
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/interface-settings.mdx
Sets the service name displayed within the MiniApp for Russian language users. Requires Cabinet WebApp.
```env
MINIAPP_SERVICE_NAME_RU=Bedolaga VPN
```
--------------------------------
### Enable SeverPay Payment Gateway
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/payments.mdx
Enable SeverPay for payments via SBP and bank cards. Requires Merchant ID and a secret token for HMAC-SHA256 webhook signature verification.
```env
SEVERPAY_ENABLED=true
SEVERPAY_MID=12345
SEVERPAY_TOKEN=your_secret_token
```
--------------------------------
### Configure Log Rotation
Source: https://github.com/bedolaga-dev/docs/blob/main/bot/admin-notifications.mdx
Enable and configure daily log rotation, specifying the chat ID, topic ID, and send time for archived logs.
```env
LOG_ROTATION_ENABLED=true
LOG_ROTATION_SEND_TO_TELEGRAM=true
LOG_ROTATION_TIME=04:00
LOG_ROTATION_CHAT_ID=-1001234567890
LOG_ROTATION_TOPIC_ID=101
```