mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
Move ldapscript setup to users module setup.
This commit is contained in:
parent
f01575e2ea
commit
401d3870f6
18
actions/ldap
18
actions/ldap
@ -121,24 +121,6 @@ remove_user_from_group()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
setup()
|
|
||||||
{
|
|
||||||
# XXX: Password setting on users is disabled as changing passwords
|
|
||||||
# using SASL Auth is not supported.
|
|
||||||
cat <<EOF | augtool --noload --noautoload --transform 'Shellvars incl /etc/ldapscripts/ldapscripts.conf' > /dev/null
|
|
||||||
set /files/etc/ldapscripts/ldapscripts.conf/SERVER '"ldapi://"'
|
|
||||||
set /files/etc/ldapscripts/ldapscripts.conf/SASLAUTH '"EXTERNAL"'
|
|
||||||
set /files/etc/ldapscripts/ldapscripts.conf/SUFFIX '"dc=thisbox"'
|
|
||||||
set /files/etc/ldapscripts/ldapscripts.conf/USUFFIX '"ou=Users"'
|
|
||||||
set /files/etc/ldapscripts/ldapscripts.conf/GSUFFIX '"ou=Groups"'
|
|
||||||
set /files/etc/ldapscripts/ldapscripts.conf/PASSWORDGEN '"true"'
|
|
||||||
save
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
setup
|
|
||||||
|
|
||||||
command=$1
|
command=$1
|
||||||
shift
|
shift
|
||||||
case $command in
|
case $command in
|
||||||
|
|||||||
@ -24,9 +24,11 @@ Configuration helper for the LDAP user directory
|
|||||||
import argparse
|
import argparse
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
import augeas
|
||||||
from plinth import action_utils
|
from plinth import action_utils
|
||||||
|
|
||||||
ACCESS_CONF = '/etc/security/access.conf'
|
ACCESS_CONF = '/etc/security/access.conf'
|
||||||
|
LDAPSCRIPTS_CONF = '/etc/ldapscripts/ldapscripts.conf'
|
||||||
|
|
||||||
|
|
||||||
def parse_arguments():
|
def parse_arguments():
|
||||||
@ -117,6 +119,22 @@ replace: olcRootDN
|
|||||||
olcRootDN: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
|
olcRootDN: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
|
||||||
''')
|
''')
|
||||||
|
|
||||||
|
aug = augeas.Augeas(flags=augeas.Augeas.NO_LOAD +
|
||||||
|
augeas.Augeas.NO_MODL_AUTOLOAD)
|
||||||
|
aug.set('/augeas/load/Shellvars/lens', 'Shellvars.lns')
|
||||||
|
aug.set('/augeas/load/Shellvars/incl[last() + 1]', LDAPSCRIPTS_CONF)
|
||||||
|
aug.load()
|
||||||
|
|
||||||
|
# XXX: Password setting on users is disabled as changing passwords
|
||||||
|
# using SASL Auth is not supported.
|
||||||
|
aug.set('/files' + LDAPSCRIPTS_CONF + '/SERVER', '"ldapi://"')
|
||||||
|
aug.set('/files' + LDAPSCRIPTS_CONF + '/SASLAUTH', '"EXTERNAL"')
|
||||||
|
aug.set('/files' + LDAPSCRIPTS_CONF + '/SUFFIX', '"dc=thisbox"')
|
||||||
|
aug.set('/files' + LDAPSCRIPTS_CONF + '/USUFFIX', '"ou=Users"')
|
||||||
|
aug.set('/files' + LDAPSCRIPTS_CONF + '/GSUFFIX', '"ou=Groups"')
|
||||||
|
aug.set('/files' + LDAPSCRIPTS_CONF + '/PASSWORDGEN', '"true"')
|
||||||
|
aug.save()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Parse arguments and perform all duties"""
|
"""Parse arguments and perform all duties"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user