Linkding Password reset
-
Purely for the purpose of reserach <cough:, nah, I'm an idiot>, how do you reset the password for Linkding?
I can see
secretkey.txt
in/app/data
but don't think I can reverse it.I have tried
python3 manage.py createsuperuser --username=joe --email=joe@example.com
but it returnssqlite3.OperationalError: unable to open database file
Also trying
python3 manage.py changepassword
returns the same error.Suggestions welcome, Couldn't see anything in their github issues.
-
I am wondering if the database is corrupt - can't find
db.sqlite3
anywhere -
Hmmm, I attempted to restore from a backup.
However the latest backup I have (retention policy 7 days : maybe I should increase) also does not havedb.sqlite3
.
I cannot tell when it might have stopped being present (as I use the app occasionally). -
Barking up the wrong tree
Fresh install on temp app.domain.tld doesn't havedb.sqlite3
either.
So ... where is the database ?EDIT : seems like this package uses Postgres
-
@timconsidine said in Linkding Password reset:
Purely for the purpose of reserach <cough:, nah, I'm an idiot>, how do you reset the password for Linkding?
I found 2 places where it looks like you can do it:
/change-password/
and
/admin/auth/user/1/password/
-
@jdaviescoates hmm, deceptively obvious, but ...
- the first link requires a valid login
- the second throws up page
Not Found
But thank you - confirms I am overlooking info.
-
OK, phew, I'm in again on the original instance.
There is probably an easier way, but this is the 'hacking' that I did, in case it helps anyone :- installed a fresh instance of Linkding on a temporary URL
- change the default password as instructed
- launched a terminal and then clicked the
Postgres
button to launchpsql
- used
SELECT * FROM auth_user;
to show the raw data for the only user, and copied the hashed password content - closed psql and closed the terminal
- in the original app installation, launched a terminal and launched a psql session
- updated the
auth_user
table for the only user withUPDATE auth_user SET password = 'copied_hashed_password_value' WHERE username = 'username';
- closed psql and terminal
- refreshed the login page for the original app instance
- logged in with the known unhashed password set for the user in the dummy app instance
- killed the dummy app instance
- for safety I also copied out the values in the bookmark table with
\COPY (SELECT * FROM bookmarks_bookmark) TO '/app/data/bookmarks.txt' WITH DELIMITER ',' CSV HEADER;
Maybe there is an easier way to do all that, but it seems Linkding doesn't provide any maintenance utilities for Postgres (just sqlite using python).
Goodnight !
-
As some petty revenge for losing access I have packaged Shiori for Cloudron :
https://forum.cloudron.io/post/74384Hope it helps someone.