Added test script for bats special focused on IDN
@@ -18,7 +18,7 @@
# Argument definition
user=$1
-domain=$2
+domain=$(idn -t --quiet -a "$2" )
ip=$3
ns1=$4
ns2=$5
@@ -14,7 +14,7 @@
-alias=$2
+alias=$(idn -t --quiet -a "$2" )
restart=$4
@@ -17,12 +17,11 @@
-domain_idn=$2
-record=$(idn -t --quiet -u "$3" )
+record=$(idn -t --quiet -a "$3" )
record=$(echo "$record" | tr '[:upper:]' '[:lower:]')
rtype=$(echo "$4"| tr '[:lower:]' '[:upper:]')
-dvalue=$(idn -t --quiet -u "$5" )
+dvalue=$(idn -t --quiet -a "$5" )
priority=$6
id=$7
restart=$8
@@ -67,8 +66,6 @@ fi
# Additional argument formatting
format_domain
format_domain_idn
-# TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
-
#----------------------------------------------------------#
# Verifications #
restart="${4-yes}"
aliases=$3
mail=${4// }
account=$3
password=$4; HIDE=4
quota=${5-unlimited}
@@ -14,8 +14,7 @@
malias=$4
@@ -27,8 +26,6 @@ source $HESTIA/conf/hestia.conf
autoreply=$4
@@ -34,8 +33,6 @@ fi
@@ -15,7 +15,7 @@
domain=$2
+domain_idn=$(idn -t --quiet -a "$2" )
email_forward=$4
# Includes
@@ -33,8 +33,6 @@ fi
antispam=${3-yes}
antivirus=${4-yes}
dkim=${5-yes}
source $HESTIA/func/main.sh
@@ -25,7 +24,6 @@ source $HESTIA/conf/hestia.conf
email="$3"
dkim_size=${3-1024}
@@ -33,8 +32,6 @@ fi
@@ -13,7 +13,7 @@
host=$3
username=$4
password=$5
ssl_dir=$3
restart="$3"
flush=$3
id=$3
@@ -20,8 +20,7 @@
restart=$4 # will be moved to the end soon
aliases=$5
@@ -33,6 +32,18 @@ source $HESTIA/func/domain.sh
source $HESTIA/func/ip.sh
source $HESTIA/conf/hestia.conf
+# Rewrite all aliases as puni code
+aliases_list=$(echo $aliases | tr "," "\n")
+aliases=''
+for alias in $aliases_list
+do
+ if [ -z "$aliases" ]; then
+ aliases=$(idn -t --quiet -a "$alias" )
+ else
+ aliases=$aliases,$(idn -t --quiet -a "$alias" )
+ fi
+done
+
@@ -15,9 +15,8 @@
-aliases=$3
+aliases=$(idn -t --quiet -a "$3" )
restart="$4"
@@ -29,7 +28,6 @@ source $HESTIA/conf/hestia.conf
format_aliases
@@ -16,8 +16,7 @@
template=${3-default}
debug=$3
ftp_user=${1}_${3}
ftp_path=$5
@@ -28,7 +27,6 @@ source $HESTIA/conf/hestia.conf
auth_user=$3
restart=${5-yes}
template=$3
default_extentions="jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,\
exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,html,htm"
@@ -19,7 +19,7 @@
ssl_home=${4-same}
restart="$5"
@@ -12,7 +12,7 @@
ssl=$3
@@ -17,8 +17,7 @@
type=$3
stats_user=$3
restart=$5
@@ -15,8 +15,7 @@
exp=$3
@@ -26,7 +25,6 @@ source $HESTIA/conf/hestia.conf
@@ -27,7 +26,7 @@ source $HESTIA/conf/hestia.conf
soa=$(echo $3 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ttl=$3
record=$4
type=$5
newid=$4
-domain=$1
+domain=$(idn -t --quiet -a "$1" )
user=$2
@@ -27,7 +26,6 @@ source $HESTIA/conf/hestia.conf
quota=$4
email=$3
@@ -13,8 +13,7 @@
restart=$3
# Argument defenition
mode=$3
@@ -21,7 +21,7 @@
# Export target domain and directory
# so they are correctly passed through to domain.sh
ftp_user=$3
ftp_path=$4
@@ -28,8 +27,6 @@ source $HESTIA/conf/hestia.conf
@@ -14,9 +14,8 @@
-new_domain=$3
+new_domain=$(idn -t --quiet -a "$3" )
@@ -31,8 +30,6 @@ source $HESTIA/conf/hestia.conf
ssl_home=$3
-src=$2
+src=$(idn -t --quiet -a "$2" )
dom_alias=$(idn -t --quiet -u "$3" )
dom_alias=$(echo $dom_alias |sed -e 's/\.*$//g' -e 's/^\.*//g')
dom_alias=$(echo $dom_alias |tr '[:upper:]' '[:lower:]')
restart="${3-yes}"
mail=$4
forward=$4
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
@@ -30,8 +29,6 @@ source $HESTIA/conf/hestia.conf
@@ -15,8 +15,8 @@
-dom_alias=$3
+dom_alias=$(idn -t --quiet -a "$3" )
restart=${4-yes}
domain_idn=$2
@@ -17,7 +17,7 @@
+domain=$(idn -t --quiet -a "$domain" )
key=$4
@@ -25,8 +24,6 @@ source $HESTIA/func/main.sh
key=$3
data=$3
data_file=$3
format=${3-shell}