mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 13:24:25 -07:00
replaced SSL key w/ SSL_CERT
This commit is contained in:
parent
9f1d16d87a
commit
c819cdaeb0
17 changed files with 33 additions and 35 deletions
|
@ -89,8 +89,8 @@ str_repl=" ServerAlias ${new_alias_idn//,/ }"
|
|||
httpd_change_config
|
||||
|
||||
# Checking ssl domain
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Defining ssl template
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
|
|
@ -75,8 +75,8 @@ str_repl=' Options +Includes -Indexes +ExecCGI'
|
|||
httpd_change_config
|
||||
|
||||
# Checking ssl
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Get ssl template name
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
|
|
@ -66,8 +66,8 @@ str_repl=" ErrorLog /var/log/httpd/domains/$domain.error.log"
|
|||
httpd_change_config
|
||||
|
||||
# Checking ssl
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Get ssl template name
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
|
|
@ -52,7 +52,7 @@ ip=$(get_web_domain_value '$IP')
|
|||
is_sys_ip_owner
|
||||
|
||||
# Check ssl is not added
|
||||
is_web_domain_key_empty '$SSL'
|
||||
is_web_domain_key_empty '$SSL_CERT'
|
||||
|
||||
# Checking ssl certificate
|
||||
is_web_domain_cert_valid
|
||||
|
@ -121,7 +121,6 @@ fi
|
|||
increase_user_value "$user" '$U_WEB_SSL'
|
||||
|
||||
# Adding ssl values
|
||||
update_web_domain_value '$SSL' 'yes'
|
||||
update_web_domain_value '$SSL_HOME' "$tpl_option"
|
||||
update_web_domain_value '$SSL_CERT' "$cert"
|
||||
|
||||
|
|
|
@ -61,8 +61,8 @@ old_ip=$(get_web_domain_value '$IP')
|
|||
change_domain_ip "$conf" "$domain" "$ip" "$old_ip" "$tpl_file"
|
||||
|
||||
# Checking ssl
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Get tpl
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
# Argument defenition
|
||||
user="$1"
|
||||
domain="$2"
|
||||
domain=$(idn -t --quiet -u "$2" )
|
||||
domain_idn=$(idn -t --quiet -a "$domain")
|
||||
certificate="$3"
|
||||
|
||||
# Importing variables
|
||||
|
@ -42,7 +43,7 @@ is_web_domain_valid
|
|||
is_domain_suspended 'web_domains'
|
||||
|
||||
# Check SSL is added
|
||||
is_web_domain_value_exist '$SSL'
|
||||
is_web_domain_value_exist '$SSL_CERT'
|
||||
|
||||
# Checking ssl certificate
|
||||
is_web_domain_cert_valid
|
||||
|
|
|
@ -42,7 +42,7 @@ is_web_domain_valid
|
|||
is_domain_suspended 'web_domains'
|
||||
|
||||
# Check SSL is added
|
||||
is_web_domain_value_exist '$SSL'
|
||||
is_web_domain_value_exist '$SSL_CERT'
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
|
|
|
@ -60,8 +60,8 @@ conf="$V_HOME/$user/conf/httpd.conf"
|
|||
httpd_del_config
|
||||
|
||||
# Checking ssl
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Get tpl
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
@ -104,11 +104,10 @@ if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
|||
fi
|
||||
|
||||
# Checking ssl
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
if [ ! -z "$cert" = 'yes' ]; then
|
||||
# Defining variables for ssl template replace
|
||||
web_ssl_port=$(get_config_value '$WEB_SSL_PORT')
|
||||
tpl_option=$(get_web_domain_value '$SSL_HOME')
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
ssl_cert="$V_HOME/$user/conf/$cert.crt"
|
||||
ssl_key="$V_HOME/$user/conf/$cert.key"
|
||||
case $tpl_option in
|
||||
|
|
|
@ -57,8 +57,8 @@ conf="$V_HOME/$user/conf/httpd.conf"
|
|||
httpd_del_config
|
||||
|
||||
# Checking ssl
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Get tpl
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
|
|
@ -86,8 +86,8 @@ str_repl=" ServerAlias ${new_alias_idn//,/ }"
|
|||
httpd_change_config
|
||||
|
||||
# Checking ssl domain
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Defining ssl template
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
|
|
@ -75,8 +75,8 @@ str_repl=' Options +Includes -Indexes -ExecCGI'
|
|||
httpd_change_config
|
||||
|
||||
# Checking ssl
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Get ssl template name
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
|
|
@ -66,8 +66,8 @@ str_repl=" #ErrorLog /var/log/httpd/domains/$domain.error.log"
|
|||
httpd_change_config
|
||||
|
||||
# Checking ssl
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Get ssl template name
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
|
|
@ -42,7 +42,7 @@ is_web_domain_valid
|
|||
is_domain_suspended 'web_domains'
|
||||
|
||||
# Checking ssl is added
|
||||
is_web_domain_value_exist '$SSL'
|
||||
is_web_domain_value_exist '$SSL_CERT'
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
|
@ -67,7 +67,6 @@ cert=$(get_web_domain_value '$SSL_CERT' )
|
|||
tpl_option=$(get_web_domain_value '$SSL_HOME' )
|
||||
|
||||
# Deleting ssl in config
|
||||
update_web_domain_value '$SSL' 'no'
|
||||
update_web_domain_value '$SSL_HOME' ''
|
||||
update_web_domain_value '$SSL_CERT' ''
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@ str_repl=" Redirect / http://$url/"
|
|||
httpd_change_config
|
||||
|
||||
# Check ssl vhost
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
# Defining teplate name
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@ for domain in $domains; do
|
|||
httpd_change_config
|
||||
|
||||
# Check ssl vhost
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
# Defining teplate name
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
||||
|
|
|
@ -59,8 +59,8 @@ str_repl=" DocumentRoot $V_HOME/$user/domains/$domain/public_html"
|
|||
httpd_change_config
|
||||
|
||||
# Check ssl vhost
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
# Defining teplate name and ssl documentroot option
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
tpl_option=$(get_web_domain_value '$SSL_HOME')
|
||||
|
|
|
@ -67,8 +67,8 @@ for domain in $domains; do
|
|||
httpd_change_config
|
||||
|
||||
# Check ssl vhost
|
||||
ssl=$(get_web_domain_value '$SSL')
|
||||
if [ "$ssl" = 'yes' ]; then
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
# Defining teplate name and ssl documentroot option
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
tpl_opt=$(get_web_domain_value '$SSL_HOME')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue