Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


SOLVED How to enable LDAP support in LAMP app?


  • I'm a bit confused...

    At first I thought LDAP is enabled in LAMP out of the box. This seems not the case and LDAP is not mentioned in the LAMP app documentation. According to the documentation, LDAP is available as addon and can be activated in the "CloudronManifest.json". So far so good.

    When browsing the appsdata folder I just found a config.json for LAMP with seems to be analog to CloudronManifest.json. I enabled LDAP addon there and restarted the app. But...it seems not to work this way. When I search for the exposed LDAP variables with env inside the LAMP terminal I only get mysql, redis and so on.

    What do I miss? My goal is to have LDAP variables exposed as environment variables to use it it within my configuration.

    Context: I try to use LDAP module of freescout

  • Staff

    You are right, the LDAP addon is not enabled for the LAMP app. The manifest is also coming from the app package itself and changing that in hindsight as you explained does not change anything. The only way to solve this is, if we release a new LAMP app with LDAP enabled. I will discuss this with @girish to check if there are any obvious issues with it. As far as I remember, it was not put there, to avoid random php scripts getting hold of the username+password during logins. But maybe this is not actually a real concern.


  • Okay I see. I found https://cloudron.io/blog/2017-02-27-lamp.html and it stated that LDAP is enabled by default. Your explanation makes sense but I ask myself if I'm the first one who stumbled over this. It would be nice but not crucial. Would it be possible to make features like ldap, redis etc adjustable by checkbox within the app configuration?

  • App Dev

    @subven I needed this for a PHP app and I just built a custom LAMP app for personal development, but if the official LAMP app got LDAP (or maybe a version of the app that has it enabled in the same likeness of how wordpress and unmanaged wordpress have different apps) it would be nice since so many self-hosted options are PHP and ldap is almost always a must have.


  • @murgero said in How to enable LDAP support in LAMP app?:

    @subven I needed this for a PHP app and I just built a custom LAMP app for personal development, but if the official LAMP app got LDAP (or maybe a version of the app that has it enabled in the same likeness of how wordpress and unmanaged wordpress have different apps) it would be nice since so many self-hosted options are PHP and ldap is almost always a must have.

    Do you have the code for this. I'm making a custom LAMP app and can't seem to get the LDAP environment variables to show up despite adding this to CloudronManifest.json:

      "addons": {
        "localstorage": {},
        "mysql": {},
        "ldap": {}
    

    This getenv("CLOUDRON_LDAP_SERVER") still shows up as null? Did I miss a step?


  • After way too long debugging this, I've come to realize that I needed to uninstall the app and re-install it as cloudron update does not initialize those environment variables.

    Works perfectly now. #thelittlethings

  • Staff

    @Lonk said in How to enable LDAP support in LAMP app?:

    After way too long debugging this, I've come to realize that I needed to uninstall the app and re-install it as cloudron update does not initialize those environment variables.

    Correct! The "ldap" bit can only be set/unset at first install time. This is something we need to look into making it more dynamic in future releases.


  • @girish said in How to enable LDAP support in LAMP app?:

    @Lonk said in How to enable LDAP support in LAMP app?:

    After way too long debugging this, I've come to realize that I needed to uninstall the app and re-install it as cloudron update does not initialize those environment variables.

    Correct! The "ldap" bit can only be set/unset at first install time. This is something we need to look into making it more dynamic in future releases.

    I can't believe I didn't think of update being different than install in an add-on sense - but little things like that have to be weighed out on what's easiest for the developer (the minority) vs what's most efficient (what customer's, being the majority notice) as to what to cache in containers or not. So, I get it.


  • @girish and @nebulon I just noticed that LDAP is still not in this app? Can we or when can we expect this?

    I really need Resourcespace (https://forum.cloudron.io/topic/2036/resourcespace-digital-asset-management-dam) and was thinking of installing it manually in LAMP. However I need to have LDAP to authenticate the 30 users of our Cloudron.

  • App Dev

    @imc67 Should be quite easy to put it in a custom app. Plus, you'd gain a nice App Dev badge 😛


  • @mehdi said in How to enable LDAP support in LAMP app?:

    Plus, you'd gain a nice App Dev badge

    well, I consider myself more as an experienced user, administrator, manager than a App Dev like you professionals are 🙂

  • Staff

    @imc67 said in How to enable LDAP support in LAMP app?:

    @girish and @nebulon I just noticed that LDAP is still not in this app? Can we or when can we expect this?

    SFTP change has been made for 6.0 already. So, I think we can make the LAMP app have LDAP support already. There is of course a small window between now and release of Cloudron 6 where non-admins can have SFTP access, so it's something to be aware of (guess it's not much of a worry for LAMP app anyway).

  • Staff

    The latest LAMP app now has LDAP addon enabled. For existing installations, LDAP will still be off (sorry).