Page 1 of 1

setting a username in docker compose?

Posted: 11 Jan 2025, 20:10
by begunfx
Here's my docker compose file. I have the option set to set a password, but how can you set the username? It seems that it defaults to "ubuntu" but I'd like it to be something else. Thanks!

version: '3.3'
services:
filebot:
container_name: filebot
image: rednoah/filebot:xpra
restart: unless-stopped
volumes:
- /volume1/docker:/data
- /volume1/video:/video:rw
- /volume1/music:/music:rw
ports:
- 5454:5454
environment:
- XPRA_AUTH=password:value=XXXXX

Re: setting a username in docker compose?

Posted: 12 Jan 2025, 13:27
by rednoah
You can read the man page for the --auth option to see if xpra can do what you want to do:
https://manpages.org/xpra
multifile
checks the username and password against the file specified using the filename option. The file must contain each user credentials on one line of the form:
username|password|uid|gid|displays|env_opts|session_opts

Re: setting a username in docker compose?

Posted: 12 Jan 2025, 14:44
by begunfx
So here's the -auth section of the docs below.

It doesn't seem to describe adding a username option as environment variable but only adding them to a file. However, for the hell of it I tried the following:

- XPRA_AUTH=username:value={redacted]

I executed the docker container with this. It did seem to take since the login prompt no longer says "ubuntu" but "user". My only issue with this is that it implies that the username is already entered only leaving you with entering the password - seems like it lowers the security threshold don't you think? Since the username credential is already entered, someone only needs to know the password. I guess another option would be to try to put the credentials into a file - I know that's more secure than entering them as environment variables anyway - just was hoping to keep it simple using env variables.

--auth=MODULE[:OPTION=VALUE]
Specifies the authentication module to use for unix domain sockets created using the bind switch. Authentication modules can validate a username and password against a variety of backend modules:
allow
always allows authentication - this is dangerous and should only be used for testing
fail
always fails authentication, useful for testing
env
matches against the environment variable specified by the name option (which defaults to XPRA_PASSWORD). ie: --auth=env:name=SOME_OTHER_ENV_VAR_NAME.
password
matches against the password specified using the value option. ie: --auth=password:value=YOURPASSWORD. Note: this command line option may be exposed to other processes on the same system.
file
checks the password against the password data found in the file specified using the filename option. ie: --auth=file:filename=./password.txt.
The contents of this file will be treated as binary data, there are no restrictions on character encodings or file size, but since older versions did have more restrictions it is best to avoid special characters, in particular: non-ASCII characters, control characters like newlines and carriage returns, and the pipe character |.


multifile
checks the username and password against the file specified using the filename option. The file must contain each user credentials on one line of the form:
username|password|uid|gid|displays|env_opts|session_opts

It is not possible to have usernames or password that contain the pipe character | which is used as delimiter, or newlines and carriage returns.

pam
validates the username and password using the PAM system
win32
validates the username and password using Microsoft Windows authentication (only available on this platform)
sys
chooses the appropriate system authentication module automatically (either pam or win32)