Fix some issues with gateway addresses

This commit is contained in:
Bolke de Bruin 2022-08-26 10:06:43 +02:00
parent 50f6d343f1
commit f94e73b1ec
4 changed files with 6 additions and 3 deletions

View file

@ -44,7 +44,7 @@ type Config struct {
stateStore *cache.Cache
Hosts []string
HostSelection string
GatewayAddress string
GatewayAddress *url.URL
UsernameTemplate string
NetworkAutoDetect int
BandwidthAutoDetect int
@ -276,7 +276,7 @@ func (c *Config) HandleDownload(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Disposition", "attachment; filename="+fn)
w.Header().Set("Content-Type", "application/x-rdp")
data := "full address:s:" + host + "\r\n" +
"gatewayhostname:s:" + c.GatewayAddress + "\r\n" +
"gatewayhostname:s:" + c.GatewayAddress.Host + "\r\n" +
"gatewaycredentialssource:i:5\r\n" +
"gatewayusagemethod:i:1\r\n" +
"gatewayprofileusagemethod:i:1\r\n" +

View file

@ -88,7 +88,7 @@ func main() {
url.Scheme = "https"
}
url.Path = "callback"
api.GatewayAddress = url.String()
api.GatewayAddress = url
oauthConfig := oauth2.Config{
ClientID: conf.OpenId.ClientId,

View file

@ -30,6 +30,9 @@ RUN git clone https://github.com/bolkedebruin/rdpgw.git /app && \
FROM scratch
# make tempdir in case filestore is used
ADD tmp.tar /
COPY --from=builder /opt/rdpgw /opt/rdpgw
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/ssl/certs /etc/ssl/certs

BIN
dev/docker/tmp.tar Normal file

Binary file not shown.