Can omit username from rendered RDP
This commit is contained in:
parent
e9e592b43a
commit
3729b65a09
@ -135,6 +135,8 @@ Client:
|
||||
# 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
|
||||
SplitUserDomain: false
|
||||
# If true, removes "username" (and "domain" if SplitUserDomain is true) from RDP file.
|
||||
# NoUsername: true
|
||||
Security:
|
||||
# a random string of 32 characters to secure cookies on the client
|
||||
# make sure to share this amongst different pods
|
||||
|
||||
@ -93,6 +93,7 @@ type ClientConfig struct {
|
||||
// kept for backwards compatibility
|
||||
UsernameTemplate string `koanf:"usernametemplate"`
|
||||
SplitUserDomain bool `koanf:"splituserdomain"`
|
||||
NoUsername string `koanf:"nousername"`
|
||||
}
|
||||
|
||||
func ToCamel(s string) string {
|
||||
|
||||
@ -110,6 +110,7 @@ func main() {
|
||||
RdpOpts: web.RdpOpts{
|
||||
UsernameTemplate: conf.Client.UsernameTemplate,
|
||||
SplitUserDomain: conf.Client.SplitUserDomain,
|
||||
NoUsername: conf.Client.NoUsername,
|
||||
},
|
||||
GatewayAddress: url,
|
||||
TemplateFile: conf.Client.Defaults,
|
||||
|
||||
@ -37,6 +37,7 @@ type Config struct {
|
||||
type RdpOpts struct {
|
||||
UsernameTemplate string
|
||||
SplitUserDomain bool
|
||||
NoUsername bool
|
||||
}
|
||||
|
||||
type Handler struct {
|
||||
@ -210,9 +211,11 @@ func (h *Handler) HandleDownload(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
d.Settings.Username = render
|
||||
if domain != "" {
|
||||
d.Settings.Domain = domain
|
||||
if !NoUsername {
|
||||
d.Settings.Username = render
|
||||
if domain != "" {
|
||||
d.Settings.Domain = domain
|
||||
}
|
||||
}
|
||||
d.Settings.FullAddress = host
|
||||
d.Settings.GatewayHostname = h.gatewayAddress.Host
|
||||
|
||||
Loading…
Reference in New Issue
Block a user