@@ -39,53 +39,6 @@ function setup() {
3939 source $HESTIA /func/ip.sh
4040}
4141
42- function validate_web_domain() {
43- local user=$1
44- local domain=$2
45- local webproof=$3
46- local webpath=${4}
47-
48- refute [ -z " $user " ]
49- refute [ -z " $domain " ]
50- refute [ -z " $webproof " ]
51-
52- source $HESTIA /func/ip.sh
53-
54- run v-list-web-domain $user $domain
55- assert_success
56-
57- USER_DATA=$HESTIA /data/users/$user
58- local domain_ip=$( get_object_value ' web' ' DOMAIN' " $domain " ' $IP' )
59- SSL=$( get_object_value ' web' ' DOMAIN' " $domain " ' $SSL' )
60- domain_ip=$( get_real_ip " $domain_ip " )
61-
62- if [ ! -z $webpath ]; then
63- domain_docroot=$( get_object_value ' web' ' DOMAIN' " $domain " ' $CUSTOM_DOCROOT' )
64- if [ -n " $domain_docroot " ] && [ -d " $domain_docroot " ]; then
65- assert_file_exist " ${domain_docroot} /${webpath} "
66- else
67- assert_file_exist " ${HOMEDIR} /${user} /web/${domain} /public_html/${webpath} "
68- fi
69- fi
70-
71- # Test HTTP
72- # Curl hates UTF domains so convert them to ascci.
73- domain_idn=$( idn2 $domain )
74- run curl --location --silent --show-error --insecure --resolve " ${domain_idn} :80:${domain_ip} " " http://${domain_idn} /${webpath} "
75- assert_success
76- assert_output --partial " $webproof "
77-
78- # Test HTTPS
79- if [ " $SSL " = " yes" ]; then
80- run v-list-web-domain-ssl $user $domain
81- assert_success
82-
83- run curl --location --silent --show-error --insecure --resolve " ${domain_idn} :443:${domain_ip} " " https://${domain_idn} /${webpath} "
84- assert_success
85- assert_output --partial " $webproof "
86- fi
87- }
88-
8942function validate_web_domain() {
9043 local user=$1
9144 local domain=$2
0 commit comments