Setup LDAP through command line

Hello,

I’m currently looking to automatically configure ERPNext as much as possible, and I was wondering if it’s possible configure LDAP settings from command line / bench.

My objective is to take a Docker image of ERPNext and set all the technical stuff like mail servers or LDAP through command line, even before the first run wizard has been completed.

Does anyone have an idea about this ?

Would be easy enough, you would just have to write a sql script that sets all the database values that you want. run the sql script from the command line and your done.

PS, there is quite a few changes going through with ldap for 11/12, I haven’t rewritten the documentation yet, but just so that you are aware. - Should be up in a week or so.

Thanks

Well, I was hoping not to write SQL inserts :sweat_smile: It surely works, but it does not feel clean (what if the table structure or values changed, etc…).

But at least I got my answer :+1:
Thanks for the info.

You could always just write a python script to do it all for you,
eg Developer Cheatsheet · frappe/frappe Wiki · GitHub

You could just execute that from the command line then… or curl + rest :slight_smile: - but probably just a simple setup python script would suffice, - you would still need to deal with changes, but usually things are only added, they are not removed.

For information, we have developed a Frappe application to automatically setup LDAP and Website signup through environment variables: GitHub - Monogramm/erpnext_autoinstall: ERPNext Frappe application to automatically setup ERPNext on install.

This is especially useful in docker containers where we use a docker-compose to configure containers.
The application is also tested, using docker containers, with Travis-CI on several ERPNext versions.

2 Likes

Nice!