Skip to content

Commit 9e21076

Browse files
committed
Merge branch 'master' of github.com:serghey-rodin/vesta
2 parents 4b8a2c3 + d55c32e commit 9e21076

File tree

85 files changed

+1850
-231
lines changed

Some content is hidden

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

85 files changed

+1850
-231
lines changed

bin/v-add-backup-host

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ if [ "$type" = 'sftp' ]; then
137137
if [ -z $port ]; then
138138
port=22
139139
fi
140-
sftmpdir="$path/vst.bK76A9SUkt"
141-
sftpc "mkdir $sftmpdir" "rmdir $sftmpdir" > /dev/null 2>&1
140+
if sftpc "mkdir $path" > /dev/null 2>&1 ; then
141+
sftmpdir="$path/vst.bK76A9SUkt"
142+
sftpc "mkdir $sftmpdir" "rmdir $sftmpdir" > /dev/null 2>&1
143+
fi
142144
rc=$?
143145
if [[ "$rc" != 0 ]]; then
144146
case $rc in

bin/v-backup-user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ if [ "$USER" != '*' ]; then
434434
set -f
435435
i=0
436436

437-
for udir in $(ls -a |egrep -v "conf|web|dns|mail|^\.\.$|^\.$"); do
437+
for udir in $(ls -a |egrep -v "^conf$|^web$|^dns$|^mail$|^\.\.$|^\.$"); do
438438
exclusion=$(echo "$USER" |tr ',' '\n' |grep "^$udir$")
439439
if [ -z "$exclusion" ]; then
440440
((i ++))

bin/v-check-user-password

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,24 @@ fi
4949
#----------------------------------------------------------#
5050

5151
# Parsing user's salt
52-
shadow=$(grep "^$user:" /etc/shadow)
53-
salt=$(echo "$shadow" |cut -f 3 -d \$)
54-
method=$(echo "$shadow" |cut -f 2 -d \$)
55-
if [ "$method" -eq '1' ]; then
56-
method='md5'
52+
shadow=$(grep "^$user:" /etc/shadow | cut -f 2 -d :)
53+
54+
if echo "$shadow" | grep -qE '^\$[0-9a-z]+\$[^\$]+\$'
55+
then
56+
salt=$(echo "$shadow" |cut -f 3 -d \$)
57+
method=$(echo "$shadow" |cut -f 2 -d \$)
58+
if [ "$method" -eq '1' ]; then
59+
method='md5'
60+
elif [ "$method" -eq '6' ]; then
61+
method='sha-512'
62+
else
63+
echo "Error: password missmatch"
64+
echo "$DATE $TIME $user $ip failed to login" >> $VESTA/log/auth.log
65+
exit 9
66+
fi
5767
else
58-
method='sha-512'
68+
salt=${shadow:0:2}
69+
method='des'
5970
fi
6071

6172
if [ -z "$salt" ]; then
@@ -64,7 +75,7 @@ if [ -z "$salt" ]; then
6475
exit 9
6576
fi
6677

67-
# Generating SHA-512
78+
# Generating hash
6879
hash=$($BIN/v-generate-password-hash $method $salt <<< $password)
6980
if [[ -z "$hash" ]]; then
7081
echo "Error: password missmatch"

bin/v-generate-password-hash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,10 @@ if ($crypt == 'htpasswd' ) {
3737
$hash = crypt($password, base64_encode($password));
3838
}
3939

40+
// Generating DES hash
41+
if ($crypt == 'des' ) {
42+
$hash = crypt($password, $salt);
43+
}
44+
4045
// Printing result
4146
echo $hash . "\n";

bin/v-list-sys-vesta-autoupdate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: list vesta autoupdate settings
3-
# options: NONE
3+
# options: [FORMAT]
44
#
55
# The function for obtaining autoupdate setings.
66

bin/v-update-firewall

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ tmp=$(mktemp)
6464
echo "$iptables -P INPUT ACCEPT" >> $tmp
6565
echo "$iptables -F INPUT" >> $tmp
6666

