Browse Source

Clear old update scripts.

Raphael Schneeberger 7 years ago
parent
commit
f96e4f09cf

+ 0 - 17
upd/add_firewall.sh

@@ -1,17 +0,0 @@
-#!/bin/bash
-
-source /etc/profile.d/vesta.sh
-if [ ! -e "$VESTA/data/firewall" ]; then
-    mkdir -p $VESTA/data/firewall
-    chmod 770 $VESTA/data/firewall
-
-    cp $VESTA/install/rhel/firewall/* \
-        $VESTA/data/firewall/
-    chmod 660 $VESTA/data/firewall/*
-
-    source $VESTA/conf/vesta.conf
-    if [ -z "$FIREWALL_SYSTEM" ]; then
-        echo "FIREWALL_SYSTEM='iptables'" \
-            >> $VESTA/conf/vesta.conf
-    fi
-fi

+ 0 - 46
upd/add_fwd_only.sh

@@ -1,46 +0,0 @@
-#!/bin/bash
-
-# RHEL or CentOS
-if [ -e "/etc/exim/exim.conf" ]; then
-    conf='/etc/exim/exim.conf'
-
-    # Check if fwd_only flag
-    check_flag=$(grep localuser_fwd_only $conf)
-    if [ ! -z "$check_flag" ]; then
-        exit
-    fi
-
-    # Define new router
-    fwd1='localuser_fwd_only:\n  driver = accept\n  transport = devnull\n'
-    fwd2='  condition = \${if exists{/etc/exim/domains/\$domain/fwd_only}'
-    fwd3='{\${lookup{\$local_part}lsearch{/etc/exim/domains/\$domain/fwd_only}'
-    fwd4='{true}{false}}}}\n\n'
-
-    # Insert router
-    sed -i "s%localuser_spam:%$fwd1$fwd2$fwd3${fwd4}localuser_spam:%" $conf
-fi
-
-# Debian or Ubuntu
-if [ -e "/etc/exim4/exim4.conf.template" ]; then
-    conf="/etc/exim4/exim4.conf.template"
-
-    # Check if fwd_only flag
-    check_flag=$(grep localuser_fwd_only $conf)
-    if [ ! -z "$check_flag" ]; then
-        sed -i "s%/exim/domains/%/exim4/domains/%g" $conf
-    else
-        # Define new router
-        fwd1='localuser_fwd_only:\n  driver = accept\n  transport = devnull\n'
-        fwd2='  condition = \${if exists{/etc/exim4/domains/\$domain/fwd_only}'
-        fwd3='{\${lookup{\$local_part}lsearch'
-        fwd4='{/etc/exim4/domains/\$domain/fwd_only}{true}{false}}}}\n\n'
-
-        # Insert router
-        sed -i "s%localuser_spam:%$fwd1$fwd2$fwd3${fwd4}localuser_spam:%" $conf
-    fi
-fi
-
-# Restart mail server
-$HESTIA/bin/v-restart-mail > /dev/null 2>&1
-
-exit

+ 0 - 8
upd/add_notifications.sh

@@ -1,8 +0,0 @@
-#!/bin/bash
-# Add notifications
-
-rm -f $HESTIA/data/users/admin/notifications.conf
-$HESTIA/bin/v-add-user-notification admin "File Manager" "Browse, copy, edit, view, and retrieve all your web domain files using a fully featured <a href='http://vestacp.com/features/#filemanager'>File Manager</a>. Plugin is available for <a href='/edit/server/?lead=filemanager#module-filemanager'>purchase</a>." 'filemanager'
-$HESTIA/bin/v-add-user-notification admin "Chroot SFTP" "If you want to have SFTP accounts that will be used only to transfer files (and not to SSH), you can  <a href='/edit/server/?lead=sftp#module-sftp'>purchase</a> and enable <a href='http://vestacp.com/features/#sftpchroot'>SFTP Chroot</a>"
-$HESTIA/bin/v-add-user-notification admin "Release 0.9.8-23" "We've made 1478 commits, fixed 29 bugs and merged 141 pull request. As always for more information please read <a href='http://vestacp.com/roadmap/#0.9.8-23'>release notes</a>"
-

+ 0 - 24
upd/add_sudo.sh

@@ -1,24 +0,0 @@
-#!/bin/bash
-# New sudoers format
-
-if [ ! -e '/etc/sudoers.d/admin' ]; then
-    if [ ! -d '/etc/sudoers.d' ]; then
-        mkdir /etc/sudoers.d
-        chmod 750 /etc/sudoers.d
-    fi
-    echo '# Created by vesta update-trigger' > /etc/sudoers.d/admin
-    echo 'Defaults env_keep="VESTA"' >> /etc/sudoers.d/admin
-    echo 'Defaults env_keep+="HESTIA"' >> /etc/sudoers.d/admin
-    echo 'Defaults:admin !syslog' >> /etc/sudoers.d/admin
-    echo 'Defaults:admin !requiretty' >> /etc/sudoers.d/admin
-    echo 'Defaults:root !requiretty' >> /etc/sudoers.d/admin
-    echo '' >> /etc/sudoers.d/admin
-    echo 'admin   ALL=(ALL)       ALL' >> /etc/sudoers.d/admin
-    echo 'admin   ALL=NOPASSWD:/usr/local/vesta/bin/*' >> /etc/sudoers.d/admin
-    echo 'admin   ALL=NOPASSWD:/usr/local/hestia/bin/*' >> /etc/sudoers.d/admin
-    chmod 440 /etc/sudoers.d/admin
-
-    if [ -z "$(grep /etc/sudoers.d /etc/sudoers)" ]; then
-        echo -e "\n#includedir /etc/sudoers.d" >> /etc/sudoers
-    fi
-fi

+ 0 - 122
upd/convert_templates.sh

@@ -1,122 +0,0 @@
-#!/bin/bash
-
-# Check version
-source /usr/local/hestia/conf/hestia.conf
-if [ "$VERSION" != '0.9.7' ]; then
-    exit
-fi
-
-# Rename web system service
-sed -i "s/apache/httpd/g" /usr/local/hestia/conf/hestia.conf
-
-# Rename dns system service
-sed -i "s/bind/named/g" /usr/local/hestia/conf/hestia.conf
-
-# Rename nginx config
-mv /etc/nginx/conf.d/hestia_users.conf /etc/nginx/conf.d/hestia.conf 2>/dev/null
-rm -f /etc/nginx/conf.d/hestia_ip.conf 2>/dev/null
-
-# Update user packages
-PKG=/usr/local/hestia/data/packages
-for package in $(ls $PKG); do
-    default=$(grep "^TEMPLATE='" $PKG/$package | cut -f2 -d \')
-    if [ ! -z "$default" ]; then
-        tpl="WEB_TEMPLATE='$default'"
-        tpl="$tpl\nPROXY_TEMPLATE='default'"
-        tpl="$tpl\nDNS_TEMPLATE='default'"
-        sed -i "s/^TEMPLATE=.*/$tpl/g" $PKG/$package
-    fi
-done
-
-# Update users
-USR=/usr/local/hestia/data/users
-for user in $(ls $USR); do
-    default=$(grep "^TEMPLATE='" $USR/$user/user.conf | cut -f2 -d \')
-    if [ ! -z "$default" ]; then
-        tpl="WEB_TEMPLATE='$default'"
-        tpl="$tpl\nPROXY_TEMPLATE='default'"
-        tpl="$tpl\nDNS_TEMPLATE='default'"
-        sed -i "s/^TEMPLATE=.*/$tpl/g" $USR/$user/user.conf
-    fi
-done
-
-# Rename NGINX to PROXY key
-sed -i "s/NGINX/PROXY/g" /usr/local/hestia/data/users/*/web.conf
-
-# Check template structure
-TPL='/usr/local/hestia/data/templates/web'
-if [ -e "$TPL/apache" ]; then
-    mv $TPL/apache $TPL/httpd
-fi
-
-# Remove unused email template
-if [ -e $TPL/email_reset_password.tpl ]; then
-    rm -f $TPL/email_reset_password.tpl
-fi
-
-# Update httpd templates
-if [ ! -z "$(ls $TPL | grep apache_)" ]; then
-    mkdir -p $TPL/httpd
-    mv $TPL/apache_* $TPL/httpd/
-    for template in $(ls $TPL/httpd); do
-        new_name=$(echo $template | sed -e "s/apache_//")
-        mv -f $TPL/httpd/$template $TPL/httpd/$new_name
-    done
-fi
-if [ -e "$TPL/httpd" ]; then
-    sed -i -e "s/%elog%//g" \
-        -e "s/%cgi%//g" \
-        -e "s/%cgi_option%/+ExecCGI/g" $TPL/httpd/*
-fi
-
-# Update nginx templates
-if [ ! -z "$(ls $TPL/| grep nginx_)" ];then
-    mkdir -p $TPL/nginx
-    mv $TPL/nginx_* $TPL/nginx/
-    for template in $(ls $TPL/nginx/); do
-        new_name=$(echo $template |sed -e "s/nginx_//")
-        mv -f $TPL/nginx/$template $TPL/nginx/$new_name
-    done
-fi
-if [ -e "$TPL/ngingx.ip.tpl" ]; then
-    mv $TPL/ngingx.ip.tpl $TPL/nginx/proxy_ip.tpl
-fi
-if [ -e "$TPL/nginx/ip.tpl" ]; then
-    mv $TPL/nginx/ip.tpl $TPL/nginx/proxy_ip.tpl
-fi
-if [ -e "$TPL/nginx" ]; then
-    sed -i -e "s/%elog%//g" \
-        -e "s/nginx_extentions/proxy_extentions/g" $TPL/nginx/*
-fi
-
-# Move Awstats templates
-if [ -e "$TPL/awstats.tpl" ]; then
-    mkdir -p $TPL/awstats
-    mv $TPL/awstats.tpl $TPL/awstats
-    mv $TPL/awstats_index.tpl $TPL/awstats/index.tpl
-    mv $TPL/awstats_nav.tpl $TPL/awstats/nav.tpl
-fi
-
-# Move Webalizer templates
-if [ -e "$TPL/webalizer.tpl" ]; then
-    mkdir -p $TPL/webalizer
-    mv $TPL/webalizer.tpl $TPL/webalizer
-fi
-
-# Update proxy ip configuration
-for ip in $(ls /usr/local/hestia/data/ips); do
-    cat $TPL/nginx/proxy_ip.tpl |\
-        sed -e "s/%ip%/$ip/g" \
-            -e "s/%web_port%/8080/g" \
-            -e "s/%proxy_port%/80/g" \
-        > /etc/nginx/conf.d/$ip.conf
-done
-
-# Remove broken symlink protection
-sed -i '/Symlinks protection/d' /etc/nginx/nginx.conf
-sed -i '/disable_symlinks.*/d' /etc/nginx/nginx.conf
-
-# Update version
-sed -i 's/0.9.7/0.9.8/' /usr/local/hestia/conf/hestia.conf
-
-exit

+ 0 - 35
upd/convert_webip.sh

@@ -1,35 +0,0 @@
-#!/bin/bash
-
-# Include hestia.conf
-source /usr/local/hestia/conf/hestia.conf
-
-# Check if old scheme is in use
-check_oldip=$(grep "^Listen" /etc/$WEB_SYSTEM/conf.d/hestia.conf)
-if [ -z "$check_oldip" ]; then
-    exit
-fi
-
-# Remove old ip definitions from hestia.conf
-sed -i "/^Listen/d" /etc/$WEB_SYSTEM/conf.d/hestia.conf
-sed -i "/^NameVirtualHost/d" /etc/$WEB_SYSTEM/conf.d/hestia.conf
-sed -i "/^$/d" /etc/$WEB_SYSTEM/conf.d/hestia.conf
-
-# Create new ip configs
-for ip in $(ls /usr/local/hestia/data/ips); do
-    web_conf="/etc/$WEB_SYSTEM/conf.d/$ip.conf"
-
-    if [ "$WEB_SYSTEM" = 'httpd' ] || [ "$WEB_SYSTEM" = 'apache2' ]; then
-        echo "NameVirtualHost $ip:$WEB_PORT" >  $web_conf
-        echo "Listen $ip:$WEB_PORT" >> $web_conf
-    fi
-
-    if [ "$WEB_SSL" = 'mod_ssl' ]; then
-        echo "NameVirtualHost $ip:$WEB_SSL_PORT" >> $web_conf
-        echo "Listen $ip:$WEB_SSL_PORT" >> $web_conf
-    fi
-done
-
-# Restart web server
-/usr/local/hestia/bin/v-restart-web
-
-exit

+ 0 - 20
upd/fix_dhcprenew.sh

@@ -1,20 +0,0 @@
-#!/bin/bash
-
-if [ -e "/usr/bin/dhcprenew" ]; then
-    mv /usr/bin/dhcprenew /usr/bin/dhcprenew.disabled
-
-    # Notify admin via control panel
-    rm /usr/local/hestia/data/users/admin/notifications.conf
-    touch /usr/local/hestia/data/users/admin/notifications.conf
-    /usr/local/hestia/bin/v-add-user-notification admin \
-        "Security Check" "Your server was compromised please contact us at info@hestiacp.com to get help."
-
-    # Send email notification
-    send_mail="/usr/local/hestia/web/inc/mail-wrapper.php"
-    email=$(grep CONTACT /usr/local/hestia/data/users/admin/user.conf |cut -f2 -d \')
-    if [ ! -z "$email" ]; then
-        echo "Your server $(hostname) was compromised please contact us at info@hestiacp.com to get help." |\
-            $send_mail -s "SECURITY CHECK: Hestia Control Panel" $email
-    fi
-fi
-

+ 0 - 12
upd/fix_exim_permissions.sh

@@ -1,12 +0,0 @@
-#!/bin/bash
-
-if [ -e "/etc/exim4/domains/" ]; then
-    for domain in $(ls /etc/exim4/domains/); do
-        domain_link=$(readlink /etc/exim4/domains/$domain)
-        chown Debian-exim:mail $domain_link
-        chown Debian-exim:mail /etc/exim4/domains/$domain/*
-        chown dovecot:mail /etc/exim4/domains/$domain/passwd
-    done
-fi
-
-exit

+ 0 - 11
upd/fix_mysql_startup.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-# Fix MySQL autostart for Ubuntu 14.04
-if [ -e "/etc/issue" ]; then
-    release=$(head -n 1 /etc/issue | cut -f 2 -d ' ' )
-    if [ "$release" = '14.04' ]; then
-        update-rc.d mysql disable
-    fi
-fi
-
-exit

+ 0 - 19
upd/fix_nginx_auth.sh

@@ -1,19 +0,0 @@
-#!/bin/bash
-
-source /etc/profile.d/hestia.sh
-source /usr/local/hestia/conf/hestia.conf
-
-sed -i "s|web/%domain%/stats/auth.*|conf/web/%domain%.auth;|" \
-    $VESTA/data/templates/web/nginx/*/*tpl >/dev/null 2>&1
-
-if [ "$WEB_SYSTEM" != 'nginx' ]; then
-    exit
-fi
-
-check=`egrep "STATS_USER='([0-9]|[a-Z].*)'" $VESTA/data/users/*/web.conf`
-if [ ! -z "$check" ]; then
-    for user in $(echo $check |cut -f1 -d: |cut -f7 -d/); do
-        $VESTA/bin/v-rebuild-web-domains $user no >/dev/null 2>&1
-    done
-    $VESTA/bin/v-restart-service nginx
-fi

+ 0 - 19
upd/fix_roundcube.sh

@@ -1,19 +0,0 @@
-#!/bin/bash
-
-# Locate roundcube directory
-if [ -d '/etc/roundcube' ]; then
-    rc_dir='/etc/roundcube'
-fi
-if [ -d '/etc/roundcubemail' ]; then
-    rc_dir='/etc/roundcubemail'
-fi
-
-if [ -z "$rc_dir" ]; then
-    exit
-fi
-
-# Check for eval
-cd $rc_dir
-for config in $(grep eval *.php |cut -f1 -d:); do
-    sed -i '/eval/d' $config
-done

+ 0 - 64
upd/fix_sessions.sh

@@ -1,64 +0,0 @@
-#!/bin/bash
-# Fix hestia session save path
-
-# Defining vars
-VESTA='/usr/local/hestia'
-cmd1="$VESTA/upd/fix_sessions.sh"
-cmd2="$VESTA/bin/fix_sessions.sh"
-cron="$VESTA/data/users/admin/cron.conf"
-sessions="$VESTA/data/sessions"
-conf="$VESTA/php/etc/php-fpm.conf"
-settings="
-php_admin_value[memory_limit] = 256M
-php_admin_value[post_max_size] = 512M
-php_admin_value[upload_max_filesize] = 512M
-php_admin_value[max_execution_time] = 600
-php_admin_value[max_input_time] = 600
-php_admin_value[session.save_path] = $sessions"
-user='admin'
-
-# Adding cron job
-if [ ! -z "$1" ]; then
-    cp $cmd1 $cmd2
-    str="JOB='777' MIN='*' HOUR='*' DAY='*' MONTH='*' WDAY='*' SUSPENDED='no'"
-    str="$str CMD='sudo $cmd2' TIME='04:39:26' DATE='2016-06-24'"
-    if [ -z "$(grep $cmd2 $cron)" ]; then
-        echo "$str" >> $cron
-        source $VESTA/func/main.sh
-        sync_cron_jobs
-        $BIN/v-restart-cron
-    fi
-    exit
-fi
-
-if [ ! -d  "$sessions" ]; then
-    # Creating new session dir
-    mkdir $sessions
-    chown admin:admin $sessions
-    chmod 770 $sessions
-
-    # Updating php.ini
-    if [ -z "$(grep $sessions $conf)" ]; then
-        echo "$settings" >> $conf
-    fi
-
-    # Moving old sessions to new dir
-    for session in $(grep WEB_SYSTEM /tmp/sess_* 2>/dev/null|cut -f1 -d :); do
-        mv $session $sessions
-    done
-
-    # Reloading php-fpm server
-    fpm_pid=$(ps auxf |grep "$conf" |grep -v grep |awk '{print $2}')
-    kill -12 $fpm_pid
-fi
-
-# Cleaning up cron jobs
-if [ ! -z "$(grep $cmd2 $cron)" ]; then
-    source $VESTA/func/main.sh
-    sed -i "/JOB='777' /d" $cron
-    sync_cron_jobs
-    $BIN/v-restart-cron
-    rm -f $VESTA/bin/fix_sessions.sh
-fi
-
-exit

+ 0 - 4
upd/fix_vesta_ssl_permissions.sh

@@ -1,4 +0,0 @@
-#!/bin/bash
-
-chown root:mail /usr/local/hestia/ssl/* >/dev/null 2>&1
-chmod 660 /usr/local/hestia/ssl/*  >/dev/null 2>&1

+ 0 - 6
upd/limit_sudo.sh

@@ -1,6 +0,0 @@
-#!/bin/bash
-
-if [ -e "/etc/sudoers.d/admin" ]; then
-    sed -i "s/admin.*ALL=(ALL).*/# sudo is limited to vesta scripts/" \
-        /etc/sudoers.d/admin
-fi

+ 0 - 41
upd/switch_rpath.sh

@@ -1,41 +0,0 @@
-#!/bin/bash
-# Switch apache to remoteip module
-
-# Checking rpaf config
-if [ ! -e "/etc/apache2/mods-enabled/rpaf.load" ]; then
-    exit
-fi
-
-# Checking remoteip module
-if [ ! -e "/etc/apache2/mods-available/remoteip.load" ]; then
-    exit
-fi
-
-if [ -f "/etc/apache2/mods-enabled/remoteip.load" ]; then
-    echo "RemoteIP is already activated"
-    exit
-fi
-
-# Disabling rpaf
-/usr/sbin/a2dismod rpaf > /dev/null 2>&1
-rm -f /etc/apache2/mods-enabled/rpaf.conf
-
-# Enabling remoteip
-/usr/sbin/a2enmod remoteip > /dev/null 2>&1
-
-# Creating configuration
-conf="/etc/apache2/mods-enabled/remoteip.conf"
-echo "<IfModule remoteip_module>" > $conf
-echo "    RemoteIPHeader X-Real-IP" >> $conf
-for ip in $(ls /usr/local/hestia/data/ips); do
-    echo "    RemoteIPInternalProxy $ip" >> $conf
-done
-echo "</IfModule>" >> $conf
-
-sed -i "s/LogFormat \"%h/LogFormat \"%a/g" /etc/apache2/apache2.conf
-
-# Restarting apache
-/usr/sbin/apachectl restart > /dev/null 2>&1
-
-# EOF
-exit