lundi 29 août 2016

Change your Gogs admin password

I might have missed something, but I haven't found any simple way to change my admin password (with emailing not active) in gogs.

It was quite easy to find the hash location, but as I didn't know how it was generated...

Luckily I eventually found the parameters used, so here it is for you if you need them embedded in a script :

var pbkdf2 = require('pbkdf2-sha256');
var key = 'YourChosenPasword';
var salt = 'AnyRandomValue';

var hash = pbkdf2(key, salt, 10000, 50); console.log(hash.toString('hex'));

All I had to do was then to update the table user, setting passwd to the generated value (and updating salt with the value used in the script).

Aucun commentaire :