Skip to content

Commit

Permalink
(simatec) v0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
simatec committed Jan 23, 2023
1 parent 68ebb3b commit eb50915
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 34 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ To leave the container on the console you have to execute 2x `exit`.
**********************************************************************************************************

## Changelog
### 0.9.0 (19.01.2023)
* (simatec) Betatest Piler Build

### 0.9.0 (23.01.2023)
* (simatec) Piler Build added
* (simatec) Piler Import Option added
* (simatec) Fix Updater

### 0.8.3 (19.01.2023)
* (simatec) Update himself added
Expand Down
22 changes: 22 additions & 0 deletions install-piler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ fi
installPth=`pwd`
configPth="$installPth/config"
etcPth="/var/lib/docker/volumes/piler-docker_piler_etc/_data"
cronPth="/var/lib/docker/volumes/piler-docker_piler_cron/_data"
buildPth="$installPth/build"

############################## Installer Settings ######################################
Expand Down Expand Up @@ -208,6 +209,16 @@ if [ ! -f $installPth/.configDone ]; then
sed -i 's/MAILCOW_HOST=.*/MAILCOW_HOST="'$mailcowHost'"/g' ./piler.conf
fi

# Import Interval Settings
while true; do
read -ep "If Use automatic import to 5 minutes interval (yes/no)? / Y|N (Default: no): " jn
case $jn in
[Yy]* ) AUTO_IMPORT=true; break;;
[Nn]* ) AUTO_IMPORT=false; break;;
* ) echo -e "${redBold} Please confirm with Y or N.${normal}";;
esac
done

echo
echo "${blue}${HLINE}"
echo "All settings were saved in the piler.conf file"
Expand Down Expand Up @@ -355,6 +366,7 @@ echo

cat >> $etcPth/config-site.php <<EOF
// ### Begin added by Piler-Installer ###
// Smarthost
\$config['SMARTHOST'] = '$SMARTHOST';
\$config['SMARTHOST_PORT'] = '25';
Expand Down Expand Up @@ -412,7 +424,15 @@ cat >> $etcPth/config-site.php <<EOF
// special settings.
//\$config['MEMCACHED_ENABLED'] = 1;
\$config['SPHINX_STRICT_SCHEMA'] = 1; // required for Sphinx see https://bitbucket.org/jsuto/piler/issues/1085/sphinx-331.
// ### end added by Piler-Installer ###
EOF

if [ "$AUTO_IMPORT" = true ]; then
cat >> $cronPth/piler <<EOF
### Piler import added by Piler-Installer
*/5 * * * * /usr/libexec/piler/import.sh
EOF
fi

if [ "$USE_MAILCOW" = true ]; then

Expand All @@ -424,12 +444,14 @@ echo

cat >> $etcPth/config-site.php <<EOF
// ### Begin added by Piler-Installer ###
// Mailcow API
\$config['MAILCOW_API_KEY'] = '$MAILCOW_APIKEY';
\$config['MAILCOW_SET_REALNAME'] = true;
\$config['CUSTOM_EMAIL_QUERY_FUNCTION'] = 'query_mailcow_for_email_access';
\$config['MAILCOW_HOST'] = '$MAILCOW_HOST'; // default $config['IMAP_HOST']
include('auth-mailcow.php');
// ### end added by Piler-Installer ###
EOF

curl -o $etcPth/auth-mailcow.php https://raw.githubusercontent.com/patschi/mailpiler-mailcow-integration/master/auth-mailcow.php
Expand Down
34 changes: 2 additions & 32 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,7 @@ if [ ! -d $installPth/backup ]; then
mkdir -p $installPth/backup
fi

#cp $etcPth/config-site.php.bak $installPth/backup/ && cp $etcPth/config-site.php $installPth/backup/
#cp $etcPth/piler.conf.bak $installPth/backup/ && cp $etcPth/piler.conf $installPth/backup/
#cp $etcPth/.my.cnf $installPth/backup/
cp $etcPth/* $installPth/backup/
cp -rf $etcPth/* $installPth/backup/

# delete old files
#rm -f $etcPth/piler.key $etcPth/piler.pem $etcPth/config-site.php
Expand All @@ -185,7 +182,7 @@ fi

# Build Piler
cd $buildPth
echo echo "${greenBold}Start Piler-Build...${normal}" && \
echo "${greenBold}Start Piler-Build...${normal}" && \
bash build.sh && \
echo "${greenBold}Piler-Build finish${normal}"

Expand Down Expand Up @@ -221,33 +218,6 @@ else
docker-compose up --force-recreate --build -d
fi

#echo "${blue}********* Piler started... Please wait... *********${normal}"

#BLA::start_loading_animation "${BLA_metro[@]}"
#sleep 20
#BLA::stop_loading_animation

# Restore Config
#cp $installPth/backup/config-site.php.bak $etcPth/ && cp $installPth/backup/config-site.php $etcPth/
#cp $installPth/backup/piler.conf.bak $etcPth/ && cp $installPth/backup/piler.conf $etcPth/
#cp $installPth/backup/.my.cnf $etcPth/
#cp $installPth/backup/* $etcPth/

# piler restart
#echo
#echo "${blue}${HLINE}"
#echo "${blue} restart piler ..."
#echo "${blue}${HLINE}${normal}"
#echo

#cd $installPth

#if [ $COMPOSE_VERSION = native ]; then
# docker compose restart piler
#else
# docker-compose restart piler
#fi

echo
echo "${greenBold}${HLINE}"
echo "${greenBold} Piler Update completed successfully"
Expand Down

0 comments on commit eb50915

Please sign in to comment.