Merge branch 'master' of github.com:serghey-rodin/vesta

This commit is contained in:
Serghey Rodin 2015-10-22 16:58:12 +03:00
commit ddf19a4bbc
11 changed files with 57 additions and 86 deletions

View file

@ -13,12 +13,18 @@ Connect to your server as root via SSH
ssh root@your.server
```
Download the installation script
Download the installation script, and run it:
```bash
curl http://vestacp.com/pub/vst-install.sh | bash
```
If the above example does not work, try this 2 step method:
Download the installation script:
```bash
curl -O http://vestacp.com/pub/vst-install.sh
```
Run it
Then run it:
```bash
bash vst-install.sh
```

View file

@ -31,9 +31,10 @@ is_object_valid 'user' 'USER' "$user"
#----------------------------------------------------------#
# Updating disk quota
# Had quota equals package value. Soft quota equals 90% of package value for warnings.
quota=$(get_user_value '$DISK_QUOTA')
soft=$((quota * 1000))
hard=$((quota + 50000))
soft=$((quota * 1024 * 0.90))
hard=$((quota * 1024))
# Searching home mount point
mnt=$(df -P /home |awk '{print $6}' |tail -n1)

View file

@ -37,7 +37,8 @@ http {
# SSL PCI Compliance
ssl_ciphers RC4:HIGH:!aNULL:!MD5:!kEDH;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_ciphers EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_session_cache shared:SSL:10m;
ssl_prefer_server_ciphers on;

View file

@ -87,5 +87,3 @@ if (isset($_POST['user']) || isset($_POST['hash'])) {
}
}
}
?>

View file

@ -4,25 +4,18 @@
//define(LISTING_TIMEOUT, 0.000001);
define(LISTING_TIMEOUT, 5);
//echo 'files: ';
//$files = scandir(__DIR__);
//echo '<pre>';
//print_r($files);
//$_REQUEST['sort_field'] = 'size';
$_REQUEST['sort_field'] = 'name';
//$_REQUEST['sort_field'] = 'atime';
//$_REQUEST['sort_field'] = 'mtime';
$_REQUEST['sort_desc'] = 1;
/*
+- copy file / dir [ recursive ]
+- rename(move) file / dir
@ -53,24 +46,12 @@ switch($_REQUEST['action']){
break;
}
//echo $_GET['sort_field'];
// if(in_array($_GET['sort_field'], $available_sort_fields)){
// echo '1';
// }
/*
upload_file
@ -87,17 +68,16 @@ switch($_REQUEST['action']){
download file / image
*/
function fm_create_file($filename){
function fm_create_file($filename)
{
if(is_file($filename))
return array('error' => 'file exists', 'code' => 1);
return !!fopen($filename, 'w');
return (bool) fopen($filename, 'w'); // (bool) > !!, sorry
}
function fm_create_dir($dirname){
function fm_create_dir($dirname)
{
if(is_dir($filename))
return array('error' => 'directory exists', 'code' => 1);
@ -105,8 +85,8 @@ function fm_create_dir($dirname){
return mkdir($dirname);
}
function fm_chown($filename, $recursive = 0, $uid = FALSE, $gid = FALSE){
function fm_chown($filename, $recursive = 0, $uid = FALSE, $gid = FALSE)
{
if (is_dir($filename) && $recursive) {
$dir_handle = opendir($dir);
while ($item = readdir($dir_handle)) {
@ -127,8 +107,8 @@ function fm_chown($filename, $recursive = 0, $uid = FALSE, $gid = FALSE){
}
}
function fm_chmod($filename, $recursive = 0, $mode){
function fm_chmod($filename, $recursive = 0, $mode)
{
if(is_dir($filename) && $recursive) {
$dir_handle = opendir($dir);
while ($item = readdir($dir_handle)) {
@ -146,8 +126,8 @@ function fm_chmod($filename, $recursive = 0, $mode){
}
}
function fm_delete($filename){
function fm_delete($filename)
{
if(is_dir($filename)){
foreach (
$iterator = new RecursiveIteratorIterator(
@ -168,12 +148,14 @@ function fm_delete($filename){
}
function fm_rename($source, $dest){
function fm_rename($source, $dest)
{
return rename($source, $dest);
}
function fm_copy($source, $dest){
function fm_copy($source, $dest)
{
if (is_dir($source)) {
foreach (
$iterator = new RecursiveIteratorIterator(
@ -187,14 +169,13 @@ function fm_copy($source, $dest){
copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
}
}
}else{
return copy($source, $dest);
}
}
function list_dir(){
function list_dir()
{
$dir_iterator = new RecursiveDirectoryIterator("/path");
$iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST);
// could use CHILD_FIRST if you so wish
@ -214,12 +195,9 @@ function list_dir(){
echo "\nTotal file size: ", $size, " bytes\n";
}
/// fast removing directory
function rmrf($dir) {
function rmrf($dir)
{
foreach (glob($dir) as $file) {
if (is_dir($file)) {
rmrf("$file/*");
@ -230,9 +208,6 @@ function rmrf($dir) {
}
}
function dir_list($dir, $sort = 0)
{
$sort_order_for_filename = SORT_ASC;
@ -274,8 +249,11 @@ function dir_list($dir, $sort = 0)
);
}else{
$listing['timeout_exeeded'] = TRUE;
if(is_dir($filename)){ $type = 'd';
}else{ $type = '-'; }
if (is_dir($filename)) {
$type = 'd';
} else {
$type = '-';
}
$item = array(
'name' => $object,
@ -294,7 +272,6 @@ function dir_list($dir, $sort = 0)
);
}
$listing['count']++;
if($item['type'] == 'd'){
@ -311,7 +288,6 @@ function dir_list($dir, $sort = 0)
}
$listing['time'] = microtime(TRUE) - $start;
if(!$listing['timeout_exeeded']){
if(in_array($_REQUEST['sort_field'], $available_sort_fields)){
if($_REQUEST['sort_desc']){
@ -325,7 +301,6 @@ function dir_list($dir, $sort = 0)
return $listing;
}
function explain_mode($mode)
{
$info = array();
@ -355,5 +330,3 @@ function explain_mode($mode)
return $info;
}
?>

View file

@ -108,5 +108,3 @@ $_SESSION['back'] = $_SERVER['REQUEST_URI'];
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_ssl.html');
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
unset($_SESSION['ok_msg']);
?>

View file

@ -32,5 +32,3 @@ $mailtext = file_get_contents("php://stdin");
if ((!empty($to)) && (!empty($subject))) {
send_email($to,$subject,$mailtext,$from);
}
?>

View file

@ -344,4 +344,3 @@ function list_timezones() {
}
return $timezone_list;
}
?>

View file

@ -1,8 +1,7 @@
<?php
session_start();
if (isset($_SESSION['user'])) {
header("Location: /list/user");
header("Location: /list/user/");
} else {
header("Location: /login/");
}
?>

View file

@ -1,7 +1,7 @@
<?php
session_start();
if (isset($_SESSION['user'])) {
header("Location: /list/user");
header("Location: /list/user/");
} else {
header("Location: /login/");
}

View file

@ -96,5 +96,3 @@ if (empty($_SESSION['language'])) $_SESSION['language']='en';
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.$_SESSION['language'].'.php');
require_once('../templates/header.html');
require_once('../templates/login.html');
?>