mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2026-03-28 23:06:34 +00:00
Improve config
This commit is contained in:
14
README.md
14
README.md
@@ -35,12 +35,11 @@ server:
|
|||||||
# port to listen on
|
# port to listen on
|
||||||
port: 443
|
port: 443
|
||||||
# list of acceptable desktop hosts to connect to
|
# list of acceptable desktop hosts to connect to
|
||||||
farmHosts:
|
hosts:
|
||||||
- localhost:3389
|
- localhost:3389
|
||||||
|
- my-{{ preferred_username }}-host:3389
|
||||||
# Allow the user to connect to any host (insecure)
|
# Allow the user to connect to any host (insecure)
|
||||||
enableOverride: false
|
enableOverride: false
|
||||||
# Set the desktop host to connect to filled in by the claims from oidc
|
|
||||||
hostTemplate: my-{{ preferred_username }}-host:3389
|
|
||||||
|
|
||||||
# Open ID Connect specific settings (required)
|
# Open ID Connect specific settings (required)
|
||||||
openId:
|
openId:
|
||||||
@@ -54,10 +53,11 @@ caps:
|
|||||||
tokenAuth: true
|
tokenAuth: true
|
||||||
# connection timeout in minutes, 0 is limitless
|
# connection timeout in minutes, 0 is limitless
|
||||||
idleTimeout: 10
|
idleTimeout: 10
|
||||||
DisablePrinter: true
|
EnablePrinter: true
|
||||||
DisablePort: true
|
EnablePort: true
|
||||||
DisablePnp: true
|
EnablePnp: true
|
||||||
DisableDrive: true
|
EnableDrive: true
|
||||||
|
EnableClipboard: true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|||||||
@@ -16,28 +16,27 @@ type ServerConfig struct {
|
|||||||
Port int
|
Port int
|
||||||
CertFile string
|
CertFile string
|
||||||
KeyFile string
|
KeyFile string
|
||||||
FarmHosts []string
|
Hosts []string
|
||||||
EnableOverride bool
|
EnableOverride bool
|
||||||
HostTemplate string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type OpenIDConfig struct {
|
type OpenIDConfig struct {
|
||||||
ProviderUrl string
|
ProviderUrl string
|
||||||
ClientId string
|
ClientId string
|
||||||
ClientSecret string
|
ClientSecret string
|
||||||
}
|
}
|
||||||
|
|
||||||
type RDGCapsConfig struct {
|
type RDGCapsConfig struct {
|
||||||
SmartCardAuth bool
|
SmartCardAuth bool
|
||||||
TokenAuth bool
|
TokenAuth bool
|
||||||
IdleTimeout int
|
IdleTimeout int
|
||||||
RedirectAll bool
|
RedirectAll bool
|
||||||
DisableRedirect bool
|
DisableRedirect bool
|
||||||
DisableClipboard bool
|
EnableClipboard bool
|
||||||
DisablePrinter bool
|
EnablePrinter bool
|
||||||
DisablePort bool
|
EnablePort bool
|
||||||
DisablePnp bool
|
EnablePnp bool
|
||||||
DisableDrive bool
|
EnableDrive bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -64,4 +63,4 @@ func Load(configFile string) Configuration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return conf
|
return conf
|
||||||
}
|
}
|
||||||
|
|||||||
12
main.go
12
main.go
@@ -91,9 +91,17 @@ func main() {
|
|||||||
|
|
||||||
// create the gateway
|
// create the gateway
|
||||||
handlerConfig := protocol.HandlerConf{
|
handlerConfig := protocol.HandlerConf{
|
||||||
TokenAuth: true,
|
IdleTimeout: conf.Caps.IdleTimeout,
|
||||||
|
TokenAuth: conf.Caps.TokenAuth,
|
||||||
|
SmartCardAuth: conf.Caps.SmartCardAuth,
|
||||||
RedirectFlags: protocol.RedirectFlags{
|
RedirectFlags: protocol.RedirectFlags{
|
||||||
Clipboard: true,
|
Clipboard: conf.Caps.EnableClipboard,
|
||||||
|
Drive: conf.Caps.EnableDrive,
|
||||||
|
Printer: conf.Caps.EnablePrinter,
|
||||||
|
Port: conf.Caps.EnablePort,
|
||||||
|
Pnp: conf.Caps.EnablePnp,
|
||||||
|
DisableAll: conf.Caps.DisableRedirect,
|
||||||
|
EnableAll: conf.Caps.RedirectAll,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
gw := protocol.Gateway{
|
gw := protocol.Gateway{
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ type RedirectFlags struct {
|
|||||||
Drive bool
|
Drive bool
|
||||||
Printer bool
|
Printer bool
|
||||||
Pnp bool
|
Pnp bool
|
||||||
disableAll bool
|
DisableAll bool
|
||||||
enableAll bool
|
EnableAll bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Handler struct {
|
type Handler struct {
|
||||||
@@ -408,10 +408,10 @@ func createPacket(pktType uint16, data []byte) (packet []byte) {
|
|||||||
func makeRedirectFlags(flags RedirectFlags) int {
|
func makeRedirectFlags(flags RedirectFlags) int {
|
||||||
var redir = 0
|
var redir = 0
|
||||||
|
|
||||||
if flags.disableAll {
|
if flags.DisableAll {
|
||||||
return HTTP_TUNNEL_REDIR_DISABLE_ALL
|
return HTTP_TUNNEL_REDIR_DISABLE_ALL
|
||||||
}
|
}
|
||||||
if flags.enableAll {
|
if flags.EnableAll {
|
||||||
return HTTP_TUNNEL_REDIR_ENABLE_ALL
|
return HTTP_TUNNEL_REDIR_ENABLE_ALL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user