Bladeren bron

Split long txt records to 255 chunks to prevent bind issues
Thanks to @setiseta for the solution and @kpapad904 for pointing us to it. This commit also closes #678, because the to long txt records will now be splitted up and also closes #693 because it was the last, suggested pr took over from vesta.

Raphael Schneeberger 6 jaren geleden
bovenliggende
commit
ba6b902c01
2 gewijzigde bestanden met toevoegingen van 5 en 0 verwijderingen
  1. 1 0
      CHANGELOG.md
  2. 4 0
      func/domain.sh

+ 1 - 0
CHANGELOG.md

@@ -67,6 +67,7 @@ All notable changes to this project will be documented in this file.
 - Hardening nginx configuration, drop TLSv1.1 support.
 - Fixed excluding folders named "logs" from restore backup, thanks to @davidgolsen.
 - Fixed typo in delete psql database part, thanks to @joshbmarshall.
+- Split long txt records to 255 chunks to prevent bind issues, thanks to @setiseta.
 
 ## [1.0.6] - 2019-09-24 - Hotfix
 ### Bugfixes

+ 4 - 0
func/domain.sh

@@ -466,6 +466,10 @@ update_domain_zone() {
             VALUE=$(idn --quiet -a -t "$VALUE")
         fi
 
+        if [ "$TYPE" = 'TXT' ] && [[ ${VALUE:0:1} != '"' ]]; then
+            VALUE=$(echo $VALUE | fold -w 255 | xargs -I '$' echo -n '"$"')
+        fi
+
         if [ "$SUSPENDED" != 'yes' ]; then
             eval echo -e "\"$fields\""|sed "s/%quote%/'/g" >> $zn_conf
         fi