Files
VDR/VirtualDDNSRouter.Server/README.md
Mohammad Mahdi 64318b0ec9
All checks were successful
Build and Push Server Docker Image / build-server (push) Successful in 5m14s
Update README formatting for improved readability
2025-09-05 22:13:21 +03:30

89 lines
2.3 KiB
Markdown

# VirtualDDNSRouter Server
The VirtualDDNSRouter Server is a lightweight reverse proxy that maintains dynamic mappings between paths and IP
addresses. Clients can update their IP addresses, and users can access services through consistent URLs.
## Configuration
The server uses a YAML rules file named `rules.yaml`. You can create this file by copying and modifying the provided
example:
```bash
cp rules.example.yaml rules.yaml
```
The rules file has the following structure:
```yaml
- name: Odoo Server # A descriptive name for the service
api_key: abc123XYZ # The API key for authentication
path: odoo # The path identifier for the service
- name: Backup server
api_key: def456ABC
path: bk
```
Each entry defines a service with:
- `name`: A descriptive label (for documentation purposes)
- `api_key`: A secret key used by clients to authenticate updates
- `path`: The URL path that users will use to access the service
## Running the Server
### Method 1: Downloading Pre-built Binaries (Recommended)
1. Download the latest server binary
from [https://git.mahdium.ir/mahdium/VDR/releases/latest](https://git.mahdium.ir/mahdium/VDR/releases/latest)
2. Extract the archive
3. Create your `rules.yaml` file based on `rules.example.yaml`
4. Run the server:
```bash
./VirtualDDNSRouter.Server
```
By default, the server listens on port 8080. You can change this by setting the `ASPNETCORE_HTTP_PORTS` environment
variable:
```bash
ASPNETCORE_HTTP_PORTS=8081 ./VirtualDDNSRouter.Server
```
### Method 2: Using Docker
```bash
docker run -p 8080:8080 -v ./rules.yaml:/app/rules.yaml virtualddnsrouter.server
```
### Method 3: Building from Source
```bash
dotnet build
dotnet run
```
## Usage
The server provides two main endpoints:
1. **IP Update Endpoint** (used by clients):
```
GET /setip/{path}/{port}/{api_key}
```
Clients call this endpoint to update their IP address.
2. **Service Access Endpoint** (used by users):
```
GET /goto/{path}
```
Users access this endpoint to reach the service associated with the path.
For example, if a client has configured a service with path "odoo", users can access it at:
```
http://your-server:8080/goto/odoo
```
The server will redirect users to the IP address and port that the client last reported.