diff --git a/README.md b/README.md index a3ec206..9da723c 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,13 @@ Gen_Config -> Services -> Activer LemonLDAP::NG -> "Oui" * Fill LemonLDAP configuration +#### Nginx Web case + +By default NGINX is configured to serve "web" application, in this case the lemonLDAP::NG application will +not be served properly, so we need to disable this function + +GenConfig -> Services -> Activer la publication d’applications web par Nginx -> "Non' + #### Configuration DNS * GenConfig -> Lemonldap -> Nom DNS du manager LemonLDAP-NG * GenConfig -> Lemonldap -> Nom DNS du service d'authentification LemonLDAP-NG diff --git a/creolefuncs/netmask.py b/creolefuncs/lemonldap.py similarity index 55% rename from creolefuncs/netmask.py rename to creolefuncs/lemonldap.py index 3aa7fa2..900c541 100644 --- a/creolefuncs/netmask.py +++ b/creolefuncs/lemonldap.py @@ -14,3 +14,15 @@ def toCidr(ip,mask=False): return str(IP(data)) except: return data + +def readPass(encoder,reader): + try: + mypwdreader=open(reader, "r").readline().rstrip() + if encoder == "": + return mypwdreader + elif encoder == "base64": + import base64 + return base64.b64encode(mypwdreader) + + except: + return "mot de passe inconnu" diff --git a/dicos/70_lemonldap_ng.xml b/dicos/70_lemonldap_ng.xml index 519454f..5a226a1 100644 --- a/dicos/70_lemonldap_ng.xml +++ b/dicos/70_lemonldap_ng.xml @@ -2,12 +2,12 @@ - + lemonldap-ng-fastcgi-server 80 443 @@ -79,6 +79,7 @@ Activer l'hébergement d'une place de marché HTTP pour OpenNebula Nom DNS de l'application de gestion de LemonLDAP::NG ex:manager.cadoles.com Nom DNS de service d'authentification de LemonLDAP::NG ex:auth.cadoles.com + DN de l'utilisateur de connection en lecture à l'annuaire (ex: cn=reader,o=gouv,c=fr) server_names_hash_bucket_size Taille du hash des noms de serveur pour NGINX diff --git a/tmpl/handler-nginx.conf b/tmpl/handler-nginx.conf index 922d0c3..8608782 100644 --- a/tmpl/handler-nginx.conf +++ b/tmpl/handler-nginx.conf @@ -12,6 +12,10 @@ # IMPORTANT: # To protect applications, see test-nginx.conf template in example files +%if %%getVar("revprox_hash_bucket_size", "non") == "non" +server_names_hash_bucket_size %%nginxBucketSize; +%end if + # Log format include /etc/lemonldap-ng/nginx-lmlog.conf; #access_log /var/log/nginx/access.log lm_combined; diff --git a/tmpl/lmConf-1.js b/tmpl/lmConf-1.js index 1c21d85..35d9a14 100644 --- a/tmpl/lmConf-1.js +++ b/tmpl/lmConf-1.js @@ -230,7 +230,7 @@ "portalDisplayChangePassword": "$_auth =~ /^(LDAP|DBI|Demo)$/", "hideOldPassword": 0, %if %%is_file(%%ldapBindUserPassword) - "managerPassword": "%%pwdreader("", %%ldapBindUserPassword)", + "managerPassword": "%%readPass("", %%ldapBindUserPassword)", %else "managerPassword": "%%ldapBindUserPassword", %end if diff --git a/tmpl/nginx.conf b/tmpl/nginx.conf deleted file mode 100644 index 13b1247..0000000 --- a/tmpl/nginx.conf +++ /dev/null @@ -1,85 +0,0 @@ -user www-data; -worker_processes auto; -pid /run/nginx.pid; - -events { - worker_connections 768; - # multi_accept on; -} - -http { - - ## - # Basic Settings - ## - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - # server_tokens off; - - server_names_hash_bucket_size %%nginxBucketSize; - # server_name_in_redirect off; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - ## - # SSL Settings - ## - - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE - ssl_prefer_server_ciphers on; - - ## - # Logging Settings - ## - - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - ## - # Gzip Settings - ## - - gzip on; - gzip_disable "msie6"; - - # gzip_vary on; - # gzip_proxied any; - # gzip_comp_level 6; - # gzip_buffers 16 8k; - # gzip_http_version 1.1; - # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; - - ## - # Virtual Host Configs - ## - - include /etc/nginx/conf.d/*.conf; - include /etc/nginx/sites-enabled/*; -} - - -#mail { -# # See sample authentication script at: -# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript -# -# # auth_http localhost/auth.php; -# # pop3_capabilities "TOP" "USER"; -# # imap_capabilities "IMAP4rev1" "UIDPLUS"; -# -# server { -# listen localhost:110; -# protocol pop3; -# proxy on; -# } -# -# server { -# listen localhost:143; -# protocol imap; -# proxy on; -# } -#}