danielguerra69 / ubuntu-xrdp

Docker fully implemented Multi User xrdp with xorgxrdp and pulseaudio on Ubuntu 16.04/18.04
MIT License
254 stars 143 forks source link

set password of default user through a build argument #12

Closed fbartels closed 5 years ago

fbartels commented 5 years ago

I could not let it go and implemented it myself. In docker-compose you could use it like the following (I did not change the bundled compose file to prevent merge conflicts):

version: '2.1'
services:
  terminalserver:
    build:
      context: .
      args:
        PASSWORD: my-password
[...]

fixes https://github.com/danielguerra69/ubuntu-xrdp/issues/11

fbartels commented 5 years ago

Yes, using a hash instead of the actual password makes it a bit better security wise. Unfortunately compose does not really seem to like such complex strings:

$ sudo docker-compose build ERROR: Invalid interpolation format for "build" option in service "terminalserver": "$1$z53Cg/fV$06o379IvIOxj/ESruVKrG1"

version: '2.1'
services:
  terminalserver:
    build:
      context: .
      args:
        PASSWORDHASH: "$1$z53Cg/fV$06o379IvIOxj/ESruVKrG1"

Edit: every dollar sign needs to be escaped with another dollar sign. So the correct line is PASSWORDHASH: $$1$$z53Cg/fV$$06o379IvIOxj/ESruVKrG1.

PR has been updated.