d2ray/README.md

35 lines
2.0 KiB
Markdown
Raw Normal View History

2021-08-13 07:42:11 +00:00
[![Build Status](https://ci.quacker.org/api/badges/d/d2ray/status.svg)](https://ci.quacker.org/d/d2ray)
2023-08-21 13:40:56 +00:00
# Xray + xtls-vision + reality all in Docker!
## What Is d2ray?
d2ray is a single Docker container that provides easy 5-minute setups and braindead configurations for xtls-vision + reality.
2021-11-25 05:59:39 +00:00
2023-08-21 13:40:56 +00:00
## Quickstart
1. You can start with the example `docker-compose.yml` from this repo.
2. Adjust environment variables:
2023-08-24 12:50:22 +00:00
- `HOST`: the hostname/IP of the server. `REQUIRED`.
2023-08-22 16:36:05 +00:00
- `PORT`: the port Xray listens on. `Optional, default = 443`.
- `TARGET_HOST`: the target host to redirect non proxy connections. `Required`.
- `TARGET_PORT`: the target port to redirect non proxy connections. `Optional, default = 443`.
- `TARGET_SNI`: comma separated list of the target website's SNIs. `Required`.
- `PRIVATE_KEY` : server's private key. `Optional`.
- `USERS`: comma separated list of usernames that can access Xray. `Required`.
- `LOG_LEVEL`: the verbosity of Xray logs. `Optional, default = warn`.
2022-12-02 13:12:46 +00:00
3. `docker compose up -d`
2023-08-24 12:50:22 +00:00
4. Check the container log using `docker logs` for per user shareable links and QR codes supported by most Xray apps. These can also be found under `/etc/xray/users/[USERNAME]` folders.
5. Test your connection.
2023-08-21 13:40:56 +00:00
## Docker Volume
2023-08-22 16:36:05 +00:00
The logs and private key are stored in `/etc/d2ray` in the container. You can mount an external folder to that location to persist settings. Otherwise d2ray creates an anonymous Docker volume.
2023-08-21 13:40:56 +00:00
## Key Generation
2023-08-24 12:50:22 +00:00
If `PRIVATE_KEY` is provided, d2ray uses that key. Otherwise, d2ray generates a new key pair and persists it in `/etc/xray/certs/keys`. The corresponding public key is always printed to the container log, which clients use to connect.
2022-12-02 13:12:46 +00:00
2023-08-22 16:36:05 +00:00
To make d2ray regenerate a new key pair, manually delete the key file `/etc/xray/certs/keys` from the mounted volume.
2023-08-21 13:40:56 +00:00
## How To Update?
2022-12-02 13:12:46 +00:00
- `docker compose down`
- `docker compose pull`
2023-08-21 14:04:02 +00:00
- `docker compose up -d`
## Notes
2023-08-21 14:04:14 +00:00
- The old xtls-vision + TLS + Nginx fallback has been branched out to the `vision` branch.