greatbit / quack

Web Based Test Management System
Apache License 2.0
116 stars 34 forks source link

Can't change password for a user #234

Open mpelley opened 1 year ago

mpelley commented 1 year ago

I am using version 1.21. I am logged in as "root" and created two users. I went to the All Users page, clicked on a user and clicked on "Change Password". It took me to an empty page.

azee commented 1 year ago

@mpelley Same as here - https://github.com/greatbit/quack/issues/236 - please clarify what is set up in your properties as AUTH and Session providers https://github.com/greatbit/quack/blob/master/api/src/main/resources/quack.properties#L13-L14

mpelley commented 1 year ago

I am using the docker container that I downloaded from GitHub without any changes. So whatever authentication you set up in that is what is being used. Lines 13-14 of quack.properties are:

whoru.auth.provider=ru.greatbit.whoru.auth.providers.StubAuthProvider
whoru.session.provider=ru.greatbit.whoru.auth.providers.InmemSessionProvider
azee commented 1 year ago

@mpelley In that case you are using StubAuthProvider. Along with docker-compose the only purpose for StubAuthProvider is to do a demo. It an authenticate a single user specified as an admin.

You'll have to set it up for yourself as a DBAuthProvider whoru.auth.provider=com.testquack.api.security.DbAuthProvider and a Hazelcast sessionProvider (in case you are running more than 1 instance of quack in a replica) whoru.session.provider=ru.greatbit.whoru.auth.providers.HazelcastSessionProvider

You can run quack in docker overriding the path to your own property file like docker run -v PATH_TO_DIRECTORY_WITH_PROPERTIES:/etc/quack -p 27017:27017 -p 8080:8080 -p 80:80 -d greatbit/quack

mpelley commented 1 year ago

Where can I find instructions on how to "set it up for yourself as a DBAuthProvider"? I'm a novice at setting up servers. Google didn't help me; it seems DBAuthProvider is a concept, not a thing that can be directly used.

azee commented 1 year ago

@mpelley Lets take one step back.

  1. Are you setting up a system for a temp demo or is it for a production-like usage?
  2. How exactly are you running the system? Could you please specify the commands exactly.

The idea is that QuAck loads property file from a specific location - etc/quack/quack.properties. It is used to specify simple properties and to specify IOC implementations of various plugins (e.g. - authentication).

If you are running the app as a plain java jar - you'll have to specify a path to your local custom property file via -Xbootclasspath parameter (see README).

If you are running it in docker - you have to map a path on your host where you keep your custom property file to a folder in docker container which QuAck uses to search for the file (also in README) docker run -v PATH_TO_DIRECTORY_WITH_PROPERTIES:/etc/quack -p 27017:27017 -p 8080:8080 -p 80:80 -d greatbit/quack

If you are running docker compose - you can specify this mapping in docker-compose.yaml in quack section https://github.com/greatbit/quack/blob/master/docker-compose.yml#L3 like volumes:

Please note that docker compose was created just for demo purposes. It starts mongo and service within one compose pack and uses demo configuration - no something you would want for production stage.

To set DBAuthProvider and HazelcastSessionProvider your config file should contain the following whoru.auth.provider=com.testquack.api.security.DbAuthProvider whoru.session.provider=ru.greatbit.whoru.auth.providers.HazelcastSessionProvider

mpelley commented 1 year ago

I had used the docker approach to do a demo. Then a person on our team went to set up the production server and ran into the problem in this issue. I decided to try to get the remote access working on my demo system (and have not been successful). While trying things out on the demo system, I ran into this issue.

To start up QuAck on my demo system, I use "sudo docker-compose up".

I copied the quack.properties to /etc/quack and added the "volumes: ..." lines to the .yml file. I get an error, "Named volume "PATH_TO_DIRECTORY_WITH_PROPERTIES:/etc/quack:rw" is used in service "quack" but no declaration was found in the volumes section."

azee commented 1 year ago

@mpelley PATH_TO_DIRECTORY_WITH_PROPERTIES is a placeholder of whatever you are using as a folder for property file on your host. You have to map it to the /etc/quack folder of a docker container.

In your case mapping will be volumes: