Skip to content

Commit 6691ea2

Browse files
committed
New syntax to hide password from logger
1 parent a9cbdfe commit 6691ea2

15 files changed

+57
-115
lines changed

bin/v-add-database

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
user=$1
2020
database="$user"_"$2"
2121
dbuser="$user"_"$3"
22-
password=$4
22+
password=$4; HIDE=4
2323
type=${5-mysql}
2424
host=$6
2525
charset=${7-UTF8}
@@ -30,10 +30,6 @@ source $VESTA/func/main.sh
3030
source $VESTA/func/db.sh
3131
source $VESTA/conf/vesta.conf
3232

33-
# Hiding password
34-
A4='******'
35-
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
36-
3733

3834
#----------------------------------------------------------#
3935
# Verifications #

bin/v-add-database-host

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
type=$1
1818
host=$2
1919
dbuser=$3
20-
password=$4
20+
password=$4; HIDE=4
2121
max_db=${6-500}
2222
charsets=${7-UTF8,LATIN1,WIN1250,WIN1251,WIN1252,WIN1256,WIN1258,KOI8}
2323
template=${8-template1}
@@ -27,10 +27,6 @@ source $VESTA/func/main.sh
2727
source $VESTA/func/db.sh
2828
source $VESTA/conf/vesta.conf
2929

30-
# Hiding password
31-
A4='******'
32-
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
33-
3430
is_mysql_host_alive() {
3531
mycnf=$(mktemp)
3632
echo "[client]">$mycnf

bin/v-add-mail-account

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,14 @@ domain=$(idn -t --quiet -u "$2" )
1515
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
1616
domain_idn=$(idn -t --quiet -a "$domain")
1717
account=$(echo $3 | tr '[:upper:]' '[:lower:]')
18-
password=$4
18+
password=$4; HIDE=4
1919
quota=${5-unlimited}
2020

2121
# Includes
2222
source $VESTA/func/main.sh
2323
source $VESTA/func/domain.sh
2424
source $VESTA/conf/vesta.conf
2525

26-
# Hiding password
27-
A4='******'
28-
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
29-
3026

3127
#----------------------------------------------------------#
3228
# Verifications #

bin/v-add-user

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# Argument defenition
1313
user=$1
14-
password=$2
14+
password=$2; HIDE=2
1515
email=$3
1616
package=${4-default}
1717
fname=$5
@@ -21,10 +21,6 @@ lname=$6
2121
source $VESTA/func/main.sh
2222
source $VESTA/conf/vesta.conf
2323

24-
# Hiding password
25-
A2='******'
26-
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
27-
2824
is_user_free() {
2925
check_sysuser=$(cut -f 1 -d : /etc/passwd | grep -w "$user" )
3026
if [ ! -z "$check_sysuser" ] || [ -e "$USER_DATA" ]; then

bin/v-add-web-domain-ftp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,14 @@ user=$1
1414
domain=$(idn -t --quiet -u "$2" )
1515
domain_idn=$(idn -t --quiet -a "$domain")
1616
ftp_user=${1}_${3}
17-
password=$4
17+
password=$4; HIDE=4
1818
ftp_path=$5
1919

2020
# Includes
2121
source $VESTA/func/main.sh
2222
source $VESTA/func/domain.sh
2323
source $VESTA/conf/vesta.conf
2424

25-
# Hiding password
26-
A4='******'
27-
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
28-
2925

3026
#----------------------------------------------------------#
3127
# Verifications #

bin/v-add-web-domain-httpauth

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@
1313
user=$1
1414
domain=$2
1515
auth_user=$3
16-
password=$4
16+
password=$4; HIDE=4
1717
restart=${5-yes}
1818

1919
# Includes
2020
source $VESTA/func/main.sh
2121
source $VESTA/func/domain.sh
2222
source $VESTA/conf/vesta.conf
2323

24-
# Hiding password
25-
A4='******'
26-
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
27-
2824
# Definining htpasswd file
2925
htaccess="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.conf_htaccess"
3026
htpasswd="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.htpasswd"

bin/v-add-web-domain-stats-user

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@
1313
user=$1
1414
domain=$(idn -t --quiet -u "$2" )
1515
stats_user=$3
16-
password=$4
16+
password=$4; HIDE=4
1717

1818
# Includes
1919
source $VESTA/func/main.sh
2020
source $VESTA/func/domain.sh
2121
source $VESTA/conf/vesta.conf
2222

23-
# Hiding password
24-
A4='******'
25-
EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
26-
2723

2824
#----------------------------------------------------------#
2925
# Verifications #

0 commit comments

Comments
 (0)