Skip to content

Commit 4daa17f

Browse files
committed
Merge branch 'master' into feature/800
Conflicts: bin/v-add-letsencrypt-user
2 parents b40e331 + a575bff commit 4daa17f

File tree

248 files changed

+6123
-2135
lines changed

Some content is hidden

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

248 files changed

+6123
-2135
lines changed

ISSUE_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### Operating System (OS/VERSION):
2+
3+
Type here, e.g. CentOS 6
4+
5+
### VestaCP Version:
6+
7+
Type here, e.g. 3.14159
8+
9+
### Installed Software (what you got with the installer):
10+
11+
Type here, e.g. php-fpm, apache, nginx, mysql
12+
13+
### Steps to Reproduce:
14+
15+
Type here, e.g. install vesta and type rm -rf / --no-preserve-root
16+
17+
### Related Issues/Forum Threads:
18+
19+
Found anything that might be related to this? It might help us find the cause.
20+
21+
### Other Notes:
22+
23+
Anything else?

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
* Vesta has a clean and focused interface without the clutter.
66
* Vesta has the latest of very innovative technologies.
77

8-
9-
How to install
8+
How to install (2 step)
109
----------------------------
1110
Connect to your server as root via SSH
1211
```bash
@@ -18,7 +17,13 @@ Download the installation script, and run it:
1817
curl http://vestacp.com/pub/vst-install.sh | bash
1918
```
2019

21-
If the above example does not work, try this 2 step method:
20+
How to install (3 step)
21+
----------------------------
22+
If the above example does not work, try this 3 step method:
23+
Connect to your server as root via SSH
24+
```bash
25+
ssh root@your.server
26+
```
2227