67+
# Enabling stateful support
68+
if [ "$conntrack" != 'no' ]; then
69+
str="$iptables -A INPUT -m state"
70+
str="$str --state ESTABLISHED,RELATED -j ACCEPT"
71+
echo "$str" >> $tmp
72+
fi
73+
74+
# Handling local traffic
75+
for ip in $(ls $VESTA/data/ips); do
76+
echo "$iptables -A INPUT -s $ip -j ACCEPT" >> $tmp
77+
done
78+
echo "$iptables -A INPUT -s 127.0.0.1 -j ACCEPT" >> $tmp
79+
6780
# Pasring iptables rules
6881
IFS=$'\n'
6982
for line in $(sort -r -n -k 2 -t \' $rules); do
@@ -100,25 +113,6 @@ for line in $(sort -r -n -k 2 -t \' $rules); do
100113
fi
101114
done
102115

103-
# Handling local traffic
104-
for ip in $(ls $VESTA/data/ips); do
105-
echo "$iptables -A INPUT -s $ip -j ACCEPT" >> $tmp
106-
done
107-
echo "$iptables -A INPUT -s 127.0.0.1 -j ACCEPT" >> $tmp
108-
IFS=$'\n'
109-
for p_rule in $(cat $ports); do
110-
eval $p_rule
111-
rule="$iptables -A INPUT -p $PROTOCOL"
112-
echo "$rule --sport $PORT -j ACCEPT" >> $tmp
113-
done
114-
115-
# Enabling stateful support
116-
if [ "$conntrack" != 'no' ]; then
117-
str="$iptables -A INPUT -p tcp -m state"
118-
str="$str --state ESTABLISHED,RELATED -j ACCEPT"
119-
echo "$str" >> $tmp
120-
fi
121-
122116
# Switching chain policy to DROP
123117
echo "$iptables -P INPUT DROP" >> $tmp
124118

install/debian/7/exim/exim4.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ procmail:
227227
autoreplay:
228228
driver = accept
229229
require_files = /etc/exim4/domains/$domain/autoreply.${local_part}.msg
230-
condition = ${if exists{/etc/exim4/domains/$domain/autoreply.${local_part}.msg}}{yes}{no}}
230+
condition = ${if exists{/etc/exim4/domains/$domain/autoreply.${local_part}.msg}{yes}{no}}
231231
retry_use_local_part
232232
transport = userautoreply
233233
unseen
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
server {
2+
listen %ip%:%web_ssl_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %docroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
10+
ssl on;
11+
ssl_certificate %ssl_pem%;
12+
ssl_certificate_key %ssl_key%;
13+
# if you need to rewrite www to non-www uncomment bellow
14+
# if ($host != '%domain%' ) {
15+
# rewrite ^/(.*)$ https://%domain%/$1 permanent;
16+
# }
17+
location = /favicon.ico {
18+
log_not_found off;
19+
access_log off;
20+
}
21+
22+
location = /robots.txt {
23+
allow all;
24+
log_not_found off;
25+
access_log off;
26+
}
27+
28+
location / {
29+
try_files $uri $uri/ @rewrite;
30+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
31+
expires max;
32+
}
33+
}
34+
location @rewrite {
35+
rewrite ^/(.*)$ /index.php?q=$1;
36+
}
37+
38+
location ~ \.php$ {
39+
try_files $uri =404;
40+
fastcgi_pass %backend_lsnr%;
41+
fastcgi_index index.php;
42+
fastcgi_param SCRIPT_FILENAME $request_filename;
43+
include /etc/nginx/fastcgi_params;
44+
}
45+
46+
error_page 403 /error/404.html;
47+
error_page 404 /error/404.html;
48+
error_page 500 502 503 504 /error/50x.html;
49+
50+
location /error/ {
51+
alias %home%/%user%/web/%domain%/document_errors/;
52+
}
53+
54+
location ~* "/\.(htaccess|htpasswd)$" {
55+
deny all;
56+
return 404;
57+
}
58+
59+
include /etc/nginx/conf.d/phpmyadmin.inc*;
60+
include /etc/nginx/conf.d/phppgadmin.inc*;
61+
include /etc/nginx/conf.d/webmail.inc*;
62+
63+
include %home%/%user%/conf/web/nginx.%domain%.conf*;
64+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
server {
2+
listen %ip%:%web_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %docroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
# if you need to rewrite www to non-www uncomment bellow
10+
# if ($host != '%domain%' ) {
11+
# rewrite ^/(.*)$ http://%domain%/$1 permanent;
12+
# }
13+
location = /favicon.ico {
14+
log_not_found off;
15+
access_log off;
16+
}
17+
18+
location = /robots.txt {
19+
allow all;
20+
log_not_found off;
21+
access_log off;
22+
}
23+
24+
location / {
25+
try_files $uri $uri/ @rewrite;
26+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
27+
expires max;
28+
}
29+
}
30+
location @rewrite {
31+
rewrite ^/(.*)$ /index.php?q=$1;
32+
}
33+
34+
location ~ \.php$ {
35+
try_files $uri =404;
36+
fastcgi_pass %backend_lsnr%;
37+
fastcgi_index index.php;
38+
fastcgi_param SCRIPT_FILENAME $request_filename;
39+
include /etc/nginx/fastcgi_params;
40+
}
41+
42+
error_page 403 /error/404.html;
43+
error_page 404 /error/404.html;
44+
error_page 500 502 503 504 /error/50x.html;
45+
46+
location /error/ {
47+
alias %home%/%user%/web/%domain%/document_errors/;
48+
}
49+
50+
location ~* "/\.(htaccess|htpasswd)$" {
51+
deny all;
52+
return 404;
53+
}
54+
55+
include /etc/nginx/conf.d/phpmyadmin.inc*;
56+
include /etc/nginx/conf.d/phppgadmin.inc*;
57+
include /etc/nginx/conf.d/webmail.inc*;
58+
59+
include %home%/%user%/conf/web/nginx.%domain%.conf*;
60+
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#[%backend%]
2-
#user = %user%
3-
#group = %user%
4-
#listen = /dev/null
1+
;[%backend%]
2+
;user = %user%
3+
;group = %user%
4+
;listen = /dev/null
55

6-
#listen.owner = %user%
7-
#listen.group = nginx
6+
;listen.owner = %user%
7+
;listen.group = nginx
88

9-
#pm = dynamic
10-
#pm.max_children = 50
11-
#pm.start_servers = 3
12-
#pm.min_spare_servers = 2
13-
#pm.max_spare_servers = 10
9+
;pm = dynamic
10+
;pm.max_children = 50
11+
;pm.start_servers = 3
12+
;pm.min_spare_servers = 2
13+
;pm.max_spare_servers = 10

0 commit comments

Comments
 (0)