This commit is contained in:
Prime-DevIT 2025-06-04 22:53:22 +01:00 committed by GitHub
commit 338599123d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1028 changed files with 5391 additions and 5368 deletions

View file

@ -2,7 +2,7 @@
Type here, e.g. CentOS 6 Type here, e.g. CentOS 6
### VestaCP Version: ### DevITCP Version:
Type here, e.g. 3.14159 Type here, e.g. 3.14159
@ -12,7 +12,7 @@ Type here, e.g. php-fpm, apache, nginx, mysql
### Steps to Reproduce: ### Steps to Reproduce:
Type here, e.g. install vesta and type rm -rf / --no-preserve-root Type here, e.g. install devit and type rm -rf / --no-preserve-root
### Related Issues/Forum Threads: ### Related Issues/Forum Threads:

View file

@ -1,13 +1,13 @@
[Vesta Control Panel](http://vestacp.com/) [DevIT Control Panel](http://devitcp.com/)
================================================== ==================================================
Vesta is back under active development as of 25 February 2024. We are commited to open source, and will engage with the community to identify the new roadmap for Vesta. Stay tuned! DevIT is back under active development as of 25 February 2024. We are commited to open source, and will engage with the community to identify the new roadmap for DevIT. Stay tuned!
[![Join the chat at https://gitter.im/vesta-cp/Lobby](https://badges.gitter.im/vesta-cp/Lobby.svg)](https://gitter.im/vesta-cp/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join the chat at https://gitter.im/devit-cp/Lobby](https://badges.gitter.im/devit-cp/Lobby.svg)](https://gitter.im/devit-cp/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
* Vesta is an open source hosting control panel. * DevIT is an open source hosting control panel.
* Vesta has a clean and focused interface without the clutter. * DevIT has a clean and focused interface without the clutter.
* Vesta has the latest of very innovative technologies. * DevIT has the latest of very innovative technologies.
How to install (2 step) How to install (2 step)
---------------------------- ----------------------------
@ -18,7 +18,7 @@ ssh root@your.server
Download the installation script, and run it: Download the installation script, and run it:
```bash ```bash
curl https://vestacp.com/pub/vst-install.sh | bash curl https://devitcp.com/pub/vst-install.sh | bash
``` ```
How to install (3 step) How to install (3 step)
@ -31,7 +31,7 @@ ssh root@your.server
Download the installation script: Download the installation script:
```bash ```bash
curl -O https://vestacp.com/pub/vst-install.sh curl -O https://devitcp.com/pub/vst-install.sh
``` ```
Then run it: Then run it:
```bash ```bash
@ -40,5 +40,5 @@ bash vst-install.sh
License License
---------------------------- ----------------------------
Vesta is licensed under [GPL v3 ](https://github.com/outroll/vesta/blob/master/LICENSE) license DevIT is licensed under [GPL v3 ](https://github.com/outroll/devit/blob/master/LICENSE) license

View file

@ -2,4 +2,4 @@
## Reporting a Vulnerability ## Reporting a Vulnerability
Please report security issues to dev@vestacp.com Please report security issues to dev@devitcp.com

View file

@ -14,8 +14,8 @@ user=$1
nid=$2 nid=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -48,7 +48,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating notification counter # Updating notification counter

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# info: activate vesta license # info: activate devit license
# options: MODULE LICENSE # options: MODULE LICENSE
# #
# The function activates and registers the vesta license # The function activates and registers the devit license
#----------------------------------------------------------# #----------------------------------------------------------#
@ -17,8 +17,8 @@ license=$2
source /etc/profile source /etc/profile
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -34,9 +34,9 @@ is_user_format_valid "$license" "license"
#----------------------------------------------------------# #----------------------------------------------------------#
# Activating license # Activating license
v_host='https://vestacp.com/checkout' v_host='https://devitcp.com/checkout'
answer=$(curl -s "$v_host/activate.php?licence_key=$license&module=$module") answer=$(curl -s "$v_host/activate.php?licence_key=$license&module=$module")
check_result $? "cant' connect to vestacp.com " $E_CONNECT check_result $? "cant' connect to devitcp.com " $E_CONNECT
# Checking server answer # Checking server answer
if [[ "$answer" != '0' ]]; then if [[ "$answer" != '0' ]]; then
@ -46,14 +46,14 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating vesta.conf # Updating devit.conf
if [ -z "$(grep "${module}_KEY" $VESTA/conf/vesta.conf)" ]; then if [ -z "$(grep "${module}_KEY" $devit/conf/devit.conf)" ]; then
echo "${module}_KEY='$license'" >> $VESTA/conf/vesta.conf echo "${module}_KEY='$license'" >> $devit/conf/devit.conf
else else
sed -i "s/${module}_KEY=.*/${module}_KEY='$license'/g" $VESTA/conf/vesta.conf sed -i "s/${module}_KEY=.*/${module}_KEY='$license'/g" $devit/conf/devit.conf
fi fi
# Activating sftpjail # Activating sftpjail

View file

@ -18,8 +18,8 @@ path=${5-/backup}
port=$6 port=$6
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Defining ftp command function # Defining ftp command function
ftpc() { ftpc() {
@ -173,25 +173,25 @@ if [ $type != 'local' ]; then
date=$(echo "$time_n_date" |cut -f 2 -d \ ) date=$(echo "$time_n_date" |cut -f 2 -d \ )
str="HOST='$host'\nUSERNAME='$user'\nPASSWORD='$password'" str="HOST='$host'\nUSERNAME='$user'\nPASSWORD='$password'"
str="$str\nBPATH='$path'\nPORT='$port'\nTIME='$time'\nDATE='$date'" str="$str\nBPATH='$path'\nPORT='$port'\nTIME='$time'\nDATE='$date'"
echo -e "$str" > $VESTA/conf/$type.backup.conf echo -e "$str" > $devit/conf/$type.backup.conf
chmod 660 $VESTA/conf/$type.backup.conf chmod 660 $devit/conf/$type.backup.conf
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Update vesta.conf # Update devit.conf
if [ -z "$(grep BACKUP_SYSTEM $VESTA/conf/vesta.conf)" ]; then if [ -z "$(grep BACKUP_SYSTEM $devit/conf/devit.conf)" ]; then
echo "BACKUP_SYSTEM='$type'" >> $VESTA/conf/vesta.conf echo "BACKUP_SYSTEM='$type'" >> $devit/conf/devit.conf
else else
bckp=$(echo "$BACKUP_SYSTEM,$type" |\ bckp=$(echo "$BACKUP_SYSTEM,$type" |\
sed "s/,/\n/g"|\ sed "s/,/\n/g"|\
sort -r -u |\ sort -r -u |\
sed "/^$/d"|\ sed "/^$/d"|\
sed ':a;N;$!ba;s/\n/,/g') sed ':a;N;$!ba;s/\n/,/g')
sed -i "s/BACKUP_SYSTEM=.*/BACKUP_SYSTEM='$bckp'/g" $VESTA/conf/vesta.conf sed -i "s/BACKUP_SYSTEM=.*/BACKUP_SYSTEM='$bckp'/g" $devit/conf/devit.conf
fi fi
# Logging # Logging

View file

@ -22,8 +22,8 @@ job=$8
restart=$9 restart=$9
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
HIDE=7 HIDE=7
@ -57,10 +57,10 @@ str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month' WDAY='$wday'"
str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'" str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'"
# Adding to crontab # Adding to crontab
echo "$str" >> $VESTA/data/users/$user/cron.conf echo "$str" >> $devit/data/users/$user/cron.conf
# Changing permissions # Changing permissions
chmod 660 $VESTA/data/users/$user/cron.conf chmod 660 $devit/data/users/$user/cron.conf
# Sort jobs by id number # Sort jobs by id number
sort_cron_jobs sort_cron_jobs
@ -70,7 +70,7 @@ sync_cron_jobs
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Increasing cron value # Increasing cron value

View file

@ -10,8 +10,8 @@
#----------------------------------------------------------# #----------------------------------------------------------#
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -26,15 +26,15 @@ is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
#----------------------------------------------------------# #----------------------------------------------------------#
# Add cron job # Add cron job
cmd="sudo /usr/local/vesta/bin/v-update-sys-queue letsencrypt" cmd="sudo /usr/local/devit/bin/v-update-sys-queue letsencrypt"
check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null) check_cron=$(grep "$cmd" $devit/data/users/admin/cron.conf 2> /dev/null)
if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
$BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd" $BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd"
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -14,8 +14,8 @@
user=$1 user=$1
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -41,7 +41,7 @@ sync_cron_jobs
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restart crond # Restart crond

View file

@ -10,8 +10,8 @@
#----------------------------------------------------------# #----------------------------------------------------------#
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -26,15 +26,15 @@ is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
#----------------------------------------------------------# #----------------------------------------------------------#
# Add cron job # Add cron job
cmd="sudo /usr/local/vesta/bin/v-update-sys-queue restart" cmd="sudo /usr/local/devit/bin/v-update-sys-queue restart"
check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null) check_cron=$(grep "$cmd" $devit/data/users/admin/cron.conf 2> /dev/null)
if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
$BIN/v-add-cron-job admin '*' '*' '*' '*' '*' "$cmd" $BIN/v-add-cron-job admin '*' '*' '*' '*' '*' "$cmd"
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# info: add cron job for vesta autoupdates # info: add cron job for devit autoupdates
# options: NONE # options: NONE
# #
# The function adds cronjob for vesta autoupdate. # The function adds cronjob for devit autoupdate.
#----------------------------------------------------------# #----------------------------------------------------------#
@ -13,8 +13,8 @@
user=admin user=admin
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -24,7 +24,7 @@ source $VESTA/conf/vesta.conf
is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM' is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
is_package_full 'CRON_JOBS' is_package_full 'CRON_JOBS'
get_next_cronjob get_next_cronjob
check_cron=$(grep 'v-update-sys-vesta-all' $USER_DATA/cron.conf) check_cron=$(grep 'v-update-sys-devit-all' $USER_DATA/cron.conf)
if [ ! -z "$check_cron" ]; then if [ ! -z "$check_cron" ]; then
exit exit
fi fi
@ -45,17 +45,17 @@ hour=$(generate_password '1234567' '1')
day='*' day='*'
month='*' month='*'
wday='*' wday='*'
command='sudo /usr/local/vesta/bin/v-update-sys-vesta-all' command='sudo /usr/local/devit/bin/v-update-sys-devit-all'
# Concatenating cron string # Concatenating cron string
str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month' WDAY='$wday'" str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month' WDAY='$wday'"
str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'" str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'"
# Adding to crontab # Adding to crontab
echo "$str" >> $VESTA/data/users/$user/cron.conf echo "$str" >> $devit/data/users/$user/cron.conf
# Chaning permissions # Chaning permissions
chmod 660 $VESTA/data/users/$user/cron.conf chmod 660 $devit/data/users/$user/cron.conf
# Sort jobs by id number # Sort jobs by id number
sort_cron_jobs sort_cron_jobs
@ -65,7 +65,7 @@ sync_cron_jobs
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Increasing cron value # Increasing cron value

View file

@ -26,9 +26,9 @@ charset=${7-UTF8}
charset=$(echo "$charset" |tr '[:lower:]' '[:upper:]') charset=$(echo "$charset" |tr '[:lower:]' '[:upper:]')
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/db.sh source $devit/func/db.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -63,7 +63,7 @@ esac
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Generating timestamp # Generating timestamp

View file

@ -23,9 +23,9 @@ charsets=${7-UTF8,LATIN1,WIN1250,WIN1251,WIN1252,WIN1256,WIN1258,KOI8}
template=${8-template1} template=${8-template1}
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/db.sh source $devit/func/db.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
is_mysql_host_alive() { is_mysql_host_alive() {
mycnf=$(mktemp) mycnf=$(mktemp)
@ -94,23 +94,23 @@ esac
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding host to conf # Adding host to conf
echo "$str" >> $VESTA/conf/$type.conf echo "$str" >> $devit/conf/$type.conf
chmod 660 $VESTA/conf/$type.conf chmod 660 $devit/conf/$type.conf
# Updating vesta.conf # Updating devit.conf
if [ -z "$(grep DB_SYSTEM $VESTA/conf/vesta.conf)" ]; then if [ -z "$(grep DB_SYSTEM $devit/conf/devit.conf)" ]; then
echo "DB_SYSTEM='$type'" >> $VESTA/conf/vesta.conf echo "DB_SYSTEM='$type'" >> $devit/conf/devit.conf
else else
db=$(echo "$DB_SYSTEM,$type" |\ db=$(echo "$DB_SYSTEM,$type" |\
sed "s/,/\n/g"|\ sed "s/,/\n/g"|\
sort -r -u |\ sort -r -u |\
sed "/^$/d"|\ sed "/^$/d"|\
sed ':a;N;$!ba;s/\n/,/g') sed ':a;N;$!ba;s/\n/,/g')
sed -i "s/DB_SYSTEM=.*/DB_SYSTEM='$db'/g" $VESTA/conf/vesta.conf sed -i "s/DB_SYSTEM=.*/DB_SYSTEM='$db'/g" $devit/conf/devit.conf
fi fi
# Logging # Logging

View file

@ -28,9 +28,9 @@ ns8=${11}
restart=${12} restart=${12}
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -184,12 +184,12 @@ fi
# Updating dns-cluster queue # Updating dns-cluster queue
if [ ! -z "$DNS_CLUSTER" ]; then if [ ! -z "$DNS_CLUSTER" ]; then
cmd="$BIN/v-add-remote-dns-domain $user $domain yes" cmd="$BIN/v-add-remote-dns-domain $user $domain yes"
echo "$cmd" >> $VESTA/data/queue/dns-cluster.pipe echo "$cmd" >> $devit/data/queue/dns-cluster.pipe
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Increasing domain value # Increasing domain value

View file

@ -16,9 +16,9 @@ ip=$3
restart=$4 restart=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -77,7 +77,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# No logging # No logging

View file

@ -28,9 +28,9 @@ if [ -z "$priority" ]; then
fi fi
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Null priority for none MX/SRV records # Null priority for none MX/SRV records
if [ "$rtype" != 'MX' ] && [ "$rtype" != 'SRV' ]; then if [ "$rtype" != 'MX' ] && [ "$rtype" != 'SRV' ]; then
@ -106,16 +106,16 @@ fi
# Updating dns-cluster queue # Updating dns-cluster queue
if [ ! -z "$DNS_CLUSTER" ]; then if [ ! -z "$DNS_CLUSTER" ]; then
# Check for first sync # Check for first sync
dlock=$(grep "domain $user $domain" $VESTA/data/queue/dns-cluster.pipe) dlock=$(grep "domain $user $domain" $devit/data/queue/dns-cluster.pipe)
if [ -z "$dlock" ]; then if [ -z "$dlock" ]; then
cmd="$BIN/v-add-remote-dns-record $user $domain $id" cmd="$BIN/v-add-remote-dns-record $user $domain $id"
echo "$cmd" >> $VESTA/data/queue/dns-cluster.pipe echo "$cmd" >> $devit/data/queue/dns-cluster.pipe
fi fi
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Update counters # Update counters

View file

@ -16,9 +16,9 @@ ip=$3
restart="${4-yes}" restart="${4-yes}"
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -75,7 +75,7 @@ check_result $? "can't restart dns" > /dev/null
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
exit exit

View file

@ -20,8 +20,8 @@ chain=$(echo $2|tr '[:lower:]' '[:upper:]')
iptables="/sbin/iptables" iptables="/sbin/iptables"
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -38,19 +38,19 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
#----------------------------------------------------------# #----------------------------------------------------------#
# Checking server ip # Checking server ip
if [ -e "$VESTA/data/ips/$ip" ] || [ "$ip" = '127.0.0.1' ]; then if [ -e "$devit/data/ips/$ip" ] || [ "$ip" = '127.0.0.1' ]; then
exit exit
fi fi
# Checking ip exclusions # Checking ip exclusions
excludes="$VESTA/data/firewall/excludes.conf" excludes="$devit/data/firewall/excludes.conf"
check_excludes=$(grep "^$ip$" $excludes 2>/dev/null) check_excludes=$(grep "^$ip$" $excludes 2>/dev/null)
if [ ! -z "$check_excludes" ]; then if [ ! -z "$check_excludes" ]; then
exit exit
fi fi
# Checking ip in banlist # Checking ip in banlist
conf="$VESTA/data/firewall/banlist.conf" conf="$devit/data/firewall/banlist.conf"
check_ip=$(grep "IP='$ip' CHAIN='$chain'" $conf 2>/dev/null) check_ip=$(grep "IP='$ip' CHAIN='$chain'" $conf 2>/dev/null)
if [ ! -z "$check_ip" ]; then if [ ! -z "$check_ip" ]; then
exit exit
@ -74,7 +74,7 @@ chmod 660 $conf
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -21,15 +21,15 @@ protocol=$(echo $protocol|tr '[:lower:]' '[:upper:]')
# Defining absolute path to iptables # Defining absolute path to iptables
iptables="/sbin/iptables" iptables="/sbin/iptables"
# Get vesta port by reading nginx.conf # Get devit port by reading nginx.conf
vestaport=$(grep 'listen' $VESTA/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||") devitport=$(grep 'listen' $devit/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")
if [ -z "$vestaport" ]; then if [ -z "$devitport" ]; then
vestaport=8083 devitport=8083
fi fi
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -59,7 +59,7 @@ case $chain in
DNS) port=53; protocol=UDP ;; DNS) port=53; protocol=UDP ;;
WEB) port='80,443'; protocol=TCP ;; WEB) port='80,443'; protocol=TCP ;;
DB) port='3306,5432'; protocol=TCP ;; DB) port='3306,5432'; protocol=TCP ;;
VESTA) port=$vestaport; protocol=TCP ;; devit) port=$devitport; protocol=TCP ;;
*) check_args '2' "$#" 'CHAIN PORT' ;; *) check_args '2' "$#" 'CHAIN PORT' ;;
esac esac
@ -78,7 +78,7 @@ if [ $? -eq 0 ]; then
fi fi
# Preserving chain # Preserving chain
chains=$VESTA/data/firewall/chains.conf chains=$devit/data/firewall/chains.conf
check_chain=$(grep "CHAIN='$chain'" $chains 2>/dev/null) check_chain=$(grep "CHAIN='$chain'" $chains 2>/dev/null)
if [ -z "$check_chain" ]; then if [ -z "$check_chain" ]; then
echo "CHAIN='$chain' PORT='$port' PROTOCOL='$protocol'" >> $chains echo "CHAIN='$chain' PORT='$port' PROTOCOL='$protocol'" >> $chains
@ -89,7 +89,7 @@ chmod 660 $chains
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -22,23 +22,23 @@ comment=$5
rule=$6 rule=$6
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Get next firewall rule id # Get next firewall rule id
get_next_fw_rule() { get_next_fw_rule() {
if [ -z "$rule" ]; then if [ -z "$rule" ]; then
curr_str=$(grep "RULE=" $VESTA/data/firewall/rules.conf |\ curr_str=$(grep "RULE=" $devit/data/firewall/rules.conf |\
cut -f 2 -d \' | sort -n | tail -n1) cut -f 2 -d \' | sort -n | tail -n1)
rule="$((curr_str +1))" rule="$((curr_str +1))"
fi fi
} }
sort_fw_rules() { sort_fw_rules() {
cat $VESTA/data/firewall/rules.conf |\ cat $devit/data/firewall/rules.conf |\
sort -n -k 2 -t \' > $VESTA/data/firewall/rules.conf.tmp sort -n -k 2 -t \' > $devit/data/firewall/rules.conf.tmp
mv -f $VESTA/data/firewall/rules.conf.tmp \ mv -f $devit/data/firewall/rules.conf.tmp \
$VESTA/data/firewall/rules.conf $devit/data/firewall/rules.conf
} }
@ -72,10 +72,10 @@ str="$str IP='$ip' COMMENT='$comment' SUSPENDED='no'"
str="$str TIME='$time' DATE='$date'" str="$str TIME='$time' DATE='$date'"
# Adding to config # Adding to config
echo "$str" >> $VESTA/data/firewall/rules.conf echo "$str" >> $devit/data/firewall/rules.conf
# Changing permissions # Changing permissions
chmod 660 $VESTA/data/firewall/rules.conf chmod 660 $devit/data/firewall/rules.conf
# Sorting firewall rules by id number # Sorting firewall rules by id number
sort_fw_rules sort_fw_rules
@ -85,7 +85,7 @@ $BIN/v-update-firewall
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -14,9 +14,9 @@ if [ -z "$src0" ]; then
exit 1 exit 1
fi fi
# Checking vesta user # Checking devit user
if [ ! -e "$VESTA/data/users/$user" ]; then if [ ! -e "$devit/data/users/$user" ]; then
echo "Error: vesta user $user doesn't exist" echo "Error: devit user $user doesn't exist"
exit 3 exit 3
fi fi

View file

@ -13,9 +13,9 @@ if [ -z "$dst_dir" ]; then
exit 1 exit 1
fi fi
# Checking vesta user # Checking devit user
if [ ! -e "$VESTA/data/users/$user" ]; then if [ ! -e "$devit/data/users/$user" ]; then
echo "Error: vesta user $user doesn't exist" echo "Error: devit user $user doesn't exist"
exit 3 exit 3
fi fi

View file

@ -13,9 +13,9 @@ if [ -z "$dst_file" ]; then
exit 1 exit 1
fi fi
# Checking vesta user # Checking devit user
if [ ! -e "$VESTA/data/users/$user" ]; then if [ ! -e "$devit/data/users/$user" ]; then
echo "Error: vesta user $user doesn't exist" echo "Error: devit user $user doesn't exist"
exit 3 exit 3
fi fi

View file

@ -18,9 +18,9 @@ aliases=$3
API='https://acme-v02.api.letsencrypt.org' API='https://acme-v02.api.letsencrypt.org'
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_identifier_idn() { format_identifier_idn() {
@ -74,15 +74,15 @@ is_object_valid 'web' 'DOMAIN' "$domain"
is_object_unsuspended 'web' 'DOMAIN' "$domain" is_object_unsuspended 'web' 'DOMAIN' "$domain"
get_domain_values 'web' get_domain_values 'web'
echo "-----------------------------------------------------------------------------------" >> /usr/local/vesta/log/letsencrypt.log echo "-----------------------------------------------------------------------------------" >> /usr/local/devit/log/letsencrypt.log
echo "[$(date)] : v-add-letsencrypt-domain $domain [$aliases]" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : v-add-letsencrypt-domain $domain [$aliases]" >> /usr/local/devit/log/letsencrypt.log
# check if alias is the letsencrypt wildcard domain, if not, make the normal checks # check if alias is the letsencrypt wildcard domain, if not, make the normal checks
if [[ "$aliases" != "*.$domain" ]]; then if [[ "$aliases" != "*.$domain" ]]; then
for alias in $(echo "$aliases" |tr ',' '\n' |sort -u); do for alias in $(echo "$aliases" |tr ',' '\n' |sort -u); do
check_alias="$(echo $ALIAS |tr ',' '\n' |grep ^$alias$)" check_alias="$(echo $ALIAS |tr ',' '\n' |grep ^$alias$)"
if [ -z "$check_alias" ]; then if [ -z "$check_alias" ]; then
echo "[$(date)] : EXIT=domain alias $alias doesn't exist" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=domain alias $alias doesn't exist" >> /usr/local/devit/log/letsencrypt.log
check_result $E_NOTEXIST "domain alias $alias doesn't exist" check_result $E_NOTEXIST "domain alias $alias doesn't exist"
fi fi
done done
@ -93,14 +93,14 @@ fi;
#----------------------------------------------------------# #----------------------------------------------------------#
# Registering LetsEncrypt user account # Registering LetsEncrypt user account
echo "[$(date)] : v-add-letsencrypt-user $user" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : v-add-letsencrypt-user $user" >> /usr/local/devit/log/letsencrypt.log
$BIN/v-add-letsencrypt-user $user $BIN/v-add-letsencrypt-user $user
echo "[$(date)] : result: $?" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : result: $?" >> /usr/local/devit/log/letsencrypt.log
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
touch $VESTA/data/queue/letsencrypt.pipe touch $devit/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe sed -i "/ $domain /d" $devit/data/queue/letsencrypt.pipe
send_notice "LETSENCRYPT" "Account registration failed" send_notice "LETSENCRYPT" "Account registration failed"
echo "[$(date)] : EXIT=LE account registration" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=LE account registration" >> /usr/local/devit/log/letsencrypt.log
check_result $E_CONNECT "LE account registration" >/dev/null check_result $E_CONNECT "LE account registration" >/dev/null
fi fi
@ -109,11 +109,11 @@ source $USER_DATA/ssl/le.conf
# Checking wildcard alias # Checking wildcard alias
if [ "$aliases" = "*.$domain" ]; then if [ "$aliases" = "*.$domain" ]; then
echo "[$(date)] : Checking wildcard alias" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : Checking wildcard alias" >> /usr/local/devit/log/letsencrypt.log
wildcard='yes' wildcard='yes'
proto="dns-01" proto="dns-01"
if [ ! -e "$VESTA/data/users/$user/dns/$domain.conf" ]; then if [ ! -e "$devit/data/users/$user/dns/$domain.conf" ]; then
echo "[$(date)] : EXIT=DNS domain $domain doesn't exist" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=DNS domain $domain doesn't exist" >> /usr/local/devit/log/letsencrypt.log
check_result $E_NOTEXIST "DNS domain $domain doesn't exist" check_result $E_NOTEXIST "DNS domain $domain doesn't exist"
fi fi
else else
@ -121,21 +121,21 @@ else
fi fi
# Requesting nonce / STEP 1 # Requesting nonce / STEP 1
echo "[$(date)] : --- Requesting nonce / STEP 1 ---" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : --- Requesting nonce / STEP 1 ---" >> /usr/local/devit/log/letsencrypt.log
echo "[$(date)] : curl -s -I \"$API/directory\"" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : curl -s -I \"$API/directory\"" >> /usr/local/devit/log/letsencrypt.log
answer=$(curl -s -I "$API/directory") answer=$(curl -s -I "$API/directory")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : answer=$answer" >> /usr/local/devit/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n') nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : nonce=$nonce" >> /usr/local/devit/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ') status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : status=$status" >> /usr/local/devit/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then if [[ "$status" -ne 200 ]]; then
echo "[$(date)] : EXIT=Let's Encrypt nonce request status $status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=Let's Encrypt nonce request status $status" >> /usr/local/devit/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt nonce request status $status" check_result $E_CONNECT "Let's Encrypt nonce request status $status"
fi fi
# Placing new order / STEP 2 # Placing new order / STEP 2
echo "[$(date)] : --- Placing new order / STEP 2 ---" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : --- Placing new order / STEP 2 ---" >> /usr/local/devit/log/letsencrypt.log
url="$API/acme/new-order" url="$API/acme/new-order"
payload='{"identifiers":[' payload='{"identifiers":['
for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
@ -144,47 +144,47 @@ for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
done done
payload=$(echo "$payload"|sed "s/,$//") payload=$(echo "$payload"|sed "s/,$//")
payload=$payload']}' payload=$payload']}'
echo "[$(date)] : payload=$payload" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : payload=$payload" >> /usr/local/devit/log/letsencrypt.log
echo "[$(date)] : query_le_v2 \"$url\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : query_le_v2 \"$url\" \"$payload\" \"$nonce\"" >> /usr/local/devit/log/letsencrypt.log
answer=$(query_le_v2 "$url" "$payload" "$nonce") answer=$(query_le_v2 "$url" "$payload" "$nonce")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : answer=$answer" >> /usr/local/devit/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n') nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : nonce=$nonce" >> /usr/local/devit/log/letsencrypt.log
authz=$(echo "$answer" |grep "acme/authz" |cut -f2 -d '"') authz=$(echo "$answer" |grep "acme/authz" |cut -f2 -d '"')
echo "[$(date)] : authz=$authz" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : authz=$authz" >> /usr/local/devit/log/letsencrypt.log
finalize=$(echo "$answer" |grep 'finalize":' |cut -f4 -d '"') finalize=$(echo "$answer" |grep 'finalize":' |cut -f4 -d '"')
echo "[$(date)] : finalize=$finalize" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : finalize=$finalize" >> /usr/local/devit/log/letsencrypt.log
status=$(echo "$answer" |grep HTTP/ |tail -n1 |cut -f2 -d ' ') status=$(echo "$answer" |grep HTTP/ |tail -n1 |cut -f2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : status=$status" >> /usr/local/devit/log/letsencrypt.log
if [[ "$status" -ne 201 ]]; then if [[ "$status" -ne 201 ]]; then
echo "[$(date)] : EXIT=Let's Encrypt new auth status $status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=Let's Encrypt new auth status $status" >> /usr/local/devit/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt new auth status $status" check_result $E_CONNECT "Let's Encrypt new auth status $status"
fi fi
# Requesting authorization token / STEP 3 # Requesting authorization token / STEP 3
echo "[$(date)] : --- Requesting authorization token / STEP 3 ---" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : --- Requesting authorization token / STEP 3 ---" >> /usr/local/devit/log/letsencrypt.log
for auth in $authz; do for auth in $authz; do
payload='' payload=''
echo "[$(date)] : for auth=$auth" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : for auth=$auth" >> /usr/local/devit/log/letsencrypt.log
echo "[$(date)] : query_le_v2 \"$auth\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : query_le_v2 \"$auth\" \"$payload\" \"$nonce\"" >> /usr/local/devit/log/letsencrypt.log
answer=$(query_le_v2 "$auth" "$payload" "$nonce") answer=$(query_le_v2 "$auth" "$payload" "$nonce")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : answer=$answer" >> /usr/local/devit/log/letsencrypt.log
url=$(echo "$answer" |grep -A3 $proto |grep '"url"' |cut -f 4 -d \") url=$(echo "$answer" |grep -A3 $proto |grep '"url"' |cut -f 4 -d \")
echo "[$(date)] : url=$url" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : url=$url" >> /usr/local/devit/log/letsencrypt.log
token=$(echo "$answer" |grep -A3 $proto |grep token |cut -f 4 -d \") token=$(echo "$answer" |grep -A3 $proto |grep token |cut -f 4 -d \")
echo "[$(date)] : token=$token" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : token=$token" >> /usr/local/devit/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n') nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : nonce=$nonce" >> /usr/local/devit/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ') status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : status=$status" >> /usr/local/devit/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then if [[ "$status" -ne 200 ]]; then
echo "[$(date)] : EXIT=Let's Encrypt acme/authz bad status $status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=Let's Encrypt acme/authz bad status $status" >> /usr/local/devit/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt acme/authz bad status $status" check_result $E_CONNECT "Let's Encrypt acme/authz bad status $status"
fi fi
# Configuring challenge / STEP 4 # Configuring challenge / STEP 4
echo "[$(date)] : --- Configuring challenge / STEP 4 ---" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : --- Configuring challenge / STEP 4 ---" >> /usr/local/devit/log/letsencrypt.log
echo "[$(date)] : wildcard=$wildcard" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : wildcard=$wildcard" >> /usr/local/devit/log/letsencrypt.log
if [ "$wildcard" = 'yes' ]; then if [ "$wildcard" = 'yes' ]; then
record=$(printf "%s" "$token.$THUMB" |\ record=$(printf "%s" "$token.$THUMB" |\
openssl dgst -sha256 -binary |encode_base64) openssl dgst -sha256 -binary |encode_base64)
@ -195,20 +195,20 @@ for auth in $authz; do
done done
$BIN/v-add-dns-record "$user" "$domain" "_acme-challenge" "TXT" "$record" $BIN/v-add-dns-record "$user" "$domain" "_acme-challenge" "TXT" "$record"
exitstatus=$? exitstatus=$?
echo "[$(date)] : v-add-dns-record \"$user\" \"$domain\" \"_acme-challenge\" \"TXT\" \"$record\"" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : v-add-dns-record \"$user\" \"$domain\" \"_acme-challenge\" \"TXT\" \"$record\"" >> /usr/local/devit/log/letsencrypt.log
if [ "$exitstatus" -ne 0 ]; then if [ "$exitstatus" -ne 0 ]; then
echo "[$(date)] : EXIT=DNS _acme-challenge record wasn't created" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=DNS _acme-challenge record wasn't created" >> /usr/local/devit/log/letsencrypt.log
fi fi
check_result $exitstatus "DNS _acme-challenge record wasn't created" check_result $exitstatus "DNS _acme-challenge record wasn't created"
else else
if [ "$WEB_SYSTEM" = 'nginx' ] || [ ! -z "$PROXY_SYSTEM" ]; then if [ "$WEB_SYSTEM" = 'nginx' ] || [ ! -z "$PROXY_SYSTEM" ]; then
if [ -f "/usr/local/vesta/web/inc/nginx_proxy" ]; then if [ -f "/usr/local/devit/web/inc/nginx_proxy" ]; then
# if vesta is behind main nginx # if devit is behind main nginx
well_known="$HOMEDIR/$user/web/$domain/public_html/.well-known" well_known="$HOMEDIR/$user/web/$domain/public_html/.well-known"
acme_challenge="$well_known/acme-challenge" acme_challenge="$well_known/acme-challenge"
mkdir -p $acme_challenge mkdir -p $acme_challenge
echo "$token.$THUMB" > $acme_challenge/$token echo "$token.$THUMB" > $acme_challenge/$token
echo "[$(date)] : in $acme_challenge/$token we put: $token.$THUMB" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : in $acme_challenge/$token we put: $token.$THUMB" >> /usr/local/devit/log/letsencrypt.log
chown -R $user:$user $well_known chown -R $user:$user $well_known
else else
# default nginx method # default nginx method
@ -221,20 +221,20 @@ for auth in $authz; do
echo ' return 200 "$1.'$THUMB'";' >> $conf echo ' return 200 "$1.'$THUMB'";' >> $conf
echo '}' >> $conf echo '}' >> $conf
# fi # fi
echo "[$(date)] : in $conf we put: $THUMB" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : in $conf we put: $THUMB" >> /usr/local/devit/log/letsencrypt.log
if [ ! -e "$sconf" ]; then if [ ! -e "$sconf" ]; then
ln -s "$conf" "$sconf" ln -s "$conf" "$sconf"
fi fi
echo "[$(date)] : v-restart-proxy" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : v-restart-proxy" >> /usr/local/devit/log/letsencrypt.log
$BIN/v-restart-proxy $BIN/v-restart-proxy
if [ -z "$PROXY_SYSTEM" ]; then if [ -z "$PROXY_SYSTEM" ]; then
# apache-less variant # apache-less variant
echo "[$(date)] : v-restart-web" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : v-restart-web" >> /usr/local/devit/log/letsencrypt.log
$BIN/v-restart-web $BIN/v-restart-web
fi fi
exitstatus=$? exitstatus=$?
if [ "$exitstatus" -ne 0 ]; then if [ "$exitstatus" -ne 0 ]; then
echo "[$(date)] : EXIT=Proxy restart failed = $exitstatus" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=Proxy restart failed = $exitstatus" >> /usr/local/devit/log/letsencrypt.log
fi fi
check_result $exitstatus "Proxy restart failed" >/dev/null check_result $exitstatus "Proxy restart failed" >/dev/null
fi fi
@ -244,16 +244,16 @@ for auth in $authz; do
mkdir -p $acme_challenge mkdir -p $acme_challenge
echo "$token.$THUMB" > $acme_challenge/$token echo "$token.$THUMB" > $acme_challenge/$token
chown -R $user:$user $well_known chown -R $user:$user $well_known
echo "[$(date)] : in $acme_challenge/$token we put: $token.$THUMB" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : in $acme_challenge/$token we put: $token.$THUMB" >> /usr/local/devit/log/letsencrypt.log
# $BIN/v-restart-web # $BIN/v-restart-web
# check_result $? "Web restart failed" >/dev/null # check_result $? "Web restart failed" >/dev/null
fi fi
fi fi
# Requesting ACME validation / STEP 5 # Requesting ACME validation / STEP 5
echo "[$(date)] : --- Requesting ACME validation / STEP 5 ---" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : --- Requesting ACME validation / STEP 5 ---" >> /usr/local/devit/log/letsencrypt.log
validation_check=$(echo "$answer" |grep '"valid"') validation_check=$(echo "$answer" |grep '"valid"')
echo "[$(date)] : validation_check=$validation_check" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : validation_check=$validation_check" >> /usr/local/devit/log/letsencrypt.log
if [[ ! -z "$validation_check" ]]; then if [[ ! -z "$validation_check" ]]; then
validation='valid' validation='valid'
else else
@ -263,33 +263,33 @@ for auth in $authz; do
# Doing pol check on status # Doing pol check on status
i=1 i=1
while [ "$validation" = 'pending' ]; do while [ "$validation" = 'pending' ]; do
echo "[$(date)] : - Doing pol check on status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : - Doing pol check on status" >> /usr/local/devit/log/letsencrypt.log
payload='{}' payload='{}'
echo "[$(date)] : query_le_v2 \"$url\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : query_le_v2 \"$url\" \"$payload\" \"$nonce\"" >> /usr/local/devit/log/letsencrypt.log
answer=$(query_le_v2 "$url" "$payload" "$nonce") answer=$(query_le_v2 "$url" "$payload" "$nonce")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : answer=$answer" >> /usr/local/devit/log/letsencrypt.log
validation=$(echo "$answer"|grep -A1 $proto |tail -n1|cut -f4 -d \") validation=$(echo "$answer"|grep -A1 $proto |tail -n1|cut -f4 -d \")
echo "[$(date)] : validation=$validation" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : validation=$validation" >> /usr/local/devit/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n') nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : nonce=$nonce" >> /usr/local/devit/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ') status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : status=$status" >> /usr/local/devit/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then if [[ "$status" -ne 200 ]]; then
echo "[$(date)] : EXIT=Let's Encrypt validation status $status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=Let's Encrypt validation status $status" >> /usr/local/devit/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt validation status $status" check_result $E_CONNECT "Let's Encrypt validation status $status"
fi fi
i=$((i + 1)) i=$((i + 1))
if [ "$i" -gt 10 ]; then if [ "$i" -gt 10 ]; then
echo "[$(date)] : EXIT=Let's Encrypt domain validation timeout" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=Let's Encrypt domain validation timeout" >> /usr/local/devit/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt domain validation timeout" check_result $E_CONNECT "Let's Encrypt domain validation timeout"
fi fi
sleeping=$((i*2)) sleeping=$((i*2))
echo "[$(date)] : sleep $sleeping (i=$i)" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : sleep $sleeping (i=$i)" >> /usr/local/devit/log/letsencrypt.log
sleep $sleeping sleep $sleeping
done done
if [ "$validation" = 'invalid' ]; then if [ "$validation" = 'invalid' ]; then
echo "[$(date)] : EXIT=Let's Encrypt domain verification failed" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=Let's Encrypt domain verification failed" >> /usr/local/devit/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt domain verification failed" check_result $E_CONNECT "Let's Encrypt domain verification failed"
fi fi
done done
@ -297,52 +297,52 @@ done
# Generating new ssl certificate # Generating new ssl certificate
ssl_dir=$($BIN/v-generate-ssl-cert "$domain" "info@$domain" "US" "California"\ ssl_dir=$($BIN/v-generate-ssl-cert "$domain" "info@$domain" "US" "California"\
"San Francisco" "Vesta" "IT" "$aliases" |tail -n1 |awk '{print $2}') "San Francisco" "devit" "IT" "$aliases" |tail -n1 |awk '{print $2}')
# Sending CSR to finalize order / STEP 6 # Sending CSR to finalize order / STEP 6
echo "[$(date)] : --- Sending CSR to finalize order / STEP 6 ---" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : --- Sending CSR to finalize order / STEP 6 ---" >> /usr/local/devit/log/letsencrypt.log
csr=$(openssl req -in $ssl_dir/$domain.csr -outform DER |encode_base64) csr=$(openssl req -in $ssl_dir/$domain.csr -outform DER |encode_base64)
payload='{"csr":"'$csr'"}' payload='{"csr":"'$csr'"}'
echo "[$(date)] : query_le_v2 \"$finalize\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : query_le_v2 \"$finalize\" \"$payload\" \"$nonce\"" >> /usr/local/devit/log/letsencrypt.log
answer=$(query_le_v2 "$finalize" "$payload" "$nonce") answer=$(query_le_v2 "$finalize" "$payload" "$nonce")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : answer=$answer" >> /usr/local/devit/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n') nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : nonce=$nonce" >> /usr/local/devit/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ') status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : status=$status" >> /usr/local/devit/log/letsencrypt.log
certificate=$(echo "$answer"|grep 'certificate":' |cut -f4 -d '"') certificate=$(echo "$answer"|grep 'certificate":' |cut -f4 -d '"')
echo "[$(date)] : certificate=$certificate" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : certificate=$certificate" >> /usr/local/devit/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then if [[ "$status" -ne 200 ]]; then
echo "[$(date)] : EXIT=Let's Encrypt finalize bad status $status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=Let's Encrypt finalize bad status $status" >> /usr/local/devit/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt finalize bad status $status" check_result $E_CONNECT "Let's Encrypt finalize bad status $status"
fi fi
# Downloading signed certificate / STEP 7 # Downloading signed certificate / STEP 7
echo "[$(date)] : --- Downloading signed certificate / STEP 7 ---" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : --- Downloading signed certificate / STEP 7 ---" >> /usr/local/devit/log/letsencrypt.log
echo "[$(date)] : query_le_v2 \"$certificate\" \"\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : query_le_v2 \"$certificate\" \"\" \"$nonce\"" >> /usr/local/devit/log/letsencrypt.log
answer=$(query_le_v2 "$certificate" "" "$nonce" "$ssl_dir/$domain.pem") answer=$(query_le_v2 "$certificate" "" "$nonce" "$ssl_dir/$domain.pem")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : answer=$answer" >> /usr/local/devit/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ') status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : status=$status" >> /usr/local/devit/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then if [[ "$status" -ne 200 ]]; then
[ -d "$ssl_dir" ] && rm -rf "$ssl_dir" [ -d "$ssl_dir" ] && rm -rf "$ssl_dir"
echo "[$(date)] : EXIT=Let's Encrypt downloading signed cert failed status: $status" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=Let's Encrypt downloading signed cert failed status: $status" >> /usr/local/devit/log/letsencrypt.log
check_result $E_NOTEXIST "Let's Encrypt downloading signed cert failed status: $status" check_result $E_NOTEXIST "Let's Encrypt downloading signed cert failed status: $status"
fi fi
# Splitting up downloaded pem # Splitting up downloaded pem
# echo "[$(date)] : - Splitting up downloaded pem" >> /usr/local/vesta/log/letsencrypt.log # echo "[$(date)] : - Splitting up downloaded pem" >> /usr/local/devit/log/letsencrypt.log
crt_end=$(grep -n 'END CERTIFICATE' $ssl_dir/$domain.pem |head -n1 |cut -f1 -d:) crt_end=$(grep -n 'END CERTIFICATE' $ssl_dir/$domain.pem |head -n1 |cut -f1 -d:)
# echo "[$(date)] : crt_end=$crt_end" >> /usr/local/vesta/log/letsencrypt.log # echo "[$(date)] : crt_end=$crt_end" >> /usr/local/devit/log/letsencrypt.log
head -n $crt_end $ssl_dir/$domain.pem > $ssl_dir/$domain.crt head -n $crt_end $ssl_dir/$domain.pem > $ssl_dir/$domain.crt
pem_lines=$(wc -l $ssl_dir/$domain.pem |cut -f 1 -d ' ') pem_lines=$(wc -l $ssl_dir/$domain.pem |cut -f 1 -d ' ')
# echo "[$(date)] : pem_lines=$pem_lines" >> /usr/local/vesta/log/letsencrypt.log # echo "[$(date)] : pem_lines=$pem_lines" >> /usr/local/devit/log/letsencrypt.log
ca_end=$(grep -n 'BEGIN CERTIFICATE' $ssl_dir/$domain.pem |tail -n1 |cut -f 1 -d :) ca_end=$(grep -n 'BEGIN CERTIFICATE' $ssl_dir/$domain.pem |tail -n1 |cut -f 1 -d :)
# echo "[$(date)] : ca_end=$ca_end" >> /usr/local/vesta/log/letsencrypt.log # echo "[$(date)] : ca_end=$ca_end" >> /usr/local/devit/log/letsencrypt.log
ca_end=$(( pem_lines - crt_end + 1 )) ca_end=$(( pem_lines - crt_end + 1 ))
# echo "[$(date)] : ca_end=$ca_end" >> /usr/local/vesta/log/letsencrypt.log # echo "[$(date)] : ca_end=$ca_end" >> /usr/local/devit/log/letsencrypt.log
tail -n $ca_end $ssl_dir/$domain.pem > $ssl_dir/$domain.ca tail -n $ca_end $ssl_dir/$domain.pem > $ssl_dir/$domain.ca
# Temporary fix for double "END CERTIFICATE" # Temporary fix for double "END CERTIFICATE"
@ -353,20 +353,20 @@ fi
# Adding SSL # Adding SSL
ssl_home=$(search_objects 'web' 'LETSENCRYPT' 'yes' 'SSL_HOME') ssl_home=$(search_objects 'web' 'LETSENCRYPT' 'yes' 'SSL_HOME')
$BIN/v-delete-web-domain-ssl $user $domain >/dev/null 2>&1 $BIN/v-delete-web-domain-ssl $user $domain >/dev/null 2>&1
echo "[$(date)] : v-add-web-domain-ssl $user $domain $ssl_dir $ssl_home" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : v-add-web-domain-ssl $user $domain $ssl_dir $ssl_home" >> /usr/local/devit/log/letsencrypt.log
$BIN/v-add-web-domain-ssl $user $domain $ssl_dir $ssl_home $BIN/v-add-web-domain-ssl $user $domain $ssl_dir $ssl_home
exitstatus=$? exitstatus=$?
echo "[$(date)] : v-add-web-domain-ssl status: $exitstatus" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : v-add-web-domain-ssl status: $exitstatus" >> /usr/local/devit/log/letsencrypt.log
if [ "$exitstatus" -ne '0' ]; then if [ "$exitstatus" -ne '0' ]; then
touch $VESTA/data/queue/letsencrypt.pipe touch $devit/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe sed -i "/ $domain /d" $devit/data/queue/letsencrypt.pipe
echo "[$(date)] : EXIT=$domain certificate installation failed" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=$domain certificate installation failed" >> /usr/local/devit/log/letsencrypt.log
send_notice 'LETSENCRYPT' "$domain certificate installation failed" send_notice 'LETSENCRYPT' "$domain certificate installation failed"
check_result $exitstatus "SSL install" >/dev/null check_result $exitstatus "SSL install" >/dev/null
fi fi
# Adding LE autorenew cronjob # Adding LE autorenew cronjob
if [ -z "$(grep v-update-lets $VESTA/data/users/admin/cron.conf)" ]; then if [ -z "$(grep v-update-lets $devit/data/users/admin/cron.conf)" ]; then
min=$(generate_password '012345' '2') min=$(generate_password '012345' '2')
hour=$(generate_password '1234567' '1') hour=$(generate_password '1234567' '1')
cmd="sudo $BIN/v-update-letsencrypt-ssl" cmd="sudo $BIN/v-update-letsencrypt-ssl"
@ -382,16 +382,16 @@ update_object_value 'web' 'DOMAIN' "$domain" '$LETSENCRYPT' 'yes'
reset_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT' reset_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT'
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Deleteing task from queue # Deleteing task from queue
touch $VESTA/data/queue/letsencrypt.pipe touch $devit/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe sed -i "/ $domain /d" $devit/data/queue/letsencrypt.pipe
# Notifying user # Notifying user
send_notice 'LETSENCRYPT' "$domain SSL has been installed successfully" send_notice 'LETSENCRYPT' "$domain SSL has been installed successfully"
echo "[$(date)] : EXIT=***** $domain SSL has been installed successfully *****" >> /usr/local/vesta/log/letsencrypt.log echo "[$(date)] : EXIT=***** $domain SSL has been installed successfully *****" >> /usr/local/devit/log/letsencrypt.log
# Logging # Logging
log_event "$OK" "$ARGUMENTS" log_event "$OK" "$ARGUMENTS"

View file

@ -16,8 +16,8 @@ user=$1
API='https://acme-v02.api.letsencrypt.org' API='https://acme-v02.api.letsencrypt.org'
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# encode base64 # encode base64
encode_base64() { encode_base64() {
@ -119,7 +119,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding le.conf # Adding le.conf

View file

@ -17,9 +17,9 @@ password=$4; HIDE=4
quota=${5-unlimited} quota=${5-unlimited}
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
if [[ "$account" =~ [[:upper:]] ]]; then if [[ "$account" =~ [[:upper:]] ]]; then
@ -65,7 +65,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Generating timestamp # Generating timestamp

View file

@ -17,9 +17,9 @@ account=$3
malias=$4 malias=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -55,10 +55,10 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding vesta alias # Adding devit alias
aliases=$(get_object_value "mail/$domain" 'ACCOUNT' "$account" '$ALIAS') aliases=$(get_object_value "mail/$domain" 'ACCOUNT' "$account" '$ALIAS')
if [ -z "$aliases" ]; then if [ -z "$aliases" ]; then
aliases="$malias" aliases="$malias"

View file

@ -17,9 +17,9 @@ account=$3
autoreply=$4 autoreply=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Define mail user # Define mail user
if [ "$MAIL_SYSTEM" = 'exim4' ]; then if [ "$MAIL_SYSTEM" = 'exim4' ]; then
@ -64,7 +64,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding autoreply message # Adding autoreply message

View file

@ -17,9 +17,9 @@ account=$3
forward=$4 forward=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -66,7 +66,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating config # Updating config

View file

@ -16,9 +16,9 @@ domain_idn=$2
account=$3 account=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Define mail user # Define mail user
if [ "$MAIL_SYSTEM" = 'exim4' ]; then if [ "$MAIL_SYSTEM" = 'exim4' ]; then
@ -66,7 +66,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating config # Updating config

View file

@ -18,9 +18,9 @@ dkim=${5-yes}
dkim_size=${6-1024} dkim_size=${6-1024}
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Define mail user # Define mail user
if [ "$MAIL_SYSTEM" = 'exim4' ]; then if [ "$MAIL_SYSTEM" = 'exim4' ]; then
@ -130,7 +130,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Increasing domain value # Increasing domain value

View file

@ -15,9 +15,9 @@ domain=$2
domain_idn=$2 domain_idn=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -50,7 +50,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding antispam in config # Adding antispam in config

View file

@ -15,9 +15,9 @@ domain=$2
domain_idn=$2 domain_idn=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -50,7 +50,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding antivirus in config # Adding antivirus in config

View file

@ -16,9 +16,9 @@ domain_idn=$2
email="$3" email="$3"
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -51,7 +51,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding antispam in config # Adding antispam in config

View file

@ -16,9 +16,9 @@ domain_idn=$2
dkim_size=${3-1024} dkim_size=${3-1024}
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Define mail user # Define mail user
if [ "$MAIL_SYSTEM" = 'exim4' ]; then if [ "$MAIL_SYSTEM" = 'exim4' ]; then
@ -78,7 +78,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding dkim in config # Adding dkim in config

View file

@ -16,9 +16,9 @@ flush=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/remote.sh source $devit/func/remote.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -39,7 +39,7 @@ remote_dns_health_check
# Parsing domain record # Parsing domain record
str=$(grep "DOMAIN='$domain'" $USER_DATA/dns.conf 2>/dev/null) str=$(grep "DOMAIN='$domain'" $USER_DATA/dns.conf 2>/dev/null)
if [ -z "$str" ]; then if [ -z "$str" ]; then
pipe="$VESTA/data/queue/dns-cluster.pipe" pipe="$devit/data/queue/dns-cluster.pipe"
queue_str=$(grep -n "$SCRIPT $1 $2 " $pipe |cut -f1 -d: |head -n1) queue_str=$(grep -n "$SCRIPT $1 $2 " $pipe |cut -f1 -d: |head -n1)
if [ ! -z "$queue_str" ]; then if [ ! -z "$queue_str" ]; then
sed -i "$queue_str d" $pipe sed -i "$queue_str d" $pipe
@ -48,7 +48,7 @@ if [ -z "$str" ]; then
fi fi
IFS=$'\n' IFS=$'\n'
for cluster in $(grep "SUSPENDED='no'" $VESTA/conf/dns-cluster.conf); do for cluster in $(grep "SUSPENDED='no'" $devit/conf/dns-cluster.conf); do
# Parsing remote dns host parameters # Parsing remote dns host parameters
eval $cluster eval $cluster
@ -77,12 +77,12 @@ done
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating pipe # Updating pipe
rm -f $tmpfile rm -f $tmpfile
pipe="$VESTA/data/queue/dns-cluster.pipe" pipe="$devit/data/queue/dns-cluster.pipe"
str=$(grep -n "$SCRIPT $1 $2 " $pipe | cut -f1 -d: | head -n1) str=$(grep -n "$SCRIPT $1 $2 " $pipe | cut -f1 -d: | head -n1)
if [ ! -z "$str" ]; then if [ ! -z "$str" ]; then
sed -i "$str d" $pipe sed -i "$str d" $pipe

View file

@ -24,9 +24,9 @@ dns_user=${6-dns-cluster}
DNS_USER=$dns_user DNS_USER=$dns_user
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/remote.sh source $devit/func/remote.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -57,14 +57,14 @@ str="$str DNS_USER='$dns_user' TYPE='$type' SUSPENDED='no'"
str="$str TIME='$time' DATE='$date'" str="$str TIME='$time' DATE='$date'"
# Adding host to dns-cluster.conf # Adding host to dns-cluster.conf
echo "$str" >> $VESTA/conf/dns-cluster.conf echo "$str" >> $devit/conf/dns-cluster.conf
chmod 660 $VESTA/conf/dns-cluster.conf chmod 660 $devit/conf/dns-cluster.conf
# Enabling DNS_CLUSTER # Enabling DNS_CLUSTER
if [ -z "$(grep DNS_CLUSTER $VESTA/conf/vesta.conf)" ]; then if [ -z "$(grep DNS_CLUSTER $devit/conf/devit.conf)" ]; then
sed -i "s/^STATS_/DNS_CLUSTER='yes'\nSTATS_/g" $VESTA/conf/vesta.conf sed -i "s/^STATS_/DNS_CLUSTER='yes'\nSTATS_/g" $devit/conf/devit.conf
else else
sed -i "s/DNS_CLUSTER=.*/DNS_CLUSTER='yes'/g" $VESTA/conf/vesta.conf sed -i "s/DNS_CLUSTER=.*/DNS_CLUSTER='yes'/g" $devit/conf/devit.conf
fi fi
# Enabling remote dns-cluster queue # Enabling remote dns-cluster queue
@ -77,12 +77,12 @@ check_result $? "$HOST sync failed" $E_CONNECT
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding local dns-cluster cron job # Adding local dns-cluster cron job
cmd="sudo /usr/local/vesta/bin/v-update-sys-queue dns-cluster" cmd="sudo /usr/local/devit/bin/v-update-sys-queue dns-cluster"
check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null) check_cron=$(grep "$cmd" $devit/data/users/admin/cron.conf 2> /dev/null)
if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
$BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd" $BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd"
fi fi

View file

@ -15,9 +15,9 @@ domain=$2
id=$3 id=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/remote.sh source $devit/func/remote.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -40,7 +40,7 @@ remote_dns_health_check
# Parsing record # Parsing record
str=$(grep "ID='$id'" $USER_DATA/dns/$domain.conf) str=$(grep "ID='$id'" $USER_DATA/dns/$domain.conf)
if [ -z "$str" ]; then if [ -z "$str" ]; then
pipe="$VESTA/data/queue/dns-cluster.pipe" pipe="$devit/data/queue/dns-cluster.pipe"
queue_str=$(grep -n "$SCRIPT $1 $2 $3$" $pipe | cut -f1 -d: | head -n1) queue_str=$(grep -n "$SCRIPT $1 $2 $3$" $pipe | cut -f1 -d: | head -n1)
if [ ! -z "$queue_str" ]; then if [ ! -z "$queue_str" ]; then
sed -i "$queue_str d" $pipe sed -i "$queue_str d" $pipe
@ -49,7 +49,7 @@ if [ -z "$str" ]; then
fi fi
IFS=$'\n' IFS=$'\n'
for cluster in $(grep "SUSPENDED='no'" $VESTA/conf/dns-cluster.conf); do for cluster in $(grep "SUSPENDED='no'" $devit/conf/dns-cluster.conf); do
# Parsing remote host parameters # Parsing remote host parameters
eval $cluster eval $cluster
@ -72,11 +72,11 @@ done
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating pipe # Updating pipe
pipe="$VESTA/data/queue/dns-cluster.pipe" pipe="$devit/data/queue/dns-cluster.pipe"
str=$(grep -n "$SCRIPT $1 $2 $3$" $pipe | cut -f1 -d: | head -n1) str=$(grep -n "$SCRIPT $1 $2 $3$" $pipe | cut -f1 -d: | head -n1)
if [ ! -z "$str" ]; then if [ ! -z "$str" ]; then
sed -i "$str d" $pipe sed -i "$str d" $pipe

View file

@ -10,8 +10,8 @@
#----------------------------------------------------------# #----------------------------------------------------------#
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -28,19 +28,19 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding firewall directory # Adding firewall directory
mkdir -p $VESTA/data/firewall/ mkdir -p $devit/data/firewall/
# Adding default ruleset # Adding default ruleset
if [ ! -e "$VESTA/data/firewall/rules.conf" ]; then if [ ! -e "$devit/data/firewall/rules.conf" ]; then
cp $VESTA/install/rhel/7/* $VESTA/data/firewall/ cp $devit/install/rhel/7/* $devit/data/firewall/
fi fi
# Updating FIREWAL_SYSTEM value # Updating FIREWAL_SYSTEM value
if [ -z "$(grep FIREWALL_SYSTEM $VESTA/conf/vesta.conf)" ]; then if [ -z "$(grep FIREWALL_SYSTEM $devit/conf/devit.conf)" ]; then
echo "FIREWALL_SYSTEM='iptables'" >> $VESTA/conf/vesta.conf echo "FIREWALL_SYSTEM='iptables'" >> $devit/conf/devit.conf
else else
sed -i "s/FIREWALL_SYSTEM.*/FIREWALL_SYSTEM='iptables'/g" \ sed -i "s/FIREWALL_SYSTEM.*/FIREWALL_SYSTEM='iptables'/g" \
$VESTA/conf/vesta.conf $devit/conf/devit.conf
fi fi
# Updating firewall rules # Updating firewall rules
@ -48,7 +48,7 @@ $BIN/v-update-firewall
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -24,10 +24,10 @@ ip_name=$6
nat_ip=$7 nat_ip=$7
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -62,7 +62,7 @@ if [ -z "$sys_ip_check" ]; then
# Adding RHEL/CentOS/Fedora/Amazon startup script # Adding RHEL/CentOS/Fedora/Amazon startup script
if [ -d "/etc/sysconfig" ]; then if [ -d "/etc/sysconfig" ]; then
sys_ip="# Added by vesta" sys_ip="# Added by devit"
sys_ip="$sys_ip\nDEVICE=$iface" sys_ip="$sys_ip\nDEVICE=$iface"
sys_ip="$sys_ip\nBOOTPROTO=static" sys_ip="$sys_ip\nBOOTPROTO=static"
sys_ip="$sys_ip\nONBOOT=yes" sys_ip="$sys_ip\nONBOOT=yes"
@ -73,7 +73,7 @@ if [ -z "$sys_ip_check" ]; then
# Adding Debian/Ubuntu startup script # Adding Debian/Ubuntu startup script
if [ -e "/etc/debian_version" ]; then if [ -e "/etc/debian_version" ]; then
sys_ip="\n# Added by vesta" sys_ip="\n# Added by devit"
sys_ip="$sys_ip\nauto $iface" sys_ip="$sys_ip\nauto $iface"
sys_ip="$sys_ip\niface $iface inet static" sys_ip="$sys_ip\niface $iface inet static"
sys_ip="$sys_ip\naddress $ip" sys_ip="$sys_ip\naddress $ip"
@ -87,7 +87,7 @@ time_n_date=$(date +'%T %F')
time=$(echo "$time_n_date" |cut -f 1 -d \ ) time=$(echo "$time_n_date" |cut -f 1 -d \ )
date=$(echo "$time_n_date" |cut -f 2 -d \ ) date=$(echo "$time_n_date" |cut -f 2 -d \ )
# Adding vesta ip # Adding devit ip
echo "OWNER='$user' echo "OWNER='$user'
STATUS='$ip_status' STATUS='$ip_status'
NAME='$ip_name' NAME='$ip_name'
@ -97,8 +97,8 @@ INTERFACE='$interface'
NETMASK='$netmask' NETMASK='$netmask'
NAT='$nat_ip' NAT='$nat_ip'
TIME='$time' TIME='$time'
DATE='$date'" > $VESTA/data/ips/$ip DATE='$date'" > $devit/data/ips/$ip
chmod 660 $VESTA/data/ips/$ip chmod 660 $devit/data/ips/$ip
# WEB support # WEB support
if [ ! -z "$WEB_SYSTEM" ]; then if [ ! -z "$WEB_SYSTEM" ]; then
@ -154,14 +154,14 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating user counters # Updating user counters
increase_user_value "$user" '$IP_OWNED' increase_user_value "$user" '$IP_OWNED'
if [ "$user" = 'admin' ]; then if [ "$user" = 'admin' ]; then
if [ "$ip_status" = 'shared' ]; then if [ "$ip_status" = 'shared' ]; then
for user in $(ls $VESTA/data/users); do for user in $(ls $devit/data/users); do
increase_user_value "$user" '$IP_AVAIL' increase_user_value "$user" '$IP_AVAIL'
done done
else else

View file

@ -15,9 +15,9 @@ domain=$2
restart=$3 restart=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -39,8 +39,8 @@ is_object_value_exist 'web' 'DOMAIN' "$domain" '$SSL'
# Defining certificate location # Defining certificate location
dom_crt="/home/$user/conf/web/ssl.$domain.pem" dom_crt="/home/$user/conf/web/ssl.$domain.pem"
dom_key="/home/$user/conf/web/ssl.$domain.key" dom_key="/home/$user/conf/web/ssl.$domain.key"
vst_crt="$VESTA/ssl/mail.crt" vst_crt="$devit/ssl/mail.crt"
vst_key="$VESTA/ssl/mail.key" vst_key="$devit/ssl/mail.key"
# Checking certificate # Checking certificate
if [ ! -e "$dom_crt" ] || [ ! -e "$dom_key" ]; then if [ ! -e "$dom_crt" ] || [ ! -e "$dom_key" ]; then
@ -79,7 +79,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restarting services # Restarting services
@ -92,12 +92,12 @@ if [ "$restart" != 'no' ]; then
fi fi
fi fi
# Updating vesta.conf # Updating devit.conf
if [ -z "$(grep MAIL_CERTIFICATE $VESTA/conf/vesta.conf)" ]; then if [ -z "$(grep MAIL_CERTIFICATE $devit/conf/devit.conf)" ]; then
echo "MAIL_CERTIFICATE='$user:$domain'" >> $VESTA/conf/vesta.conf echo "MAIL_CERTIFICATE='$user:$domain'" >> $devit/conf/devit.conf
else else
sed -i "s/MAIL_CERTIFICATE.*/MAIL_CERTIFICATE='$user:$domain'/g" \ sed -i "s/MAIL_CERTIFICATE.*/MAIL_CERTIFICATE='$user:$domain'/g" \
$VESTA/conf/vesta.conf $devit/conf/devit.conf
fi fi
# Logging # Logging

View file

@ -10,8 +10,8 @@
#----------------------------------------------------------# #----------------------------------------------------------#
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -67,21 +67,21 @@ if [ ! -z "$(quotaon -pa | grep " $mnt " | grep 'user\|group' | grep 'is off')"
check_result $? "quota can't be enabled in $mnt" $E_DISK check_result $? "quota can't be enabled in $mnt" $E_DISK
fi fi
# Updating vesta.conf value # Updating devit.conf value
if [ -z "$(grep DISK_QUOTA $VESTA/conf/vesta.conf)" ]; then if [ -z "$(grep DISK_QUOTA $devit/conf/devit.conf)" ]; then
echo "DISK_QUOTA='yes'" >> $VESTA/conf/vesta.conf echo "DISK_QUOTA='yes'" >> $devit/conf/devit.conf
else else
sed -i "s/DISK_QUOTA=.*/DISK_QUOTA='yes'/g" $VESTA/conf/vesta.conf sed -i "s/DISK_QUOTA=.*/DISK_QUOTA='yes'/g" $devit/conf/devit.conf
fi fi
# Rebuilding user quota # Rebuilding user quota
for user in $(ls $VESTA/data/users); do for user in $(ls $devit/data/users); do
$BIN/v-update-user-quota $user $BIN/v-update-user-quota $user
done done
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -14,8 +14,8 @@
source /etc/profile source /etc/profile
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -58,7 +58,7 @@ fi
# Validating opensshd config # Validating opensshd config
if [ "$restart" = 'yes' ]; then if [ "$restart" = 'yes' ]; then
subj="OpenSSH restart failed" subj="OpenSSH restart failed"
email=$(grep CONTACT $VESTA/data/users/admin/user.conf |cut -f 2 -d \') email=$(grep CONTACT $devit/data/users/admin/user.conf |cut -f 2 -d \')
/usr/sbin/sshd -t >/dev/null 2>&1 /usr/sbin/sshd -t >/dev/null 2>&1
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
mail_text="OpenSSH can not be restarted. Please check config: mail_text="OpenSSH can not be restarted. Please check config:
@ -97,7 +97,7 @@ else
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# info: add vesta ssl certificate # info: add devit ssl certificate
# options: USER DOMAIN [RESTART] # options: USER DOMAIN [RESTART]
# #
# The function copies user domain SSL to vesta SSL directory # The function copies user domain SSL to devit SSL directory
#----------------------------------------------------------# #----------------------------------------------------------#
@ -15,9 +15,9 @@ domain=$2
restart=$3 restart=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -39,8 +39,8 @@ is_object_value_exist 'web' 'DOMAIN' "$domain" '$SSL'
# Defining certificate location # Defining certificate location
dom_crt="/home/$user/conf/web/ssl.$domain.pem" dom_crt="/home/$user/conf/web/ssl.$domain.pem"
dom_key="/home/$user/conf/web/ssl.$domain.key" dom_key="/home/$user/conf/web/ssl.$domain.key"
vst_crt="$VESTA/ssl/certificate.crt" vst_crt="$devit/ssl/certificate.crt"
vst_key="$VESTA/ssl/certificate.key" vst_key="$devit/ssl/certificate.key"
# Checking certificate # Checking certificate
if [ ! -e "$dom_crt" ] || [ ! -e "$dom_key" ]; then if [ ! -e "$dom_crt" ] || [ ! -e "$dom_key" ]; then
@ -62,7 +62,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restarting services # Restarting services
@ -76,19 +76,19 @@ if [ "$restart" != 'no' ]; then
if [ ! -z "$FTP_SYSTEM" ]; then if [ ! -z "$FTP_SYSTEM" ]; then
$BIN/v-restart-service "$FTP_SYSTEM" $BIN/v-restart-service "$FTP_SYSTEM"
fi fi
if [ -e "/var/run/vesta-nginx.pid" ]; then if [ -e "/var/run/devit-nginx.pid" ]; then
kill -HUP $(cat /var/run/vesta-nginx.pid) kill -HUP $(cat /var/run/devit-nginx.pid)
else else
service vesta restart service devit restart
fi fi
fi fi
# Updating vesta.conf # Updating devit.conf
if [ -z "$(grep VESTA_CERTIFICATE $VESTA/conf/vesta.conf)" ]; then if [ -z "$(grep devit_CERTIFICATE $devit/conf/devit.conf)" ]; then
echo "VESTA_CERTIFICATE='$user:$domain'" >> $VESTA/conf/vesta.conf echo "devit_CERTIFICATE='$user:$domain'" >> $devit/conf/devit.conf
else else
sed -i "s/VESTA_CERTIFICATE.*/VESTA_CERTIFICATE='$user:$domain'/g" \ sed -i "s/devit_CERTIFICATE.*/devit_CERTIFICATE='$user:$domain'/g" \
$VESTA/conf/vesta.conf $devit/conf/devit.conf
fi fi
# Logging # Logging

View file

@ -18,8 +18,8 @@ fname=$5
lname=$6 lname=$6
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
is_user_free() { is_user_free() {
check_sysuser=$(cut -f 1 -d : /etc/passwd | grep "^$user$" ) check_sysuser=$(cut -f 1 -d : /etc/passwd | grep "^$user$" )
@ -48,7 +48,7 @@ is_package_valid
#----------------------------------------------------------# #----------------------------------------------------------#
# Parsing package data # Parsing package data
pkg_data=$(cat $VESTA/data/packages/$package.pkg |egrep -v "TIME|DATE") pkg_data=$(cat $devit/data/packages/$package.pkg |egrep -v "TIME|DATE")
# Checking shell # Checking shell
shell_conf=$(echo "$pkg_data" | grep 'SHELL' | cut -f 2 -d \') shell_conf=$(echo "$pkg_data" | grep 'SHELL' | cut -f 2 -d \')
@ -88,7 +88,7 @@ chattr +i $HOMEDIR/$user/conf
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding user dir # Adding user dir
@ -119,18 +119,18 @@ chmod 660 $USER_DATA/backup.conf \
$USER_DATA/cron.conf $USER_DATA/cron.conf
# Updating queue pipes # Updating queue pipes
echo "$BIN/v-update-user-disk $user" >> $VESTA/data/queue/disk.pipe echo "$BIN/v-update-user-disk $user" >> $devit/data/queue/disk.pipe
if [ ! -z "$WEB_SYSTEM" ]; then if [ ! -z "$WEB_SYSTEM" ]; then
echo "$BIN/v-update-web-domains-traff $user" \ echo "$BIN/v-update-web-domains-traff $user" \
>> $VESTA/data/queue/traffic.pipe >> $devit/data/queue/traffic.pipe
echo "$BIN/v-update-web-domains-disk $user" >> $VESTA/data/queue/disk.pipe echo "$BIN/v-update-web-domains-disk $user" >> $devit/data/queue/disk.pipe
fi fi
if [ ! -z "$MAIL_SYSTEM" ]; then if [ ! -z "$MAIL_SYSTEM" ]; then
echo "$BIN/v-update-mail-domains-disk $user" >> $VESTA/data/queue/disk.pipe echo "$BIN/v-update-mail-domains-disk $user" >> $devit/data/queue/disk.pipe
fi fi
if [ ! -z "$DB_SYSTEM" ]; then if [ ! -z "$DB_SYSTEM" ]; then
echo "$BIN/v-update-databases-disk $user" >> $VESTA/data/queue/disk.pipe echo "$BIN/v-update-databases-disk $user" >> $devit/data/queue/disk.pipe
fi fi
# Generating timestamp # Generating timestamp
@ -199,8 +199,8 @@ if [ "$user" != 'admin' ]; then
fi fi
# Run template trigger # Run template trigger
if [ -x "$VESTA/data/packages/$package.sh" ]; then if [ -x "$devit/data/packages/$package.sh" ]; then
$VESTA/data/packages/$package.sh "$user" "$email" "$fname" "$lname" $devit/data/packages/$package.sh "$user" "$email" "$fname" "$lname"
fi fi
# Adding jailed sftp env # Adding jailed sftp env

View file

@ -17,8 +17,8 @@ email=$3
id=$3 id=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -115,7 +115,7 @@ FIREWALL='$FIREWALL'" > $USER_DATA/favourites.conf
chmod 640 $USER_DATA/favourites.conf chmod 640 $USER_DATA/favourites.conf
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -16,8 +16,8 @@ notice=$(echo $3 |sed "s/'/%quote%/g")
type=$4 type=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -63,7 +63,7 @@ chmod 660 $USER_DATA/notifications.conf
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating notification counter # Updating notification counter

View file

@ -15,12 +15,12 @@ package=$2
rewrite=$3 rewrite=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Functions # Functions
is_package_new() { is_package_new() {
if [ -e "$VESTA/data/packages/$package.pkg" ]; then if [ -e "$devit/data/packages/$package.pkg" ]; then
echo "Error: package $package already exists." echo "Error: package $package already exists."
log_event "$E_EXISTS" "$ARGUMENTS" log_event "$E_EXISTS" "$ARGUMENTS"
exit $E_EXISTS exit $E_EXISTS
@ -83,12 +83,12 @@ is_package_consistent
# Action # # Action #
#----------------------------------------------------------# #----------------------------------------------------------#
cp -f $pkg_dir/$package.pkg $VESTA/data/packages/ cp -f $pkg_dir/$package.pkg $devit/data/packages/
chmod 644 $VESTA/data/packages/$package.pkg chmod 644 $devit/data/packages/$package.pkg
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -13,8 +13,8 @@
user=$1 user=$1
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -57,7 +57,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# info: add vesta softaculous # info: add devit softaculous
# options: [TYPE] # options: [TYPE]
# #
# The script enables softaculous plugin # The script enables softaculous plugin
@ -13,8 +13,8 @@ TYPE=$1
# Includes # Includes
source /etc/profile source /etc/profile
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -22,13 +22,13 @@ source $VESTA/conf/vesta.conf
#----------------------------------------------------------# #----------------------------------------------------------#
if [ "$TYPE" = 'WEB' ]; then if [ "$TYPE" = 'WEB' ]; then
if [ ! -e "$VESTA/softaculous" ] && [ ! -e "$VESTA/ioncube" ]; then if [ ! -e "$devit/softaculous" ] && [ ! -e "$devit/ioncube" ]; then
$BIN/v-schedule-vesta-softaculous $BIN/v-schedule-devit-softaculous
exit exit
fi fi
else else
cmd="v-add-vesta-softaculous" cmd="v-add-devit-softaculous"
check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null) check_cron=$(grep "$cmd" $devit/data/users/admin/cron.conf 2> /dev/null)
if [ ! -z "$check_cron" ]; then if [ ! -z "$check_cron" ]; then
eval $check_cron eval $check_cron
$BIN/v-delete-cron-job admin $JOB $BIN/v-delete-cron-job admin $JOB
@ -48,83 +48,83 @@ fi
# Cleaning yum cache # Cleaning yum cache
if [ -d "/etc/sysconfig" ]; then if [ -d "/etc/sysconfig" ]; then
yum -q clean all yum -q clean all
yum="yum -q -y --noplugins --disablerepo=* --enablerepo=vesta" yum="yum -q -y --noplugins --disablerepo=* --enablerepo=devit"
else else
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
apt-get update -o Dir::Etc::sourcelist="sources.list.d/vesta.list" \ apt-get update -o Dir::Etc::sourcelist="sources.list.d/devit.list" \
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -qq -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -qq
fi fi
# Updating php pacakge # Updating php pacakge
if [ -z "$($VESTA/php/bin/php -v|grep 'PHP 5.6')" ]; then if [ -z "$($devit/php/bin/php -v|grep 'PHP 5.6')" ]; then
if [ -d "/etc/sysconfig" ]; then if [ -d "/etc/sysconfig" ]; then
$yum -y update vesta-php $yum -y update devit-php
check_result $? "vesta-php package upgrade failed" $E_UPDATE check_result $? "devit-php package upgrade failed" $E_UPDATE
else else
apt-get -y install vesta-php apt-get -y install devit-php
check_result $? "vesta-php package upgrade failed" $E_UPDATE check_result $? "devit-php package upgrade failed" $E_UPDATE
fi fi
fi fi
# Adding vesta-ioncube package # Adding devit-ioncube package
if [ -d "/etc/sysconfig" ]; then if [ -d "/etc/sysconfig" ]; then
rpm -q vesta-ioncube >/dev/null 2>&1 rpm -q devit-ioncube >/dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
$yum -y install vesta-ioncube >/dev/null 2>&1 $yum -y install devit-ioncube >/dev/null 2>&1
check_result $? "vesta-ioncube package installation failed" $E_UPDATE check_result $? "devit-ioncube package installation failed" $E_UPDATE
fi fi
else else
dpkg -l vesta-ioncube |grep ^ii >/dev/null 2>&1 dpkg -l devit-ioncube |grep ^ii >/dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
apt-get -y install vesta-ioncube >/dev/null 2>&1 apt-get -y install devit-ioncube >/dev/null 2>&1
check_result $? "vesta-ioncube package installation failed" $E_UPDATE check_result $? "devit-ioncube package installation failed" $E_UPDATE
fi fi
fi fi
# Adding vesta-softaculous package # Adding devit-softaculous package
if [ -d "/etc/sysconfig" ]; then if [ -d "/etc/sysconfig" ]; then
rpm -q vesta-softaculous >/dev/null 2>&1 rpm -q devit-softaculous >/dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
$yum -y install vesta-softaculous >/dev/null 2>&1 $yum -y install devit-softaculous >/dev/null 2>&1
check_result $? "vesta-softaculous package installation failed" $E_UPDATE check_result $? "devit-softaculous package installation failed" $E_UPDATE
fi fi
else else
dpkg -l vesta-softaculous |grep ^ii >/dev/null 2>&1 dpkg -l devit-softaculous |grep ^ii >/dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
apt-get -y install vesta-softaculous >/dev/null 2>&1 apt-get -y install devit-softaculous >/dev/null 2>&1
check_result $? "vesta-softaculous package installation failed" $E_UPDATE check_result $? "devit-softaculous package installation failed" $E_UPDATE
fi fi
fi fi
# Installing softaculous # Installing softaculous
if [ ! -e "$VESTA/softaculous/vst_installed" ]; then if [ ! -e "$devit/softaculous/vst_installed" ]; then
mkdir -p /var/softaculous mkdir -p /var/softaculous
chown -R admin:admin /var/softaculous chown -R admin:admin /var/softaculous
cd $VESTA/softaculous cd $devit/softaculous
wget -q http://c.vestacp.com/3rdparty/softaculous_install.inc wget -q http://c.devitcp.com/3rdparty/softaculous_install.inc
$VESTA/php/bin/php softaculous_install.inc $devit/php/bin/php softaculous_install.inc
check_result $? "vesta-softaculous package installation failed" $E_UPDATE check_result $? "devit-softaculous package installation failed" $E_UPDATE
touch $VESTA/softaculous/vst_installed touch $devit/softaculous/vst_installed
fi fi
# Enabling symlink # Enabling symlink
if [ -e "$VESTA/disabled_plugins/softaculous" ]; then if [ -e "$devit/disabled_plugins/softaculous" ]; then
if [ ! -e "$VESTA/web/softaculous" ]; then if [ ! -e "$devit/web/softaculous" ]; then
mv $VESTA/disabled_plugins/softaculous $VESTA/web/softaculous mv $devit/disabled_plugins/softaculous $devit/web/softaculous
fi fi
fi fi
# Updating SOFTACULOUS value # Updating SOFTACULOUS value
if [ -z "$(grep SOFTACULOUS $VESTA/conf/vesta.conf)" ]; then if [ -z "$(grep SOFTACULOUS $devit/conf/devit.conf)" ]; then
echo "SOFTACULOUS='yes'" >> $VESTA/conf/vesta.conf echo "SOFTACULOUS='yes'" >> $devit/conf/devit.conf
else else
sed -i "s/SOFTACULOUS.*/SOFTACULOUS='yes'/g" \ sed -i "s/SOFTACULOUS.*/SOFTACULOUS='yes'/g" \
$VESTA/conf/vesta.conf $devit/conf/devit.conf
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -25,10 +25,10 @@ aliases=$5
proxy_ext=$6 proxy_ext=$6
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -146,7 +146,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Increasing counters # Increasing counters

View file

@ -18,10 +18,10 @@ aliases=$3
restart="$4" restart="$4"
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -81,7 +81,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding new alias # Adding new alias

View file

@ -16,9 +16,9 @@ template=${3-default}
restart=$4 restart=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -63,7 +63,7 @@ cat $WEBTPL/$WEB_BACKEND/$template.tpl |\
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restart backend server # Restart backend server

View file

@ -18,9 +18,9 @@ password=$4; HIDE=4
ftp_path=$5 ftp_path=$5
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -98,7 +98,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Transforming absolute path to relative # Transforming absolute path to relative

View file

@ -17,9 +17,9 @@ password=$4; HIDE=4
restart=${5-yes} restart=${5-yes}
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Defining htpasswd file # Defining htpasswd file
htaccess="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.conf_htaccess" htaccess="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.conf_htaccess"
@ -91,7 +91,7 @@ if [ "$restart" != 'no' ] && [ "$restart_required" = 'yes' ]; then
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Preparing web.conf keys # Preparing web.conf keys

View file

@ -20,10 +20,10 @@ extentions=${4-$default_extentions}
restart="$5" restart="$5"
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -64,7 +64,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Update config # Update config

View file

@ -36,10 +36,10 @@ domain=$(idn -t --quiet -u "$domain" )
domain_idn=$(idn -t --quiet -a "$domain") domain_idn=$(idn -t --quiet -a "$domain")
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -103,7 +103,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Increasing domain value # Increasing domain value
@ -121,11 +121,11 @@ $BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null check_result $? "Proxy restart failed" >/dev/null
# Updating system ssl dependencies # Updating system ssl dependencies
if [ ! -z "$VESTA_CERTIFICATE" ]; then if [ ! -z "$devit_CERTIFICATE" ]; then
crt_user=$(echo "$VESTA_CERTIFICATE" |cut -f 1 -d :) crt_user=$(echo "$devit_CERTIFICATE" |cut -f 1 -d :)
crt_domain=$(echo "$VESTA_CERTIFICATE" |cut -f 2 -d :) crt_domain=$(echo "$devit_CERTIFICATE" |cut -f 2 -d :)
if [ "$user" = "$crt_user" ] && [ "$domain" = "$crt_domain" ]; then if [ "$user" = "$crt_user" ] && [ "$domain" = "$crt_domain" ]; then
$BIN/v-add-sys-vesta-ssl $user $domain >/dev/null 2>&1 $BIN/v-add-sys-devit-ssl $user $domain >/dev/null 2>&1
fi fi
fi fi
if [ ! -z "$MAIL_CERTIFICATE" ]; then if [ ! -z "$MAIL_CERTIFICATE" ]; then
@ -144,7 +144,7 @@ if [ ! -z "$UPDATE_HOSTNAME_SSL" ] && [ "$UPDATE_HOSTNAME_SSL" = "yes" ]; then
fi fi
UPDATE_SSL_SCRIPT='' UPDATE_SSL_SCRIPT=''
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
if [ ! -z "$UPDATE_SSL_SCRIPT" ]; then if [ ! -z "$UPDATE_SSL_SCRIPT" ]; then
eval "$UPDATE_SSL_SCRIPT $user $domain" eval "$UPDATE_SSL_SCRIPT $user $domain"
fi fi

View file

@ -20,9 +20,9 @@ domain_idn=$2
type=$3 type=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -80,12 +80,12 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Schedule statistic processing # Schedule statistic processing
echo "$BIN/v-update-web-domain-stat $user $domain" >> \ echo "$BIN/v-update-web-domain-stat $user $domain" >> \
$VESTA/data/queue/webstats.pipe $devit/data/queue/webstats.pipe
# Update config # Update config
update_object_value 'web' 'DOMAIN' "$domain" '$STATS' "$type" update_object_value 'web' 'DOMAIN' "$domain" '$STATS' "$type"

View file

@ -17,9 +17,9 @@ password=$4; HIDE=4
restart=$5 restart=$5
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -62,7 +62,7 @@ echo "$stats_user:$stats_pass" > $stats_dir/.htpasswd
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding stats user in config # Adding stats user in config

View file

@ -17,10 +17,10 @@ user=$1
notify=${2-no} notify=${2-no}
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/func/db.sh source $devit/func/db.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -50,7 +50,7 @@ start_time=$(date '+%s')
# Set notification email and subject # Set notification email and subject
subj="$user → backup failed" subj="$user → backup failed"
email=$(grep CONTACT $VESTA/data/users/admin/user.conf |cut -f 2 -d \') email=$(grep CONTACT $devit/data/users/admin/user.conf |cut -f 2 -d \')
# Checking load average # Checking load average
la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.') la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.')
@ -61,7 +61,7 @@ while [ "$la" -ge "$BACKUP_LA_LIMIT" ]; do
if [ "$i" -ge "15" ]; then if [ "$i" -ge "15" ]; then
la_error="LoadAverage $la is above threshold" la_error="LoadAverage $la is above threshold"
echo "$la_error" |$SENDMAIL -s "$subj" $email $notify echo "$la_error" |$SENDMAIL -s "$subj" $email $notify
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe sed -i "/ $user /d" $devit/data/queue/backup.pipe
check_result $E_LA "$la_error" check_result $E_LA "$la_error"
fi fi
la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.') la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.')
@ -82,25 +82,25 @@ fi
# Backup sys configs # Backup sys configs
echo "-- SYSTEM --" |tee $BACKUP/$user.log echo "-- SYSTEM --" |tee $BACKUP/$user.log
mkdir $tmpdir/vesta mkdir $tmpdir/devit
echo -e "$(date "+%F %T") $user.conf" |tee -a $BACKUP/$user.log echo -e "$(date "+%F %T") $user.conf" |tee -a $BACKUP/$user.log
cp -r $USER_DATA/user.conf $tmpdir/vesta/ cp -r $USER_DATA/user.conf $tmpdir/devit/
cp -r $USER_DATA/ssl $tmpdir/vesta/ cp -r $USER_DATA/ssl $tmpdir/devit/
if [ -e "$USER_DATA/stats.log" ]; then if [ -e "$USER_DATA/stats.log" ]; then
echo -e "$(date "+%F %T") stats.log" |tee -a $BACKUP/$user.log echo -e "$(date "+%F %T") stats.log" |tee -a $BACKUP/$user.log
cp -r $USER_DATA/stats.log $tmpdir/vesta/ cp -r $USER_DATA/stats.log $tmpdir/devit/
fi fi
if [ -e "$USER_DATA/history.log" ]; then if [ -e "$USER_DATA/history.log" ]; then
echo -e "$(date "+%F %T") history.log" |tee -a $BACKUP/$user.log echo -e "$(date "+%F %T") history.log" |tee -a $BACKUP/$user.log
cp -r $USER_DATA/history.log $tmpdir/vesta/ cp -r $USER_DATA/history.log $tmpdir/devit/
fi fi
if [ -e "$USER_DATA/backup-excludes.conf" ]; then if [ -e "$USER_DATA/backup-excludes.conf" ]; then
echo -e "$(date "+%F %T") backup-excludes.conf" |tee -a $BACKUP/$user.log echo -e "$(date "+%F %T") backup-excludes.conf" |tee -a $BACKUP/$user.log
cp -r $USER_DATA/backup-excludes.conf $tmpdir/vesta/ cp -r $USER_DATA/backup-excludes.conf $tmpdir/devit/
fi fi
# Backup PAM # Backup PAM
@ -139,7 +139,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
((i ++)) ((i ++))
echo -e "$(date "+%F %T") $domain" |tee -a $BACKUP/$user.log echo -e "$(date "+%F %T") $domain" |tee -a $BACKUP/$user.log
mkdir -p $tmpdir/web/$domain/conf mkdir -p $tmpdir/web/$domain/conf
mkdir -p $tmpdir/web/$domain/vesta mkdir -p $tmpdir/web/$domain/devit
# Get domain variables # Get domain variables
domain_idn=$domain domain_idn=$domain
@ -149,7 +149,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
# Backup web.conf # Backup web.conf
cd $tmpdir/web/$domain/ cd $tmpdir/web/$domain/
conf="$USER_DATA/web.conf" conf="$USER_DATA/web.conf"
grep "DOMAIN='$domain'" $conf > vesta/web.conf grep "DOMAIN='$domain'" $conf > devit/web.conf
# Backup vhost config # Backup vhost config
conf=$HOMEDIR/$user/conf/web/$domain.$WEB_SYSTEM.conf conf=$HOMEDIR/$user/conf/web/$domain.$WEB_SYSTEM.conf
@ -213,7 +213,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
# Backup ssl certificates # Backup ssl certificates
if [ "$SSL" = 'yes' ] ; then if [ "$SSL" = 'yes' ] ; then
cp $HOMEDIR/$user/conf/web/ssl.$domain.* conf/ cp $HOMEDIR/$user/conf/web/ssl.$domain.* conf/
cp $USER_DATA/ssl/$domain.* vesta/ cp $USER_DATA/ssl/$domain.* devit/
fi fi
# Changin dir to documentroot # Changin dir to documentroot
@ -276,15 +276,15 @@ if [ ! -z "$DNS_SYSTEM" ] && [ "$DNS" != '*' ]; then
# Building directory tree # Building directory tree
mkdir -p $tmpdir/dns/$domain/conf mkdir -p $tmpdir/dns/$domain/conf
mkdir -p $tmpdir/dns/$domain/vesta mkdir -p $tmpdir/dns/$domain/devit
# Backup dns.conf # Backup dns.conf
cd $tmpdir/dns/$domain/ cd $tmpdir/dns/$domain/
conf="$USER_DATA/dns.conf" conf="$USER_DATA/dns.conf"
grep "DOMAIN='$domain'" $conf > vesta/dns.conf grep "DOMAIN='$domain'" $conf > devit/dns.conf
# Backup dns recods # Backup dns recods
cp $USER_DATA/dns/$domain.conf vesta/$domain.conf cp $USER_DATA/dns/$domain.conf devit/$domain.conf
if [ "$DNS_SYSTEM" != 'remote' ]; then if [ "$DNS_SYSTEM" != 'remote' ]; then
cp $HOMEDIR/$user/conf/dns/$domain.db conf/$domain.db cp $HOMEDIR/$user/conf/dns/$domain.db conf/$domain.db
fi fi
@ -320,7 +320,7 @@ if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL" != '*' ]; then
((i ++)) ((i ++))
echo -e "$(date "+%F %T") $domain" |tee -a $BACKUP/$user.log echo -e "$(date "+%F %T") $domain" |tee -a $BACKUP/$user.log
mkdir -p $tmpdir/mail/$domain/conf mkdir -p $tmpdir/mail/$domain/conf
mkdir -p $tmpdir/mail/$domain/vesta mkdir -p $tmpdir/mail/$domain/devit
domain_idn=$domain domain_idn=$domain
format_domain_idn format_domain_idn
@ -332,10 +332,10 @@ if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL" != '*' ]; then
# Backup mail.conf # Backup mail.conf
conf="$USER_DATA/mail.conf" conf="$USER_DATA/mail.conf"
grep "DOMAIN='$domain'" $conf > vesta/mail.conf grep "DOMAIN='$domain'" $conf > devit/mail.conf
cp $USER_DATA/mail/$domain.* vesta/ cp $USER_DATA/mail/$domain.* devit/
if [ ! -z "$(ls $USER_DATA/mail/|grep *@$domain)" ]; then if [ ! -z "$(ls $USER_DATA/mail/|grep *@$domain)" ]; then
cp $USER_DATA/mail/*@$domain.* vesta/ cp $USER_DATA/mail/*@$domain.* devit/
fi fi
# Backup emails # Backup emails
@ -394,10 +394,10 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB" != '*' ]; then
echo -e "$(date "+%F %T") $database ($TYPE)" |tee -a $BACKUP/$user.log echo -e "$(date "+%F %T") $database ($TYPE)" |tee -a $BACKUP/$user.log
mkdir -p $tmpdir/db/$database/conf mkdir -p $tmpdir/db/$database/conf
mkdir -p $tmpdir/db/$database/vesta mkdir -p $tmpdir/db/$database/devit
cd $tmpdir/db/$database/ cd $tmpdir/db/$database/
grep "DB='$database'" $conf > vesta/db.conf grep "DB='$database'" $conf > devit/db.conf
dump="$tmpdir/db/$database/$database.$TYPE.sql" dump="$tmpdir/db/$database/$database.$TYPE.sql"
dumpgz="$tmpdir/db/$database/$database.$TYPE.sql.gz" dumpgz="$tmpdir/db/$database/$database.$TYPE.sql.gz"
@ -535,7 +535,7 @@ local_backup(){
if [ "$disk_usage" -ge "$BACKUP_DISK_LIMIT" ]; then if [ "$disk_usage" -ge "$BACKUP_DISK_LIMIT" ]; then
rm -rf $tmpdir rm -rf $tmpdir
rm -f $BACKUP/$user.log rm -f $BACKUP/$user.log
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe sed -i "/ $user /d" $devit/data/queue/backup.pipe
echo "Not enough disk space" |$SENDMAIL -s "$subj" $email $notify echo "Not enough disk space" |$SENDMAIL -s "$subj" $email $notify
check_result "$E_DISK" "Not enough dsk space" check_result "$E_DISK" "Not enough dsk space"
fi fi
@ -567,20 +567,20 @@ EOF
# Defining ftp storage function # Defining ftp storage function
ftp_backup() { ftp_backup() {
# Checking config # Checking config
if [ ! -e "$VESTA/conf/ftp.backup.conf" ]; then if [ ! -e "$devit/conf/ftp.backup.conf" ]; then
error="ftp.backup.conf doesn't exist" error="ftp.backup.conf doesn't exist"
rm -rf $tmpdir rm -rf $tmpdir
rm -f $BACKUP/$user.log rm -f $BACKUP/$user.log
echo "$error" |$SENDMAIL -s "$subj" $email $notify echo "$error" |$SENDMAIL -s "$subj" $email $notify
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe sed -i "/ $user /d" $devit/data/queue/backup.pipe
check_result "$E_NOTEXIST" "$error" check_result "$E_NOTEXIST" "$error"
fi fi
# Parse config # Parse config
source $VESTA/conf/ftp.backup.conf source $devit/conf/ftp.backup.conf
# Set default port # Set default port
if [ -z "$(grep 'PORT=' $VESTA/conf/ftp.backup.conf)" ]; then if [ -z "$(grep 'PORT=' $devit/conf/ftp.backup.conf)" ]; then
PORT='21' PORT='21'
fi fi
@ -590,7 +590,7 @@ ftp_backup() {
rm -rf $tmpdir rm -rf $tmpdir
rm -f $BACKUP/$user.log rm -f $BACKUP/$user.log
echo "$error" |$SENDMAIL -s "$subj" $email $notify echo "$error" |$SENDMAIL -s "$subj" $email $notify
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe sed -i "/ $user /d" $devit/data/queue/backup.pipe
check_result "$E_PARSING" "$error" check_result "$E_PARSING" "$error"
fi fi
@ -605,7 +605,7 @@ ftp_backup() {
rm -rf $tmpdir rm -rf $tmpdir
rm -f $BACKUP/$user.log rm -f $BACKUP/$user.log
echo "$error" |$SENDMAIL -s "$subj" $email $notify echo "$error" |$SENDMAIL -s "$subj" $email $notify
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe sed -i "/ $user /d" $devit/data/queue/backup.pipe
check_result "$E_CONNECT" "$error" check_result "$E_CONNECT" "$error"
fi fi
@ -623,7 +623,7 @@ ftp_backup() {
rm -rf $tmpdir rm -rf $tmpdir
rm -f $BACKUP/$user.log rm -f $BACKUP/$user.log
echo "$error" |$SENDMAIL -s "$subj" $email $notify echo "$error" |$SENDMAIL -s "$subj" $email $notify
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe sed -i "/ $user /d" $devit/data/queue/backup.pipe
check_result "$E_FTP" "$error" check_result "$E_FTP" "$error"
fi fi
@ -730,20 +730,20 @@ EOF
sftp_backup() { sftp_backup() {
# Checking config # Checking config
if [ ! -e "$VESTA/conf/sftp.backup.conf" ]; then if [ ! -e "$devit/conf/sftp.backup.conf" ]; then
error="Can't open sftp.backup.conf" error="Can't open sftp.backup.conf"
rm -rf $tmpdir rm -rf $tmpdir
rm -f $BACKUP/$user.log rm -f $BACKUP/$user.log
echo "$error" |$SENDMAIL -s "$subj" $email $notify echo "$error" |$SENDMAIL -s "$subj" $email $notify
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe sed -i "/ $user /d" $devit/data/queue/backup.pipe
check_result "$E_NOTEXIST" "$error" check_result "$E_NOTEXIST" "$error"
fi fi
# Parse config # Parse config
source $VESTA/conf/sftp.backup.conf source $devit/conf/sftp.backup.conf
# Set default port # Set default port
if [ -z "$(grep 'PORT=' $VESTA/conf/sftp.backup.conf)" ]; then if [ -z "$(grep 'PORT=' $devit/conf/sftp.backup.conf)" ]; then
PORT='22' PORT='22'
fi fi
@ -753,7 +753,7 @@ sftp_backup() {
rm -rf $tmpdir rm -rf $tmpdir
rm -f $BACKUP/$user.log rm -f $BACKUP/$user.log
echo "$error" |$SENDMAIL -s "$subj" $email $notify echo "$error" |$SENDMAIL -s "$subj" $email $notify
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe sed -i "/ $user /d" $devit/data/queue/backup.pipe
check_result "$E_PARSING" "$error" check_result "$E_PARSING" "$error"
fi fi
@ -778,7 +778,7 @@ sftp_backup() {
rm -rf $tmpdir rm -rf $tmpdir
rm -f $BACKUP/$user.log rm -f $BACKUP/$user.log
echo "$error" |$SENDMAIL -s "$subj" $email $notify echo "$error" |$SENDMAIL -s "$subj" $email $notify
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe sed -i "/ $user /d" $devit/data/queue/backup.pipe
check_result "$rc" "$error" check_result "$rc" "$error"
fi fi
@ -828,9 +828,9 @@ sftp_backup() {
google_backup() { google_backup() {
# Defining google settings # Defining google settings
source $VESTA/conf/google.backup.conf source $devit/conf/google.backup.conf
gsutil="$VESTA/3rdparty/gsutil/gsutil" gsutil="$devit/3rdparty/gsutil/gsutil"
export BOTO_CONFIG="$VESTA/conf/.google.backup.boto" export BOTO_CONFIG="$devit/conf/.google.backup.boto"
# Debug info # Debug info
echo -e "$(date "+%F %T") Remote: gs://$BUCKET/$BPATH/$user.$backup_new_date.tar" echo -e "$(date "+%F %T") Remote: gs://$BUCKET/$BPATH/$user.$backup_new_date.tar"
@ -897,7 +897,7 @@ echo "$(date "+%F %T") Runtime: $run_time $min" |tee -a $BACKUP/$user.log
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Removing duplicate # Removing duplicate
@ -922,7 +922,7 @@ mv -f $USER_DATA/backup.conf_ $USER_DATA/backup.conf
chmod 660 $USER_DATA/backup.conf chmod 660 $USER_DATA/backup.conf
# Deleting task from queue # Deleting task from queue
sed -i "/v-backup-user $user /d" $VESTA/data/queue/backup.pipe sed -i "/v-backup-user $user /d" $devit/data/queue/backup.pipe
U_BACKUPS=$(grep BACKUP $USER_DATA/backup.conf |wc -l) U_BACKUPS=$(grep BACKUP $USER_DATA/backup.conf |wc -l)
update_user_value "$user" '$U_BACKUPS' "$U_BACKUPS" update_user_value "$user" '$U_BACKUPS' "$U_BACKUPS"

View file

@ -14,25 +14,25 @@
source /etc/profile source /etc/profile
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
# Action # # Action #
#----------------------------------------------------------# #----------------------------------------------------------#
$BIN/v-check-vesta-license >/dev/null $BIN/v-check-devit-license >/dev/null
if [ -z "$BACKUP_SYSTEM" ]; then if [ -z "$BACKUP_SYSTEM" ]; then
exit exit
fi fi
for user in $(grep '@' /etc/passwd |cut -f1 -d:); do for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
if [ ! -f "$VESTA/data/users/$user/user.conf" ]; then if [ ! -f "$devit/data/users/$user/user.conf" ]; then
continue; continue;
fi fi
check_suspend=$(grep "SUSPENDED='no'" $VESTA/data/users/$user/user.conf) check_suspend=$(grep "SUSPENDED='no'" $devit/data/users/$user/user.conf)
log=$VESTA/log/backup.log log=$devit/log/backup.log
if [ ! -z "$check_suspend" ]; then if [ ! -z "$check_suspend" ]; then
echo -e "================================" >> $log echo -e "================================" >> $log
echo -e "$user" >> $log echo -e "$user" >> $log
@ -43,7 +43,7 @@ for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
done done
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# No Logging # No Logging

View file

@ -21,8 +21,8 @@ wday=$7
command=$8 command=$8
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -66,7 +66,7 @@ sync_cron_jobs
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restarting crond # Restarting crond

View file

@ -16,9 +16,9 @@ dbuser=$3
password=$4; HIDE=4 password=$4; HIDE=4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/db.sh source $devit/func/db.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -37,7 +37,7 @@ dbpass="$password"
#----------------------------------------------------------# #----------------------------------------------------------#
# Define email # Define email
email=$(grep CONTACT $VESTA/data/users/admin/user.conf |cut -f2 -d \') email=$(grep CONTACT $devit/data/users/admin/user.conf |cut -f2 -d \')
subj="v-change-database-host-password $*" subj="v-change-database-host-password $*"
case $type in case $type in
@ -59,7 +59,7 @@ update_object_value "../../conf/$type" 'HOST' "$host" '$PASSWORD' "$dbpass"
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -14,10 +14,10 @@ database=$1
user=$2 user=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/db.sh source $devit/func/db.sh
source $VESTA/func/rebuild.sh source $devit/func/rebuild.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -32,7 +32,7 @@ is_object_unsuspended 'user' 'USER' "$user"
# Check owner existance # Check owner existance
owner=$(echo $database | cut -f 1 -d '_') owner=$(echo $database | cut -f 1 -d '_')
if [ ! -e "$VESTA/data/users/$owner" ]; then if [ ! -e "$devit/data/users/$owner" ]; then
echo "Error: database owner doesn't exist" echo "Error: database owner doesn't exist"
log_event "$E_NOTEXIST" "$ARGUMENTS" log_event "$E_NOTEXIST" "$ARGUMENTS"
exit $E_NOTEXIST exit $E_NOTEXIST
@ -44,7 +44,7 @@ if [ "$owner" = "$user" ]; then
fi fi
# Check db existance # Check db existance
db_data=$(grep "DB='$database'" $VESTA/data/users/$owner/db.conf) db_data=$(grep "DB='$database'" $devit/data/users/$owner/db.conf)
if [ -z "$db_data" ]; then if [ -z "$db_data" ]; then
echo "Error: database $database doesn't exist" echo "Error: database $database doesn't exist"
log_event "$E_NOTEXIST" "$ARGUMENTS" log_event "$E_NOTEXIST" "$ARGUMENTS"
@ -53,7 +53,7 @@ fi
# Check if datbase name is uniq # Check if datbase name is uniq
new_db=$(echo $database | sed "s/^${owner}_/${user}_/") new_db=$(echo $database | sed "s/^${owner}_/${user}_/")
check_db=$(grep "DB='$new_db'" $VESTA/data/users/$user/db.conf) check_db=$(grep "DB='$new_db'" $devit/data/users/$user/db.conf)
if [ ! -z "$check_db" ]; then if [ ! -z "$check_db" ]; then
echo "Error: $new_db database exists" echo "Error: $new_db database exists"
log_event "$E_EXISTS" "$ARGUMENTS" log_event "$E_EXISTS" "$ARGUMENTS"
@ -87,7 +87,7 @@ esac
# Import configuration # Import configuration
db_data=$(echo "$db_data" | sed "s/'${owner}_/'${user}_/g") db_data=$(echo "$db_data" | sed "s/'${owner}_/'${user}_/g")
echo "$db_data" >> $VESTA/data/users/$user/db.conf echo "$db_data" >> $devit/data/users/$user/db.conf
eval $db_data eval $db_data
# Unsuspend db # Unsuspend db
@ -115,7 +115,7 @@ $BIN/v-update-user-counters $user
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -16,9 +16,9 @@ database=$2
password=$3; HIDE=3 password=$3; HIDE=3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/db.sh source $devit/func/db.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -48,7 +48,7 @@ esac
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Update config value # Update config value

View file

@ -16,10 +16,10 @@ dbuser="$user"_"$3"
password=$4; HIDE=4 password=$4; HIDE=4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/db.sh source $devit/func/db.sh
source $VESTA/func/rebuild.sh source $devit/func/rebuild.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -81,7 +81,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -17,8 +17,8 @@ domain_idn=$2
exp=$3 exp=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -49,16 +49,16 @@ update_object_value 'dns' 'DOMAIN' "$domain" '$EXP' "$exp"
# Updating dns-cluster queue # Updating dns-cluster queue
if [ ! -z "$DNS_CLUSTER" ]; then if [ ! -z "$DNS_CLUSTER" ]; then
# Check for first sync # Check for first sync
dlock=$(grep "domain $user $domain" $VESTA/data/queue/dns-cluster.pipe) dlock=$(grep "domain $user $domain" $devit/data/queue/dns-cluster.pipe)
if [ -z "$dlock" ]; then if [ -z "$dlock" ]; then
cmd="$BIN/v-change-remote-dns-domain-exp $user $domain $exp" cmd="$BIN/v-change-remote-dns-domain-exp $user $domain $exp"
echo "$cmd" >> $VESTA/data/queue/dns-cluster.pipe echo "$cmd" >> $devit/data/queue/dns-cluster.pipe
fi fi
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -17,9 +17,9 @@ ip=$3
restart=$4 restart=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -63,16 +63,16 @@ fi
# Updating dns-cluster queue # Updating dns-cluster queue
if [ ! -z "$DNS_CLUSTER" ]; then if [ ! -z "$DNS_CLUSTER" ]; then
# Check for first sync # Check for first sync
dlock=$(grep "domain $user $domain" $VESTA/data/queue/dns-cluster.pipe) dlock=$(grep "domain $user $domain" $devit/data/queue/dns-cluster.pipe)
if [ -z "$dlock" ]; then if [ -z "$dlock" ]; then
cmd="$BIN/v-add-remote-dns-domain $user $domain domain yes" cmd="$BIN/v-add-remote-dns-domain $user $domain domain yes"
echo "$cmd" >> $VESTA/data/queue/dns-cluster.pipe echo "$cmd" >> $devit/data/queue/dns-cluster.pipe
fi fi
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restarting named # Restarting named

View file

@ -18,9 +18,9 @@ soa=$(echo $3 | sed -e 's/\.*$//g' -e 's/^\.*//g')
restart=$4 restart=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -57,16 +57,16 @@ fi
# Updating dns-cluster queue # Updating dns-cluster queue
if [ ! -z "$DNS_CLUSTER" ]; then if [ ! -z "$DNS_CLUSTER" ]; then
# Check for first sync # Check for first sync
dlock=$(grep "domain $user $domain" $VESTA/data/queue/dns-cluster.pipe) dlock=$(grep "domain $user $domain" $devit/data/queue/dns-cluster.pipe)
if [ -z "$dlock" ]; then if [ -z "$dlock" ]; then
cmd="$BIN/v-change-remote-dns-domain-soa $user $domain $soa" cmd="$BIN/v-change-remote-dns-domain-soa $user $domain $soa"
echo "$cmd" >> $VESTA/data/queue/dns-cluster.pipe echo "$cmd" >> $devit/data/queue/dns-cluster.pipe
fi fi
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restarting named # Restarting named

View file

@ -19,9 +19,9 @@ template=$3
restart=$4 restart=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -104,19 +104,19 @@ fi
# Updating dns-cluster queue # Updating dns-cluster queue
if [ ! -z "$DNS_CLUSTER" ]; then if [ ! -z "$DNS_CLUSTER" ]; then
# Check for first sync # Check for first sync
dlock=$(grep "domain $user $domain" $VESTA/data/queue/dns-cluster.pipe) dlock=$(grep "domain $user $domain" $devit/data/queue/dns-cluster.pipe)
if [ -z "$dlock" ]; then if [ -z "$dlock" ]; then
cmd="$BIN/v-add-remote-dns-domain $user $domain domain" cmd="$BIN/v-add-remote-dns-domain $user $domain domain"
echo "$cmd" >> $VESTA/data/queue/dns-cluster.pipe echo "$cmd" >> $devit/data/queue/dns-cluster.pipe
fi fi
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating vesta config # Updating devit config
update_object_value 'dns' 'DOMAIN' "$domain" '$TPL' "$template" update_object_value 'dns' 'DOMAIN' "$domain" '$TPL' "$template"
update_object_value 'dns' 'DOMAIN' "$domain" '$RECORDS' "$records" update_object_value 'dns' 'DOMAIN' "$domain" '$RECORDS' "$records"

View file

@ -17,9 +17,9 @@ ttl=$3
restart=$4 restart=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -56,16 +56,16 @@ fi
# Updating dns-cluster queue # Updating dns-cluster queue
if [ ! -z "$DNS_CLUSTER" ]; then if [ ! -z "$DNS_CLUSTER" ]; then
# Check for first sync # Check for first sync
dlock=$(grep "domain $user $domain" $VESTA/data/queue/dns-cluster.pipe) dlock=$(grep "domain $user $domain" $devit/data/queue/dns-cluster.pipe)
if [ -z "$dlock" ]; then if [ -z "$dlock" ]; then
cmd="$BIN/v-change-remote-dns-domain-ttl $user $domain $ttl" cmd="$BIN/v-change-remote-dns-domain-ttl $user $domain $ttl"
echo "$cmd" >> $VESTA/data/queue/dns-cluster.pipe echo "$cmd" >> $devit/data/queue/dns-cluster.pipe
fi fi
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restarting named # Restarting named

View file

@ -19,9 +19,9 @@ priority=$5
restart=$6 restart=$6
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -93,16 +93,16 @@ fi
# Updating dns-cluster queue # Updating dns-cluster queue
if [ ! -z "$DNS_CLUSTER" ]; then if [ ! -z "$DNS_CLUSTER" ]; then
# Check for first sync # Check for first sync
dlock=$(grep "domain $user $domain" $VESTA/data/queue/dns-cluster.pipe) dlock=$(grep "domain $user $domain" $devit/data/queue/dns-cluster.pipe)
if [ -z "$dlock" ]; then if [ -z "$dlock" ]; then
cmd="$BIN/v-add-remote-dns-domain $user $domain records" cmd="$BIN/v-add-remote-dns-domain $user $domain records"
echo "$cmd" >> $VESTA/data/queue/dns-cluster.pipe echo "$cmd" >> $devit/data/queue/dns-cluster.pipe
fi fi
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restarting named # Restarting named

View file

@ -18,9 +18,9 @@ newid=$4
restart=$5 restart=$5
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -62,16 +62,16 @@ fi
# Updating dns-cluster queue # Updating dns-cluster queue
if [ ! -z "$DNS_CLUSTER" ]; then if [ ! -z "$DNS_CLUSTER" ]; then
# Check for first sync # Check for first sync
dlock=$(grep "domain $user $domain" $VESTA/data/queue/dns-cluster.pipe) dlock=$(grep "domain $user $domain" $devit/data/queue/dns-cluster.pipe)
if [ -z "$dlock" ]; then if [ -z "$dlock" ]; then
cmd="$BIN/v-add-remote-dns-domain $user $domain records" cmd="$BIN/v-add-remote-dns-domain $user $domain records"
echo "$cmd" >> $VESTA/data/queue/dns-cluster.pipe echo "$cmd" >> $devit/data/queue/dns-cluster.pipe
fi fi
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restarting named # Restarting named

View file

@ -14,9 +14,9 @@ domain=$1
user=$2 user=$2
# Includes # Includes
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -41,7 +41,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# WEB domain # WEB domain
web_data=$(grep "DOMAIN='$domain'" $VESTA/data/users/$owner/web.conf) web_data=$(grep "DOMAIN='$domain'" $devit/data/users/$owner/web.conf)
if [ ! -z "$web_data" ]; then if [ ! -z "$web_data" ]; then
$BIN/v-suspend-web-domain $owner $domain >> /dev/null 2>&1 $BIN/v-suspend-web-domain $owner $domain >> /dev/null 2>&1
eval $web_data eval $web_data
@ -53,14 +53,14 @@ if [ ! -z "$web_data" ]; then
# Check SSL # Check SSL
if [ "$SSL" = 'yes' ]; then if [ "$SSL" = 'yes' ]; then
ssl_crt=$VESTA/data/users/$owner/ssl/$domain.crt ssl_crt=$devit/data/users/$owner/ssl/$domain.crt
ssl_key=$VESTA/data/users/$owner/ssl/$domain.key ssl_key=$devit/data/users/$owner/ssl/$domain.key
ssl_ca=$VESTA/data/users/$owner/ssl/$domain.ca ssl_ca=$devit/data/users/$owner/ssl/$domain.ca
ssl_pem=$VESTA/data/users/$owner/ssl/$domain.pem ssl_pem=$devit/data/users/$owner/ssl/$domain.pem
mv $ssl_crt $VESTA/data/users/$user/ssl/ mv $ssl_crt $devit/data/users/$user/ssl/
mv $ssl_key $VESTA/data/users/$user/ssl/ mv $ssl_key $devit/data/users/$user/ssl/
mv $ssl_ca $VESTA/data/users/$user/ssl/ >> /dev/null 2>&1 mv $ssl_ca $devit/data/users/$user/ssl/ >> /dev/null 2>&1
mv $ssl_pem $VESTA/data/users/$user/ssl/ >> /dev/null 2>&1 mv $ssl_pem $devit/data/users/$user/ssl/ >> /dev/null 2>&1
rm -f $HOMEDIR/$owner/conf/web/ssl.$domain.* rm -f $HOMEDIR/$owner/conf/web/ssl.$domain.*
fi fi
@ -73,8 +73,8 @@ if [ ! -z "$web_data" ]; then
fi fi
# Move config # Move config
sed -i "/DOMAIN='$domain'/d" $VESTA/data/users/$owner/web.conf sed -i "/DOMAIN='$domain'/d" $devit/data/users/$owner/web.conf
echo "$web_data" >> $VESTA/data/users/$user/web.conf echo "$web_data" >> $devit/data/users/$user/web.conf
# Move data # Move data
mv $HOMEDIR/$owner/web/$domain $HOMEDIR/$user/web/ mv $HOMEDIR/$owner/web/$domain $HOMEDIR/$user/web/
@ -90,23 +90,23 @@ if [ ! -z "$web_data" ]; then
fi fi
# DNS domain # DNS domain
dns_data=$(grep "DOMAIN='$domain'" $VESTA/data/users/$owner/dns.conf) dns_data=$(grep "DOMAIN='$domain'" $devit/data/users/$owner/dns.conf)
if [ ! -z "$dns_data" ]; then if [ ! -z "$dns_data" ]; then
eval $dns_data eval $dns_data
# Change IP # Change IP
if [ ! -z "$ip" ]; then if [ ! -z "$ip" ]; then
dns_data=$(echo "$dns_data" | sed "s/IP='$IP'/IP='$ip'/") dns_data=$(echo "$dns_data" | sed "s/IP='$IP'/IP='$ip'/")
sed -i "s/$IP/$ip/g" $VESTA/data/users/$owner/dns/$domain.conf sed -i "s/$IP/$ip/g" $devit/data/users/$owner/dns/$domain.conf
fi fi
# Move config # Move config
sed -i "/DOMAIN='$domain'/d" $VESTA/data/users/$owner/dns.conf sed -i "/DOMAIN='$domain'/d" $devit/data/users/$owner/dns.conf
echo "$dns_data" >> $VESTA/data/users/$user/dns.conf echo "$dns_data" >> $devit/data/users/$user/dns.conf
# Move dns records # Move dns records
mv $VESTA/data/users/$owner/dns/$domain.conf \ mv $devit/data/users/$owner/dns/$domain.conf \
$VESTA/data/users/$user/dns/ $devit/data/users/$user/dns/
# Rebuild config # Rebuild config
$BIN/v-unsuspend-dns-domain $user $domain no >> /dev/null 2>&1 $BIN/v-unsuspend-dns-domain $user $domain no >> /dev/null 2>&1
@ -120,21 +120,21 @@ if [ ! -z "$dns_data" ]; then
fi fi
# MAIL domain # MAIL domain
mail_data=$(grep "DOMAIN='$domain'" $VESTA/data/users/$owner/mail.conf) mail_data=$(grep "DOMAIN='$domain'" $devit/data/users/$owner/mail.conf)
if [ ! -z "$mail_data" ]; then if [ ! -z "$mail_data" ]; then
# Move config # Move config
sed -i "/DOMAIN='$domain'/d" $VESTA/data/users/$owner/mail.conf sed -i "/DOMAIN='$domain'/d" $devit/data/users/$owner/mail.conf
echo "$mail_data" >> $VESTA/data/users/$user/mail.conf echo "$mail_data" >> $devit/data/users/$user/mail.conf
mv -f $VESTA/data/users/$owner/mail/$domain.conf \ mv -f $devit/data/users/$owner/mail/$domain.conf \
$VESTA/data/users/$user/mail/ $devit/data/users/$user/mail/
# Move DKIM # Move DKIM
if [ -e "$VESTA/data/users/$owner/mail/$domain.pem" ]; then if [ -e "$devit/data/users/$owner/mail/$domain.pem" ]; then
mv -f $VESTA/data/users/$owner/mail/$domain.pem \ mv -f $devit/data/users/$owner/mail/$domain.pem \
$VESTA/data/users/$user/mail/ $devit/data/users/$user/mail/
mv -f $VESTA/data/users/$owner/mail/$domain.pub \ mv -f $devit/data/users/$owner/mail/$domain.pub \
$VESTA/data/users/$user/mail/ $devit/data/users/$user/mail/
fi fi
# Move data # Move data
@ -168,7 +168,7 @@ $BIN/v-update-user-counters $user
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -23,15 +23,15 @@ protocol=$(echo $protocol|tr '[:lower:]' '[:upper:]')
comment=$6 comment=$6
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Sort function # Sort function
sort_fw_rules() { sort_fw_rules() {
cat $VESTA/data/firewall/rules.conf |\ cat $devit/data/firewall/rules.conf |\
sort -n -k 2 -t \' > $VESTA/data/firewall/rules.conf.tmp sort -n -k 2 -t \' > $devit/data/firewall/rules.conf.tmp
mv -f $VESTA/data/firewall/rules.conf.tmp \ mv -f $devit/data/firewall/rules.conf.tmp \
$VESTA/data/firewall/rules.conf $devit/data/firewall/rules.conf
} }
@ -63,10 +63,10 @@ str="$str IP='$ip' COMMENT='$comment' SUSPENDED='no'"
str="$str TIME='$time' DATE='$date'" str="$str TIME='$time' DATE='$date'"
# Deleting old rule # Deleting old rule
sed -i "/RULE='$rule' /d" $VESTA/data/firewall/rules.conf sed -i "/RULE='$rule' /d" $devit/data/firewall/rules.conf
# Adding new # Adding new
echo "$str" >> $VESTA/data/firewall/rules.conf echo "$str" >> $devit/data/firewall/rules.conf
# Sorting firewall rules by id number # Sorting firewall rules by id number
sort_fw_rules sort_fw_rules
@ -76,7 +76,7 @@ $BIN/v-update-firewall
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -14,9 +14,9 @@ if [ -z "$permissions" ]; then
exit 1 exit 1
fi fi
# Checking vesta user # Checking devit user
if [ ! -e "$VESTA/data/users/$user" ]; then if [ ! -e "$devit/data/users/$user" ]; then
echo "Error: vesta user $user doesn't exist" echo "Error: devit user $user doesn't exist"
exit 3 exit 3
fi fi

View file

@ -17,9 +17,9 @@ account=$3
password=$4; HIDE=4 password=$4; HIDE=4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -52,7 +52,7 @@ salt=$(generate_password "$PW_MATRIX" "8")
md5="{MD5}$($BIN/v-generate-password-hash md5 $salt <<<$password)" md5="{MD5}$($BIN/v-generate-password-hash md5 $salt <<<$password)"
if [[ "$MAIL_SYSTEM" =~ exim ]]; then if [[ "$MAIL_SYSTEM" =~ exim ]]; then
quota=$(grep $account $VESTA/data/users/${user}/mail/${domain}.conf) quota=$(grep $account $devit/data/users/${user}/mail/${domain}.conf)
quota=$(echo $quota | awk '{ print $7 }' | sed -e "s/'//g" ) quota=$(echo $quota | awk '{ print $7 }' | sed -e "s/'//g" )
quota=$(echo $quota | cut -d "=" -f 2 | sed -e "s/unlimited/0/g") quota=$(echo $quota | cut -d "=" -f 2 | sed -e "s/unlimited/0/g")
sed -i "/^$account:/d" $HOMEDIR/$user/conf/mail/$domain/passwd sed -i "/^$account:/d" $HOMEDIR/$user/conf/mail/$domain/passwd
@ -62,7 +62,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Update md5 # Update md5

View file

@ -17,9 +17,9 @@ account=$3
quota=$4 quota=$4
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -61,7 +61,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
if [[ "$quota" -eq 0 ]]; then if [[ "$quota" -eq 0 ]]; then

View file

@ -16,9 +16,9 @@ domain_idn=$2
email=$3 email=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
# Additional argument formatting # Additional argument formatting
format_domain format_domain
@ -50,7 +50,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Change catchall in config # Change catchall in config

View file

@ -14,9 +14,9 @@ user=$1
domain=$2 domain=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/remote.sh source $devit/func/remote.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -37,7 +37,7 @@ remote_dns_health_check
#----------------------------------------------------------# #----------------------------------------------------------#
IFS=$'\n' IFS=$'\n'
for cluster in $(grep "SUSPENDED='no'" $VESTA/conf/dns-cluster.conf); do for cluster in $(grep "SUSPENDED='no'" $devit/conf/dns-cluster.conf); do
# Parsing remote host parameters # Parsing remote host parameters
eval $cluster eval $cluster
@ -51,11 +51,11 @@ done
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating pipe # Updating pipe
pipe="$VESTA/data/queue/dns-cluster.pipe" pipe="$devit/data/queue/dns-cluster.pipe"
str=$(grep -n "$SCRIPT $1 $2 $3$" $pipe | cut -f1 -d: | head -n1) str=$(grep -n "$SCRIPT $1 $2 $3$" $pipe | cut -f1 -d: | head -n1)
if [ ! -z "$str" ]; then if [ ! -z "$str" ]; then
sed -i "$str d" $pipe sed -i "$str d" $pipe

View file

@ -14,9 +14,9 @@ user=$1
domain=$2 domain=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/remote.sh source $devit/func/remote.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -37,7 +37,7 @@ remote_dns_health_check
#----------------------------------------------------------# #----------------------------------------------------------#
IFS=$'\n' IFS=$'\n'
for cluster in $(grep "SUSPENDED='no'" $VESTA/conf/dns-cluster.conf); do for cluster in $(grep "SUSPENDED='no'" $devit/conf/dns-cluster.conf); do
# Parsing remote host parameters # Parsing remote host parameters
eval $cluster eval $cluster
@ -55,11 +55,11 @@ done
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating pipe # Updating pipe
pipe="$VESTA/data/queue/dns-cluster.pipe" pipe="$devit/data/queue/dns-cluster.pipe"
str=$(grep -n "$SCRIPT $1 $2 $3$" $pipe | cut -f1 -d: | head -n1) str=$(grep -n "$SCRIPT $1 $2 $3$" $pipe | cut -f1 -d: | head -n1)
if [ ! -z "$str" ]; then if [ ! -z "$str" ]; then
sed -i "$str d" $pipe sed -i "$str d" $pipe

View file

@ -14,9 +14,9 @@ user=$1
domain=$2 domain=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/remote.sh source $devit/func/remote.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -37,7 +37,7 @@ remote_dns_health_check
#----------------------------------------------------------# #----------------------------------------------------------#
IFS=$'\n' IFS=$'\n'
for cluster in $(grep "SUSPENDED='no'" $VESTA/conf/dns-cluster.conf); do for cluster in $(grep "SUSPENDED='no'" $devit/conf/dns-cluster.conf); do
# Parsing remote host parameters # Parsing remote host parameters
eval $cluster eval $cluster
@ -55,11 +55,11 @@ done
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating pipe # Updating pipe
pipe="$VESTA/data/queue/dns-cluster.pipe" pipe="$devit/data/queue/dns-cluster.pipe"
str=$(grep -n "$SCRIPT $1 $2 $3$" $pipe | cut -f1 -d: | head -n1) str=$(grep -n "$SCRIPT $1 $2 $3$" $pipe | cut -f1 -d: | head -n1)
if [ ! -z "$str" ]; then if [ ! -z "$str" ]; then
sed -i "$str d" $pipe sed -i "$str d" $pipe

View file

@ -15,8 +15,8 @@ key=$(echo "$1" | tr '[:lower:]' '[:upper:]' )
value=$2 value=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin" PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin"
@ -35,11 +35,11 @@ format_no_quotes "$value" 'value'
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating conf # Updating conf
check_ckey=$(grep "^$key='" $VESTA/conf/vesta.conf) check_ckey=$(grep "^$key='" $devit/conf/devit.conf)
if [ -z "$check_ckey" ]; then if [ -z "$check_ckey" ]; then
echo "$key='$value'" >> $VESTA/conf/vesta.conf echo "$key='$value'" >> $devit/conf/devit.conf
else else
sed -i "s|$key=.*|$key='$value'|g" $VESTA/conf/vesta.conf sed -i "s|$key=.*|$key='$value'|g" $devit/conf/devit.conf
fi fi
if [ "$key" = "BACKUP" ] && [ "$value" != '/backup' ]; then if [ "$key" = "BACKUP" ] && [ "$value" != '/backup' ]; then
@ -49,7 +49,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -13,8 +13,8 @@
domain=$1 domain=$1
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -46,7 +46,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -14,9 +14,9 @@ ip=$1
ip_name=$2 ip_name=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -38,7 +38,7 @@ update_ip_value '$NAME' "$ip_name"
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -15,9 +15,9 @@ nat_ip=$2
restart=$3 restart=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -35,14 +35,14 @@ is_ip_valid "$ip"
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating IP # Updating IP
if [ -z "$(grep NAT= $VESTA/data/ips/$ip)" ]; then if [ -z "$(grep NAT= $devit/data/ips/$ip)" ]; then
sed -i "s/^TIME/NAT='$nat_ip'\nTIME/g" $VESTA/data/ips/$ip sed -i "s/^TIME/NAT='$nat_ip'\nTIME/g" $devit/data/ips/$ip
old='' old=''
new=$nat_ip new=$nat_ip
else else
old=$(get_ip_value '$NAT') old=$(get_ip_value '$NAT')
new=$nat_ip new=$nat_ip
sed -i "s/NAT=.*/NAT='$new'/" $VESTA/data/ips/$ip sed -i "s/NAT=.*/NAT='$new'/" $devit/data/ips/$ip
if [ -z "$nat_ip" ]; then if [ -z "$nat_ip" ]; then
new=$ip new=$ip
fi fi
@ -50,8 +50,8 @@ fi
# Updating WEB configs # Updating WEB configs
if [ ! -z "$old" ] && [ ! -z "$WEB_SYSTEM" ]; then if [ ! -z "$old" ] && [ ! -z "$WEB_SYSTEM" ]; then
sed -i "s/$old/$new/" $VESTA/data/users/*/web.conf sed -i "s/$old/$new/" $devit/data/users/*/web.conf
for user in $(ls $VESTA/data/users/); do for user in $(ls $devit/data/users/); do
$BIN/v-rebuild-web-domains $user no $BIN/v-rebuild-web-domains $user no
done done
$BIN/v-restart-dns $restart $BIN/v-restart-dns $restart
@ -59,9 +59,9 @@ fi
# Updating DNS configs # Updating DNS configs
if [ ! -z "$old" ] && [ ! -z "$DNS_SYSTEM" ]; then if [ ! -z "$old" ] && [ ! -z "$DNS_SYSTEM" ]; then
sed -i "s/$old/$new/" $VESTA/data/users/*/dns.conf sed -i "s/$old/$new/" $devit/data/users/*/dns.conf
sed -i "s/$old/$new/" $VESTA/data/users/*/dns/*.conf sed -i "s/$old/$new/" $devit/data/users/*/dns/*.conf
for user in $(ls $VESTA/data/users/); do for user in $(ls $devit/data/users/); do
$BIN/v-rebuild-dns-domains $user no $BIN/v-rebuild-dns-domains $user no
done done
$BIN/v-restart-dns $restart $BIN/v-restart-dns $restart
@ -90,14 +90,14 @@ fi
# Updating firewall # Updating firewall
if [ ! -z "$old" ] && [ ! -z "$FIREWALL_SYSTEM" ]; then if [ ! -z "$old" ] && [ ! -z "$FIREWALL_SYSTEM" ]; then
sed -i "s/$old/$new/g" $VESTA/data/firewall/*.conf sed -i "s/$old/$new/g" $devit/data/firewall/*.conf
$BIN/v-update-firewall $BIN/v-update-firewall
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -14,9 +14,9 @@ ip=$1
user=$2 user=$2
# Includes # Includes
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -43,8 +43,8 @@ if [ "$ip_owner" != "$user" ]; then
decrease_user_value "$ip_owner" '$IP_OWNED' decrease_user_value "$ip_owner" '$IP_OWNED'
if [ "$ip_owner" = 'admin' ]; then if [ "$ip_owner" = 'admin' ]; then
if [ "$ip_status" = 'shared' ]; then if [ "$ip_status" = 'shared' ]; then
for vesta_user in $(ls $VESTA/data/users); do for devit_user in $(ls $devit/data/users); do
decrease_user_value "$vesta_user" '$IP_AVAIL' decrease_user_value "$devit_user" '$IP_AVAIL'
done done
else else
decrease_user_value 'admin' '$IP_AVAIL' decrease_user_value 'admin' '$IP_AVAIL'
@ -57,7 +57,7 @@ if [ "$ip_owner" != "$user" ]; then
increase_user_value "$user" '$IP_OWNED' increase_user_value "$user" '$IP_OWNED'
if [ "$user" = 'admin' ]; then if [ "$user" = 'admin' ]; then
if [ "$ip_status" = 'shared' ]; then if [ "$ip_status" = 'shared' ]; then
for user in $(ls $VESTA/data/users); do for user in $(ls $devit/data/users); do
increase_user_value "$user" '$IP_AVAIL' increase_user_value "$user" '$IP_AVAIL'
done done
else else
@ -71,7 +71,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -14,9 +14,9 @@ ip=$1
ip_status=$2 ip_status=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/ip.sh source $devit/func/ip.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -46,7 +46,7 @@ update_ip_value '$STATUS' "$ip_status"
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -13,12 +13,12 @@
language=$1 language=$1
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
is_language_valid() { is_language_valid() {
if [ ! -e "$VESTA/web/inc/i18n/$language.php" ]; then if [ ! -e "$devit/web/inc/i18n/$language.php" ]; then
echo "Error: language file $language doesn't exist" echo "Error: language file $language doesn't exist"
log_event "$E_NOTEXIST $ARGUMENTS" log_event "$E_NOTEXIST $ARGUMENTS"
exit $E_NOTEXIST exit $E_NOTEXIST
@ -40,15 +40,15 @@ is_language_valid $language
#----------------------------------------------------------# #----------------------------------------------------------#
# Change language # Change language
if [ -z "$(grep LANGUAGE $VESTA/conf/vesta.conf)" ]; then if [ -z "$(grep LANGUAGE $devit/conf/devit.conf)" ]; then
echo "LANGUAGE='$language'" >> $VESTA/conf/vesta.conf echo "LANGUAGE='$language'" >> $devit/conf/devit.conf
else else
sed -i "s/LANGUAGE=.*/LANGUAGE='$language'/g" $VESTA/conf/vesta.conf sed -i "s/LANGUAGE=.*/LANGUAGE='$language'/g" $devit/conf/devit.conf
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -16,8 +16,8 @@ restart=$3
echo "$0 $*" >/tmp/t.log echo "$0 $*" >/tmp/t.log
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -122,7 +122,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -13,8 +13,8 @@
timezone=$1 timezone=$1
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
is_timezone_valid() { is_timezone_valid() {
if [ ! -e "/usr/share/zoneinfo/$timezone" ]; then if [ ! -e "/usr/share/zoneinfo/$timezone" ]; then
@ -63,7 +63,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# info: change vesta ssl certificate # info: change devit ssl certificate
# options: SSL_DIR [RESTART] # options: SSL_DIR [RESTART]
# #
# The function changes vesta SSL certificate and the key. # The function changes devit SSL certificate and the key.
#----------------------------------------------------------# #----------------------------------------------------------#
@ -15,9 +15,9 @@ ssl_dir=$1
restart=$2 restart=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -50,21 +50,21 @@ else
fi fi
# Moving old certificate # Moving old certificate
mv $VESTA/ssl/certificate.crt $VESTA/ssl/certificate.crt.back mv $devit/ssl/certificate.crt $devit/ssl/certificate.crt.back
mv $VESTA/ssl/certificate.key $VESTA/ssl/certificate.key.back mv $devit/ssl/certificate.key $devit/ssl/certificate.key.back
# Adding new certificate # Adding new certificate
cp -f $ssl_dir/certificate.crt $VESTA/ssl/certificate.crt cp -f $ssl_dir/certificate.crt $devit/ssl/certificate.crt
cp -f $ssl_dir/certificate.key $VESTA/ssl/certificate.key cp -f $ssl_dir/certificate.key $devit/ssl/certificate.key
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Restarting web server # Restarting web server
if [ "$restart" != 'no' ]; then if [ "$restart" != 'no' ]; then
kill -HUP $(cat /var/run/vesta-nginx.pid) kill -HUP $(cat /var/run/devit-nginx.pid)
$BIN/v-restart-mail $BIN/v-restart-mail
if [ ! -z "$IMAP_SYSTEM" ]; then if [ ! -z "$IMAP_SYSTEM" ]; then
v-restart-service "$IMAP_SYSTEM" v-restart-service "$IMAP_SYSTEM"

View file

@ -14,8 +14,8 @@ user=$1
email=$2 email=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -44,7 +44,7 @@ $BIN/v-rebuild-cron-jobs $user > /dev/null 2>&1
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -14,8 +14,8 @@ user=$1
language=$2 language=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
is_language_valid() { is_language_valid() {
@ -24,7 +24,7 @@ is_language_valid() {
log_event "$E_INVALID" "$ARGUMENTS" log_event "$E_INVALID" "$ARGUMENTS"
exit $E_INVALID exit $E_INVALID
fi fi
if [ ! -e "$VESTA/web/inc/i18n/$1.php" ]; then if [ ! -e "$devit/web/inc/i18n/$1.php" ]; then
echo "Error: language $1 doesn't exist" echo "Error: language $1 doesn't exist"
log_event "$E_NOTEXIST" "$ARGUMENTS" log_event "$E_NOTEXIST" "$ARGUMENTS"
exit $E_NOTEXIST exit $E_NOTEXIST
@ -56,7 +56,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -15,8 +15,8 @@ fname=$2
lname=$3 lname=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -43,7 +43,7 @@ update_user_value "$user" '$LNAME' "$lname"
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -21,8 +21,8 @@ ns7=$(echo $8 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns8=$(echo $9 | sed -e 's/\.*$//g' -e 's/^\.*//g') ns8=$(echo $9 | sed -e 's/\.*$//g' -e 's/^\.*//g')
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -75,7 +75,7 @@ update_user_value "$user" '$NS' "$ns"
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -15,9 +15,9 @@ package=$2
force=$3 force=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
is_package_avalable() { is_package_avalable() {
@ -29,7 +29,7 @@ is_package_avalable() {
DISK_QUOTA='0' DISK_QUOTA='0'
BANDWIDTH='0' BANDWIDTH='0'
pkg_data=$(cat $VESTA/data/packages/$package.pkg| egrep -v "TIME|DATE") pkg_data=$(cat $devit/data/packages/$package.pkg| egrep -v "TIME|DATE")
IFS=$'\n' IFS=$'\n'
for str in $pkg_data; do for str in $pkg_data; do
key=$(echo $str |cut -f 1 -d =) key=$(echo $str |cut -f 1 -d =)
@ -82,7 +82,7 @@ is_package_avalable() {
change_user_package() { change_user_package() {
source $USER_DATA/user.conf source $USER_DATA/user.conf
pkg_data=$(cat $VESTA/data/packages/$package.pkg| egrep -v "TIME|DATE") pkg_data=$(cat $devit/data/packages/$package.pkg| egrep -v "TIME|DATE")
IFS=$'\n' IFS=$'\n'
for str in $pkg_data; do for str in $pkg_data; do
key=$(echo $str |cut -f 1 -d =) key=$(echo $str |cut -f 1 -d =)
@ -172,19 +172,19 @@ shell=$(grep -w "$shell_conf" /etc/shells |head -n1)
/usr/bin/chsh -s "$shell" "$user" &>/dev/null /usr/bin/chsh -s "$shell" "$user" &>/dev/null
# Run template trigger # Run template trigger
if [ -x "$VESTA/data/packages/$package.sh" ]; then if [ -x "$devit/data/packages/$package.sh" ]; then
$VESTA/data/packages/$package.sh "$user" "$CONTACT" "$FNAME" "$LNAME" $devit/data/packages/$package.sh "$user" "$CONTACT" "$FNAME" "$LNAME"
fi fi
# Update disk quota # Update disk quota
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
if [ "$DISK_QUOTA" = 'yes' ]; then if [ "$DISK_QUOTA" = 'yes' ]; then
$BIN/v-update-user-quota $user $BIN/v-update-user-quota $user
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

View file

@ -18,8 +18,8 @@ password=$2; HIDE=2
source /etc/profile source /etc/profile
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -44,13 +44,13 @@ is_password_valid
echo "$user:$password" | /usr/sbin/chpasswd echo "$user:$password" | /usr/sbin/chpasswd
md5=$(awk -v user=$user -F : 'user == $1 {print $2}' /etc/shadow) md5=$(awk -v user=$user -F : 'user == $1 {print $2}' /etc/shadow)
if [ "$user" = 'admin' ] && [ -e "$VESTA/web/reset.admin" ]; then if [ "$user" = 'admin' ] && [ -e "$devit/web/reset.admin" ]; then
rm -f $VESTA/web/reset.admin rm -f $devit/web/reset.admin
fi fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Changing RKEY value # Changing RKEY value

View file

@ -14,8 +14,8 @@ user=$1
shell=$2 shell=$2
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -50,7 +50,7 @@ fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Changing user shell # Changing user shell

View file

@ -15,9 +15,9 @@ type=$(echo "$2" | tr '[:lower:]' '[:upper:]')
template=$3 template=$3
# Includes # Includes
source $VESTA/func/main.sh source $devit/func/main.sh
source $VESTA/func/domain.sh source $devit/func/domain.sh
source $VESTA/conf/vesta.conf source $devit/conf/devit.conf
#----------------------------------------------------------# #----------------------------------------------------------#
@ -46,7 +46,7 @@ esac
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # devit #
#----------------------------------------------------------# #----------------------------------------------------------#
# Logging # Logging

Some files were not shown because too many files have changed in this diff Show more