2328
Download the installation script:
2429
```bash

bin/v-add-dns-record

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ if [[ $rtype =~ NS|CNAME|MX|PTR|SRV ]]; then
4949
fi
5050
fi
5151

52+
dvalue=${dvalue//\"/}
53+
54+
if [[ "$dvalue" =~ [\;[:space:]] ]]; then
55+
dvalue='"'"$dvalue"'"'
56+
fi
57+
5258

5359
#----------------------------------------------------------#
5460
# Verifications #

bin/v-add-fs-archive

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
user=$1
88
archive=$2
9-
src=$3
9+
src0=$3
1010

1111
# Checking arguments
12-
if [ -z "$src" ]; then
13-
echo "Usage: USER ARCHIVE SOURCE"
12+
if [ -z "$src0" ]; then
13+
echo "Usage: USER ARCHIVE FILE [FILE_2] [FILE_3] [FILE ...]"
1414
exit 1
1515
fi
1616

@@ -21,36 +21,56 @@ if [ ! -e "$VESTA/data/users/$user" ]; then
2121
fi
2222

2323
# Checking user homedir
24-
homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
24+
homedir=$(grep "^$user:" /etc/passwd |cut -f 6 -d :)
2525
if [ -z $homedir ]; then
2626
echo "Error: user home directory doesn't exist"
2727
exit 12
2828
fi
2929

3030
# Checking archive
31-
if [ -e "$archive.tar.gz" ]; then
32-
echo "Error: archive already exist $archive.tar.gz"
31+
if [ -e "$archive" ]; then
32+
echo "Error: archive already exist $archive"
3333
exit 1
3434
fi
3535

3636
# Checking source path
37-
rpath=$(readlink -f "$src")
38-
if [ -z "$(echo $rpath |egrep "^/tmp|^$homedir")" ]; then
39-
echo "Error: invalid source path $src"
40-
exit 1
41-
fi
37+
IFS=$'\n'
38+
i=1
39+
for src in $*; do
40+
if [ "$i" -gt 2 ]; then
41+
rpath=$(readlink -f "$src")
42+
if [ -z "$(echo $rpath |egrep "^/tmp|^$homedir")" ]; then
43+
echo "Error: invalid source path $src"
44+
exit 1
45+
fi
46+
fi
47+
((i++))
48+
done
4249

43-
# Parsing current directory
44-
d=$(dirname "$src")
50+
i=1
51+
for src in $*; do
52+
if [ "$i" -gt 2 ]; then
53+
# Deleting leading home path
54+
src=$(echo "$src"| sed -e "s|/home/$user/||")
4555

46-
# Removing leading file path
47-
f=$(echo "$src" |sed -e "s|$d/||")
56+
# Creating tar.gz archive
57+
sudo -u $user tar -rf "${archive/.gz/}" -C /home/$user $src >\
58+
/dev/null 2>&1
59+
if [ "$?" -ne 0 ]; then
60+
echo "Error: archive $archive was not created"
61+
exit 3
62+
fi
63+
fi
64+
((i++))
65+
done
4866

49-
# Creating tar.gz archive
50-
sudo -u $user tar -czf "$archive.tar.gz" -C $d $f >/dev/null 2>&1
51-
if [ "$?" -ne 0 ]; then
52-
echo "Error: archive $archive.tar.gz was not created"
53-
exit 3
67+
# Checking gzip
68+
if [[ "$archive" =~ \.gz$ ]]; then
69+
sudo -u $user gzip "${archive/.gz/}" >/dev/null 2>&1
70+
if [ "$?" -ne 0 ]; then
71+
echo "Error: archive $archive was not gziped"
72+
exit 3
73+
fi
5474
fi
5575

5676
exit

bin/v-add-letsencrypt-user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Argument definition
1313
user=$1
1414
email=$2
15-
key_size=2048
15+
key_size=4096
1616

1717
# Includes
1818
source $VESTA/func/main.sh

bin/v-add-mail-domain-dkim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ fi
6363
# Adding dns records
6464
if [ ! -z "$DNS_SYSTEM" ] && [ -e "$USER_DATA/dns/$domain.conf" ]; then
6565
p=$(cat $USER_DATA/mail/$domain.pub |grep -v ' KEY---' |tr -d '\n')
66-
record='_domainkey'
66+
record="_domainkey.$domain_idn"
6767
policy="\"t=y; o=~;\""
6868
$BIN/v-add-dns-record $user $domain $record TXT "$policy"
6969

70-
record='mail._domainkey'
70+
record="mail._domainkey.$domain_idn"
7171
selector="\"k=rsa\; p=$p\""
7272
$BIN/v-add-dns-record $user $domain $record TXT "$selector"
7373
fi

bin/v-add-remote-dns-domain

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ user=$1
1414
domain=$2
1515
flush=$3
1616

17+
1718
# Includes
1819
source $VESTA/func/main.sh
1920
source $VESTA/func/remote.sh
@@ -27,12 +28,7 @@ source $VESTA/conf/vesta.conf
2728
check_args '2' "$#" 'USER DOMAIN [FLUSH]'
2829
is_format_valid 'user' 'domain'
2930
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
30-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
31-
check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
32-
fi
33-
if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
34-
check_result $E_EXISTS "another sync process already running"
35-
fi
31+
is_procces_running
3632
remote_dns_health_check
3733

3834

bin/v-add-remote-dns-record

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ is_format_valid 'user' 'domain' 'id'
2929
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
3030
is_object_valid 'user' 'USER' "$user"
3131
is_object_valid 'dns' 'DOMAIN' "$domain"
32-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
33-
check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
34-
fi
35-
if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
36-
check_result $E_EXISTS "another sync process already running"
37-
fi
32+
is_procces_running
3833
remote_dns_health_check
3934

4035

bin/v-add-user

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ mkdir $HOMEDIR/$user/conf
6666

6767
if [ ! -z "$WEB_SYSTEM" ]; then
6868
mkdir $HOMEDIR/$user/conf/web $HOMEDIR/$user/web $HOMEDIR/$user/tmp
69-
chmod 751 $HOMEDIR/$user/conf/web $HOMEDIR/$user/web
70-
chmod 771 $HOMEDIR/$user/tmp
69+
chmod 751 $HOMEDIR/$user/conf/web
70+
chmod 710 $HOMEDIR/$user/web
71+
chmod 700 $HOMEDIR/$user/tmp
7172
chown $user:$user $HOMEDIR/$user/web $HOMEDIR/$user/tmp
7273
fi
7374

bin/v-add-web-domain

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: add web domain
3-
# options: USER DOMAIN [IP] [ALIASES] [PROXY_EXTENTIONS] [RESTART]
3+
# options: USER DOMAIN [IP] [ALIASES] [PROXY_EXTENSIONS] [RESTART]
44
#
55
# The function adds virtual host to a server. In cases when ip is
66
# undefined in the script, "default" template will be used. The alias of
@@ -55,7 +55,7 @@ source $VESTA/conf/vesta.conf
5555
#----------------------------------------------------------#
5656

5757
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
58-
check_args '2' "$#" 'USER DOMAIN [IP] [RESTART] [ALIASES] [PROXY_EXTENTIONS]'
58+
check_args '2' "$#" 'USER DOMAIN [IP] [RESTART] [ALIASES] [PROXY_EXTENSIONS]'
5959
is_format_valid 'user' 'domain' 'aliases' 'ip' 'proxy_ext'
6060
is_object_valid 'user' 'USER' "$user"
6161
is_object_unsuspended 'user' 'USER' "$user"
@@ -120,12 +120,21 @@ if [ ! -z "$WEB_BACKEND" ]; then
120120
check_result $? "Backend error" >/dev/null
121121
fi
122122

123-
# Preparing domain variables
124-
if [ "$aliases" != 'none' ]; then
125-
ALIAS="www.$domain,$aliases,$(get_ip_alias $domain)"
126-
else
123+
# Preparing domain aliases
124+
if [ "$aliases" = 'none' ]; then
127125
ALIAS=''
126+
else
127+
ALIAS="www.$domain"
128+
if [ ! -z "$aliases" ]; then
129+
ALIAS="$ALIAS,$aliases"
130+
fi
131+
ip_alias=$(get_ip_alias $domain)
132+
if [ ! -z "$ip_alias" ]; then
133+
ALIAS="$ALIAS,$ip_alias"
134+
fi
128135
fi
136+
137+
# Preparing domain variables
129138
prepare_web_domain_values
130139

131140
# Adding web server config

0 commit comments

Comments
 (0)