bolkedebruin / rdpgw

Remote Desktop Gateway in Go for deploying on Linux/BSD/Kubernetes
Apache License 2.0
693 stars 117 forks source link

Some issues after recent work: boolean fields in RDP template can't be parsed + entrypoint inhibits args #104

Closed KoltesDigital closed 3 months ago

KoltesDigital commented 3 months ago

Hi @bolkedebruin. Nice to see you're still active on this project! However your recent changes broke my deployment 😄

I don't understand why it worked before and doesn't anymore, because both cmd/rdpgw/config/parsers/rdp.go and cmd/rdpgw/rdp/rdp.go haven't changed. But RdpSettings has a lot of boolean values, whereas the RDP spec only has i(nts) and s(trings). Thus it can't process my template anymore:

2024/03/29 00:39:58 Cannot load RDP template file /etc/configs/defaults.rdp due to 2 error(s) decoding:
* 'enablecredsspsupport' expected type 'bool', got unconvertible type 'int', value: '0'
* 'use multimon' expected type 'bool', got unconvertible type 'int', value: '1'

Another issue is that the entrypoint doesn't forward the args anymore due to this line:

https://github.com/KoltesDigital/rdpgw/blob/5aa6e4d9ee708c492b3fd962f43f0d312fc6d898/dev/docker/run.sh#L32

Therefore --conf is ignored. I think you could use $@ to forward args to su.

As a side note, I wanted to use a previous version of the image, but you only publish the latest tag. You could add in the CICD workflow to also tag with the commit id: you still won't care about semver, but it can save the day when there's a regression.

bolkedebruin commented 3 months ago

Haha, oops. I'll take a look at that :-)

bolkedebruin commented 3 months ago

This is now fixed in master and will do a new release. Please try.

KoltesDigital commented 3 months ago

Parsing the bool fields seems to be working now.

Regarding su, the commit looks fine to me, but I prefer to keep overriding the entrypoint to run /opt/rdpgw/rdpgw directly as I'm already overriding uid and gid, and I'm not interested in creating users. So I haven't tested.

Thanks for the quick fix!