Giter Site home page Giter Site logo

Comments (7)

rubenmdh avatar rubenmdh commented on July 26, 2024 1

Thank you for your fast response. After following the instructions you gave me, it works flawlessly.

Thank you for mantaining this fork, I've been using it for quite a while now and it is just awesome.
I will close this issue now as the commit will roll out soon.

from lolisafe.

BobbyWibowo avatar BobbyWibowo commented on July 26, 2024

Ah yes, sorry about that.

The main script lolisafe.js doesn't wait for DB tables to be created first, before proceeding to query the tables (for file identifiers cache and whatnot). And since it exits immediately upon error, the database is never fully initiated.

Meanwhile, try to delete any leftover, and possibly broken anyway, db file with rm database/db in lolisafe's root dir.
Then you can try to run node to start node shell, also in lolisafe's root dir, and then execute the commands below through it:

require('./database/db.js')(require('knex')({ client: 'sqlite3', connection: { filename: './database/db' }, useNullAsDefault: true }))

That should properly initiate the sqlite databse with all the required tables and whatnot.

I'll commit a permanent fix in a few hours. Thanks for the report! 👍

from lolisafe.

rubenmdh avatar rubenmdh commented on July 26, 2024

I have to reopen this as I can't log in to the root account.

I've checked that the default admin details should be as follow:
Username: root
Password: changeme

I am unable to log in with these details. Do I have to initialize the root account somehow?

from lolisafe.

BobbyWibowo avatar BobbyWibowo commented on July 26, 2024

Ah, if your DB was created BEFORE the bug fix commit (that is, through the instructions I sent previously), the default login was username root & password root.
But I forgot that a couple weeks ago, I enforced password min length to 6 chars in the auth page, thus preventing new installations from using root password (cause it's only 4 chars).
So I decided to also change the default password in that bug fix commit to changeme, but that will only apply to new DB created AFTER the commit.

from lolisafe.

BobbyWibowo avatar BobbyWibowo commented on July 26, 2024

If necessary, you can execute the commands below in node shell to forcefully update the admin account's password (if starting over with a clean DB is not an option):

db = require('knex')({ client: 'sqlite3', connection: { filename: './database/db' }, useNullAsDefault: true })

require('bcrypt').hash('changeme', 10).then(pass => db.table('users').where('username', 'root').first().update('password', pass))

Make sure to execute the command line by line.
It'll update the password to changeme.

from lolisafe.

rubenmdh avatar rubenmdh commented on July 26, 2024

If necessary, you can execute the commands below in node shell to forcefully update the admin account's password (if starting over with a clean DB is not an option):

db = require('knex')({ client: 'sqlite3', connection: { filename: './database/db' }, useNullAsDefault: true })

require('bcrypt').hash('changeme', 10).then(pass => db.table('users').where('username', 'root').first().update('password', pass))

Make sure to execute the command line by line.
It'll update the password to changeme.

Thanks for the help, I just logged in changing the minlength value from the password box to 4. This works for logging in although it doesn't for registering, which is the expected scenario.

Feel free to close this issue if everything seems ok to you.

from lolisafe.

BobbyWibowo avatar BobbyWibowo commented on July 26, 2024

Aha, I had the impression that I also forced the min length on the login API, which was why I didn't bother to suggest temporarily editing the input's minlength attribute.
I guess it wouldn't make much sense to force it on the API to begin with, so I'll leave it as it is.
Anyway, good to know it's working for you 👍

from lolisafe.

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.