majewsky / portunus

Self-contained user/group management and authentication service
GNU General Public License v3.0
75 stars 5 forks source link

Feature Request: Seed with password hash #33

Open lorenzleutgeb opened 1 month ago

lorenzleutgeb commented 1 month ago

It seems that there is currently now way for me to bring my own crypt hash for seeding? Say that my password is "example", then I would like to put $y$j9T$QxVr8WsdgXcVw.AVprEU20$MRgBvLbME5JhfxvcPwOCd4./YFicx/B/MtqZ1Fz12n6 in PORTUNUS_SEED_PATH=.../seed.json:

{
  "users": [{
    // ...
    "password": "$y$j9T$QxVr8WsdgXcVw.AVprEU20$MRgBvLbME5JhfxvcPwOCd4./YFicx/B/MtqZ1Fz12n6"
  }]
}

I also tried

{
  "users": [{
    // ...
    "password": "{CRYPT}$y$j9T$QxVr8WsdgXcVw.AVprEU20$MRgBvLbME5JhfxvcPwOCd4./YFicx/B/MtqZ1Fz12n6"
  }]
}

but that won't have the desired effect (my password then is literally "{CRYPT}$y...").

I would prefer that over putting the password in a file and using a command.