mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Misc comment improvements?
This commit is contained in:
parent
4eb93d62e9
commit
a179e9107a
1 changed files with 14 additions and 15 deletions
|
@ -14,21 +14,21 @@ do_init_regen() {
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
# Because slaptest can't test the LDAP config file
|
# Validate the new slapd config
|
||||||
# we need to regenerate the new config and after validate it
|
# To do so, we have to use the .ldif to generate the config directory
|
||||||
# regenerate LDAP config directory from slapd.ldif
|
# so we use a temporary directory slapd_new.d
|
||||||
rm -Rf /etc/ldap/slapd_new.d
|
rm -Rf /etc/ldap/slapd_new.d
|
||||||
mkdir /etc/ldap/slapd_new.d
|
mkdir /etc/ldap/slapd_new.d
|
||||||
slapadd -n0 -l /etc/ldap/slapd.ldif -F /etc/ldap/slapd_new.d/ 2>&1
|
slapadd -n0 -l /etc/ldap/slapd.ldif -F /etc/ldap/slapd_new.d/ 2>&1
|
||||||
|
# Actual validation (-Q is for quiet, -u is for dry-run)
|
||||||
# check the slapd config file at first
|
|
||||||
slaptest -Q -u -F /etc/ldap/slapd_new.d
|
slaptest -Q -u -F /etc/ldap/slapd_new.d
|
||||||
|
|
||||||
# Move to the new config
|
# "Commit" / apply the new config (meaning we delete the old one and replace
|
||||||
|
# it with the new one)
|
||||||
rm -Rf /etc/ldap/slapd.d
|
rm -Rf /etc/ldap/slapd.d
|
||||||
mv /etc/ldap/slapd_new.d /etc/ldap/slapd.d
|
mv /etc/ldap/slapd_new.d /etc/ldap/slapd.d
|
||||||
|
|
||||||
# fix some permissions
|
# Enforce permissions
|
||||||
chown root:openldap /etc/ldap/slapd.ldif
|
chown root:openldap /etc/ldap/slapd.ldif
|
||||||
chown -R openldap:openldap /etc/ldap/schema/
|
chown -R openldap:openldap /etc/ldap/schema/
|
||||||
chown -R openldap:openldap /etc/ldap/slapd.d/
|
chown -R openldap:openldap /etc/ldap/slapd.d/
|
||||||
|
@ -50,7 +50,7 @@ do_pre_regen() {
|
||||||
backup_dir="/var/backups/dc=yunohost,dc=org-${curr_backend}-$(date +%s)"
|
backup_dir="/var/backups/dc=yunohost,dc=org-${curr_backend}-$(date +%s)"
|
||||||
mkdir -p "$backup_dir"
|
mkdir -p "$backup_dir"
|
||||||
slapcat -b dc=yunohost,dc=org \
|
slapcat -b dc=yunohost,dc=org \
|
||||||
-l "${backup_dir}/dc=yunohost-dc=org.ldif"
|
-l "${backup_dir}/dc=yunohost-dc=org.ldif"
|
||||||
echo "$backup_dir" > "$tmp_backup_dir_file"
|
echo "$backup_dir" > "$tmp_backup_dir_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ do_post_regen() {
|
||||||
regen_conf_files=$1
|
regen_conf_files=$1
|
||||||
|
|
||||||
# fix some permissions
|
# fix some permissions
|
||||||
echo "Making sure we have the right permissions needed ..."
|
echo "Enforce permissions on ldap/slapd directories and certs ..."
|
||||||
# penldap user should be in the ssl-cert group to let it access the certificate for TLS
|
# penldap user should be in the ssl-cert group to let it access the certificate for TLS
|
||||||
usermod -aG ssl-cert openldap
|
usermod -aG ssl-cert openldap
|
||||||
chown root:openldap /etc/ldap/slapd.ldif
|
chown root:openldap /etc/ldap/slapd.ldif
|
||||||
|
@ -100,16 +100,15 @@ do_post_regen() {
|
||||||
backup_dir=$(cat "$tmp_backup_dir_file" 2>/dev/null || true)
|
backup_dir=$(cat "$tmp_backup_dir_file" 2>/dev/null || true)
|
||||||
|
|
||||||
# regenerate LDAP config directory from slapd.conf
|
# regenerate LDAP config directory from slapd.conf
|
||||||
echo "Regenerate LDAP config directory from slapd.conf"
|
echo "Regenerate LDAP config directory from slapd.ldif"
|
||||||
|
|
||||||
# Because slaptest can't test the LDAP config file
|
# Validate the new slapd config
|
||||||
# we need to regenerate the new config and after validate it
|
# To do so, we have to use the .ldif to generate the config directory
|
||||||
# regenerate LDAP config directory from slapd.ldif
|
# so we use a temporary directory slapd_new.d
|
||||||
rm -Rf /etc/ldap/slapd_new.d
|
rm -Rf /etc/ldap/slapd_new.d
|
||||||
mkdir /etc/ldap/slapd_new.d
|
mkdir /etc/ldap/slapd_new.d
|
||||||
slapadd -n0 -l /etc/ldap/slapd.ldif -F /etc/ldap/slapd_new.d/ 2>&1
|
slapadd -n0 -l /etc/ldap/slapd.ldif -F /etc/ldap/slapd_new.d/ 2>&1
|
||||||
|
# Actual validation (-Q is for quiet, -u is for dry-run)
|
||||||
# check the slapd config file at first
|
|
||||||
slaptest -Q -u -F /etc/ldap/slapd_new.d
|
slaptest -Q -u -F /etc/ldap/slapd_new.d
|
||||||
|
|
||||||
# Move to the new config
|
# Move to the new config
|
||||||
|
|
Loading…
Add table
Reference in a new issue