2

I'm running Wildfly within Docker. I need to add users and set the configuration before the java process is started.

I can run the add-user.sh script to create a simple user:

/wildfly/bin/add-user.sh admin admin --silent

However, I need to create a management user that will be used for authenticating an instance with the managed instance. In the CLI the option is:

"Is this new user going to be used for one AS process to connect to another AS process?", reply yes.

Is there a way to set this option via a parameter in the script?

Ken J
  • 4,312
  • 12
  • 50
  • 86
  • Interestingly enough it doesn't look like this option is required to authenticate instances. Not sure if this is just legacy. – Ken J Jul 31 '15 at 02:39
  • this question returns an encoded password which is required in domain mode. which needs to be added in tag in host.xml – happy Jul 31 '15 at 05:22
  • i just added a management user using the command i have in the question and added the encoded password in the host.xml and this works....no need to use the interactive shell – Ken J Jul 31 '15 at 17:37
  • The only purpose of that option is so that it outputs the entry that is needed on the client side of the configuration, where users were trying to generate that value themselves they were running into many problems so we decided to just output it ourselves. – Darran L Jul 31 '15 at 18:12

2 Answers2

4

add-user.sh just adds the user to: mgmt-users.properties

so you can generate this value for yourself pretty easily.

Tea Curran
  • 2,923
  • 2
  • 18
  • 22
  • This is correct, all the add-user utility is doing to writing to the properties files, nothing to stop you doing this directly yourself. – Darran L Jul 31 '15 at 18:13
  • Now that I have a better understanding of the function of the script I'll just echo >> in my entry script from now on. Thanks! – Ken J Jul 31 '15 at 18:48
0

This will give you access to the container

docker exec -it wildfly-instance /bin/bash
Weston Jones
  • 151
  • 4
  • I don't have to access the container. In my ENTRYPOINT I've got a script to add the users. You shouldn't have to depend on running commands after the container is up. Thanks for adding, though. – Ken J Jul 31 '15 at 18:46