Tweak to better organise the prep steps
This commit is contained in:
parent
b8c31a541e
commit
6b57383a4c
@ -47,7 +47,7 @@ check_gluerecords() {
|
|||||||
|
|
||||||
echo -ne "done."
|
echo -ne "done."
|
||||||
}
|
}
|
||||||
do_serviceprep() {
|
do_serviceprep_dns() {
|
||||||
# Create DNS records for newdomain
|
# Create DNS records for newdomain
|
||||||
docker exec pdns pdnsutil create-zone $DOMAIN_NEW
|
docker exec pdns pdnsutil create-zone $DOMAIN_NEW
|
||||||
docker exec pdns pdnsutil set-kind $DOMAIN_NEW native
|
docker exec pdns pdnsutil set-kind $DOMAIN_NEW native
|
||||||
@ -63,13 +63,8 @@ do_serviceprep() {
|
|||||||
docker exec pdns pdnsutil add-record $DOMAIN_NEW @ TXT 86400 "\"v=spf1 mx a:$DOMAIN_NEW ~all\""
|
docker exec pdns pdnsutil add-record $DOMAIN_NEW @ TXT 86400 "\"v=spf1 mx a:$DOMAIN_NEW ~all\""
|
||||||
docker exec pdns pdnsutil add-record $DOMAIN_NEW \* CNAME 86400 www.$DOMAIN_NEW
|
docker exec pdns pdnsutil add-record $DOMAIN_NEW \* CNAME 86400 www.$DOMAIN_NEW
|
||||||
docker exec pdns pdnsutil add-record $DOMAIN_NEW @ A 86400 $EXTERNALIP
|
docker exec pdns pdnsutil add-record $DOMAIN_NEW @ A 86400 $EXTERNALIP
|
||||||
|
}
|
||||||
# Set SMTP user based on if fcore exists
|
do_serviceprep_ldap() {
|
||||||
[[ $(docker exec ldap slapcat | grep fcore) ]] && SMTPUSER="fcore" || SMTPUSER="admin"
|
|
||||||
|
|
||||||
# Other pre-prep service stuff
|
|
||||||
docker exec -u 33 nextcloud /var/www/html/occ -vv ldap:delete-config s01
|
|
||||||
docker exec -u 33 nextcloud /var/www/html/occ app:disable user_ldap
|
|
||||||
docker exec ldap bash -c "slapcat > /root/convertdomain.ldif"
|
docker exec ldap bash -c "slapcat > /root/convertdomain.ldif"
|
||||||
|
|
||||||
# Remove first lines of ldap config, replace dc= with new domain, replace domain name
|
# Remove first lines of ldap config, replace dc= with new domain, replace domain name
|
||||||
@ -221,9 +216,14 @@ convert_ldap() {
|
|||||||
# Start service with command to make sure it's up before proceeding
|
# Start service with command to make sure it's up before proceeding
|
||||||
start_service_convert "ldap" "nc -z $SERVICE_IP 636 &> /dev/null"
|
start_service_convert "ldap" "nc -z $SERVICE_IP 636 &> /dev/null"
|
||||||
|
|
||||||
|
# DEBUG output of the ldif
|
||||||
|
echo "/root/convertdomain1.ldif before import"
|
||||||
|
echo "---------------------------------------"
|
||||||
|
cat /federated/apps/ldap/data/root/convertdomain1.ldif
|
||||||
|
|
||||||
# This imports the modified LDAP configuration above
|
# This imports the modified LDAP configuration above
|
||||||
docker exec ldap bash -c "slapadd -v -l /root/convertdomain1.ldif"
|
docker exec ldap bash -c "slapadd -v -l /root/convertdomain1.ldif"
|
||||||
# [ $? -ne 0 ] && failcheck "Couldn't slapadd convertdomain1.ldif inside ldap container"
|
[ $? -ne 0 ] && failcheck "Couldn't slapadd convertdomain1.ldif inside ldap container"
|
||||||
|
|
||||||
echo -ne "done."
|
echo -ne "done."
|
||||||
}
|
}
|
||||||
@ -280,6 +280,10 @@ convert_nextcloud() {
|
|||||||
#### Convert Nextcloud
|
#### Convert Nextcloud
|
||||||
echo -ne "\n* Converting nextcloud.."
|
echo -ne "\n* Converting nextcloud.."
|
||||||
|
|
||||||
|
# Disable Nextcloud LDAP
|
||||||
|
docker exec -u 33 nextcloud /var/www/html/occ -vv ldap:delete-config s01
|
||||||
|
docker exec -u 33 nextcloud /var/www/html/occ app:disable user_ldap
|
||||||
|
|
||||||
convert_generic nextcloud
|
convert_generic nextcloud
|
||||||
sed -i "s#$DOMAIN#$DOMAIN_NEW#g" /federated/apps/nextcloud/data/var/www/html/config/config.php
|
sed -i "s#$DOMAIN#$DOMAIN_NEW#g" /federated/apps/nextcloud/data/var/www/html/config/config.php
|
||||||
|
|
||||||
@ -1038,11 +1042,16 @@ DOMAIN_LDAP_DC="DC=${DOMAIN//./,DC=}"
|
|||||||
ADMINPASS=`cat /federated/bin/.adminpass | head -1`
|
ADMINPASS=`cat /federated/bin/.adminpass | head -1`
|
||||||
LDAP_SECRET=`cat /federated/apps/ldap/.ldap.secret`
|
LDAP_SECRET=`cat /federated/apps/ldap/.ldap.secret`
|
||||||
|
|
||||||
|
# Set SMTP user based on if fcore exists
|
||||||
|
[[ $(docker exec ldap slapcat | grep fcore) ]] && SMTPUSER="fcore" || SMTPUSER="admin"
|
||||||
|
|
||||||
echo -ne "\n\nConverting Federated Core $DOMAIN to $DOMAIN_NEW.\n\n"
|
echo -ne "\n\nConverting Federated Core $DOMAIN to $DOMAIN_NEW.\n\n"
|
||||||
|
|
||||||
|
# Key initial steps
|
||||||
check_gluerecords
|
check_gluerecords
|
||||||
#get_installedapps
|
#get_installedapps
|
||||||
do_serviceprep
|
do_serviceprep_dns
|
||||||
|
do_serviceprep_ldap
|
||||||
|
|
||||||
# Stop all services
|
# Stop all services
|
||||||
/federated/bin/stop all &> /dev/null
|
/federated/bin/stop all &> /dev/null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user