diff --git a/2.12.3/docker-compose.yml b/2.12.3/docker-compose.yml index bebf458..165e672 100644 --- a/2.12.3/docker-compose.yml +++ b/2.12.3/docker-compose.yml @@ -21,6 +21,14 @@ services: # See documentation to set up SSL for MySQL OCS_SSL_ENABLED: 0 OCS_DBI_PRINT_ERROR: 0 + # 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 + AUTH_TYPE: 1 links: - ocsdb networks: diff --git a/2.12.3/docker-entrypoint.d/21-ajust-authtype.sh b/2.12.3/docker-entrypoint.d/21-ajust-authtype.sh new file mode 100644 index 0000000..ca2a2e7 --- /dev/null +++ b/2.12.3/docker-entrypoint.d/21-ajust-authtype.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +VAR_FILE=${OCS_WEBCONSOLE_DIR}/ocsreports/var.php + +if [ -f ${VAR_FILE} ]; then + echo "+-----------------------------------------------+" + echo "| Customizing OCS Console AUTHTYPE... |" + echo "+-----------------------------------------------+" + echo + sed -ri -e "/AUTH_TYPE/c\define('AUTH_TYPE', $AUTH_TYPE);" ${VAR_FILE} +fi \ No newline at end of file diff --git a/nightly/conf/ocsinventory-server.conf b/nightly/conf/ocsinventory-server.conf index d4e461f..c402608 100644 --- a/nightly/conf/ocsinventory-server.conf +++ b/nightly/conf/ocsinventory-server.conf @@ -74,7 +74,7 @@ # If you need to specify a mysql socket that the client's built-in #PerlSetEnv OCS_OPT_DBI_MYSQL_SOCKET "path/to/mysql/unix/socket" # DBI verbosity - PerlSetEnv OCS_OPT_DBI_PRINT_ERROR 0 + PerlSetEnv OCS_OPT_DBI_PRINT_ERROR OCS_DBI_PRINT_ERROR # Unicode support PerlSetEnv OCS_OPT_UNICODE_SUPPORT 1 diff --git a/nightly/docker-compose.yml b/nightly/docker-compose.yml index 32e3cb9..23d64b3 100644 --- a/nightly/docker-compose.yml +++ b/nightly/docker-compose.yml @@ -20,6 +20,15 @@ services: OCS_DB_NAME: ocsweb # See documentation to set up SSL for MySQL OCS_SSL_ENABLED: 0 + OCS_DBI_PRINT_ERROR: 0 + # 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 + AUTH_TYPE: 1 links: - ocsdb networks: diff --git a/nightly/docker-entrypoint.d/10-com-server.sh b/nightly/docker-entrypoint.d/10-com-server.sh index bfd4732..73aa399 100644 --- a/nightly/docker-entrypoint.d/10-com-server.sh +++ b/nightly/docker-entrypoint.d/10-com-server.sh @@ -23,6 +23,7 @@ if [ ! -f ${SRV_CONF_FILE} ]; then sed -i 's/"PATH_TO_LOG_DIRECTORY"/'"${OCS_LOG_DIR//\//\\/}"'/g' ${SRV_CONF_FILE} sed -i 's/"PATH_TO_PLUGINS_PERL_DIRECTORY"/'"${OCS_PERLEXT_DIR//\//\\/}"'/g' ${SRV_CONF_FILE} sed -i 's/"PATH_TO_PLUGINS_CONFIG_DIRECTORY"/'"${OCS_PLUGINSEXT_DIR//\//\\/}"'/g' ${SRV_CONF_FILE} + sed -i 's/OCS_DBI_PRINT_ERROR/'"$OCS_DBI_PRINT_ERROR"'/g' ${SRV_CONF_FILE} fi # Replace Variables @@ -41,6 +42,9 @@ if [ -f ${SRV_CONF_FILE} ]; then done fi +# Quick fix https://github.com/OCSInventory-NG/OCSInventory-Docker-Stack/issues/16 +sed -i 's/^.*PerlSetEnv OCS_OPT_DBI_PRINT_ERROR.*$/PerlSetEnv OCS_OPT_DBI_PRINT_ERROR 0/' ${SRV_CONF_FILE} + # Permissions chown -R $APACHE_RUN_USER: $OCS_LOG_DIR diff --git a/nightly/docker-entrypoint.d/21-ajust-authtype.sh b/nightly/docker-entrypoint.d/21-ajust-authtype.sh new file mode 100644 index 0000000..ca2a2e7 --- /dev/null +++ b/nightly/docker-entrypoint.d/21-ajust-authtype.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +VAR_FILE=${OCS_WEBCONSOLE_DIR}/ocsreports/var.php + +if [ -f ${VAR_FILE} ]; then + echo "+-----------------------------------------------+" + echo "| Customizing OCS Console AUTHTYPE... |" + echo "+-----------------------------------------------+" + echo + sed -ri -e "/AUTH_TYPE/c\define('AUTH_TYPE', $AUTH_TYPE);" ${VAR_FILE} +fi \ No newline at end of file