Skip to content

Commit 1bb6ecb

Browse files
author
Serghey Rodin
committed
Merge branch 'master' of github.com:serghey-rodin/vesta
2 parents a2cb705 + ceba42f commit 1bb6ecb

Some content is hidden

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

46 files changed

+188
-41
lines changed

bin/v-add-sys-ip

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ if [ ! -z "$PROXY_SYSTEM" ]; then
142142
rpaf_str="$rpaf_str $ip"
143143
sed -i "s/.*RPAFproxy_ips.*/$rpaf_str/" $rpaf_conf
144144
fi
145+
146+
#mod_remoteip
147+
remoteip_conf="/etc/$WEB_SYSTEM/mods-enabled/remoteip.conf"
148+
if [ -e "$remoteip_conf" ]; then
149+
if [ $( grep -ic "$ip" $remoteip_conf ) -eq 0 ]; then
150+
sed -i "s/<\/IfModule>/RemoteIPInternalProxy $ip\n<\/IfModule>/g" $remoteip_conf
151+
fi
152+
fi
145153
fi
146154

147155

bin/v-delete-sys-ip

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ if [ ! -z "$PROXY_SYSTEM" ]; then
9999
new_ips=$(echo "$rpaf_str" | sed "s/$ip//")
100100
sed -i "s/$ips/$new_ips/g" $rpaf_conf
101101
fi
102+
103+
#mod_remoteip
104+
remoteip_conf="/etc/$WEB_SYSTEM/mods-enabled/remoteip.conf"
105+
if [ -e "$remoteip_conf" ]; then
106+
sed -i "s/RemoteIPInternalProxy $ip//g" $remoteip_conf
107+
fi
102108
fi
103109

104110

