Non-default admin user/pw for BaseX on Docker image
Tuesday, 5 April 2016 · 5 messages · last reply 18 Apr 2016
MC
Mike Cobo5 Apr 2016 17:08 #
Hi BaseX team, hi all
I want to create a docker image based on the existing basexhttp image, but with other credentials for the admin user. For this reason I added an edited .basex file with changed password (here: mypassword) to the new docker image:
.basex:
...
# Client/Server Architecture
HOST = localhost
PORT = 1984
SERVERPORT = 1984
USER = admin
PASSWORD = mypassword
SERVERHOST =
...
Dockerfile:
FROM basex/basexhttp:latest
MAINTAINER Mike <myemail at mail.com>
COPY .basex /srv/
VOLUME ["/srv/BaseXData", "/srv/BaseXWeb"]
After starting the docker container I checked if the edited file can be found under the path "/srv/.basex". The file is there but when I want to login to the database (or run an XQuery script via the browser) I cannot login with admin/mypassword. The erreor message is:
Connection failed: Access denied.
But I can still use the default user/pw (admin/admin) to connect.
Why is the changed .basex file not loaded/parsed when starting the BaseX (http) server on the docker container? Should the file be copied to a different path?
Best regards,
MikeJE
Jens Erat5 Apr 2016 17:35 #
Hi Mike,
I'll have a look at that this weekend. Some wild guesswork: this might be a permission issue with the .basex file. It might also be that I messed up somewhere, but I verified changed .basex files have been working (actually, I'm using one myself in a project).
Could you share the example project including Dockerfile and the .basex file as tar or zip archive, preserving permissions (tar -p flag)?
Regards,
Jens
Quoted text · Mike Cobo · 48 lines
Am 05.04.2016 um 17:08 schrieb Mike Cobo: > Hi BaseX team, hi all > > > > I want to create a docker image based on the existing basexhttp image, > but with other credentials for the admin user. For this reason I added > an edited .basex file with changed password (here: mypassword) to the > new docker image: > > .basex: > > ... > # Client/Server Architecture > HOST = localhost > PORT = 1984 > SERVERPORT = 1984 > USER = admin > PASSWORD = mypassword > SERVERHOST = > ... > > Dockerfile: > > FROM basex/basexhttp:latest > MAINTAINER Mike <myemail at mail.com> > COPY .basex /srv/ > VOLUME ["/srv/BaseXData", "/srv/BaseXWeb"] > > > After starting the docker container I checked if the edited file can be > found under the path "/srv/.basex". The file is there but when I want to > login to the database (or run an XQuery script via the browser) I cannot > login with admin/mypassword. The erreor message is: > > *Connection failed: Access denied. * > > But I can still use the default user/pw (admin/admin) to connect. > > Why is the changed .basex file not loaded/parsed when starting the BaseX > (http) server on the docker container? Should the file be copied to a > different path? > > > Best regards, > Mike > >
--
Jens Erat
Universität Konstanz
Kommunikations-, Infomations-, Medienzentrum (KIM)
Abteilung Basisdienste
D-78457 Konstanz
Mail: jens.erat at uni-konstanz.de
AB
Andy Bunce6 Apr 2016 11:27 #
Hi,
My understanding is *basexhttp *does not use* .basex* or options for user details.
It always runs as user admin with password from *data/users.xml*. If *data/users.xml* does not exist or does not specify an admin password then admin is also used as the password. [1],[2]
/Andy
[1]
http://www.mail-archive.com/basex-talk%40mailman.uni-konstanz.de/msg05469.html [2]
https://github.com/Quodatum/openshift-basex-quick-start#users-and-permissions
Quoted text · Jens Erat · 72 lines
On 5 April 2016 at 16:35, Jens Erat <jens.erat at uni-konstanz.de> wrote: > Hi Mike, > > I'll have a look at that this weekend. Some wild guesswork: this might > be a permission issue with the .basex file. It might also be that I > messed up somewhere, but I verified changed .basex files have been > working (actually, I'm using one myself in a project). > > Could you share the example project including Dockerfile and the .basex > file as tar or zip archive, preserving permissions (tar -p flag)? > > Regards, > Jens > > Am 05.04.2016 um 17:08 schrieb Mike Cobo: > > Hi BaseX team, hi all > > > > > > > > I want to create a docker image based on the existing basexhttp image, > > but with other credentials for the admin user. For this reason I added > > an edited .basex file with changed password (here: mypassword) to the > > new docker image: > > > > .basex: > > > > ... > > # Client/Server Architecture > > HOST = localhost > > PORT = 1984 > > SERVERPORT = 1984 > > USER = admin > > PASSWORD = mypassword > > SERVERHOST = > > ... > > > > Dockerfile: > > > > FROM basex/basexhttp:latest > > MAINTAINER Mike <myemail at mail.com> > > COPY .basex /srv/ > > VOLUME ["/srv/BaseXData", "/srv/BaseXWeb"] > > > > > > After starting the docker container I checked if the edited file can be > > found under the path "/srv/.basex". The file is there but when I want to > > login to the database (or run an XQuery script via the browser) I cannot > > login with admin/mypassword. The erreor message is: > > > > *Connection failed: Access denied. * > > > > But I can still use the default user/pw (admin/admin) to connect. > > > > Why is the changed .basex file not loaded/parsed when starting the BaseX > > (http) server on the docker container? Should the file be copied to a > > different path? > > > > > > Best regards, > > Mike > > > > > > -- > Jens Erat > Universität Konstanz > Kommunikations-, Infomations-, Medienzentrum (KIM) > Abteilung Basisdienste > D-78457 Konstanz > Mail: jens.erat at uni-konstanz.de > >
MC
Mike Cobo6 Apr 2016 16:00 #
Hi
Thanks for your support! Andy is right, when I create a new docker image and copy the user.xml to /srv/BaseXData then I can authenticate with the credentials defined in user.xml. As the passwords are encrypted I just used the DBA webconsole to change the admin password on my local machine and then I can use this file when creating the docker image, i.e. in the Dockerfile I added the following line: COPY users.xml /srv/BaseXData/
I think it should be clarified in the official documentation: http://docs.basex.org/wiki/Docker#BaseX_Configuration (changing the admin password has no effect...)
As so far I only used the BaseX GUI and now I'm using the docker version of BaseX for a new project I need to get a better understanding of how the server configuration and user management works.I can still use all of my existing XQuery sciripts but some things needed to be changed:
- In order to use the SQL module when using BaseX in the docker container the jdbc drivers need to be copied to the path /usr/src/basex/basex-core/lib/ and not as one might guess to /lib/.
- In the import module statement the absolute path is needed, e.g. import module namespace api="http://www.domain.com/myapp" at "/srv/BaseXWeb/modules/util.xqm";
RegardsMike From: Andy Bunce <bunce.andy at gmail.com>
To: Jens Erat <jens.erat at uni-konstanz.de>
Cc: Mike Cobo <mikecobo at yahoo.com>; "basex-talk at mailman.uni-konstanz.de" <basex-talk at mailman.uni-konstanz.de> Sent: Wednesday, April 6, 2016 11:27 AM
Subject: Re: [basex-talk] Non-default admin user/pw for BaseX on Docker image
Hi,
My understanding is basexhttp does not use .basex or options for user details. It always runs as user admin with password from data/users.xml. If data/users.xml does not exist or does not specify an admin password then admin is also used as the password. [1],[2]
/Andy
[1] http://www.mail-archive.com/basex-talk%40mailman.uni-konstanz.de/msg05469.html [2] https://github.com/Quodatum/openshift-basex-quick-start#users-and-permissions
Quoted text · Jens Erat · 1 line
On 5 April 2016 at 16:35, Jens Erat <jens.erat at uni-konstanz.de> wrote:
Hi Mike,
I'll have a look at that this weekend. Some wild guesswork: this might be a permission issue with the .basex file. It might also be that I messed up somewhere, but I verified changed .basex files have been working (actually, I'm using one myself in a project).
Could you share the example project including Dockerfile and the .basex file as tar or zip archive, preserving permissions (tar -p flag)?
Regards,
Jens
Quoted text · Andy Bunce · 48 lines
Am 05.04.2016 um 17:08 schrieb Mike Cobo: > Hi BaseX team, hi all > > > > I want to create a docker image based on the existing basexhttp image, > but with other credentials for the admin user. For this reason I added > an edited .basex file with changed password (here: mypassword) to the > new docker image: > > .basex: > > ... > # Client/Server Architecture > HOST = localhost > PORT = 1984 > SERVERPORT = 1984 > USER = admin > PASSWORD = mypassword > SERVERHOST = > ... > > Dockerfile: > > FROM basex/basexhttp:latest > MAINTAINER Mike <myemail at mail.com> > COPY .basex /srv/ > VOLUME ["/srv/BaseXData", "/srv/BaseXWeb"] > > > After starting the docker container I checked if the edited file can be > found under the path "/srv/.basex". The file is there but when I want to > login to the database (or run an XQuery script via the browser) I cannot > login with admin/mypassword. The erreor message is: > > *Connection failed: Access denied. * > > But I can still use the default user/pw (admin/admin) to connect. > > Why is the changed .basex file not loaded/parsed when starting the BaseX > (http) server on the docker container? Should the file be copied to a > different path? > > > Best regards, > Mike > >
--
Jens Erat
Universität Konstanz
Kommunikations-, Infomations-, Medienzentrum (KIM)
Abteilung Basisdienste
D-78457 Konstanz
Mail: jens.erat at uni-konstanz.de
JE
Jens Erat18 Apr 2016 16:58 #
Hi Mike and Andy,
Quoted text · Mike Cobo · 13 lines
> Andy is right, when I create a new docker image and copy the user.xml to > /srv/BaseXData then I can authenticate with the credentials defined in > user.xml. As the passwords are encrypted I just used the DBA webconsole > to change the admin password on my local machine and then I can use this > file when creating the docker image, i.e. in the Dockerfile I added the > following line: > > COPY users.xml /srv/BaseXData/ > > > I think it should be clarified in the official > documentation: http://docs.basex.org/wiki/Docker#BaseX_Configuration > (changing the admin password has no effect...)
I just added some information to the Docker documentation page:
http://docs.basex.org/wiki/Docker
If you have more helpful information to add to he documentation, it is written using a Wiki and everybody's invited to improve it, but you'll have to request an account to prevent spam before:
http://docs.basex.org/wiki/Special:RequestAccount
I'm still investigating an issue together with Docker which prevents the automated builds from automatically adding new releases, but I hope this will be resolved in the next few days.
Regards,
Jens
--
Jens Erat
[phone]: tel:+49-151-56961126
[mail]: mailto:email at jenserat.de
[jabber]: xmpp:jabber at jenserat.de
[web]: http://www.jenserat.de
OpenPGP: 0D69 E11F 12BD BA07 7B37 26AB 4E1F 799A A4FF 2279
Written for BaseX 8.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery