mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2026-03-30 23:46:36 +00:00
Can omit username from rendered RDP (#83)
This commit is contained in:
committed by
GitHub
parent
6325c0c4b7
commit
8e117ad083
@@ -137,6 +137,8 @@ Client:
|
|||||||
# If true puts splits "user@domain.com" into the user and domain component so that
|
# If true puts splits "user@domain.com" into the user and domain component so that
|
||||||
# domain gets set in the rdp file and the domain name is stripped from the username
|
# domain gets set in the rdp file and the domain name is stripped from the username
|
||||||
SplitUserDomain: false
|
SplitUserDomain: false
|
||||||
|
# If true, removes "username" (and "domain" if SplitUserDomain is true) from RDP file.
|
||||||
|
# NoUsername: true
|
||||||
Security:
|
Security:
|
||||||
# a random string of 32 characters to secure cookies on the client
|
# a random string of 32 characters to secure cookies on the client
|
||||||
# make sure to share this amongst different pods
|
# make sure to share this amongst different pods
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ type ClientConfig struct {
|
|||||||
// kept for backwards compatibility
|
// kept for backwards compatibility
|
||||||
UsernameTemplate string `koanf:"usernametemplate"`
|
UsernameTemplate string `koanf:"usernametemplate"`
|
||||||
SplitUserDomain bool `koanf:"splituserdomain"`
|
SplitUserDomain bool `koanf:"splituserdomain"`
|
||||||
|
NoUsername string `koanf:"nousername"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func ToCamel(s string) string {
|
func ToCamel(s string) string {
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ func main() {
|
|||||||
RdpOpts: web.RdpOpts{
|
RdpOpts: web.RdpOpts{
|
||||||
UsernameTemplate: conf.Client.UsernameTemplate,
|
UsernameTemplate: conf.Client.UsernameTemplate,
|
||||||
SplitUserDomain: conf.Client.SplitUserDomain,
|
SplitUserDomain: conf.Client.SplitUserDomain,
|
||||||
|
NoUsername: conf.Client.NoUsername,
|
||||||
},
|
},
|
||||||
GatewayAddress: url,
|
GatewayAddress: url,
|
||||||
TemplateFile: conf.Client.Defaults,
|
TemplateFile: conf.Client.Defaults,
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ type Config struct {
|
|||||||
type RdpOpts struct {
|
type RdpOpts struct {
|
||||||
UsernameTemplate string
|
UsernameTemplate string
|
||||||
SplitUserDomain bool
|
SplitUserDomain bool
|
||||||
|
NoUsername bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Handler struct {
|
type Handler struct {
|
||||||
@@ -210,9 +211,11 @@ func (h *Handler) HandleDownload(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
d.Settings.Username = render
|
if !NoUsername {
|
||||||
if domain != "" {
|
d.Settings.Username = render
|
||||||
d.Settings.Domain = domain
|
if domain != "" {
|
||||||
|
d.Settings.Domain = domain
|
||||||
|
}
|
||||||
}
|
}
|
||||||
d.Settings.FullAddress = host
|
d.Settings.FullAddress = host
|
||||||
d.Settings.GatewayHostname = h.gatewayAddress.Host
|
d.Settings.GatewayHostname = h.gatewayAddress.Host
|
||||||
|
|||||||
Reference in New Issue
Block a user