func/main.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,10 @@ is_date_format_valid() {
583583
# Database user validator
584584
is_dbuser_format_valid() {
585585
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|/|\|\"|'|;|%|\`| ]"
586-
if [[ "$1" =~ $exclude ]] || [ 17 -le ${#1} ]; then
586+
if [ 17 -le ${#1} ]; then
587+
check_result $E_INVALID "mysql username can be up to 16 characters long"
588+
fi
589+
if [[ "$1" =~ $exclude ]]; then
587590
check_result $E_INVALID "invalid $2 format :: $1"
588591
fi
589592
}

install/rhel/6/roundcube/vesta.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,17 @@ function save($curpass, $passwd)
4242
$send .= PHP_EOL;
4343
$send .= $postdata . PHP_EOL . PHP_EOL;
4444

45-
$fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
45+
//$fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
46+
$errno = "";
47+
$errstr = "";
48+
$context = stream_context_create();
49+
50+
$result = stream_context_set_option($context, 'ssl', 'verify_peer', false);
51+
$result = stream_context_set_option($context, 'ssl', 'verify_host', false);
52+
$result = stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
53+
54+
$fp = stream_socket_client('ssl://' . $vesta_host . ':'.$vesta_port, $errno, $errstr, 60, STREAM_CLIENT_CONNECT, $context);
55+
4656
fputs($fp, $send);
4757
$result = fread($fp, 2048);
4858
fclose($fp);

install/rhel/7/roundcube/vesta.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,17 @@ function save($curpass, $passwd)
4242
$send .= PHP_EOL;
4343
$send .= $postdata . PHP_EOL . PHP_EOL;
4444

45-
$fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
45+
//$fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
46+
$errno = "";
47+
$errstr = "";
48+
$context = stream_context_create();
49+
50+
$result = stream_context_set_option($context, 'ssl', 'verify_peer', false);
51+
$result = stream_context_set_option($context, 'ssl', 'verify_host', false);
52+
$result = stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
53+
54+
$fp = stream_socket_client('ssl://' . $vesta_host . ':'.$vesta_port, $errno, $errstr, 60, STREAM_CLIENT_CONNECT, $context);
55+
4656
fputs($fp, $send);
4757
$result = fread($fp, 2048);
4858
fclose($fp);

install/vst-install-rhel.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,7 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
11591159
cd /usr/share/roundcubemail/plugins/password
11601160
wget $vestacp/roundcube/vesta.php -O drivers/vesta.php
11611161
wget $vestacp/roundcube/config.inc.php -O config.inc.php
1162+
sed -i "s/localhost/$servername/g" /usr/share/roundcubemail/plugins/password/config.inc.php
11621163
chmod a+r /etc/roundcubemail/*
11631164
chmod -f 777 /var/log/roundcubemail
11641165
r="$(gen_pass)"
@@ -1226,18 +1227,18 @@ $VESTA/bin/v-update-sys-ip
12261227
# Get main ip
12271228
ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
12281229

1230+
# Firewall configuration
1231+
if [ "$iptables" = 'yes' ]; then
1232+
$VESTA/bin/v-update-firewall
1233+
fi
1234+
12291235
# Get public ip
12301236
pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
12311237
if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
12321238
$VESTA/bin/v-change-sys-ip-nat $ip $pub_ip
12331239
ip=$pub_ip
12341240
fi
12351241

1236-
# Firewall configuration
1237-
if [ "$iptables" = 'yes' ]; then
1238-
$VESTA/bin/v-update-firewall
1239-
fi
1240-
12411242
# Configuring mysql host
12421243
if [ "$mysql" = 'yes' ]; then
12431244
$VESTA/bin/v-add-database-host mysql localhost root $vpass

install/vst-install-ubuntu.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,18 +1125,18 @@ $VESTA/bin/v-update-sys-ip
11251125
# Get main ip
11261126
ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
11271127

1128+
# Firewall configuration
1129+
if [ "$iptables" = 'yes' ]; then
1130+
$VESTA/bin/v-update-firewall
1131+
fi
1132+
11281133
# Get public ip
11291134
pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
11301135
if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
11311136
$VESTA/bin/v-change-sys-ip-nat $ip $pub_ip
11321137
ip=$pub_ip
11331138
fi
11341139

1135-
# Firewall configuration
1136-
if [ "$iptables" = 'yes' ]; then
1137-
$VESTA/bin/v-update-firewall
1138-
fi
1139-
11401140
# Configuring mysql host
11411141
if [ "$mysql" = 'yes' ]; then
11421142
$VESTA/bin/v-add-database-host mysql localhost root $vpass

web/css/styles.min.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2623,6 +2623,15 @@ a.vst-text:active b{
26232623
margin: 2px 6px 0 3px;
26242624
padding: 5px;
26252625
}
2626+
.lets-encrypt-note {
2627+
color: #89a40a !important;
2628+
font-style: italic;
2629+
font-weight: normal !important;
2630+
height: 30px;
2631+
padding-top: 10px;
2632+
vertical-align: top;
2633+
}
2634+
26262635
.additional-control {
26272636
margin-left: 17px;
26282637
color: #2C9491;
@@ -2695,6 +2704,7 @@ td.hint {
26952704
font-style: italic;
26962705
font-weight: normal;
26972706
}
2707+
.ftp-path-prefix { padding-top: 7px; }
26982708

26992709
.ui-button,
27002710
.button {

web/inc/i18n/ar.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@
190190
'template' => 'نموذج',
191191
'SSL Support' => 'دعم SSL',
192192
'SSL Home Directory' => 'المجلد الرئيسي لـ SSL',
193+
'Lets Encrypt Support' => 'Lets Encrypt Support',
194+
'Lets Encrypt' => 'Lets Encrypt',
195+
'Your certificate will be automatically issued in 5 minutes' => 'Your certificate will be automatically issued in 5 minutes',
193196
'Proxy Support' => 'دغم بروكسي',
194197
'Proxy Extensions' => 'توسعات بروكسي',
195198
'Web Statistics' => 'إحصائيات الوب',

web/inc/i18n/bs.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@
190190
'template' => 'šablon',
191191
'SSL Support' => 'SSL podrška',
192192
'SSL Home Directory' => 'SSL direktorij',
193+
'Lets Encrypt Support' => 'Lets Encrypt Support',
194+
'Your certificate will be automatically issued in 5 minutes' => 'Your certificate will be automatically issued in 5 minutes',
195+
'Lets Encrypt' => 'Lets Encrypt',
193196
'Proxy Support' => 'Proxy podrška',
194197
'Proxy Extensions' => 'Proxy ekstenzije',
195198
'Web Statistics' => 'Web statistika',

0 commit comments

Comments
 (0)