New syntax to hide password from logger

This commit is contained in:
Serghey Rodin 2015-10-21 15:57:54 +03:00
parent a9cbdfe6ff
commit 6691ea2c8b
15 changed files with 57 additions and 115 deletions

View file

@ -19,7 +19,7 @@
user=$1
database="$user"_"$2"
dbuser="$user"_"$3"
password=$4
password=$4; HIDE=4
type=${5-mysql}
host=$6
charset=${7-UTF8}
@ -30,10 +30,6 @@ source $VESTA/func/main.sh
source $VESTA/func/db.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
#----------------------------------------------------------#
# Verifications #

View file

@ -17,7 +17,7 @@
type=$1
host=$2
dbuser=$3
password=$4
password=$4; HIDE=4
max_db=${6-500}
charsets=${7-UTF8,LATIN1,WIN1250,WIN1251,WIN1252,WIN1256,WIN1258,KOI8}
template=${8-template1}
@ -27,10 +27,6 @@ source $VESTA/func/main.sh
source $VESTA/func/db.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
is_mysql_host_alive() {
mycnf=$(mktemp)
echo "[client]">$mycnf

View file

@ -15,7 +15,7 @@ domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
account=$(echo $3 | tr '[:upper:]' '[:lower:]')
password=$4
password=$4; HIDE=4
quota=${5-unlimited}
# Includes
@ -23,10 +23,6 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
#----------------------------------------------------------#
# Verifications #

View file

@ -11,7 +11,7 @@
# Argument defenition
user=$1
password=$2
password=$2; HIDE=2
email=$3
package=${4-default}
fname=$5
@ -21,10 +21,6 @@ lname=$6
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# Hiding password
A2='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
is_user_free() {
check_sysuser=$(cut -f 1 -d : /etc/passwd | grep -w "$user" )
if [ ! -z "$check_sysuser" ] || [ -e "$USER_DATA" ]; then

View file

@ -14,7 +14,7 @@ user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
ftp_user=${1}_${3}
password=$4
password=$4; HIDE=4
ftp_path=$5
# Includes
@ -22,10 +22,6 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
#----------------------------------------------------------#
# Verifications #

View file

@ -13,7 +13,7 @@
user=$1
domain=$2
auth_user=$3
password=$4
password=$4; HIDE=4
restart=${5-yes}
# Includes
@ -21,10 +21,6 @@ source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
# Definining htpasswd file
htaccess="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.conf_htaccess"
htpasswd="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.htpasswd"

View file

@ -13,17 +13,13 @@
user=$1
domain=$(idn -t --quiet -u "$2" )
stats_user=$3
password=$4
password=$4; HIDE=4
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
#----------------------------------------------------------#
# Verifications #

View file

@ -56,7 +56,6 @@ else
subj="$user → backup failed"
email=$(grep CONTACT $VESTA/data/users/admin/user.conf |cut -f 2 -d \')
fi
send_mail="$VESTA/web/inc/mail-wrapper.php"
# Check load average
la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.')
@ -137,8 +136,8 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
# Parsing domain exclusions
conf="$USER_DATA/web.conf"
for domain in $(search_objects 'web' 'SUSPENDED' "*" 'DOMAIN'); do
check_exl=$(echo -e "${WEB//,/\n}" |grep "^$domain$")
if [ -z "$check_exl" ]; then
exclusion=$(echo -e "$WEB" |tr ',' '\n' |grep "^$domain$")
if [ -z "$exclusion" ]; then
web_list="$web_list $domain"
else
echo "$(date "+%F %T") excluding $domain"
@ -212,9 +211,9 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
fargs+=(-not)
fargs+=(-path)
fargs+=("./logs*")
check_exlusion=$(echo -e "${WEB//,/\n}" | grep "^$domain:")
if [ ! -z "$check_exlusion" ]; then
xdirs="$(echo -e "${check_exlusion//:/\n}" |grep -v $domain)"
exlusion=$(echo -e "$WEB" |tr ',' '\n' |grep "^$domain:")
if [ ! -z "$exlusion" ]; then
xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)"
for xpath in $xdirs; do
xpath="$(echo $xpath |sed -e 's/\/*$//' -e 's/^\/*//')"
fargs+=(-not)
@ -259,8 +258,8 @@ if [ ! -z "$DNS_SYSTEM" ] && [ "$DNS" != '*' ]; then
# Parsing domain exclusions
for domain in $(search_objects 'dns' 'SUSPENDED' "*" 'DOMAIN'); do
check_exl=$(echo -e "${DNS//,/\n}" |grep "^$domain$")
if [ -z "$check_exl" ]; then
exclusion=$(echo "$DNS" |tr ',' '\n' |grep "^$domain$")
if [ -z "$exclusion" ]; then
dns_list="$dns_list $domain"
else
echo "$(date "+%F %T") excluding $domain"
@ -312,7 +311,7 @@ if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL" != '*' ]; then
# Parsing domain exclusions
conf="$USER_DATA/mail.conf"
for domain in $(search_objects 'mail' 'SUSPENDED' "*" 'DOMAIN'); do
check_exl=$(echo -e "${MAIL//,/\n}" |grep "^$domain$")
check_exl=$(echo "$MAIL" |tr ',' '\n' |grep "^$domain$")
if [ -z "$check_exl" ]; then
mail_list="$mail_list $domain"
else
@ -348,8 +347,8 @@ if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL" != '*' ]; then
# Backup emails
cd $HOMEDIR/$user/mail/$domain_idn
for account in $(ls); do
exclusion=$(echo -e "${MAIL//,/\n}" |grep "$domain:")
exclusion=$(echo -e "${exclusion//:/\n}" |grep "^$account$")
exclusion=$(echo "$MAIL" |tr ',' '\n' |grep "$domain:")
exclusion=$(echo "$exclusion" |tr ':' '\n' |grep "^$account$")
# Checking exlusions
if [ -z "$exclusion" ] && [[ "$MAIL_SYSTEM" =~ exim ]]; then
@ -390,8 +389,8 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB" != '*' ]; then
# Parsing database exclusions
for database in $(search_objects 'db' 'SUSPENDED' "*" 'DB'); do
check_exl=$(echo -e "${DB//,/\n}" |grep "^$database$")
if [ -z "$check_exl" ]; then
exclusion=$(echo "$DB" |tr ',' '\n' |grep "^$database$")
if [ -z "$exclusion" ]; then
db_list="$db_list $database"
else
echo "$(date "+%F %T") excluding $database"
@ -477,9 +476,8 @@ if [ "$USER" != '*' ]; then
if [ -e "$USER_DATA/backup-excludes.conf" ]; then
source $USER_DATA/backup-excludes.conf
fi
exlusion_list=$(echo -e "${USER//,/\n}")
fargs=()
for xpath in $exlusion_list; do
for xpath in $(echo "$USER" |tr ',' '\n'); do
fargs+=(-not)
fargs+=(-path)
fargs+=("./$xpath*")
@ -491,12 +489,12 @@ if [ "$USER" != '*' ]; then
set -f
i=0
for udir in $(ls -a |egrep -v "conf|web|dns|mail|^\.\.$|^\.$"); do
check_exl=$(echo -e "${USER//,/\n}" |grep "^$udir$")
if [ -z "$check_exl" ]; then
exclusion=$(echo "$USER" |tr ',' '\n' |grep "^$udir$")
if [ -z "$exclusion" ]; then
((i ++))
udir_list="$udir_list $udir"
echo -e "$(date "+%F %T") adding directory $udir"
msg="$msg\n$(date "+%F %T") adding directory $udir"
echo -e "$(date "+%F %T") adding $udir"
msg="$msg\n$(date "+%F %T") adding $udir"
# Backup files
find ./$udir ${fargs[@]} -type f -or -type l -print0 |\

View file

@ -13,17 +13,13 @@
type=$1
host=$2
dbuser=$3
password=$4
password=$4; HIDE=4
# Includes
source $VESTA/func/main.sh
source $VESTA/func/db.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
#----------------------------------------------------------#
# Verifications #

View file

@ -13,17 +13,13 @@
# Argument defenition
user=$1
database=$2
password=$3
password=$3; HIDE=3
# Includes
source $VESTA/func/main.sh
source $VESTA/func/db.sh
source $VESTA/conf/vesta.conf
# Hiding password
A3='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
#----------------------------------------------------------#
# Verifications #

View file

@ -13,7 +13,7 @@
user=$1
database=$2
dbuser="$user"_"$3"
password=$4
password=$4; HIDE=4
# Includes
source $VESTA/func/main.sh
@ -21,10 +21,6 @@ source $VESTA/func/db.sh
source $VESTA/func/rebuild.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
#----------------------------------------------------------#
# Verifications #

View file

@ -15,17 +15,13 @@ domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
account=$3
password=$4
password=$4; HIDE=4
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
#----------------------------------------------------------#
# Verifications #

View file

@ -11,16 +11,12 @@
# Argument defenition
user=$1
password=$2
password=$2; HIDE=2
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# Hiding password
A2="******"
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
#----------------------------------------------------------#
# Verifications #

View file

@ -14,17 +14,13 @@ user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
ftp_user=$3
password=$4
password=$4; HIDE=4
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4="******"
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
#----------------------------------------------------------#
# Verifications #

View file

@ -13,17 +13,13 @@
user=$1
domain=$2
auth_user=$3
password=$4
password=$4; HIDE=4
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Hiding password
A4='******'
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
# Definining htpasswd file
htpasswd="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.htpasswd"