Forum archive
A newbie stuck with a firstboot script problem building a new appliance
Hi. My first post, and I'm not sure if I should even ask here or go searching in Python forums :)
I am most of the way through building an appliance for SLIMS8 [ Google Senayan SLIMS, or search for SLIMS on Github ] , having successfully drawn upon scripts from LAMP, Moodle, and Xoops appliances.
SLIMS8 stores its internal user passwords using bcrypt ( so far as I can ascertain from the SLIMS code e.g
passwd = '".password_hash($retype_password, PASSWORD_BCRYPT)."',
in several php files in the application. )
I used a modified XOOPS script - xoops.py to successfuly do a first boot request for the SLIMS application 'admin' password and email, and write the input to the database, thus:
hash = hashlib.md5(password).hexdigest()
m = MySQL()
m.execute('UPDATE senayandb.user SET passwd=\"%s\" WHERE username=\"admin\";' % hash)
m.execute('UPDATE senayandb.user SET email=\"%s\" WHERE username=\"admin\";' % email)
In fact this allows me to login to the application as admin, through a piece of luck!!
Earlier versions of SLIMS used md5 for password hashing, so for upgrade purposes the developers have included code which triggers an "Enter new password" when a user first logs in using an md5 password, and forces rentry of any password with the improved bcrypt hashing :)
Obviously this is not the best solution for end users of the the appliance. So how do I proceed to get rid of md5 in the above code and replace it with bcrypt? My Python knowledge is extremely limited.
More questions about the final build of the appliance will follow, but this is my last real hurdle before taking it out of TKLDEV and into Github.
It's been a learning curve, but I have my head around most of TKLDEV now. I have my eye on a couple more library appliances once this one is done .
echo | pecl install yaz
was exactly what was needed.
Thanks