Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting password via env variable MERMEID_admin_password does not persist restart #221

Open
peterstadler opened this issue Oct 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@peterstadler
Copy link
Member

as reported by Dominik Kasper:

If you work with the environment variable MERMEID_admin_password, then in my opinion the empty admin PW should be overwritten at the first startup (= post-install script is executed) and the new one from the variable should be written to the database (if it is persistent). Further ups and downs, starts or stops should retain the PW as long as the contents of the eXist-data directory are retained.

In my case, however, something else happens: The admin PW is NOT written to the database, but is basically only valid for this “run” (with a persistent database!). In other words: I start up containers with the MERMEID_admin_password variable set. I can then log in to MerMEID, Monex, eXide, etc. with the password. (In the dashboard too, even if it doesn't look like that, but I'm sure you know the problem with that). I then stop the environment or shut it down. When it starts up again, the admin PW is back to default, i.e. empty string.

There are known problems with the sm:passwd function, as already reported. I just wanted to let you know in case you are not aware of this. The solution in practice is simple: the admin PW must be set manually (additionally) via the dashboard's user manager the first time the system is started up. During this short time, nobody can get in because the PW from the environment variable seems to be valid at least for the “session”. Once it has been set manually, it is actually stored in the DB and is retained.

Translated with DeepL.com (free version)

@peterstadler peterstadler added the bug Something isn't working label Oct 16, 2024
@peterstadler
Copy link
Member Author

I was able to reproduce the issue with

  1. docker create --name mermeid -p8080:8080 -e MERMEID_admin_password=foobar -v /some/local/path:/exist/data edirom/mermeid:develop-java11-ShenGC
  2. docker start mermeid
  3. wait for eXist-db to start up and successfully login to e.g. eXide with "admin" and "foobar"
  4. docker restart mermeid
  5. wait for eXist-db to start up: this time the login will fail with the provided credentials

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant