Documentation: Add missing service configuration section

- Add comprehensive service configuration documentation to README.md
- Add detailed service configuration section to DOCUMENTATION.md
- Document service config file format and examples for SSH, RDP, VNC
- Explain service directory setup and multiple services configuration
- Include service discovery and loading information
parent 7c7653f6
...@@ -391,6 +391,102 @@ mode = interactive ...@@ -391,6 +391,102 @@ mode = interactive
daemon = false daemon = false
``` ```
#### Service Configuration Files
WSSSH supports multiple services per client through individual service configuration files. These files are stored in the `services-path` directory (default: `/etc/wsssh.d/`) and allow you to configure different services like SSH, RDP, VNC, etc.
##### Service Configuration File Format
Each service configuration file defines a single service with the following format:
```ini
[service_name]
# Target host for the tunnel connection
tunnel-host = 192.168.1.100
# Target port for the tunnel connection
tunnel-port = 22
# Optional command to execute before establishing the tunnel
# command = /usr/local/bin/setup-tunnel.sh
# Protocol to use (tcp or udp, default: tcp)
proto = tcp
```
##### Service Configuration Examples
**SSH Service** (`/etc/wsssh.d/ssh.conf`):
```ini
[ssh]
tunnel-host = 192.168.1.100
tunnel-port = 22
proto = tcp
```
**RDP Service** (`/etc/wsssh.d/rdp.conf`):
```ini
[rdp]
tunnel-host = 192.168.1.100
tunnel-port = 3389
proto = tcp
```
**VNC Service** (`/etc/wsssh.d/vnc.conf`):
```ini
[vnc]
tunnel-host = 192.168.1.100
tunnel-port = 5900
proto = tcp
```
**Custom Service with Setup Command** (`/etc/wsssh.d/custom.conf`):
```ini
[custom]
tunnel-host = 10.0.0.5
tunnel-port = 8080
command = /usr/local/bin/prepare-service.sh
proto = tcp
```
##### Service Configuration Directory Setup
```bash
# Create the services directory
sudo mkdir -p /etc/wsssh.d/
# Copy example service configurations
sudo cp service.conf.example /etc/wsssh.d/ssh.conf
# Edit the service configuration
sudo editor /etc/wsssh.d/ssh.conf
```
##### Multiple Services Configuration
You can configure multiple services by creating separate configuration files in the services directory:
```bash
# SSH service
sudo cp service.conf.example /etc/wsssh.d/ssh.conf
sudo editor /etc/wsssh.d/ssh.conf
# RDP service
sudo cp service.conf.example /etc/wsssh.d/rdp.conf
sudo editor /etc/wsssh.d/rdp.conf
# VNC service
sudo cp service.conf.example /etc/wsssh.d/vnc.conf
sudo editor /etc/wsssh.d/vnc.conf
```
##### Service Discovery and Loading
- Service configuration files are loaded from the `services-path` directory specified in `wssshc.conf`
- Multiple directories can be specified using colon separation: `/etc/wsssh.d/:/usr/local/etc/wsssh.d/`
- Files must have a `.conf` extension
- The section name `[service_name]` defines the service identifier used in tunnel requests
- Services are loaded at client startup and registered with the server
#### wsssh/wsscp Configuration #### wsssh/wsscp Configuration
```ini ```ini
......
...@@ -254,6 +254,81 @@ port = 9898 ...@@ -254,6 +254,81 @@ port = 9898
id = client01 id = client01
``` ```
### Service Configuration Files
WSSSH supports multiple services per client through individual service configuration files. These files are stored in the `services-path` directory (default: `/etc/wsssh.d/`) and allow you to configure different services like SSH, RDP, VNC, etc.
#### Service Configuration File Format (`/etc/wsssh.d/ssh.conf`)
```ini
[ssh]
# Target host for the tunnel connection
tunnel-host = 192.168.1.100
# Target port for the tunnel connection
tunnel-port = 22
# Optional command to execute before establishing the tunnel
# command = /usr/local/bin/setup-tunnel.sh
# Protocol to use (tcp or udp, default: tcp)
proto = tcp
```
#### Service Configuration File Format (`/etc/wsssh.d/rdp.conf`)
```ini
[rdp]
# Target host for the tunnel connection
tunnel-host = 192.168.1.100
# Target port for the tunnel connection
tunnel-port = 3389
# Protocol to use (tcp or udp, default: tcp)
proto = tcp
```
#### Service Configuration File Format (`/etc/wsssh.d/vnc.conf`)
```ini
[vnc]
# Target host for the tunnel connection
tunnel-host = 192.168.1.100
# Target port for the tunnel connection
tunnel-port = 5900
# Protocol to use (tcp or udp, default: tcp)
proto = tcp
```
#### Service Configuration Directory Setup
```bash
# Create the services directory
sudo mkdir -p /etc/wsssh.d/
# Copy example service configurations
sudo cp service.conf.example /etc/wsssh.d/ssh.conf
# Edit the service configuration
sudo editor /etc/wsssh.d/ssh.conf
```
#### Multiple Services Configuration
You can configure multiple services by creating separate configuration files:
```bash
# SSH service
sudo cp service.conf.example /etc/wsssh.d/ssh.conf
sudo editor /etc/wsssh.d/ssh.conf
# RDP service
sudo cp service.conf.example /etc/wsssh.d/rdp.conf
sudo editor /etc/wsssh.d/rdp.conf
# VNC service
sudo cp service.conf.example /etc/wsssh.d/vnc.conf
sudo editor /etc/wsssh.d/vnc.conf
```
### Tools Configuration (`~/.config/wsssh/wsssh.conf`) ### Tools Configuration (`~/.config/wsssh/wsssh.conf`)
```ini ```ini
[default] [default]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment