first commit
This commit is contained in:
1
dockers/ldap/.env
Symbolic link
1
dockers/ldap/.env
Symbolic link
@ -0,0 +1 @@
|
||||
../../config/dockers.env
|
16
dockers/ldap/UIHooks/post-hook.sh
Executable file
16
dockers/ldap/UIHooks/post-hook.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
EMAIL=$1
|
||||
NEWPASSWORD=$(base64 -d <<< $2)
|
||||
OLDPASSWORD=$(base64 -d <<< $3)
|
||||
|
||||
URL_AGORA="https://${matterHost}.${domain}"
|
||||
mattermost_token=${LDAPUI_MM_ADMIN_TOKEN}
|
||||
|
||||
IDUSER=$(curl -s -H "Authorization: Bearer ${mattermost_token}" "${URL_AGORA}/api/v4/users/email/${EMAIL}" | awk -F "," '{print $1}' | sed -e 's/{"id"://g' -e 's/"//g')
|
||||
if [ ${IDUSER} == 'app.user.missing_account.const' ]
|
||||
then
|
||||
exit 1
|
||||
else
|
||||
curl -X PUT -i -H "Authorization: Bearer ${mattermost_token}" -d "{\"current_password\":\"${OLDPASSWORD}\",\"new_password\":\"${NEWPASSWORD}\"}" "${URL_AGORA}/api/v4/users/${IDUSER}/password"
|
||||
fi
|
21
dockers/ldap/base/acl.ldif.tmpl
Normal file
21
dockers/ldap/base/acl.ldif.tmpl
Normal file
@ -0,0 +1,21 @@
|
||||
dn: olcDatabase={2}mdb,cn=config
|
||||
changeType: modify
|
||||
replace: olcAccess
|
||||
olcAccess: {0}to attrs=userPassword,shadowLastChange
|
||||
by self write
|
||||
by anonymous auth
|
||||
by dn="cn=ldapui,ou=applications,$LDAPROOT" write
|
||||
by dn="$BINDDN" write
|
||||
by * none
|
||||
olcAccess: {1}to dn.subtree="$LDAPROOT"
|
||||
by self read
|
||||
by dn="cn=ldapui,ou=applications,$LDAPROOT" read
|
||||
by dn="cn=postfix,ou=applications,$LDAPROOT" read
|
||||
by dn="cn=mattermost,ou=applications,$LDAPROOT" read
|
||||
by dn="cn=cloud,ou=applications,$LDAPROOT" read
|
||||
by dn="cn=mobilizon,ou=applications,$LDAPROOT" read
|
||||
by dn="$BINDDN" write
|
||||
by * none
|
||||
olcAccess: {2}to *
|
||||
by dn="$BINDDN" write
|
||||
by * none
|
35
dockers/ldap/base/kaz-schema.ldif.tmpl
Normal file
35
dockers/ldap/base/kaz-schema.ldif.tmpl
Normal file
@ -0,0 +1,35 @@
|
||||
dn: cn={$KAZNUMBER}kaz,cn=schema,cn=config
|
||||
changeType: modify
|
||||
replace: olcAttributeTypes
|
||||
olcAttributeTypes: {0}( 1.3.6.1.4.1.5656.1.1.1 NAME 'mailDeSecours'
|
||||
DESC 'Adresse mail de secours'
|
||||
EQUALITY caseIgnoreIA5Match
|
||||
SUBSTR caseIgnoreIA5SubstringsMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{320} )
|
||||
olcAttributeTypes: {1}( 1.3.6.1.4.1.5656.1.1.2 NAME 'quota'
|
||||
DESC 'Quota en GO (integer)'
|
||||
EQUALITY integerMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE)
|
||||
olcAttributeTypes: {2}( 1.3.6.1.4.1.5656.1.1.3 NAME 'agoraEnabled'
|
||||
DESC 'acces a agora'
|
||||
EQUALITY caseIgnoreMatch
|
||||
SUBSTR caseIgnoreSubstringsMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE)
|
||||
olcAttributeTypes: {3}( 1.3.6.1.4.1.5656.1.1.4 NAME 'mobilizonEnabled'
|
||||
DESC 'acces a mobilizon'
|
||||
EQUALITY caseIgnoreMatch
|
||||
SUBSTR caseIgnoreSubstringsMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE)
|
||||
olcAttributeTypes: {4}( 1.3.6.1.4.1.5656.1.1.5 NAME 'identifiantKaz'
|
||||
DESC 'Identifiant Kaz prenom.nom'
|
||||
EQUALITY caseIgnoreMatch
|
||||
SUBSTR caseIgnoreSubstringsMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{320} )
|
||||
-
|
||||
replace: olcObjectClasses
|
||||
olcObjectClasses: {0}( 1.3.6.1.4.1.5656.1.2.1 NAME 'kaznaute'
|
||||
DESC 'Un kaznaute'
|
||||
SUP top AUXILIARY
|
||||
MUST ( cn $ quota $ mailDeSecours $ identifiantKaz )
|
||||
MAY ( agoraEnabled $ mobilizonEnabled )
|
||||
)
|
36
dockers/ldap/base/skeleton.ldif.tmpl
Normal file
36
dockers/ldap/base/skeleton.ldif.tmpl
Normal file
@ -0,0 +1,36 @@
|
||||
dn: ou=users,$LDAPROOT
|
||||
objectClass: organizationalUnit
|
||||
ou: users
|
||||
|
||||
dn: ou=applications,$LDAPROOT
|
||||
objectClass: organizationalUnit
|
||||
ou: system
|
||||
|
||||
dn: ou=mailForwardings,$LDAPROOT
|
||||
objectClass: organizationalUnit
|
||||
ou: mailForwardings
|
||||
|
||||
dn: cn=postfix,ou=applications,$LDAPROOT
|
||||
objectClass: person
|
||||
sn: postfix
|
||||
userPassword: $POSTFIX_PASSWORD
|
||||
|
||||
dn: cn=ldapui,ou=applications,$LDAPROOT
|
||||
objectClass: person
|
||||
sn: ldapui
|
||||
userPassword: $LDAPUI_PASSWORD
|
||||
|
||||
dn: cn=mattermost,ou=applications,$LDAPROOT
|
||||
objectClass: person
|
||||
sn: mattermost
|
||||
userPassword: $MATTERMOST_PASSWORD
|
||||
|
||||
dn: cn=cloud,ou=applications,$LDAPROOT
|
||||
objectClass: person
|
||||
sn: cloud
|
||||
userPassword: $CLOUD_PASSWORD
|
||||
|
||||
dn: cn=mobilizon,ou=applications,$LDAPROOT
|
||||
objectClass: person
|
||||
sn: mobilizon
|
||||
userPassword: $MOBILIZON_PASSWORD
|
156
dockers/ldap/br.inc.php
Normal file
156
dockers/ldap/br.inc.php
Normal file
@ -0,0 +1,156 @@
|
||||
<?php
|
||||
#==============================================================================
|
||||
# LTB Self Service Password
|
||||
#
|
||||
# Copyright (C) 2009 Clement OUDOT
|
||||
# Copyright (C) 2009 LTB-project.org
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# GPL License: http://www.gnu.org/licenses/gpl.txt
|
||||
#
|
||||
#==============================================================================
|
||||
|
||||
# 30-04-2024 : Traduction en breton par Fanch Jestin ( @fanch.jestin sur l'agora de kaz.bzh)
|
||||
|
||||
#==============================================================================
|
||||
# Breton
|
||||
#==============================================================================
|
||||
$messages['phpupgraderequired'] = "PHP a rank bezañ hizivaet";
|
||||
$messages['nophpldap'] = "Mat e vefe deoc'h staliañ PHP LDAP evit implijout an ostilh-mañ";
|
||||
$messages['nophpmhash'] = "Mat e vefe deoc'h staliañ PHP mhash evit implijout ar mod Samba";
|
||||
$messages['nokeyphrase'] = "Ret eo deoc'h kefluniañ keyphrase evit lakaat an enkripterezh da vont en-dro";
|
||||
$messages['ldaperror'] = "Ur fazi a zo bet en ur aksediñ ar c'havlec'h";
|
||||
$messages['loginrequired'] = "Lakait hoc'h anv-implijer";
|
||||
$messages['oldpasswordrequired'] = "Lakait ho ker-tremen kozh";
|
||||
$messages['newpasswordrequired'] = "Lakait ho ker-tremen nevez";
|
||||
$messages['confirmpasswordrequired'] = "Kadarnait ho ker-tremen nevez";
|
||||
$messages['passwordchanged'] = "Cheñchet eo bet ho ker-tremen";
|
||||
$messages['nomatch'] = "Ar gerioù-tremen ne glotont ket kenetrezo";
|
||||
$messages['badcredentials'] = "Anv-implijer pe ger-tremen direizh";
|
||||
$messages['passworderror'] = "Nac'het eo bet ar ger-tremen";
|
||||
$messages['title'] = "Merañ ar ger-tremen";
|
||||
$messages['login'] = "Anv-implijer";
|
||||
$messages['oldpassword'] = "Ger-tremen kozh";
|
||||
$messages['newpassword'] = "Ger-tremen nevez";
|
||||
$messages['confirmpassword'] = "Kadarnaat ar ger-tremen";
|
||||
$messages['submit'] = "Kas";
|
||||
$messages['tooshort'] = "Re verr eo ho ker-tremen";
|
||||
$messages['toobig'] = "Re hir eo ho ker-tremen";
|
||||
$messages['minlower'] = "N'eus ket a-walc'h a lizherennoù munut en ho ker-tremen";
|
||||
$messages['minupper'] = "N'eus ket a-walc'h a lizherennoù bras en ho ker-tremen";
|
||||
$messages['mindigit'] = "N'eus ket a-walc'h a sifroù en ho ker-tremen";
|
||||
$messages['minspecial'] = "N'eus ket a-walc'h a arouezioù ispisial en ho ker-tremen";
|
||||
$messages['sameasold'] = "Heñvel eo ho ker-tremen ouzh an hini kozh";
|
||||
$messages['policy'] = "Ho ker-tremen a rank doujañ d'ar redioù-mañ :";
|
||||
$messages['policyminlength'] = "Niver a arouezioù d'an nebeutañ :";
|
||||
$messages['policymaxlength'] = "Niver a arouezioù d'ar muiañ :";
|
||||
$messages['policyminlower'] = "Niver a lizherennoù munut d'an nebeutañ :";
|
||||
$messages['policyminupper'] = "Niver a lizherennoù bras d'an nebeutañ :";
|
||||
$messages['policymindigit'] = "Niver a sifroù d'an nebeutañ :";
|
||||
$messages['policyminspecial'] = "Niver a arouezioù ispisial d'an nebeutañ :";
|
||||
$messages['forbiddenchars'] = "Arouezioù berzet a zo en ho ker-tremen";
|
||||
$messages['policyforbiddenchars'] = "Arouezioù berzet :";
|
||||
$messages['policynoreuse'] = "Arabat d'ho ker-tremen nevez bezañ heñvel ouzh an hini kozh";
|
||||
$messages['questions']['birthday'] = "Peseurt deiz ez oc'h bet ganet ?";
|
||||
$messages['questions']['color'] = "Peseurt liv a blij ar muiañ deoc'h ?";
|
||||
$messages['password'] = "Ger-tremen";
|
||||
$messages['question'] = "Goulenn";
|
||||
$messages['answer'] = "Respont";
|
||||
$messages['setquestionshelp'] = "Dibabit pe cheñchit ho koublad goulenn/respont a-benn adderaouiñ ho ker-tremen. Goude-se e c'helloc'h cheñch ho ker-tremen <a href=\"?action=resetbyquestions\">amañ</a>.";
|
||||
$messages['answerrequired'] = "N'ho peus lakaet respont ";
|
||||
$messages['questionrequired'] = "N'ho peus dibabet goulenn ebet";
|
||||
$messages['passwordrequired'] = "Ho ker-tremen a rankit lakaat";
|
||||
$messages['answermoderror'] = "N'eo ket bet enrollet ho respont";
|
||||
$messages['answerchanged'] = "Enrollet eo bet ho respont";
|
||||
$messages['answernomatch'] = "N'eo ket reizh ho respont";
|
||||
$messages['resetbyquestionshelp'] = "Dibabit ur goulenn ha respontit outi a-benn adderaouiñ ho ker-tremen. En a-raok e rankit bezañ <a href=\"?action=setquestions\">enrollet ur respont</a>.";
|
||||
$messages['changehelp'] = "Lakait ho ker-tremen kozh ha dibabit unan nevez.";
|
||||
$messages['changehelpreset'] = "Ankounac'haet ho ker-tremen ganeoc'h ?";
|
||||
$messages['changehelpquestions'] = "<a href=\"?action=resetbyquestions\">Adderaouit ho ker-tremen dre respont ouzh goulennoù</a>";
|
||||
$messages['changehelptoken'] = "<a href=\"?action=sendtoken\">Adderaouit ho ker-tremen dre degemer un daeadenn dre bostel</a>";
|
||||
$messages['changehelpsms'] = "<a href=\"?action=sendsms\">Adderaouit ho ker-tremen dre SMS</a>";
|
||||
$messages['resetmessage'] = "Kevarc'h {login},\n\nKlikit amañ evit adderaouiñ ho ker-tremen :\n{url}\n\nMa n'eo ket ganeoc'h-c'hwi eo bet goulennet, na rit ket a van.";
|
||||
$messages['resetsubject'] = "Adderaouiñ ho ker-tremen";
|
||||
$messages['sendtokenhelp'] = "Lakait hoc'h anv-implijer hag ho chomlec'h postel evit adderaouiñ ho ker-tremen. Goude-se e rankoc'h klikañ war al liamm a vo bet kaset deoc'h dre bostel.";
|
||||
$messages['sendtokenhelpnomail'] = "Lakait hoc'h anv-implijer evit adderaouiñ ho ker-tremen. Goude-se e rankoc'h klikañ war al liamm a vo bet kaset deoc'h dre bostel.";
|
||||
$messages['mail'] = "Chomlec'h postel";
|
||||
$messages['mailrequired'] = "Ho chomlec'h-postel a rankit lakaat";
|
||||
$messages['mailnomatch'] = "Ne glot ket ar chomlec'h postel gant an anv-implijer merket";
|
||||
$messages['tokensent'] = "Kaset ez eus bet ur postel kadarnaat";
|
||||
$messages['tokennotsent'] = "En em gavet ez eus ur fazi pa 'z eo bet kaset ar postel kadarnaat";
|
||||
$messages['tokenrequired'] = "Ret eo kaout ar jedouer adderaouiñ";
|
||||
$messages['tokennotvalid'] = "N'eo ket reizh ar jedouer adderaouiñ";
|
||||
$messages['resetbytokenhelp'] = "Ar jedaouer kaset dre bostel a ro an tu deoc'h da adderaouiñ ho ker-tremen. Evit degemer ur jedaouer nevez, <a href=\"?action=sendtoken\">klikit amañ</a>.";
|
||||
$messages['resetbysmshelp'] = "Ar jedaouer kaset dre SMS a ro an tu deoc'h da adderaouiñ ho ker-tremen. Evit degemer ur jedaouer nevez, <a href=\"?action=sendsms\">klikit amañ</a>.";
|
||||
$messages['changemessage'] = "Kevarc'h {login},\n\nCheñchet eo bet ho ker-tremen.\n\nMa n'eo ket ganeoc'h-c'hwi eo bet goulennet, kit diouzhtu e darempred gant merour ho rouedad.";
|
||||
$messages['changesubject'] = "Cheñchet eo bet ho ker-tremen";
|
||||
$messages['badcaptcha'] = "N'eo ket bet skoet mat ar 'c'haptcha'. Klaskit adarre.";
|
||||
$messages['captcharequired'] = "Ar 'c'haptcha' a rankit skeiñ.";
|
||||
$messages['captcha'] = "Captcha";
|
||||
$messages['notcomplex'] = "Ne 'z eus ket a-walc'h a zoareoù arouezennoù disheñvel gant ho ker-stur.";
|
||||
$messages['policycomplex'] = "Niver a zoareoù arouezennoù disheñvel d'an nebeutañ :";
|
||||
$messages['sms'] = "Niverenn SMS";
|
||||
$messages['smsresetmessage'] = "Setu ho jedouer :";
|
||||
$messages['sendsmshelp'] = "Skoit hoc'h anv-implijer evit degemer ho kod-kadarnaat. Goude-se skoit ar c'hod ho po bet dre SMS.";
|
||||
$messages['smssent'] = "Kaset eo bet ar c'hod-kadarnaat dre SMS.";
|
||||
$messages['smsnotsent'] = "Ur fazi a zo bet en ur kas an SMS";
|
||||
$messages['smsnonumber'] = "N'eo ket bet kavet an niverenn pellgomz hezoug.";
|
||||
$messages['userfullname'] = "Anv klok";
|
||||
$messages['username'] = "Anv-implijer";
|
||||
$messages['smscrypttokensrequired'] = "Ret eo kaout an dibarzh crypt_tokens evit implijout ar fonktion SMS.";
|
||||
$messages['smsuserfound'] = "Gwiriit eo reizh an titouroù amañ dindan ha klikit war Kas evit degemer ho kod-kadarnaat.";
|
||||
$messages['smstoken'] = "Kod-kadarnaat";
|
||||
$messages['getuser'] = "Kavout an implijer";
|
||||
$messages['nophpmbstring'] = "Mat e vefe deoc'h staliañ PHP mbstring";
|
||||
$messages['menuquestions'] = "Question";
|
||||
$messages['menutoken'] = "Mail";
|
||||
$messages['menusms'] = "SMS";
|
||||
$messages['nophpxml'] = "Vous devriez installer PHP XML pour utiliser cet outil";
|
||||
$messages['tokenattempts'] = "Jedour didalvoud, klaskit adarre";
|
||||
$messages['emptychangeform'] = "Cheñchit ho ker-tremen";
|
||||
$messages['emptysendtokenform'] = "Degemerit ul liamm evit cheñch ho ker-tremen";
|
||||
$messages['emptyresetbyquestionsform'] = "Adderaouit ho ker-tremen";
|
||||
$messages['emptysetquestionsform'] = "Enrollit ho respont";
|
||||
$messages['emptysendsmsform'] = "Degemerit ur c'hod-adderaouiñ";
|
||||
$messages['sameaslogin'] = "Heñvel eo ho ker-tremen hag hoc'h anv-implijer";
|
||||
$messages['policydifflogin'] = "Disheñvel diouzh hoc'h anv-implijer e rank bezañ ho ker-tremen";
|
||||
$messages['changesshkeymessage'] = "Kevarc'h {login}, \n\nCheñchet eo bet hoc'h alc'hwez SSH. \n\nMa n'eo ket ganeoc'h-c'hwi eo bet goulennet, kit diouzhtu e darempred gant merour ho rouedad.";
|
||||
$messages['menusshkey'] = "Alc'hwez SSH";
|
||||
$messages['changehelpsshkey'] = "<a href=\"?action=changesshkey\">Cheñchit hoc'h alc'hwez SSH</a>";
|
||||
$messages['sshkeychanged'] = "Cheñchet eo bet hoc'h alc'hwez SSH";
|
||||
$messages['sshkeyrequired'] = "An alc'hwez SSH a rankit lakaat";
|
||||
$messages['invalidsshkey'] = "An alc'hwez SSH-mañ a seblant bezañ didalvoud";
|
||||
$messages['changesshkeysubject'] = "Cheñchet eo bet hoc'h alc'hwez SSH";
|
||||
$messages['sshkey'] = "Alc'hwez SSH";
|
||||
$messages['emptysshkeychangeform'] = "Cheñchit hoc'h alc'hwez SSH";
|
||||
$messages['changesshkeyhelp'] = "Lakait ho ker-tremen hag an alc'hwez SSH nevez.";
|
||||
$messages['sshkeyerror'] = "Nac'het eo bet an alc'hwez gant ar c'havlec'h LDAP";
|
||||
$messages['pwned'] = "Siek eo ho ker-tremen nevez, mat e vefe deoc'h cheñch anezhañ e kement lec'h ec'h implijit anezhañ";
|
||||
$messages['policypwned'] = "Arabat d'ho ker-tremen nevez bezañ anavezet e-barzh ur bon foran a c'herioù-tremen siek";
|
||||
$messages['policydiffminchars'] = "Niver a arouezennoù o-unan d'an nebeutañ :";
|
||||
$messages['diffminchars'] = "Re heñvel ouzh ho ker-tremen kozh eo an hini nevez";
|
||||
$messages['specialatends'] = "Emañ arouezenn ispisial e-unan ho ker-tremen nevez e penn-kentañ pe er penn-diwezhañ";
|
||||
$messages['policyspecialatends'] = "Arabat d'an arouezenn ispisial e-unan bezañ e penn-kentañ pe e fin ho ker-tremen nevez.";
|
||||
$messages['checkdatabeforesubmit'] = "Gwiriit an titouroù, mar plij, araok kadarnaat ar furmenn";
|
||||
$messages['forbiddenwords'] = "Gerioù difennet a zo en ho ker-stur";
|
||||
$messages['policyforbiddenwords'] = "Arabat d'ho ker-tremen bezañ ennañ :";
|
||||
$messages['forbiddenldapfields'] = "Ho ker-tremen a zo ennañ arroudoù eus ho antre LDAP";
|
||||
$messages['policyforbiddenldapfields'] = "Arabat d'ho ker-tremen bezañ ennañ perzhioù eus hoc'h antre :";
|
||||
$messages['ldap_cn'] = "anv klok";
|
||||
$messages['ldap_givenName'] = "anv-bihan";
|
||||
$messages['ldap_sn'] = "anv-familh";
|
||||
$messages['ldap_mail'] = "chomlec'h postel";
|
||||
$messages["questionspopulatehint"] = "Lakait hoc'h anv-implijer nemetken evit adkavout ar goulennoù ho peus enrollet.";
|
||||
$messages['badquality'] = "N'eo ket pinvidik a-walc'h ho ker-tremen";
|
||||
$messages['tooyoung'] = "Re nevez-cheñchet eo ho ker-tremen";
|
||||
$messages['inhistory'] = "E-barzh roll ho kerioù-tremen kozh emañ ar ger-tremen-mañ";
|
||||
$messages['throttle'] = "Re a daolioù-arnod dindan re verr amzer. Klaskit diwezhatoc'h (ma 'z eus un den ac'hanoc'h)";
|
84
dockers/ldap/docker-compose.yml
Normal file
84
dockers/ldap/docker-compose.yml
Normal file
@ -0,0 +1,84 @@
|
||||
# https://github.com/bitnami/bitnami-docker-openldap
|
||||
# https://github.com/wheelybird/ldap-user-manager
|
||||
# https://github.com/osixia/docker-openldap
|
||||
# openssl x509 -outform der -in /etc/letsencrypt/local/_wildcard.kaz.local.pem -out /etc/letsencrypt/local/_wildcard.kaz.local.crt
|
||||
# openssl pkey -in /etc/letsencrypt/local/_wildcard.kaz.local-key.pem -out /etc/letsencrypt/local/_wildcard.kaz.local.key
|
||||
# apt install ldap-utils
|
||||
# ldapsearch -x -H ldaps://kaz.local -D "cn=admin,dc=kaz,dc=local" -W
|
||||
|
||||
version: '2'
|
||||
services:
|
||||
|
||||
web:
|
||||
image: ltbproject/self-service-password
|
||||
container_name: ${ldapUIName}
|
||||
depends_on:
|
||||
- ldap
|
||||
networks:
|
||||
- ldapNet
|
||||
- postfixNet
|
||||
links:
|
||||
- ldap
|
||||
external_links:
|
||||
- ${smtpServName}:${smtpHost}
|
||||
env_file:
|
||||
- ../../secret/env-${ldapUIName}
|
||||
# ports:
|
||||
# - 389:389
|
||||
# - 636:636
|
||||
environment:
|
||||
- domain=${domain}
|
||||
- matterHost=${matterHost}
|
||||
volumes:
|
||||
- /etc/ssl:/etc/ssl:ro
|
||||
- /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /root/mkcert:/root/mkcert:ro
|
||||
- configSSP:/var/www/conf/
|
||||
- icons:/var/www/html/images/
|
||||
- lang:/var/www/lang/
|
||||
- ./UIHooks:/var/www/kaz/
|
||||
# labels:
|
||||
# - "traefik.enable=true"
|
||||
# - "traefik.http.routers.${ldapUIName}.rule=Host(`${ldapUIHost}.${domain}`)"
|
||||
# - "traefik.docker.network=ldapNet"
|
||||
|
||||
ldap:
|
||||
image: docker.io/bitnami/openldap:2.6
|
||||
container_name: ${ldapServName}
|
||||
restart: always
|
||||
|
||||
env_file:
|
||||
- ../../secret/env-${ldapServName}
|
||||
# ports:
|
||||
# - 389:389
|
||||
# - 636:636
|
||||
environment:
|
||||
- LDAP_ROOT=${ldap_root}
|
||||
- LDAP_PORT_NUMBER=389
|
||||
- LDAP_LDAPS_PORT_NUMBER=636
|
||||
- LDAP_CONFIG_ADMIN_ENABLED=yes
|
||||
- LDAP_SKIP_DEFAULT_TREE=yes
|
||||
- LDAP_ENABLE_TLS=no
|
||||
volumes:
|
||||
- openldapData:/bitnami/openldap
|
||||
#- ./ldifs:/ldifs:ro
|
||||
- /etc/letsencrypt:/etc/letsencrypt:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
networks:
|
||||
- ldapNet
|
||||
|
||||
volumes:
|
||||
openldapData:
|
||||
configSSP:
|
||||
icons:
|
||||
lang:
|
||||
|
||||
networks:
|
||||
ldapNet:
|
||||
external: true
|
||||
name: ldapNet
|
||||
postfixNet:
|
||||
external: true
|
||||
name: postfixNet
|
88
dockers/ldap/first.sh
Executable file
88
dockers/ldap/first.sh
Executable file
@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
SERV_DIR=$(cd $(dirname $0); pwd)
|
||||
KAZ_ROOT=$(cd $(dirname $0)/../..; pwd)
|
||||
. "${KAZ_ROOT}/bin/.commonFunctions.sh"
|
||||
setKazVars
|
||||
|
||||
cd $(dirname $0)
|
||||
. "${DOCKERS_ENV}"
|
||||
. "${KAZ_KEY_DIR}/env-${ldapServName}"
|
||||
. "${KAZ_KEY_DIR}/env-${ldapUIName}"
|
||||
|
||||
|
||||
checkDockerRunning "${ldapServName}" "LDAP" || exit
|
||||
|
||||
printKazMsg "\n *** Premier lancement de LDAP : Mise en place"
|
||||
|
||||
LDAP_IP=$(docker inspect -f '{{.NetworkSettings.Networks.ldapNet.IPAddress}}' ldapServ)
|
||||
MAIL_IP=$(docker inspect -f '{{.NetworkSettings.Networks.ldapNet.IPAddress}}' mailServ)
|
||||
|
||||
docker exec ${ldapUIName} bash -c "echo '${MAIL_IP} ${smtpHost}.${domain}' >> /etc/hosts"
|
||||
|
||||
BINDDN=cn=${LDAP_ADMIN_USERNAME},${ldap_root}
|
||||
DC=$(echo ${ldap_root} | cut -d',' -f1 | cut -d'=' -f2)
|
||||
|
||||
for schema in `ls schemas/`
|
||||
do
|
||||
ldapadd -H ldap://$LDAP_IP -D "cn=${LDAP_CONFIG_ADMIN_USERNAME},cn=config" -w ${LDAP_CONFIG_ADMIN_PASSWORD} -f schemas/${schema}
|
||||
done
|
||||
|
||||
echo "dn: ${ldap_root}
|
||||
objectClass: dcObject
|
||||
objectClass: organization
|
||||
dc: $DC
|
||||
o: Kaz" | ldapadd -H ldap://$LDAP_IP -D "${BINDDN}" -w ${LDAP_ADMIN_PASSWORD}
|
||||
|
||||
./update.sh
|
||||
|
||||
CONFIG_IHM="${DOCK_VOL}/ldap_configSSP/_data/config.inc.php"
|
||||
|
||||
updateVarInConf(){
|
||||
# $1 key
|
||||
# $2 val
|
||||
# $3 file
|
||||
# $4 : vide => la valeur sera encadré par des guillement, sinon c'est du php
|
||||
if grep -q "^\s*\$$1" "$3" ; then
|
||||
echo " update ${CYAN}${BOLD}$1${NC} => $2"
|
||||
# !!! les valeur ne doivent pas contenir le caractère '%'
|
||||
if [ -z "$4" ]; then
|
||||
sed -i -e "s%^\s*\(\$$1\s*=\).*$%\1 \"$2\";%" "$3"
|
||||
else
|
||||
sed -i -e "s%^\s*\(\$$1\s*=\).*$%\1 $2;%" "$3"
|
||||
fi
|
||||
else
|
||||
echo " add ${CYAN}${BOLD}$1${NC} => $2"
|
||||
if [ -z "$4" ]; then
|
||||
echo "\$$1 = \"$2\";" >> "$3"
|
||||
else
|
||||
echo "\$$1 = $2;" >> "$3"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
updateVarInConf "ldap_url" "${LDAPUI_URI}" "${CONFIG_IHM}"
|
||||
updateVarInConf "ldap_binddn" "${LDAPUI_ADMIN_BIND_DN}" "${CONFIG_IHM}"
|
||||
updateVarInConf "ldap_bindpw" "${LDAPUI_ADMIN_BIND_PWD}" "${CONFIG_IHM}"
|
||||
updateVarInConf "ldap_base" "${LDAPUI_BASE_DN}" "${CONFIG_IHM}"
|
||||
updateVarInConf "ldap_login_attribute" "cn" "${CONFIG_IHM}"
|
||||
updateVarInConf "hash" "CRYPT" "${CONFIG_IHM}"
|
||||
updateVarInConf "use_questions" "false" "${CONFIG_IHM}" "php"
|
||||
updateVarInConf "mail_from" "admin@${domain}" "${CONFIG_IHM}"
|
||||
updateVarInConf "mail_from_name" "Récupération de mot de passe Kaz" "${CONFIG_IHM}"
|
||||
updateVarInConf "mail_smtp_host" "${smtpHost}.${domain}" "${CONFIG_IHM}"
|
||||
updateVarInConf "use_sms" "false" "${CONFIG_IHM}" "php"
|
||||
updateVarInConf "keyphrase" "${LDAPUI_PASSWORD}" "${CONFIG_IHM}"
|
||||
updateVarInConf "lang" "fr" "${CONFIG_IHM}"
|
||||
updateVarInConf "allowed_lang" "array('fr', 'br');" "${CONFIG_IHM}" "php"
|
||||
updateVarInConf "mail_smtp_secure" "tls" "${CONFIG_IHM}"
|
||||
updateVarInConf "mail_address_use_ldap" "true" "${CONFIG_IHM}"
|
||||
updateVarInConf "mail_attributes" "array(\"mailDeSecours\", \"mail\")" "${CONFIG_IHM}" "php"
|
||||
updateVarInConf "pwd_min_length" "10" "${CONFIG_IHM}"
|
||||
updateVarInConf "pwd_min_special" "2" "${CONFIG_IHM}"
|
||||
updateVarInConf "pwd_show_policy" "always" "${CONFIG_IHM}"
|
||||
updateVarInConf "posthook" "/var/www/kaz/post-hook.sh" "${CONFIG_IHM}"
|
||||
updateVarInConf "posthook_password_encodebase64" "true" "${CONFIG_IHM}"
|
||||
|
||||
|
||||
docker cp "${KAZ_BIN_DIR}/look/kaz/kaz-tete.png" "${ldapUIName}:/var/www/html/images/ltb-logo.png"
|
11
dockers/ldap/schemas/kaz.ldif
Normal file
11
dockers/ldap/schemas/kaz.ldif
Normal file
@ -0,0 +1,11 @@
|
||||
# On crée un schéma vide, qui sera peuplé ensuite par update.sh
|
||||
# L'attribut mailDeSecours sert juste à bloquer la re-création si on relance
|
||||
|
||||
dn: cn=kaz,cn=schema,cn=config
|
||||
objectClass: olcSchemaConfig
|
||||
cn: kaz
|
||||
olcAttributeTypes: {0}( 1.3.6.1.4.1.5656.1.1.1 NAME 'mailDeSecours'
|
||||
DESC 'Adresse mail de secours'
|
||||
EQUALITY caseIgnoreIA5Match
|
||||
SUBSTR caseIgnoreIA5SubstringsMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{320} )
|
25
dockers/ldap/schemas/nextcloud.ldif
Normal file
25
dockers/ldap/schemas/nextcloud.ldif
Normal file
@ -0,0 +1,25 @@
|
||||
dn: cn=nextcloud,cn=schema,cn=config
|
||||
objectClass: olcSchemaConfig
|
||||
cn: nextcloud
|
||||
olcAttributeTypes: {0}( 1.3.6.1.4.1.49213.1.1.1 NAME 'nextcloudEnabled'
|
||||
DESC 'whether user or group should be available in Nextcloud'
|
||||
EQUALITY caseIgnoreMatch
|
||||
SUBSTR caseIgnoreSubstringsMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE)
|
||||
olcAttributeTypes: {1}( 1.3.6.1.4.1.49213.1.1.2 NAME 'nextcloudQuota'
|
||||
DESC 'defines how much disk space is available for the user'
|
||||
EQUALITY caseIgnoreMatch
|
||||
SUBSTR caseIgnoreSubstringsMatch
|
||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE)
|
||||
olcObjectClasses: {0}( 1.3.6.1.4.1.49213.1.2.1 NAME 'nextcloudAccount'
|
||||
DESC 'A Nextcloud account'
|
||||
SUP top AUXILIARY
|
||||
MUST ( cn )
|
||||
MAY ( nextcloudEnabled $ nextcloudQuota )
|
||||
)
|
||||
olcObjectClasses: {1}( 1.3.6.1.4.1.49213.1.2.2 NAME 'nextcloudGroup'
|
||||
DESC 'A Nextcloud group'
|
||||
SUP top AUXILIARY
|
||||
MUST ( cn )
|
||||
MAY ( nextcloudEnabled )
|
||||
)
|
41
dockers/ldap/schemas/postfixbook.ldif
Normal file
41
dockers/ldap/schemas/postfixbook.ldif
Normal file
@ -0,0 +1,41 @@
|
||||
dn: cn=postfixbook,cn=schema,cn=config
|
||||
objectClass: olcSchemaConfig
|
||||
cn: postfixbook
|
||||
olcAttributeTypes: {0}( 1.3.6.1.4.1.29426.1.10.1 NAME 'mailHomeDirectory' DE
|
||||
SC 'The absolute path to the mail user home directory' EQUALITY caseExactIA
|
||||
5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
|
||||
olcAttributeTypes: {1}( 1.3.6.1.4.1.29426.1.10.2 NAME 'mailAlias' DESC 'RFC8
|
||||
22 Mailbox - mail alias' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5Su
|
||||
bstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
|
||||
olcAttributeTypes: {2}( 1.3.6.1.4.1.29426.1.10.3 NAME 'mailUidNumber' DESC '
|
||||
UID required to access the mailbox' EQUALITY integerMatch SYNTAX 1.3.6.1.4.
|
||||
1.1466.115.121.1.27 SINGLE-VALUE )
|
||||
olcAttributeTypes: {3}( 1.3.6.1.4.1.29426.1.10.4 NAME 'mailGidNumber' DESC '
|
||||
GID required to access the mailbox' EQUALITY integerMatch SYNTAX 1.3.6.1.4.
|
||||
1.1466.115.121.1.27 SINGLE-VALUE )
|
||||
olcAttributeTypes: {4}( 1.3.6.1.4.1.29426.1.10.5 NAME 'mailEnabled' DESC 'TR
|
||||
UE to enable, FALSE to disable account' EQUALITY booleanMatch SYNTAX 1.3.6.
|
||||
1.4.1.1466.115.121.1.7 SINGLE-VALUE )
|
||||
olcAttributeTypes: {5}( 1.3.6.1.4.1.29426.1.10.6 NAME 'mailGroupMember' DESC
|
||||
'Name of a mail distribution list' EQUALITY caseExactIA5Match SYNTAX 1.3.6
|
||||
.1.4.1.1466.115.121.1.26 )
|
||||
olcAttributeTypes: {6}( 1.3.6.1.4.1.29426.1.10.7 NAME 'mailQuota' DESC 'Mail
|
||||
quota limit in kilobytes' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.14
|
||||
66.115.121.1.26 )
|
||||
olcAttributeTypes: {7}( 1.3.6.1.4.1.29426.1.10.8 NAME 'mailStorageDirectory'
|
||||
DESC 'The absolute path to the mail users mailbox' EQUALITY caseExactIA5Ma
|
||||
tch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
|
||||
olcAttributeTypes: {8}( 1.3.6.1.4.1.29426.1.10.9 NAME 'mailSieveRuleSource'
|
||||
DESC 'Sun ONE Messaging Server defined attribute' SYNTAX 1.3.6.1.4.1.1466.1
|
||||
15.121.1.26 X-ORIGIN 'Sun ONE Messaging Server' )
|
||||
olcAttributeTypes: {9}( 1.3.6.1.4.1.29426.1.10.10 NAME 'mailForwardingAddres
|
||||
s' DESC 'Address(es) to forward all incoming messages to.' EQUALITY caseIgn
|
||||
oreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{320} )
|
||||
olcObjectClasses: {0}( 1.3.6.1.4.1.29426.1.2.2.1 NAME 'PostfixBookMailAccoun
|
||||
t' DESC 'Mail account used in Postfix Book' SUP top AUXILIARY MUST mail MAY
|
||||
( mailHomeDirectory $ mailAlias $ mailGroupMember $ mailUidNumber $ mailGi
|
||||
dNumber $ mailEnabled $ mailQuota $ mailStorageDirectory $ mailSieveRuleSou
|
||||
rce ) )
|
||||
olcObjectClasses: {1}( 1.3.6.1.4.1.29426.1.2.2.2 NAME 'PostfixBookMailForwar
|
||||
d' DESC 'Mail forward used in Postfix Book' SUP top AUXILIARY MUST ( mail $
|
||||
mailAlias ) MAY mailForwardingAddress )
|
40
dockers/ldap/update.sh
Executable file
40
dockers/ldap/update.sh
Executable file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
SERV_DIR=$(cd $(dirname $0); pwd)
|
||||
KAZ_ROOT=$(cd $(dirname $0)/../..; pwd)
|
||||
. "${KAZ_ROOT}/bin/.commonFunctions.sh"
|
||||
setKazVars
|
||||
|
||||
cd $(dirname $0)
|
||||
. "${DOCKERS_ENV}"
|
||||
. "${KAZ_KEY_DIR}/env-${ldapServName}"
|
||||
|
||||
checkDockerRunning "${ldapServName}" "LDAP" || exit
|
||||
|
||||
printKazMsg "\n *** Update du LDAP"
|
||||
|
||||
LDAP_IP=$(docker inspect -f '{{.NetworkSettings.Networks.ldapNet.IPAddress}}' ldapServ)
|
||||
|
||||
BINDDN=cn=${LDAP_ADMIN_USERNAME},${ldap_root}
|
||||
DC=$(echo ${ldap_root} | cut -d',' -f1 | cut -d'=' -f2)
|
||||
|
||||
cp base/acl.ldif.tmpl /tmp/acl.ldif
|
||||
sed -i -e "s/\$BINDDN/${BINDDN}/g" /tmp/acl.ldif
|
||||
sed -i -e "s/\$LDAPROOT/${ldap_root}/g" /tmp/acl.ldif
|
||||
|
||||
cp base/skeleton.ldif.tmpl /tmp/skeleton.ldif
|
||||
sed -i -e "s/\$LDAPROOT/${ldap_root}/g" /tmp/skeleton.ldif
|
||||
sed -i -e "s%\$POSTFIX_PASSWORD%\{CRYPT\}`mkpasswd -m sha512crypt ${LDAP_POSTFIX_PASSWORD}`%g" /tmp/skeleton.ldif
|
||||
sed -i -e "s%\$LDAPUI_PASSWORD%\{CRYPT\}`mkpasswd -m sha512crypt ${LDAP_LDAPUI_PASSWORD}`%g" /tmp/skeleton.ldif
|
||||
sed -i -e "s%\$MATTERMOST_PASSWORD%\{CRYPT\}`mkpasswd -m sha512crypt ${LDAP_MATTERMOST_PASSWORD}`%g" /tmp/skeleton.ldif
|
||||
sed -i -e "s%\$CLOUD_PASSWORD%\{CRYPT\}`mkpasswd -m sha512crypt ${LDAP_CLOUD_PASSWORD}`%g" /tmp/skeleton.ldif
|
||||
sed -i -e "s%\$MOBILIZON_PASSWORD%\{CRYPT\}`mkpasswd -m sha512crypt ${LDAP_MOBILIZON_PASSWORD}`%g" /tmp/skeleton.ldif
|
||||
|
||||
cp base/kaz-schema.ldif.tmpl /tmp/kaz-schema.ldif
|
||||
KAZNUMBER=$(ldapsearch -H ldap://$LDAP_IP -D "cn=${LDAP_CONFIG_ADMIN_USERNAME},cn=config" -w ${LDAP_CONFIG_ADMIN_PASSWORD} -b cn=schema,cn=config | grep "kaz,cn=schema" | head -n1 | cut -d',' -f1 | cut -d'{' -f2 | cut -d'}' -f1)
|
||||
sed -i -e "s/\$KAZNUMBER/${KAZNUMBER}/g" /tmp/kaz-schema.ldif
|
||||
|
||||
|
||||
ldapmodify -H ldap://$LDAP_IP -D "cn=${LDAP_CONFIG_ADMIN_USERNAME},cn=config" -w ${LDAP_CONFIG_ADMIN_PASSWORD} -f /tmp/acl.ldif
|
||||
ldapmodify -H ldap://$LDAP_IP -D "cn=${LDAP_CONFIG_ADMIN_USERNAME},cn=config" -w ${LDAP_CONFIG_ADMIN_PASSWORD} -f /tmp/kaz-schema.ldif
|
||||
ldapadd -c -H ldap://$LDAP_IP -D "${BINDDN}" -w ${LDAP_ADMIN_PASSWORD} -f /tmp/skeleton.ldif
|
Reference in New Issue
Block a user