### Install the V2RayTun panel Source: https://v2.run/en/roadmap Execute the installation script to set up the panel and initialize the setup process. ```bash bash <(curl -fsSL https://raw.githubusercontent.com/v2RayTun/install-panel/main/install.sh) ``` ```bash v2raytunsetup install-panel ``` -------------------------------- ### Install the Panel Source: https://v2.run/en/docs/quick-start Initializes the panel installation wizard to configure domains and start services. ```bash v2raytunsetup install-panel ``` -------------------------------- ### Run the V2RayTun Installer Source: https://v2.run/en/docs/quick-start Executes the installation script to set up Docker and the v2raytunsetup CLI. ```bash bash <(curl -fsSL https://raw.githubusercontent.com/v2RayTun/install-panel/main/install.sh) ``` -------------------------------- ### Install Docker Source: https://v2.run/en/docs/install/nodes Installs the Docker engine on the node server. ```bash curl -fsSL https://get.docker.com | sh ``` -------------------------------- ### Run the Panel Installer Source: https://v2.run/en/docs/install/panel Executes the installation process either interactively or via environment variables for non-interactive deployment. ```bash v2raytunsetup install-panel ``` ```bash V2RAYTUN_PANEL_DOMAIN=panel.example.com \ V2RAYTUN_SUB_DOMAIN=sub.example.com \ v2raytunsetup install-panel ``` -------------------------------- ### Start Node Services Source: https://v2.run/en/docs/install/nodes Initializes the node containers using the provided docker-compose.yml file. ```bash docker compose up -d ``` -------------------------------- ### View Directory Structure Source: https://v2.run/en/docs/install/panel Displays the file layout created by the installation process in /opt/v2raytun/. ```plaintext /opt/v2raytun/ ├── docker-compose.yml ├── .env ├── caddy/ │ └── Caddyfile ├── data/ │ ├── postgres/ │ └── redis/ └── certs/ ├── ca.crt ├── panel.crt └── panel.key ``` -------------------------------- ### Install AmneziaWG Kernel Module Source: https://v2.run/en/docs/protocols/awg Commands to install the required amneziawg-dkms module on a Linux server. ```bash apt install -y linux-headers-$(uname -r) apt install -y amneziawg-dkms ``` -------------------------------- ### Install the Panel in Non-Interactive Mode Source: https://v2.run/en/docs/quick-start Skips the interactive wizard by providing panel and subscription domains via environment variables. ```bash V2RAYTUN_PANEL_DOMAIN=panel.example.com \ V2RAYTUN_SUB_DOMAIN=sub.example.com \ v2raytunsetup install-panel ``` -------------------------------- ### Verify Installation Status Source: https://v2.run/en/docs/install/panel Checks the status of the Docker containers to ensure all services are running correctly. ```bash docker compose ps ``` -------------------------------- ### Hysteria2 Protocol URI Source: https://v2.run/en Example URI for a Hysteria2 connection utilizing salamander obfuscation. ```text hysteria2://WMwO…@138.124.93.130:443/?insecure=1&sni=138.124.93.130&obfs=salamander&obfs-password=713e70ba…#NL-Hysteria2 ``` -------------------------------- ### GET /api/sub/{shortUuid} Source: https://v2.run/en/docs/subscriptions Retrieves the user's subscription configuration list as a base64-encoded string containing connection URIs. ```APIDOC ## GET /api/sub/{shortUuid} ### Description Fetches a base64-encoded list of connection URIs for all protocols and nodes assigned to the user's squad. ### Method GET ### Endpoint https://sub.example.com/api/sub/{shortUuid} ### Parameters #### Path Parameters - **shortUuid** (string) - Required - The user's unique short identifier generated by the panel. ### Response #### Success Response (200) - **body** (string) - A base64-encoded string which, when decoded, contains one connection URI per line. ``` -------------------------------- ### VLESS Reality Protocol URI Source: https://v2.run/en Example URI for a VLESS Reality connection with HTTPS masquerading and xtls-rprx-vision flow. ```text vless://71f9...8543@138.124.114.177:443?type=tcp&security=reality&sni=www.google.com&fp=chrome&pbk=zPSnNw1puCbPC_gU8jfrCny_HsgBz_i7…&sid=f2f623d7…&flow=xtls-rprx-vision#NL-VLESS ``` -------------------------------- ### AmneziaWG Protocol URI Source: https://v2.run/en Example URI for an AmneziaWG connection configured with jitter parameters to bypass DPI. ```text awg://oIs268…@138.124.61.254:51820/?publickey=%2B%2FzKkr%2F…&address=10.8.0.2%2F32&mtu=1420&presharedkey=Hnr…&dns=1.1.1.1&jc=4&jmin=40&jmax=70&s1=0&s2=0&h1=1&h2=2&h3=3&h4=4#NL-AWG ``` -------------------------------- ### Decoded Subscription Response Source: https://v2.run/en/docs/subscriptions Example of the decoded content returned by a subscription URL, containing multiple protocol URIs. ```plaintext vless://uuid@ip1:443?type=tcp&security=reality&sni=www.google.com&fp=chrome&pbk=...&sid=...&flow=xtls-rprx-vision#Node1-VLESS hysteria2://pass@ip1:8443/?insecure=1&sni=...&obfs=salamander&obfs-password=...#Node1-Hysteria2 awg://privkey@ip1:51820/?publickey=...&address=10.8.0.2/32&mtu=1420&presharedkey=...&dns=1.1.1.1&jc=4&jmin=40&jmax=70&s1=0&s2=0&h1=1&h2=2&h3=3&h4=4#Node1-AWG vless://uuid@ip2:443?type=tcp&security=reality&sni=www.google.com&fp=chrome&pbk=...&sid=...&flow=xtls-rprx-vision#Node2-VLESS hysteria2://pass@ip2:8443/?insecure=1&sni=...&obfs=salamander&obfs-password=...#Node2-Hysteria2 ``` -------------------------------- ### Create Working Directory Source: https://v2.run/en/docs/install/nodes Creates the directory structure required for node configuration and certificates. ```bash mkdir -p /opt/v2raytun-node && cd /opt/v2raytun-node ``` -------------------------------- ### Manage panel maintenance and backups Source: https://v2.run/en/roadmap Commands for performing system backups and updating the panel software. ```bash v2raytunsetup backup ``` ```bash v2raytunsetup update ``` -------------------------------- ### Create a User via Python Source: https://v2.run/en/docs/api Use the requests library to create a new user by providing the required JSON payload. ```python import requests resp = requests.post( "https://panel.example.com/api/users", headers={"Authorization": "Bearer API_TOKEN"}, json={ "username": "alice", "trafficLimitGB": 50, "expiresAt": "2025-12-31T23:59:59Z", "squadId": 1, }, ) print(resp.json()["subscriptionUrl"]) ``` -------------------------------- ### Create a User via JavaScript Source: https://v2.run/en/docs/api Use the fetch API to create a new user with specific traffic and expiration settings. ```javascript const res = await fetch("https://panel.example.com/api/users", { method: "POST", headers: { "Content-Type": "application/json", Authorization: "Bearer API_TOKEN", }, body: JSON.stringify({ username: "alice", trafficLimitGB: 50, expiresAt: "2025-12-31T23:59:59Z", squadId: 1, }), }); const user = await res.json(); console.log(user.subscriptionUrl); ``` -------------------------------- ### Diagnostic commands Source: https://v2.run/en/bugreport Commands to retrieve system status, logs, and subscription data for troubleshooting. ```bash v2raytunsetup status ``` ```bash v2raytunsetup logs backend --tail 50 ``` ```bash docker logs v2raytunpanel-caddy --tail 30 ``` ```bash docker ps && docker logs v2raytunpanel-node --tail 50 ``` ```bash curl -s "https://sub-domain/api/sub/XXXX" | head -c 300 ``` -------------------------------- ### Bug report template Source: https://v2.run/en/bugreport Use this template to provide necessary environment and error details when submitting a support request. ```text Panel version: (v2raytunsetup status — version line) How you open the panel: https://domain / http://domain / http://IP Protocol: VLESS Reality / Hysteria2 / AmneziaWG Steps you took: 1. ... 2. ... 3. ... Expected: ... What happened: ... (exact error text) Client (for subscription): v2rayTun / Hiddify / NekoBox / Streisand + version ``` -------------------------------- ### Verify Node Logs Source: https://v2.run/en/docs/install/nodes Checks the container logs to confirm a successful connection to the panel. ```bash docker compose logs -f --tail 50 ``` -------------------------------- ### Verify AmneziaWG Module Source: https://v2.run/en/docs/protocols/awg Commands to verify that the amneziawg kernel module is correctly loaded. ```bash modprobe amneziawg lsmod | grep amneziawg ``` -------------------------------- ### Fetch Subscription via curl Source: https://v2.run/en/docs/subscriptions Command to retrieve and decode the subscription list from the terminal. ```bash curl -s https://sub.example.com/api/sub/abc123 | base64 -d ``` -------------------------------- ### Authenticate via Login Endpoint Source: https://v2.run/en/docs/api Obtain a JWT access token by sending credentials to the login endpoint. ```bash curl -X POST https://panel.example.com/api/auth/login \ -H "Content-Type: application/json" \ -d '{"username": "admin", "password": "your-password"}' ``` -------------------------------- ### POST /api/auth/login Source: https://v2.run/en/docs/api Authenticates a user and returns a JWT access token. ```APIDOC ## POST /api/auth/login ### Description Authenticates a user with credentials to obtain a JWT access token for subsequent API requests. ### Method POST ### Endpoint /api/auth/login ### Request Body - **username** (string) - Required - The username of the account - **password** (string) - Required - The password of the account ### Request Example { "username": "admin", "password": "your-password" } ### Response #### Success Response (200) - **accessToken** (string) - The JWT token used for authentication ``` -------------------------------- ### Host Management Endpoints Source: https://v2.run/en/docs/api Endpoints for managing system hosts. ```APIDOC ## GET /api/hosts ### Description List all hosts. ## PUT /api/hosts/:id ### Description Update a host. ``` -------------------------------- ### Subscription URL Format Source: https://v2.run/en/docs/subscriptions The standard structure for a user's subscription URL using a short UUID. ```plaintext https://sub.example.com/api/sub/{shortUuid} ``` -------------------------------- ### VLESS Reality URI Format Source: https://v2.run/en/docs/protocols/vless-reality The standard URI structure used for importing VLESS Reality nodes into compatible client applications. ```plaintext vless://uuid@ip:443?type=tcp&security=reality&sni=www.google.com&fp=chrome&pbk=PUBLIC_KEY&sid=SHORT_ID&flow=xtls-rprx-vision#NAME ``` -------------------------------- ### Certificate Directory Structure Source: https://v2.run/en/docs/install/nodes The expected file structure for mTLS certificates within the node directory. ```plaintext certs/ ├── ca.crt ├── node.crt └── node.key ``` -------------------------------- ### User Management Endpoints Source: https://v2.run/en/docs/api Endpoints for managing system users. ```APIDOC ## GET /api/users ### Description List all users. Supports pagination via query parameters. ## POST /api/users ### Description Create a new user. ## GET /api/users/:id ### Description Get details for a specific user. ## PUT /api/users/:id ### Description Update an existing user. ## DELETE /api/users/:id ### Description Delete a user. ### Query Parameters - **page** (integer) - Optional - Page number for pagination - **limit** (integer) - Optional - Number of items per page ``` -------------------------------- ### Node Management Endpoints Source: https://v2.run/en/docs/api Endpoints for managing system nodes. ```APIDOC ## GET /api/nodes ### Description List all nodes. ## POST /api/nodes ### Description Create a new node. ## GET /api/nodes/:id ### Description Get node details. ## DELETE /api/nodes/:id ### Description Delete a node. ``` -------------------------------- ### Squad Management Endpoints Source: https://v2.run/en/docs/api Endpoints for managing squads. ```APIDOC ## GET /api/squads ### Description List all squads. ## POST /api/squads ### Description Create a squad. ## PUT /api/squads/:id ### Description Update a squad. ## DELETE /api/squads/:id ### Description Delete a squad. ``` -------------------------------- ### Paginate API Results Source: https://v2.run/en/docs/api Control the number of returned items using page and limit query parameters. ```bash curl "https://panel.example.com/api/users?page=1&limit=20" \ -H "Authorization: Bearer API_TOKEN" ``` -------------------------------- ### Authorize Requests with Bearer Token Source: https://v2.run/en/docs/api Include the access token in the Authorization header for authenticated requests. ```bash curl https://panel.example.com/api/users \ -H "Authorization: Bearer ACCESS_TOKEN" ``` ```bash curl https://panel.example.com/api/users \ -H "Authorization: Bearer API_TOKEN" ``` -------------------------------- ### AmneziaWG URI Format Source: https://v2.run/en/docs/protocols/awg The standard URI structure used for importing AmneziaWG configurations into compatible clients. ```plaintext awg://PRIVATE_KEY@ip:51820/?publickey=SERVER_PUBLIC_KEY&address=10.8.0.2/32&mtu=1420&presharedkey=PSK&dns=1.1.1.1&jc=4&jmin=40&jmax=70&s1=0&s2=0&h1=1&h2=2&h3=3&h4=4#NAME ``` -------------------------------- ### Hysteria2 URI Format Source: https://v2.run/en/docs/protocols/hysteria2 The standard URI scheme used for configuring Hysteria2 clients. ```plaintext hysteria2://password@ip:8443/?insecure=1&sni=example.com&obfs=salamander&obfs-password=OBF_PASSWORD#NAME ``` -------------------------------- ### Handle API Error Responses Source: https://v2.run/en/docs/api API errors return a JSON object containing a status code and a descriptive message. ```json { "statusCode": 404, "message": "User not found" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.