diff --git a/api/web.go b/api/web.go index 8a350690971ef64289cc7b332779a4b2b8241351..edb0cb6e5377ef99cce8f6abc5fa6b6ada9b8873 100644 --- a/api/web.go +++ b/api/web.go @@ -43,6 +43,7 @@ type Config struct { BandwidthAutoDetect int ConnectionType int SplitUserDomain bool + DefaultDomain string } func (c *Config) NewApi() { @@ -158,16 +159,14 @@ func (c *Config) HandleDownload(w http.ResponseWriter, r *http.Request) { host = strings.Replace(host, "{{ preferred_username }}", userName, 1) // split the username into user and domain - var user string - var domain string + var user = userName + var domain = c.DefaultDomain if c.SplitUserDomain { creds := strings.SplitN(userName, "@", 2) user = creds[0] if len(creds) > 1 { domain = creds[1] } - } else { - user = userName } render := user diff --git a/config/configuration.go b/config/configuration.go index 03de4699812e1a459a9ddb7af937feadecf94dce..43b77056781c10774ee19461cbe9ef90cbfb56ed 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -58,6 +58,7 @@ type ClientConfig struct { ConnectionType int UsernameTemplate string SplitUserDomain bool + DefaultDomain string } func init() { diff --git a/dev/docker/docker-compose.yml b/dev/docker/docker-compose.yml index e09fc1570d015e2b8802a48bf374cc4b2e0c2551..a5e086f2b3fd1dbbbb17e4a63c960e01ba4bda62 100644 --- a/dev/docker/docker-compose.yml +++ b/dev/docker/docker-compose.yml @@ -33,16 +33,4 @@ services: volumes: - ${PWD}/xrdp_users.txt:/root/createusers.txt environment: - TZ: "Europe/London" - rdpgw: - build: . - ports: - - 9443:9443 - restart: on-failure - depends_on: - - keycloak - healthcheck: - test: ["CMD", "curl", "-f", "http://keycloak:8080"] - interval: 30s - timeout: 10s - retries: 10 + TZ: "Europe/Amsterdam" diff --git a/main.go b/main.go index 733e55501199ff2e38d3fab76ab9d5eef1298f93..c6836d6f1e0e86f23dda7dcdaa83d5845bf20a59 100644 --- a/main.go +++ b/main.go @@ -77,6 +77,7 @@ func main() { BandwidthAutoDetect: conf.Client.BandwidthAutoDetect, ConnectionType: conf.Client.ConnectionType, SplitUserDomain: conf.Client.SplitUserDomain, + DefaultDomain: conf.Client.DefaultDomain, } api.NewApi()