surajcm / darkhold

darkhold is a self-hosted alternative emulating the famous classroom quiz portal Kahoot.
GNU General Public License v3.0
32 stars 8 forks source link

DockerHub Image broken #77

Open SamTV12345 opened 1 year ago

SamTV12345 commented 1 year ago

I started the docker image with docker run \ --name Darkhold \ --restart unless-stopped \ -v "./Darkhold/db:/tmp/db" \ -p 8181:8181/tcp \ surajcm/darkhold

. It somehow started to download gradle? After signing up with test test I get a lot of errors that EL1004E: Method call: Method getUsername() cannot be found on type java.lang.String

surajcm commented 1 year ago

Hi, I did a Java upgrade and forgot to update the Dockerfile with the new Java version. It seems it was the issue. Could you please update the code (I just pushed the required change) and try again?

SamTV12345 commented 1 year ago

It is still not working.

SamTV12345 commented 1 year ago

Ah it's still the same old docker image. I'll try the main branch. Why do you always build the project from source? That seems pretty redundant. You can do a gradle build and pack the jar into the container (best is Alpine) and simply do at startup java -jar

SamTV12345 commented 1 year ago

A few tips:

So I got the project started and got these messages when trying to login: 2023-06-16 23:49:55.538 INFO [http-nio-8181-exec-3] {transactionId=33651441-f470-45b8-9550-bce8635dbdc8} : c.q.d.l.c.LoginController: into loginMe 2023-06-16 23:49:59.967 INFO [http-nio-8181-exec-4] {transactionId=27aa80bd-6b1b-40d6-b829-3eecbc32bc90} : c.q.d.l.s.UserDetailsServiceImpl: requested user name is test@test.com 2023-06-16 23:49:59.969 INFO [http-nio-8181-exec-4] {transactionId=27aa80bd-6b1b-40d6-b829-3eecbc32bc90} : c.q.d.l.s.UserDetailsServiceImpl: current user -> User[id=3, name='Test', email='test@test.com', password='$2a$10$IETkLhJaSnIsMd4dwxmpNu.DmwqsNod91XckFts/nfy6MDExNRTtO', enabled='false', roles=[com.quiz.darkhold.login.entity.Role@6dd0c77a]] 2023-06-16 23:49:59.974 INFO [http-nio-8181-exec-9] {transactionId=01eec1ee-28ab-41fc-96c4-1e99fa6770c9} : c.q.d.l.c.LoginController: error is there ...

I can override users with my own credentials (this is one of the biggest problems. If someone finds out about this and wants to hijack an account. Simply create that one again and login)

The redirect on signup doesn't seem to work. I get back to the main page and when I try to login with that user I get above error message.

The error appears there because you only check if the error is null. In my case the string is blank.

I would love if you move to a more sophisticated framework like react. They have client side routing which is normally a lot more robust than the Spring Boot Server.

surajcm commented 1 year ago

Thank you for these tips. I will try to address them. I plan to learn React and rewrite the UI part while keeping the backend as Java and also, planning to move everything to a NoSQL db, most probably to MongoDB.

SamTV12345 commented 1 year ago

You're welcome. Feel free to ask any questions if you get stuck.