OCSInventory-NG / OCSInventory-Docker-Image

Docker image for OCSInventory Server
GNU General Public License v3.0
78 stars 92 forks source link

Ldap auth settings #75

Open nevlkv opened 2 years ago

nevlkv commented 2 years ago

Settings file with AUTH_TYPE is static, and LDAP auth is not availible

wiltonsr commented 2 years ago

Hi, @nevlkv

I made PR #87 that refactors all startup's script logic. Once this PR is accepted, you could solve this problem with a simple script called 21-ajust-ldap.sh, like that:

#!/bin/bash

VAR_FILE=${OCS_WEBCONSOLE_DIR}/ocsreports/var.php

if [ -f $VAR_FILE ]; then
  sed -ri \
    -e "/AUTH_TYPE/c\define('AUTH_TYPE', 2);" \
    $VAR_FILE
fi

And just mount it as a volume:

...
services:
  ocsapplication:
    image: ocsinventory/ocsinventory-docker-image:2.9.2
...
    volumes:
      - "./21-ajust-ldap.sh:/docker-entrypoint.d/21-ajust-ldap.sh"
...

From docs, you could use this values for AUTH_TYPE:

/**
 * Define the auth type :
 * - 1 : Local Only
 * - 2 : Local and LDAP
 * - 3 : LDAP Only
 * - 4 : LDAP with SSO
 * - 5 : Always OK, won't ask for user and password
 * - 6 : CAS authentication
 * 
 * If LDAP / SSO Basic auth is configured, please configure the LDAP Authentication
 */

Regards.

wiltonsr commented 2 years ago

ping @gillesdubois

Cloud-Kid commented 1 year ago

Hi all, First thanks for your work, it's awesome :) This feature needs to be implemented ! OCS being mainly used in companies, LDAP support needs to be enabled by default or, at least, can be easely activated, with an environment variable for example. Thanks again for your update @wiltonsr

Cloud-Kid commented 7 months ago

@gillesdubois Ping

gillesdubois commented 7 months ago

Hi,

Sorry for the delay. We plan to implement this feature in the next release of the docker image :)

Regards, Gilles DUBOIS.

Cloud-Kid commented 7 months ago

Hey, thanks for your answer ! Any insight for the next release progress ? Thanks for your work BTW

gillesdubois commented 7 months ago

Hi,

2.12.2 will most likely comes in mid-April, so you can expect a new docker image on the same week as of the source release.

Regards, Gilles DUBOIS.