Skip to content

Commit 8b90f99

Browse files
committed
Merge remote-tracking branch 'serghey-rodin/master'
# Conflicts: # web/inc/i18n/tw.php
2 parents b557ba4 + 1689ea3 commit 8b90f99

File tree

2,171 files changed

+85499
-10458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,171 files changed

+85499
-10458
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.tar
2+
*.zip
3+
*.gzip
4+
*.gz
File renamed without changes.

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,23 @@ Connect to your server as root via SSH
1313
ssh root@your.server
1414
```
1515

16-
Download the installation script
16+
Download the installation script, and run it:
1717
```bash
18-
curl -O http://vestacp.com/pub/vst-install.sh
18+
curl http://vestacp.com/pub/vst-install.sh | bash
1919
```
2020

21-
Run it
21+
If the above example does not work, try this 2 step method:
22+
23+
Download the installation script:
24+
```bash
25+
curl -O http://vestacp.com/pub/vst-install.sh
26+
```
27+
Then run it:
2228
```bash
2329
bash vst-install.sh
2430
```
2531

2632
License
2733
----------------------------
28-
Vesta is licensed under [GPL v3 ](https://github.com/serghey-rodin/vesta/blob/master/LICENSE.txt) license
34+
Vesta is licensed under [GPL v3 ](https://github.com/serghey-rodin/vesta/blob/master/LICENSE) license
2935

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
# info: update user notification
3+
# options: USER NOTIFICATION
4+
#
5+
# The function updates user notification.
6+
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
11+
12+
# Argument definition
13+
user=$1
14+
nid=$2
15+
16+
# Includes
17+
source $VESTA/func/main.sh
18+
source $VESTA/conf/vesta.conf
19+
20+
21+
#----------------------------------------------------------#
22+
# Verifications #
23+
#----------------------------------------------------------#
24+
25+
check_args '2' "$#" 'USER NOTIFICATION'
26+
validate_format 'user' 'nid'
27+
is_object_valid 'user' 'USER' "$user"
28+
29+
30+
#----------------------------------------------------------#
31+
# Action #
32+
#----------------------------------------------------------#
33+
34+
# Updating notification
35+
update_object_value 'notifications' 'NID' "$nid" '$ACK' 'yes' 2>/dev/null
36+
37+
# Checking last notification
38+
if [ -e "$USER_DATA/notifications.conf" ]; then
39+
if [ -z "$(grep NID= $USER_DATA/notifications.conf)" ]; then
40+
notice='no'
41+
fi
42+
if [ -z "$(grep "ACK='no'" $USER_DATA/notifications.conf)" ]; then
43+
notice='no'
44+
fi
45+
else
46+
notice='no'
47+
fi
48+
49+
50+
#----------------------------------------------------------#
51+
# Vesta #
52+
#----------------------------------------------------------#
53+
54+
# Updating notification counter
55+
if [ "$notice" = 'no' ]; then
56+
if [ -z "$(grep NOTIFICATIONS $USER_DATA/user.conf)" ]; then
57+
sed -i "s/^TIME/NOTIFICATIONS='no'\nTIME/g" $USER_DATA/user.conf
58+
else
59+
update_user_value "$user" '$NOTIFICATIONS' "no"
60+
fi
61+
fi
62+
63+
# Logging
64+
log_event "$OK" "$EVENT"
65+
66+
exit

bin/v-activate-vesta-license

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/bash
2+
# info: activate vesta license
3+
# options: MODULE LICENSE
4+
#
5+
# The function activates and registers the vesta license
6+
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
11+
12+
# Argument definition
13+
module=$(echo $1 | tr '[:lower:]' '[:upper:]')
14+
license=$2
15+
16+
# Importing system environment
17+
source /etc/profile
18+
19+
# Includes
20+
source $VESTA/func/main.sh
21+
source $VESTA/conf/vesta.conf
22+
23+
24+
#----------------------------------------------------------#
25+
# Verifications #
26+
#----------------------------------------------------------#
27+
28+
# Checking arg number
29+
check_args '2' "$#" 'MODULE LICENSE'
30+
31+
32+
#----------------------------------------------------------#
33+
# Action #
34+
#----------------------------------------------------------#
35+
36+
# Activating license
37+
v_host='https://vestacp.com/checkout'
38+
answer=$(curl -s $v_host/activate.php?licence_key=$license&module=$module)
39+
check_result $? "cant' connect to vestacp.com " $E_CONNECT
40+
41+
# Checking server answer
42+
if [[ "$answer" != '0' ]]; then
43+
echo "Error: $module license $license is invalid"
44+
exit $E_INVALID
45+
fi
46+
47+
48+
#----------------------------------------------------------#
49+
# Vesta #
50+
#----------------------------------------------------------#
51+
52+
# Updating vesta.conf
53+
if [ -z "$(grep "${module}_KEY" $VESTA/conf/vesta.conf)" ]; then
54+
echo "${module}_KEY='$license'" >> $VESTA/conf/vesta.conf
55+
else
56+
sed -i "s/${module}_KEY=.*/${module}_KEY='$license'/g" $VESTA/conf/vesta.conf
57+
fi
58+
59+
# Activating sftpjail
60+
if [ "$module" = 'SFTPJAIL' ]; then
61+
setsid $BIN/v-add-sys-sftp-jail 2>/dev/null
62+
fi
63+
64+
# Logging
65+
log_event "$OK" "$EVENT"
66+
67+
exit

bin/v-add-backup-host

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,25 @@
22
# info: add backup host
33
# options: TYPE HOST USERNAME PASSWORD [PATH] [PORT]
44
#
5-
# The function adds backup host
5+
# This function adds a backup host
66

77

88
#----------------------------------------------------------#
99
# Variable&Function #
1010
#----------------------------------------------------------#
1111

12-
# Argument defenition
12+
# Argument definition
1313
type=$1
1414
host=$2
1515
user=$3
16-
password=$4
16+
password=$4; HIDE=4
1717
path=${5-/backup}
1818
port=$6
1919

2020
# Includes
2121
source $VESTA/func/main.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
# Defining ftp command function
2925
ftpc() {
3026
ftp -p -n $host $port <<EOF
@@ -102,11 +98,7 @@ if [ "$type" != 'local' ];then
10298
is_password_valid
10399
if [ "$type" = 'sftp' ]; then
104100
which expect >/dev/null 2>&1
105-
if [ $? -ne 0 ];then
106-
echo "Error: expect utility not found"
107-
log_event "$E_NOTEXIST" "$EVENT"
108-
exit $E_NOTEXIST
109-
fi
101+
check_result $? "expect command not found" $E_NOTEXIST
110102
fi
111103
fi
112104

bin/v-add-cron-job

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Variable&Function #
1111
#----------------------------------------------------------#
1212

13-
# Argument defenition
13+
# Argument definition
1414
user=$1
1515
min=$2
1616
hour=$3
@@ -25,7 +25,7 @@ restart=$9
2525
source $VESTA/func/main.sh
2626
source $VESTA/conf/vesta.conf
2727

28-
# Assing new value
28+
# Assigning new value
2929
A7="$command"
3030

3131

@@ -72,11 +72,9 @@ sync_cron_jobs
7272
# Increasing cron value
7373
increase_user_value $user '$U_CRON_JOBS'
7474

75-
# Restart crond
75+
# Restarting crond
7676
$BIN/v-restart-cron
77-
if [ $? -ne 0 ]; then
78-
exit $E_RESTART
79-
fi
77+
check_result $? "Cron restart failed" >/dev/null
8078

8179
# Logging
8280
log_history "added cron job $job"

bin/v-add-cron-reports

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: add cron reports
3-
# opions: user
3+
# options: user
44
#
55
# The script for enabling reports on cron tasks and administrative
66
# notifications.
@@ -10,7 +10,7 @@
1010
# Variable&Function #
1111
#----------------------------------------------------------#
1212

13-
# Argument defenition
13+
# Argument definition
1414
user=$1
1515

1616
# Includes
@@ -46,9 +46,7 @@ sync_cron_jobs
4646

4747
# Restart crond
4848
$BIN/v-restart-cron
49-
if [ $? -ne 0 ]; then
50-
exit $E_RESTART
51-
fi
49+
check_result $? "Cron restart failed" >/dev/null
5250

5351
# Logging
5452
log_history "enabled cron reporting"

bin/v-add-cron-restart-job

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: add cron reports
3-
# opions: NONE
3+
# options: NONE
44
#
55
# The script for enabling restart cron tasks
66

bin/v-add-cron-vesta-autoupdate

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Variable&Function #
1010
#----------------------------------------------------------#
1111

12-
# Argument defenition
12+
# Argument definition
1313
user=admin
1414

1515
# Includes
@@ -34,7 +34,7 @@ fi
3434
# Action #
3535
#----------------------------------------------------------#
3636

37-
# Define time somewhere at nigth
37+
# Define time somewhere at night
3838
min=$(gen_password '012345' '2')
3939
hour=$(gen_password '1234567' '1')
4040
day='*'
@@ -66,11 +66,9 @@ sync_cron_jobs
6666
# Increasing cron value
6767
increase_user_value $user '$U_CRON_JOBS'
6868

69-
# Restart crond
69+
# Restarting crond
7070
$BIN/v-restart-cron
71-
if [ $? -ne 0 ]; then
72-
exit $E_RESTART
73-
fi
71+
check_result $? "Cron restart failed" >/dev/null
7472

7573
# Logging
7674
log_history "added cron job $job"

0 commit comments

Comments
 (0)