Commit dee0c34f authored by w4t's avatar w4t

wtserver 0.54

parent 1616e0c7
...@@ -13,3 +13,13 @@ My to-do list for the ispconfig3 installer script. ...@@ -13,3 +13,13 @@ My to-do list for the ispconfig3 installer script.
Suggestions? feel free to comment. Suggestions? feel free to comment.
sok hozzáférési hiba...
doveadm fts rescan -A >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
# Adds unindexed files to the fts database
#
# * `-q`: Queues the indexing to be run by indexer process. (will background the indexing)
# * `-A`: All users
# * `'*'`: All folders
doveadm index -A -q \* >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
...@@ -28,10 +28,9 @@ InstallAntiVirus() { ...@@ -28,10 +28,9 @@ InstallAntiVirus() {
if [[ "$(which named)" == "" ]]; then if [[ "$(which named)" == "" ]]; then
apt_install unbound apt_install unbound
fi fi
CODENAME=`lsb_release -c -s` curl https://rspamd.com/apt-stable/gpg.key | gpg --dearmor > /etc/apt/trusted.gpg.d/rspamd.gpg
curl https://rspamd.com/apt-stable/gpg.key | apt-key add - echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rspamd.gpg] http://rspamd.com/apt-stable/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/rspamd.list
echo "deb [arch=amd64] http://rspamd.com/apt-stable/ $CODENAME main" > /etc/apt/sources.list.d/rspamd.list echo "deb-src [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rspamd.gpg] http://rspamd.com/apt-stable/ $(lsb_release -cs) main" >> /etc/apt/sources.list.d/rspamd.list
echo "deb-src [arch=amd64] http://rspamd.com/apt-stable/ $CODENAME main" >> /etc/apt/sources.list.d/rspamd.list
apt_update apt_update
apt_install rspamd apt_install rspamd
echo 'servers = "127.0.0.1";' > /etc/rspamd/local.d/redis.conf echo 'servers = "127.0.0.1";' > /etc/rspamd/local.d/redis.conf
...@@ -46,7 +45,7 @@ InstallAntiVirus() { ...@@ -46,7 +45,7 @@ InstallAntiVirus() {
fi fi
echo -n -e "$IDENTATION_LVL_1 Installing AntiVirus utilities (ClamAV) (This take some time. Don't abort it!)..." echo -n -e "$IDENTATION_LVL_1 Installing AntiVirus utilities (ClamAV) (This take some time. Don't abort it!)..."
apt_install clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full lrzip apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libclam unrar9 libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl libdbd-mysql-perl unrar-free unp lz4 liblz4-tool rpm2cpio tnef unp apt_install clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full lrzip apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libclamunrar11 libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl libdbd-mysql-perl unrar-free unp lz4 liblz4-tool rpm2cpio tnef unp
echo -e " [ ${green}DONE${NC} ] " echo -e " [ ${green}DONE${NC} ] "
echo -n -e "$IDENTATION_LVL_1 Configure AntiVirus ... " echo -n -e "$IDENTATION_LVL_1 Configure AntiVirus ... "
......
...@@ -366,7 +366,7 @@ EOF ...@@ -366,7 +366,7 @@ EOF
# Restart services # Restart services
restart_service dovecot restart_service dovecot
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
# IMAP search with xapian # IMAP search with xapian
# -------------------------------- # --------------------------------
# #
...@@ -376,75 +376,8 @@ EOF ...@@ -376,75 +376,8 @@ EOF
# fts xapian might be a good match. See https://github.com/grosjo/fts-xapian # fts xapian might be a good match. See https://github.com/grosjo/fts-xapian
# Install and configure fts-xapian for better search performance # Install and configure fts-xapian for better search performance
echo -n -e "$IDENTATION_LVL_2 Installing fts-xapian... " #Not work
apt_install dovecot-fts-xapian #Installdovecot-fts-xapian
# Update the dovecot plugin configuration
#sed -i "s/#mail_plugins =\(.*\)/mail_plugins =\1 \$mail_plugins quota/" /etc/dovecot/conf.d/10-mail.conf
if ! grep -q "mail_plugins.* fts fts_xapian" /etc/dovecot/conf.d/10-mail.conf; then
sed -i "s/\(mail_plugins =.*\)/\1\n mail_plugins = \$mail_plugins fts fts_xapian/" /etc/dovecot/conf.d/10-mail.conf
fi
# Install cronjobs to keep FTS up to date
hide_output install -m 755 $APWD/conf/cron/miab_dovecot /etc/cron.daily/
# Install files
if [ ! -f /usr/lib/dovecot/decode2text.sh ]; then
cp -f /usr/share/doc/dovecot-core/examples/decode2text.sh /usr/lib/dovecot
fi
# Install text decoder utilities
apt_install poppler-utils catdoc unzip
# Create configuration file
cat > /etc/dovecot/conf.d/90-plugin-fts.conf << EOF;
plugin {
plugin = fts fts_xapian
fts = xapian
fts_xapian = partial=3 full=20 verbose=0
fts_autoindex = yes
fts_enforced = yes
fts_autoindex_exclude = \Trash
fts_autoindex_exclude2 = \Junk
fts_autoindex_exclude3 = \Spam
fts_decoder = decode2text
}
service indexer-worker {
vsz_limit = 2G
}
service decode2text {
executable = script /usr/lib/dovecot/decode2text.sh
user = dovecot
unix_listener decode2text {
mode = 0666
}
}
EOF
restart_service dovecot
# Kickoff building the index
# Per doveadm-fts manpage: Scan what mails exist in the full text search index
# and compare those to what actually exist in mailboxes.
# This removes mails from the index that have already been expunged and makes
# sure that the next doveadm index will index all the missing mails (if any).
#hide_output doveadm fts rescan -A
doveadm fts rescan -A >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
# Adds unindexed files to the fts database
#
# * `-q`: Queues the indexing to be run by indexer process. (will background the indexing)
# * `-A`: All users
# * `'*'`: All folders
#doveadm index -A -q \* >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
### Additional modifications ### Additional modifications
...@@ -455,7 +388,7 @@ EOF ...@@ -455,7 +388,7 @@ EOF
hide_output install -m 755 $APWD/conf/cron/miab_clean_mail /etc/cron.weekly/ hide_output install -m 755 $APWD/conf/cron/miab_clean_mail /etc/cron.weekly/
# Reduce logs by not logging mail output in syslog # Reduce logs by not logging mail output in syslog
sed -i "s/\*\.\*;auth,authpriv.none.*\-\/var\/log\/syslog/\*\.\*;mail,auth,authpriv.none \-\/var\/log\/syslog/g" /etc/rsyslog.d/50-default.conf #sed -i "s/\*\.\*;auth,authpriv.none.*\-\/var\/log\/syslog/\*\.\*;mail,auth,authpriv.none \-\/var\/log\/syslog/g" /etc/rsyslog.d/50-default.conf
# Reduce logs by only logging ufw in ufw.log # Reduce logs by only logging ufw in ufw.log
sed -i "s/#\& stop/\& stop/g" /etc/rsyslog.d/20-ufw.conf sed -i "s/#\& stop/\& stop/g" /etc/rsyslog.d/20-ufw.conf
...@@ -510,3 +443,84 @@ EOF ...@@ -510,3 +443,84 @@ EOF
MeasureTimeDuration $START_TIME MeasureTimeDuration $START_TIME
} }
Installdovecot-fts-xapian() {
# IMAP search with xapian
# --------------------------------
#
# By default dovecot uses its own Squat search index that has awful performance
# on large mailboxes and is obsolete. Dovecot 2.1+ has support for using Lucene
# internally. Solr uses too much memory. Same goes for elasticsearch.
# fts xapian might be a good match. See https://github.com/grosjo/fts-xapian
# Install and configure fts-xapian for better search performance
echo -n -e "$IDENTATION_LVL_2 Installing fts-xapian... "
apt_install dovecot-fts-xapian
# Update the dovecot plugin configuration
#sed -i "s/#mail_plugins =\(.*\)/mail_plugins =\1 \$mail_plugins quota/" /etc/dovecot/conf.d/10-mail.conf
if ! grep -q "mail_plugins.* fts fts_xapian" /etc/dovecot/conf.d/10-mail.conf; then
sed -i "s/\(mail_plugins =.*\)/\1\n mail_plugins = \$mail_plugins fts fts_xapian/" /etc/dovecot/conf.d/10-mail.conf
fi
# Install cronjobs to keep FTS up to date
hide_output install -m 755 $APWD/conf/cron/miab_dovecot /etc/cron.daily/
# Install files
if [ ! -f /usr/lib/dovecot/decode2text.sh ]; then
cp -f /usr/share/doc/dovecot-core/examples/decode2text.sh /usr/lib/dovecot
fi
# Install text decoder utilities
apt_install poppler-utils catdoc unzip
# Create configuration file
cat > /etc/dovecot/conf.d/90-plugin-fts.conf << EOF;
plugin {
plugin = fts fts_xapian
fts = xapian
fts_xapian = partial=3 full=20 verbose=0
fts_autoindex = yes
fts_enforced = yes
fts_autoindex_exclude = \Trash
fts_autoindex_exclude2 = \Junk
fts_autoindex_exclude3 = \Spam
fts_decoder = decode2text
}
service indexer-worker {
vsz_limit = 2G
}
service decode2text {
executable = script /usr/lib/dovecot/decode2text.sh
user = dovecot
unix_listener decode2text {
mode = 0666
}
}
EOF
restart_service dovecot
# Kickoff building the index
# Per doveadm-fts manpage: Scan what mails exist in the full text search index
# and compare those to what actually exist in mailboxes.
# This removes mails from the index that have already been expunged and makes
# sure that the next doveadm index will index all the missing mails (if any).
#hide_output doveadm fts rescan -A
doveadm fts rescan -A >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
# Adds unindexed files to the fts database
#
# * `-q`: Queues the indexing to be run by indexer process. (will background the indexing)
# * `-A`: All users
# * `'*'`: All folders
doveadm index -A -q \* >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
}
...@@ -155,8 +155,8 @@ default-authentication-plugin=mysql_native_password ...@@ -155,8 +155,8 @@ default-authentication-plugin=mysql_native_password
echo -n -e "$IDENTATION_LVL_1 Installing MariaDB Server & Client... " echo -n -e "$IDENTATION_LVL_1 Installing MariaDB Server & Client... "
apt_install software-properties-common dirmngr apt-transport-https apt_install software-properties-common dirmngr apt-transport-https
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 curl https://mariadb.org/mariadb_release_signing_key.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/mariadb.gpg
yes | add-apt-repository 'deb [arch=amd64] http://mariadb.mirrors.ovh.net/MariaDB/repo/11.8.1/debian bookworm main' >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/mariadb.gpg] http://mariadb.mirrors.ovh.net/MariaDB/repo/11.8.1/debian $(lsb_release -cs) main" > /etc/apt/sources.list.d/mariadb.list
apt_update apt_update
apt_install mariadb-client mariadb-server apt_install mariadb-client mariadb-server
echo -e "[${green}DONE${NC}]" echo -e "[${green}DONE${NC}]"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment