tomcatwarbasex

How to set initial password in BaseX


I use tomcat and have downlaoded and deployed the basex105.war in the folder webapps. I can successfully access BaseX via localhost:8080/BaseX105/.

Now I want to access the DBA: Database Administration, which requires username and password.

According to the documentation https://docs.basex.org/index.php?title=Web_Application&mobileaction=toggle_view_desktop the default password for the user "admin" has been removed. How do I set an initial password?

Only having the *.war file, where is the script basexhttp or how do I start the command-line?


Solution

  • I still don't know what the correct way is, but this solved my issue:

    1. Make a new folder called "data" on root level of the unpacked war. In my case /path/to/tomcat/webapps/BaseX105/data. Cave: There is a data folder under /path/to/tomcat/webapps/BaseX105/WEB-INF/data, this does NOT work.

    2. In the new data folder make a users.xml with the content:

      <users>
        <user name="testuser" permission="admin">
          <password algorithm="digest">
            <hash>b36dcc7c618183221ee878599cdf989a</hash>
          </password>
          <password algorithm="salted-sha256">
            <salt>7271028275349696</salt>
            <hash>eb71284c38ab22088897675065ae0f2bd5b58f1afa5273ae087604793030cfa7</hash>
          </password>
        </user>
      </users> 
      
    3. Restart Tomcat and you can login into the DBA with User: testuser PW: testuser

    4. In the DBA-GUI set admin a new password. You may delete testuser from the xml.