mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 05:14:08 -07:00
renamed SSL_CERT to SSL
This commit is contained in:
parent
8c288a2fd0
commit
30d1240682
24 changed files with 62 additions and 62 deletions
|
@ -205,7 +205,7 @@ v_str="$v_str TPL='$template'"
|
||||||
v_str="$v_str ALIAS='$aliases'"
|
v_str="$v_str ALIAS='$aliases'"
|
||||||
v_str="$v_str $template_data" # Inserting PHP, CGI and ELOG keys
|
v_str="$v_str $template_data" # Inserting PHP, CGI and ELOG keys
|
||||||
v_str="$v_str STATS='' STATS_AUTH=''"
|
v_str="$v_str STATS='' STATS_AUTH=''"
|
||||||
v_str="$v_str SSL_HOME='' SSL_CERT=''"
|
v_str="$v_str SSL='' SSL_HOME=''"
|
||||||
v_str="$v_str NGINX='' NGINX_EXT='' SUSPEND='no' DATE='$V_DATE'"
|
v_str="$v_str NGINX='' NGINX_EXT='' SUSPEND='no' DATE='$V_DATE'"
|
||||||
|
|
||||||
# Registering domain
|
# Registering domain
|
||||||
|
|
|
@ -82,7 +82,7 @@ upd_web_domain_values
|
||||||
del_web_config
|
del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
@ -96,7 +96,7 @@ if [ ! -z "$NGINX" ]; then
|
||||||
del_web_config
|
del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
|
|
|
@ -64,7 +64,7 @@ del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
|
|
@ -64,7 +64,7 @@ del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
@ -78,7 +78,7 @@ if [ ! -z "$NGINX" ]; then
|
||||||
del_web_config
|
del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
|
|
|
@ -68,7 +68,7 @@ conf="$V_HOME/$user/conf/nginx.conf"
|
||||||
upd_web_domain_values
|
upd_web_domain_values
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
|
|
|
@ -49,7 +49,7 @@ is_domain_suspended 'web'
|
||||||
is_package_full 'web_ssl'
|
is_package_full 'web_ssl'
|
||||||
|
|
||||||
# Check ssl is not added
|
# Check ssl is not added
|
||||||
is_web_domain_key_empty '$SSL_CERT'
|
is_web_domain_key_empty '$SSL'
|
||||||
|
|
||||||
# Checking ssl certificate
|
# Checking ssl certificate
|
||||||
is_web_domain_cert_valid
|
is_web_domain_cert_valid
|
||||||
|
@ -63,7 +63,7 @@ is_web_domain_cert_valid
|
||||||
get_web_domain_values
|
get_web_domain_values
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
SSL_CERT=$ssl
|
SSL=$ssl
|
||||||
SSL_HOME=$ssl_home
|
SSL_HOME=$ssl_home
|
||||||
|
|
||||||
# Checking ip ownership
|
# Checking ip ownership
|
||||||
|
@ -76,8 +76,8 @@ upd_web_domain_values
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
# Adding certificate to user dir
|
# Adding certificate to user dir
|
||||||
cp -f $V_USERS/$user/cert/$SSL_CERT.crt $ssl_cert
|
cp -f $V_USERS/$user/cert/$SSL.crt $ssl_cert
|
||||||
cp -f $V_USERS/$user/cert/$SSL_CERT.key $ssl_key
|
cp -f $V_USERS/$user/cert/$SSL.key $ssl_key
|
||||||
|
|
||||||
# Running template trigger
|
# Running template trigger
|
||||||
if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
||||||
|
@ -115,7 +115,7 @@ fi
|
||||||
increase_user_value "$user" '$U_WEB_SSL'
|
increase_user_value "$user" '$U_WEB_SSL'
|
||||||
|
|
||||||
# Adding ssl values
|
# Adding ssl values
|
||||||
update_web_domain_value '$SSL_CERT' "$SSL_CERT"
|
update_web_domain_value '$SSL' "$SSL"
|
||||||
update_web_domain_value '$SSL_HOME' "$SSL_HOME"
|
update_web_domain_value '$SSL_HOME' "$SSL_HOME"
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
|
|
|
@ -61,7 +61,7 @@ new=$ip
|
||||||
replace_web_config
|
replace_web_config
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
replace_web_config
|
replace_web_config
|
||||||
|
@ -75,7 +75,7 @@ if [ ! -z "$NGINX" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checking nginx
|
# Checking nginx
|
||||||
if [ ! -z "$SSL_CERT" ] && [ ! -z "$NGINX" ]; then
|
if [ ! -z "$SSL" ] && [ ! -z "$NGINX" ]; then
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
replace_web_config
|
replace_web_config
|
||||||
|
|
|
@ -44,7 +44,7 @@ is_web_domain_valid
|
||||||
is_domain_suspended 'web'
|
is_domain_suspended 'web'
|
||||||
|
|
||||||
# Check SSL is added
|
# Check SSL is added
|
||||||
is_web_domain_value_exist '$SSL_CERT'
|
is_web_domain_value_exist '$SSL'
|
||||||
|
|
||||||
# Checking ssl certificate
|
# Checking ssl certificate
|
||||||
is_web_domain_cert_valid
|
is_web_domain_cert_valid
|
||||||
|
@ -58,8 +58,8 @@ is_web_domain_cert_valid
|
||||||
get_web_domain_values
|
get_web_domain_values
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
old_ssl="$SSL_CERT"
|
old_ssl="$SSL"
|
||||||
SSL_CERT="$ssl"
|
SSL="$ssl"
|
||||||
|
|
||||||
# Preparing domain values for the template substitution
|
# Preparing domain values for the template substitution
|
||||||
upd_web_domain_values
|
upd_web_domain_values
|
||||||
|
@ -78,11 +78,11 @@ if [ ! -z "$NGINX" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Adding new certificate to user dir
|
# Adding new certificate to user dir
|
||||||
cp -f $V_USERS/$user/cert/$SSL_CERT.crt $ssl_cert
|
cp -f $V_USERS/$user/cert/$SSL.crt $ssl_cert
|
||||||
cp -f $V_USERS/$user/cert/$SSL_CERT.key $ssl_key
|
cp -f $V_USERS/$user/cert/$SSL.key $ssl_key
|
||||||
|
|
||||||
# Deleting old certificate
|
# Deleting old certificate
|
||||||
check_cert=$(grep "SSL_CERT='$old_ssl'" $V_USERS/$user/web.conf |wc -l)
|
check_cert=$(grep "SSL='$old_ssl'" $V_USERS/$user/web.conf |wc -l)
|
||||||
if [ "$check_cert" -lt 2 ]; then
|
if [ "$check_cert" -lt 2 ]; then
|
||||||
rm -f $V_HOME/$user/conf/$old_ssl.crt
|
rm -f $V_HOME/$user/conf/$old_ssl.crt
|
||||||
rm -f $V_HOME/$user/conf/$old_ssl.key
|
rm -f $V_HOME/$user/conf/$old_ssl.key
|
||||||
|
@ -94,7 +94,7 @@ fi
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Adding sslcert in config
|
# Adding sslcert in config
|
||||||
update_web_domain_value '$SSL_CERT' "$SSL_CERT"
|
update_web_domain_value '$SSL' "$SSL"
|
||||||
|
|
||||||
# Adding task to the vesta pipe
|
# Adding task to the vesta pipe
|
||||||
restart_schedule 'web'
|
restart_schedule 'web'
|
||||||
|
|
|
@ -44,7 +44,7 @@ is_web_domain_valid
|
||||||
is_domain_suspended 'web'
|
is_domain_suspended 'web'
|
||||||
|
|
||||||
# Check SSL is added
|
# Check SSL is added
|
||||||
is_web_domain_value_exist '$SSL_CERT'
|
is_web_domain_value_exist '$SSL'
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
|
@ -62,7 +62,7 @@ conf="$V_HOME/$user/conf/httpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
|
||||||
# Deleting ssl vhost
|
# Deleting ssl vhost
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
@ -139,10 +139,10 @@ if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
# Defining variables for ssl template replace
|
# Defining variables for ssl template replace
|
||||||
ssl_cert="$V_HOME/$user/conf/$SSL_CERT.crt"
|
ssl_cert="$V_HOME/$user/conf/$SSL.crt"
|
||||||
ssl_key="$V_HOME/$user/conf/$SSL_CERT.key"
|
ssl_key="$V_HOME/$user/conf/$SSL.key"
|
||||||
case $SSL_HOME in
|
case $SSL_HOME in
|
||||||
single) docroot="$V_HOME/$user/web/$domain/public_shtml" ;;
|
single) docroot="$V_HOME/$user/web/$domain/public_shtml" ;;
|
||||||
same) docroot="$V_HOME/$user/web/$domain/public_html" ;;
|
same) docroot="$V_HOME/$user/web/$domain/public_html" ;;
|
||||||
|
|
|
@ -57,16 +57,16 @@ conf="$V_HOME/$user/conf/httpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
|
||||||
# Deleting old certificate
|
# Deleting old certificate
|
||||||
check_cert=$(grep "SSL_CERT='$SSL_CERT'" $V_USERS/$user/web.conf |wc -l)
|
check_cert=$(grep "SSL='$SSL'" $V_USERS/$user/web.conf |wc -l)
|
||||||
if [ "$check_cert" -lt 2 ]; then
|
if [ "$check_cert" -lt 2 ]; then
|
||||||
rm -f $V_HOME/$user/conf/$SSL_CERT.crt
|
rm -f $V_HOME/$user/conf/$SSL.crt
|
||||||
rm -f $V_HOME/$user/conf/$SSL_CERT.key
|
rm -f $V_HOME/$user/conf/$SSL.key
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@ -77,7 +77,7 @@ if [ ! -z "$NGINX" ]; then
|
||||||
conf="$V_HOME/$user/conf/nginx.conf"
|
conf="$V_HOME/$user/conf/nginx.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
|
@ -117,7 +117,7 @@ rm -rf /var/log/httpd/domains/$domain.error*
|
||||||
del_web_domain
|
del_web_domain
|
||||||
|
|
||||||
# Checking last ssl domain
|
# Checking last ssl domain
|
||||||
ssl_dom=$(grep -v "SSL_CERT=''" $V_USERS/$user/web.conf | wc -l)
|
ssl_dom=$(grep -v "SSL=''" $V_USERS/$user/web.conf | wc -l)
|
||||||
if [ "$ssl_dom" -eq '0' ]; then
|
if [ "$ssl_dom" -eq '0' ]; then
|
||||||
sed -i "s/ Include /#Include /" $V_HOME/$user/conf/httpd.conf
|
sed -i "s/ Include /#Include /" $V_HOME/$user/conf/httpd.conf
|
||||||
fi
|
fi
|
||||||
|
@ -135,7 +135,7 @@ fi
|
||||||
# Checking last nginx domain
|
# Checking last nginx domain
|
||||||
conf='/etc/nginx/conf.d/vesta_users.conf'
|
conf='/etc/nginx/conf.d/vesta_users.conf'
|
||||||
last_nginx=$(grep -v "NGINX=''" $V_USERS/$user/web.conf)
|
last_nginx=$(grep -v "NGINX=''" $V_USERS/$user/web.conf)
|
||||||
last_snginx=$(echo "$last_nginx" | grep -v "SSL_CERT=''")
|
last_snginx=$(echo "$last_nginx" | grep -v "SSL=''")
|
||||||
if [ -z "$last_snginx" ]; then
|
if [ -z "$last_snginx" ]; then
|
||||||
sline=$(grep -n "$V_HOME/$user/conf/snginx.conf" $conf | cut -f 1 -d : )
|
sline=$(grep -n "$V_HOME/$user/conf/snginx.conf" $conf | cut -f 1 -d : )
|
||||||
if [ ! -z "$sline" ]; then
|
if [ ! -z "$sline" ]; then
|
||||||
|
|
|
@ -73,7 +73,7 @@ upd_web_domain_values
|
||||||
del_web_config
|
del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
@ -87,7 +87,7 @@ if [ ! -z "$NGINX" ]; then
|
||||||
del_web_config
|
del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
|
|
|
@ -63,7 +63,7 @@ del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
|
|
@ -64,7 +64,7 @@ del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
@ -78,7 +78,7 @@ if [ ! -z "$NGINX" ]; then
|
||||||
del_web_config
|
del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
|
|
|
@ -57,7 +57,7 @@ conf="$V_HOME/$user/conf/nginx.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
@ -75,7 +75,7 @@ update_web_domain_value '$NGINX_EXT' ''
|
||||||
# Checking last nginx domain
|
# Checking last nginx domain
|
||||||
conf='/etc/nginx/conf.d/vesta_users.conf'
|
conf='/etc/nginx/conf.d/vesta_users.conf'
|
||||||
last_nginx=$(grep -v "NGINX=''" $V_USERS/$user/web.conf)
|
last_nginx=$(grep -v "NGINX=''" $V_USERS/$user/web.conf)
|
||||||
last_snginx=$(echo "$last_nginx" | grep -v "SSL_CERT=''")
|
last_snginx=$(echo "$last_nginx" | grep -v "SSL=''")
|
||||||
if [ -z "$last_snginx" ]; then
|
if [ -z "$last_snginx" ]; then
|
||||||
sline=$(grep -n "$V_HOME/$user/conf/snginx.conf" $conf | cut -f 1 -d : )
|
sline=$(grep -n "$V_HOME/$user/conf/snginx.conf" $conf | cut -f 1 -d : )
|
||||||
if [ ! -z "$sline" ]; then
|
if [ ! -z "$sline" ]; then
|
||||||
|
|
|
@ -43,7 +43,7 @@ is_web_domain_valid
|
||||||
is_domain_suspended 'web'
|
is_domain_suspended 'web'
|
||||||
|
|
||||||
# Checking ssl is added
|
# Checking ssl is added
|
||||||
is_web_domain_value_exist '$SSL_CERT'
|
is_web_domain_value_exist '$SSL'
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
@ -54,7 +54,7 @@ is_web_domain_value_exist '$SSL_CERT'
|
||||||
get_web_domain_values
|
get_web_domain_values
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
old_ssl="$SSL_CERT"
|
old_ssl="$SSL"
|
||||||
|
|
||||||
# Deleting domain
|
# Deleting domain
|
||||||
del_web_config
|
del_web_config
|
||||||
|
@ -67,7 +67,7 @@ if [ ! -z "$NGINX" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Deleting old certificate
|
# Deleting old certificate
|
||||||
check_cert=$(grep "SSL_CERT='$old_ssl'" $V_USERS/$user/web.conf |wc -l)
|
check_cert=$(grep "SSL='$old_ssl'" $V_USERS/$user/web.conf |wc -l)
|
||||||
if [ "$check_cert" -lt 2 ]; then
|
if [ "$check_cert" -lt 2 ]; then
|
||||||
rm -f $V_HOME/$user/conf/$old_ssl.crt
|
rm -f $V_HOME/$user/conf/$old_ssl.crt
|
||||||
rm -f $V_HOME/$user/conf/$old_ssl.key
|
rm -f $V_HOME/$user/conf/$old_ssl.key
|
||||||
|
@ -79,11 +79,11 @@ fi
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Deleting ssl in config
|
# Deleting ssl in config
|
||||||
|
update_web_domain_value '$SSL' ''
|
||||||
update_web_domain_value '$SSL_HOME' ''
|
update_web_domain_value '$SSL_HOME' ''
|
||||||
update_web_domain_value '$SSL_CERT' ''
|
|
||||||
|
|
||||||
# Checking last ssl domain
|
# Checking last ssl domain
|
||||||
ssl_dom=$(grep -v "SSL_CERT=''" $V_USERS/$user/web.conf)
|
ssl_dom=$(grep -v "SSL=''" $V_USERS/$user/web.conf)
|
||||||
main_conf='/etc/httpd/conf.d/vesta.conf'
|
main_conf='/etc/httpd/conf.d/vesta.conf'
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
if [ -z "$ssl_dom" ]; then
|
if [ -z "$ssl_dom" ]; then
|
||||||
|
@ -94,7 +94,7 @@ fi
|
||||||
# Checking last nginx domain
|
# Checking last nginx domain
|
||||||
conf='/etc/nginx/conf.d/vesta_users.conf'
|
conf='/etc/nginx/conf.d/vesta_users.conf'
|
||||||
last_nginx=$(grep -v "NGINX=''" $V_USERS/$user/web.conf)
|
last_nginx=$(grep -v "NGINX=''" $V_USERS/$user/web.conf)
|
||||||
last_snginx=$(echo "$last_nginx" | grep -v "SSL_CERT=''")
|
last_snginx=$(echo "$last_nginx" | grep -v "SSL=''")
|
||||||
if [ -z "$last_snginx" ]; then
|
if [ -z "$last_snginx" ]; then
|
||||||
sline=$(grep -n "$V_HOME/$user/conf/snginx.conf" $conf | cut -f 1 -d : )
|
sline=$(grep -n "$V_HOME/$user/conf/snginx.conf" $conf | cut -f 1 -d : )
|
||||||
if [ ! -z "$sline" ]; then
|
if [ ! -z "$sline" ]; then
|
||||||
|
@ -110,7 +110,7 @@ decrease_user_value "$user" '$U_WEB_SSL'
|
||||||
restart_schedule 'web'
|
restart_schedule 'web'
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
log_history "$V_EVENT" "v_add_web_domain_ssl $user $domain $SSL_CERT $SSL_HOME"
|
log_history "$V_EVENT" "v_add_web_domain_ssl $user $domain $SSL $SSL_HOME"
|
||||||
log_event 'system' "$V_EVENT"
|
log_event 'system' "$V_EVENT"
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
|
|
@ -96,7 +96,7 @@ conf=$V_USERS/$user/web.conf
|
||||||
|
|
||||||
# Defining fileds to select
|
# Defining fileds to select
|
||||||
fields='$DOMAIN $IP $U_DISK $U_BANDWIDTH $TPL $ALIAS $PHP $CGI $ELOG $STATS
|
fields='$DOMAIN $IP $U_DISK $U_BANDWIDTH $TPL $ALIAS $PHP $CGI $ELOG $STATS
|
||||||
$STATS_AUTH $SSL_HOME $SSL_CERT $NGINX $NGINX_EXT $SUSPEND $DATE'
|
$STATS_AUTH $SSL $SSL_HOME $NGINX $NGINX_EXT $SUSPEND $DATE'
|
||||||
|
|
||||||
# Listing domains
|
# Listing domains
|
||||||
case $format in
|
case $format in
|
||||||
|
|
|
@ -37,7 +37,7 @@ conf=$V_USERS/$user/web.conf
|
||||||
|
|
||||||
# Defining fileds to select
|
# Defining fileds to select
|
||||||
fields="\$DOMAIN \$IP \$U_DISK \$U_BANDWIDTH \$TPL \$ALIAS \$PHP \$CGI \$ELOG"
|
fields="\$DOMAIN \$IP \$U_DISK \$U_BANDWIDTH \$TPL \$ALIAS \$PHP \$CGI \$ELOG"
|
||||||
fields="$fields \$STATS \$STATS_AUTH \$SSL_HOME \$SSL_CERT \$NGINX \$NGINX_EXT"
|
fields="$fields \$STATS \$STATS_AUTH \$SSL \$SSL_HOME \$NGINX \$NGINX_EXT"
|
||||||
fields="$fields \$SUSPEND \$DATE"
|
fields="$fields \$SUSPEND \$DATE"
|
||||||
|
|
||||||
# Listing domains
|
# Listing domains
|
||||||
|
|
|
@ -36,7 +36,7 @@ is_user_valid
|
||||||
conf="$V_USERS/$user/web.conf"
|
conf="$V_USERS/$user/web.conf"
|
||||||
|
|
||||||
# Defining fileds to select
|
# Defining fileds to select
|
||||||
fields="\$DOMAIN \$SSL_HOME \$SSL_CERT"
|
fields="\$DOMAIN \$SSL \$SSL_HOME"
|
||||||
|
|
||||||
# Listing domains
|
# Listing domains
|
||||||
case $format in
|
case $format in
|
||||||
|
|
|
@ -70,7 +70,7 @@ for domain in $(shell_list) ; do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
# Adding domain to the shttpd.conf
|
# Adding domain to the shttpd.conf
|
||||||
conf="$V_HOME/$user/conf/tmp_shttpd.conf"
|
conf="$V_HOME/$user/conf/tmp_shttpd.conf"
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
|
@ -90,7 +90,7 @@ for domain in $(shell_list) ; do
|
||||||
conf="$V_HOME/$user/conf/tmp_nginx.conf"
|
conf="$V_HOME/$user/conf/tmp_nginx.conf"
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
if [ "$SUSPEND" = 'yes' ]; then
|
if [ "$SUSPEND" = 'yes' ]; then
|
||||||
proxy_string="rewrite ^(.*)\$ http://$url;"
|
proxy_string="rewrite ^(.*)\$ http://$url;"
|
||||||
else
|
else
|
||||||
|
|
|
@ -61,7 +61,7 @@ del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
# Check ssl
|
# Check ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
@ -75,7 +75,7 @@ if [ ! -z "$NGINX" ]; then
|
||||||
del_web_config
|
del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
proxy_string="rewrite ^(.*)\$ http://$url;"
|
proxy_string="rewrite ^(.*)\$ http://$url;"
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
|
|
|
@ -58,7 +58,7 @@ del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
# Check ssl
|
# Check ssl
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
tpl_file="$V_WEBTPL/apache_$TPL.stpl"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
del_web_config
|
del_web_config
|
||||||
|
@ -72,7 +72,7 @@ if [ ! -z "$NGINX" ]; then
|
||||||
del_web_config
|
del_web_config
|
||||||
add_web_config
|
add_web_config
|
||||||
|
|
||||||
if [ ! -z "$SSL_CERT" ]; then
|
if [ ! -z "$SSL" ]; then
|
||||||
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
|
||||||
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
tpl_file="$V_WEBTPL/ngingx_vhost_$NGINX.stpl"
|
||||||
conf="$V_HOME/$user/conf/snginx.conf"
|
conf="$V_HOME/$user/conf/snginx.conf"
|
||||||
|
|
|
@ -65,7 +65,7 @@ is_cert_valid() {
|
||||||
|
|
||||||
is_cert_used() {
|
is_cert_used() {
|
||||||
# Parsing config
|
# Parsing config
|
||||||
check_cert=$(grep "SSL_CERT='$ssl'" $V_USERS/$user/web.conf)
|
check_cert=$(grep "SSL='$ssl'" $V_USERS/$user/*.conf)
|
||||||
|
|
||||||
# Checking result
|
# Checking result
|
||||||
if [ ! -z "$check_cert" ]; then
|
if [ ! -z "$check_cert" ]; then
|
||||||
|
|
|
@ -688,7 +688,7 @@ upd_web_domain_values() {
|
||||||
else
|
else
|
||||||
alias_string="$alias_string\n ServerAlias $server_alias"
|
alias_string="$alias_string\n ServerAlias $server_alias"
|
||||||
fi
|
fi
|
||||||
(( ++j))
|
j=2
|
||||||
server_alias=''
|
server_alias=''
|
||||||
fi
|
fi
|
||||||
if [ "$i" -eq 1 ]; then
|
if [ "$i" -eq 1 ]; then
|
||||||
|
@ -699,10 +699,10 @@ upd_web_domain_values() {
|
||||||
aliases_idn="$aliases_idn,$dalias"
|
aliases_idn="$aliases_idn,$dalias"
|
||||||
server_alias="$server_alias $dalias"
|
server_alias="$server_alias $dalias"
|
||||||
fi
|
fi
|
||||||
(( ++i))
|
i=2
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$j" -gt 1 ]; then
|
if [ $j -gt 1 ]; then
|
||||||
alias_string="$alias_string\n ServerAlias $server_alias"
|
alias_string="$alias_string\n ServerAlias $server_alias"
|
||||||
else
|
else
|
||||||
alias_string="ServerAlias $server_alias"
|
alias_string="ServerAlias $server_alias"
|
||||||
|
@ -733,8 +733,8 @@ upd_web_domain_values() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Defining SSL vars
|
# Defining SSL vars
|
||||||
ssl_cert="$V_HOME/$user/conf/$SSL_CERT.crt"
|
ssl_cert="$V_HOME/$user/conf/$SSL.crt"
|
||||||
ssl_key="$V_HOME/$user/conf/$SSL_CERT.key"
|
ssl_key="$V_HOME/$user/conf/$SSL.key"
|
||||||
case $SSL_HOME in
|
case $SSL_HOME in
|
||||||
single) docroot="$V_HOME/$user/web/$domain/public_shtml" ;;
|
single) docroot="$V_HOME/$user/web/$domain/public_shtml" ;;
|
||||||
same) docroot="$V_HOME/$user/web/$domain/public_html" ;;
|
same) docroot="$V_HOME/$user/web/$domain/public_html" ;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue