From 1f474d654a0a4d4cb23099dcc3977ace61bdaa2c Mon Sep 17 00:00:00 2001 From: Marek Miklewicz Date: Sun, 4 Jun 2023 20:48:46 +0200 Subject: [PATCH 1/3] Update dapostinstall.sh --- dapostinstall.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dapostinstall.sh b/dapostinstall.sh index c142092..73c6374 100644 --- a/dapostinstall.sh +++ b/dapostinstall.sh @@ -564,6 +564,9 @@ echo "PS1='\[\e[0;1;38;5;46m\]\u\[\e[0m\]@\[\e[0;1;38;5;214m\]\h\[\e[0m\][\[\e[0 echo "dodanie kolorowego prompta dla roota" echo "PS1='\[\e[0;1;91m\]\u\[\e[0m\]@\[\e[0;1;38;5;214m\]\h\[\e[0m\][\[\e[0;1;97m\]\W\[\e[0m\]]\[\e[0;1m\]# \[\e[0m\]'" | sudo tee -a /root/.bash_profile +echo "never_commands=custombuild:updates:license" >> /usr/local/directadmin/conf/directadmin.conf +systemctl restart directadmin + cd $DAPOSTINSTALL_DIR sh da_cli.sh disablenamed sh da_cli.sh disablemultiserverpage From 74fbece785648dc13c7bf274b06edfed4a87f20a Mon Sep 17 00:00:00 2001 From: Marek Miklewicz Date: Sun, 4 Jun 2023 22:39:51 +0200 Subject: [PATCH 2/3] # VERSION 1.6-04.06.2023 --- dapostinstall.sh | 9 +++-- options.conf | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ pwgen.sh | 12 ++++++ 3 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 options.conf create mode 100644 pwgen.sh diff --git a/dapostinstall.sh b/dapostinstall.sh index 73c6374..cdd7198 100644 --- a/dapostinstall.sh +++ b/dapostinstall.sh @@ -1,5 +1,5 @@ #!/bin/bash -# VERSION 1.5-03.06.2023 +# VERSION 1.6-04.06.2023 DAPOSTINSTALL_DIR=/opt/dapostinstall DADIR=/usr/local/directadmin CBDIR=/usr/local/directadmin/custombuild @@ -341,12 +341,12 @@ echo -e "\e[96mMam wszystkie informacje - rozpoczynam konfiguracje\e[0m" echo "Generowanie maila powitalnego" -DA_ADMINPASS=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1) cd $DAPOSTINSTALL_DIR chmod 755 da_cli.sh DA_OPTIONSCONF=$CBDIR/options.conf DA_USERCONF=$DADIR/data/users/admin/user.conf DA_HOSTNAME=$(hostname -f) +sh pwgen.sh DA_IP=`cat $DA_USERCONF | grep ip= | cut -d= -f2` DA_NS1=`cat $DA_USERCONF | grep ns1= | cut -d= -f2` DA_NS2=`cat $DA_USERCONF | grep ns1= | cut -d= -f2` @@ -355,6 +355,7 @@ DA_PHP2=`cat $DA_OPTIONSCONF | grep php2_release= | cut -d= -f2` DA_PHP3=`cat $DA_OPTIONSCONF | grep php3_release= | cut -d= -f2` DA_PHP4=`cat $DA_OPTIONSCONF | grep php4_release= | cut -d= -f2` sed -i 's/DA_HOSTNAME/'"$DA_HOSTNAME"'/g' mail_powitalny.txt +sed -i 's/DA_HOSTNAME/'"$DA_HOSTNAME"'/g' options.conf sed -i 's/DA_IP/'"$DA_IP"'/g' mail_powitalny.txt sed -i 's/DA_NS1/'"$DA_NS1"'/g' mail_powitalny.txt sed -i 's/DA_NS2/'"$DA_NS2"'/g' mail_powitalny.txt @@ -364,7 +365,7 @@ sed -i 's/DA_PHP1/'"$DA_PHP1"'/g' mail_powitalny.txt sed -i 's/DA_PHP2/'"$DA_PHP2"'/g' mail_powitalny.txt sed -i 's/DA_PHP3/'"$DA_PHP3"'/g' mail_powitalny.txt sed -i 's/DA_PHP4/'"$DA_PHP4"'/g' mail_powitalny.txt -cp mail_powitalny.txt /opt +mv mail_powitalny.txt /root echo "instalacja SpamBlocker" cd $CBDIR @@ -576,7 +577,7 @@ sh da_cli.sh changeuserpass admin $DA_ADMINPASS clear -echo -e "\e[92mKonfiguracja zakonczona - usuwam pliki tymczasowe - tekst powitalny z uzupelnionymi odpowiednimi danymi znajdziesz w /opt/mail_powitalny.txt\e[0m" +echo -e "\e[92mKonfiguracja zakonczona - usuwam pliki tymczasowe - tekst powitalny z uzupelnionymi odpowiednimi danymi znajdziesz w /root/mail_powitalny.txt\e[0m" cd ~ exec >/dev/null 2>&1 rm -rf $DAPOSTINSTALL_DIR diff --git a/options.conf b/options.conf new file mode 100644 index 0000000..002f1fc --- /dev/null +++ b/options.conf @@ -0,0 +1,96 @@ +# PHP Settings +php1_release=8.1 +php1_mode=php-fpm +php2_release=8.2 +php2_mode=php-fpm +php3_release=7.4 +php3_mode=php-fpm +php4_release=5.6 +php4_mode=php-fpm +secure_php=yes +php_ini=no +php_timezone=Europe/Warsaw +php_ini_type=production +x_mail_header=yes + +# MySQL Settings +mysql=8.0 +mariadb=10.5 +mysql_inst=mariadb +mysql_backup=yes +mysql_backup_gzip=no +mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups +mysql_force_compile=no + +# WEB Server Settings +unit=no +webserver=apache +http_methods=ALL +litespeed_serialno=trial +modsecurity=yes +apache_mpm=auto +mod_ruid2=no +userdir_access=no +harden_symlinks_patch=yes +use_hostname_for_alias=no +redirect_host=DA_HOSTNAME +redirect_host_https=no + +# WEB Applications Settings +phpmyadmin=yes +phpmyadmin_public=no +squirrelmail=no +roundcube=yes +webapps_inbox_prefix=no + +# ClamAV-related Settings +clamav=no +clamav_exim=yes +modsecurity_uploadscan=no +proftpd_uploadscan=no +pureftpd_uploadscan=no +suhosin_php_uploadscan=no + +# Mail Settings +exim=yes +eximconf=yes +blockcracking=yes +easy_spam_fighter=yes +spamd=spamassassin +sa_update=daily +dovecot=yes +dovecot_conf=yes +mail_compress=no +pigeonhole=yes + +# FTP Settings +ftpd=proftpd + +# Statistics Settings +awstats=no +webalizer=yes + +# CustomBuild Settings +bold=yes +clean=yes +clean_old_tarballs=yes +clean_old_webapps=yes + +# Cronjob Settings +cron=yes +cron_frequency=daily +email=email@domain.com +notifications=no +updates=no +webapps_updates=no + +# CloudLinux Settings +cloudlinux=no +cagefs=no + +# Advanced Settings +csf=yes +ssl_configuration=intermediate +redis=no + +modsecurity_ruleset=none diff --git a/pwgen.sh b/pwgen.sh new file mode 100644 index 0000000..1ad8117 --- /dev/null +++ b/pwgen.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +min_length=8 +max_length=18 + +generate_password() { + local length=$((RANDOM % (max_length - min_length + 1) + min_length)) + local password=$(tr -dc '[:alnum:]' < /dev/urandom | fold -w "$length" | grep -E '[[:digit:]]' | grep -E '[[:upper:]]' | head -n 1) + echo "$password" +} + +DA_ADMINPASS=$(generate_password) From f36f60606f3257ead352cea2545aa39ffc7896fb Mon Sep 17 00:00:00 2001 From: Marek Miklewicz Date: Sun, 4 Jun 2023 23:08:04 +0200 Subject: [PATCH 3/3] Drobne poprawki --- dapostinstall.sh | 8 +++++++- pwgen.sh | 12 ------------ 2 files changed, 7 insertions(+), 13 deletions(-) delete mode 100644 pwgen.sh diff --git a/dapostinstall.sh b/dapostinstall.sh index cdd7198..b112fa7 100644 --- a/dapostinstall.sh +++ b/dapostinstall.sh @@ -343,10 +343,16 @@ echo "Generowanie maila powitalnego" cd $DAPOSTINSTALL_DIR chmod 755 da_cli.sh + +echo "Generowanie hasla DirectAdmin" + +min_length=8 +max_length=18 +DA_ADMINPASS=$(tr -dc '[:alnum:]' < /dev/urandom | fold -w "$((RANDOM % (max_length - min_length + 1) + min_length))" | grep -E '[[:digit:]]' | grep -E '[[:upper:]]' | head -n 1) + DA_OPTIONSCONF=$CBDIR/options.conf DA_USERCONF=$DADIR/data/users/admin/user.conf DA_HOSTNAME=$(hostname -f) -sh pwgen.sh DA_IP=`cat $DA_USERCONF | grep ip= | cut -d= -f2` DA_NS1=`cat $DA_USERCONF | grep ns1= | cut -d= -f2` DA_NS2=`cat $DA_USERCONF | grep ns1= | cut -d= -f2` diff --git a/pwgen.sh b/pwgen.sh deleted file mode 100644 index 1ad8117..0000000 --- a/pwgen.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -min_length=8 -max_length=18 - -generate_password() { - local length=$((RANDOM % (max_length - min_length + 1) + min_length)) - local password=$(tr -dc '[:alnum:]' < /dev/urandom | fold -w "$length" | grep -E '[[:digit:]]' | grep -E '[[:upper:]]' | head -n 1) - echo "$password" -} - -DA_ADMINPASS=$(generate_password)