sabre-io / Baikal

Baïkal is a Calendar+Contacts server
https://sabre.io/baikal/
GNU General Public License v3.0
2.42k stars 281 forks source link

Create users from custom PHP script? #1238

Closed ballou-git closed 3 months ago

ballou-git commented 5 months ago

Baikal version: 0.94

Hi, this works great. But I would like my app to create a user in Baikal at the same time as I generate a mail account on mail server. How can I do that correct? I can use the same info as on the mail account. The password is my biggest concern.

Best regards

ballou-git commented 5 months ago

It would be great is I could get help how to generate the password correct when creating the record in the baikal DB

acanton77 commented 5 months ago

Maybe this will help: https://stackoverflow.com/questions/73008394/sabre-io-baikal-rest-api or perhaps something here: http://tinyurl.com/2p8wha5u .

ballou-git commented 5 months ago

Thank you, but that is far from my knowledge. Easiest way would be for me to just use a PHP script to post in the DB. But I really don't know how the password is encrypted.

ByteHamster commented 5 months ago

Don't mess with the database manually. You will likely break things.

ballou-git commented 5 months ago

Can you tell me how you create the passwords in the DB? What type of encrypter etc? If I can find a way to do the same?

acanton77 commented 5 months ago

The DB is either SQLlite or MySQL, depending on what you are using. You can open them in phpMyAdmin for MySQL or one of the similar ones for SQLlite and see how the password is encrypted. My guess is MD5 or an SSH key?

ballou-git commented 5 months ago

After a while I found the formula for creating the password. All encrypted with MD5 value:value:value

ballou-git commented 5 months ago

I've build a function that creates the the mailaccounts in postfix and the users with CardDAV and CalDAV. Just love this Baikal!