Git Product home page Git Product logo

Comments (10)

jtschladen avatar jtschladen commented on June 13, 2024 1

You can include the password on the initial user creation (POST /users), but unfortunately I agree that PUT users/user_id doesn't allow you update the password. I think your original idea of using ResetPassword() would work, but it is obviously less convenient than an API since you have to be in the Lemur container to run it (and it's interactive, not a single call).

Feel free to propose a PR against Lemur if you'd like, though I must admit that I'm not sure if there's an intentional reason this functionality isn't included.

from lemur-docker.

jtschladen avatar jtschladen commented on June 13, 2024

Hi @Jonesy22 - I haven't had time to spin up a Docker container today to test this out (nor have I confirmed the required parameters to run it), but I'd expect you could run it using a command similar to the following (using docker exec):

# use correct username/password/DB name; these are the default values
export SQLALCHEMY_DATABASE_URI="postgresql://lemur:12345@postgres:5432/lemur"

/opt/venv/bin/python3 /opt/lemur/lemur/manage.py --config=/home/lemur/.lemur/lemur.conf.py reset_password -u username

I took this from the Docker entrypoint, which uses the same syntax to invoke Lemur's init command.

Let me know how this works for you.

from lemur-docker.

jtschladen avatar jtschladen commented on June 13, 2024

Also, in case you're not familiar with docker exec, you'd start with something like:

docker exec -it lemur-docker_lemur_1 bash

Which should get you into a shell on the Docker container in order to execute the command I mentioned above.

from lemur-docker.

Jonesy22 avatar Jonesy22 commented on June 13, 2024

Thank you for your response. So I've exec'd into the container successfully, but when I try running the line in your first comment, it says /opt/venv/bin/python3: not found. I do not have /opt/venv/ in the lemur container, as opt/ only holds lemur/

from lemur-docker.

jtschladen avatar jtschladen commented on June 13, 2024

How did you start the container? It's been a while since I worked on this project but I'm pretty sure /opt/venv is a necessary directory; I wouldn't expect the container to be able to start successfully without it.

from lemur-docker.

Jonesy22 avatar Jonesy22 commented on June 13, 2024

In one terminal I did docker-compose up. And then in a separate terminal I did the exec command, and then tried to run that reset password commad.

from lemur-docker.

jtschladen avatar jtschladen commented on June 13, 2024

When you run docker ps, does your lemur-docker_lemur_1 container indicate healthy? Are you able to access the UI at https://localhost:447/? I'm a bit baffled how you could be missing /opt/venv; it's used in the Dockerfile as well as in the entrypoint (unless loading from a dump file). If your container really doesn't have /opt/venv, I think that indicates something more fundamentally wrong with the container.

from lemur-docker.

Jonesy22 avatar Jonesy22 commented on June 13, 2024

So after running a make clean and then make. It is rebuilt and I now can access /opt/venv. I executed the activate command in /opt/venv/bin by running source activate from that directory. Then when I tried to run lemur reset_password -u lemur, I got an error saying no such tables: users.

from lemur-docker.

jtschladen avatar jtschladen commented on June 13, 2024

Sounds like you haven't initialized the Lemur DB yet. See the Database configuration section under the Configuration header in the README -- you probably want to run your containers in init mode once (but make sure you switch it back to blank after so the data isn't overwritten on the next boot).

from lemur-docker.

Jonesy22 avatar Jonesy22 commented on June 13, 2024

Thank you for all your help. Ideally for my use, users would have accounts created for them by an admin, and then they can change their passwords on their own accounts. But this process doesn't seem to help me in that case. Essentially I want to have functionality in the PUT users/user_id API call to change the user's password, so it can be changed by 1 call. But it looks like this isn't implemented within Lemur unfortunately.

from lemur-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.