Updaded dependencies
*Added php ctype extention *Switched OfflineImap from PIP package to the apk one from the "Alpine Community Edge" repo due to PEP 68 braking the install
This commit is contained in:
@@ -3,4 +3,4 @@
|
|||||||
read -p "Enter name for the new sync job: " username
|
read -p "Enter name for the new sync job: " username
|
||||||
adduser $username
|
adduser $username
|
||||||
sed -i -e 's/UserName/'$username'/' /home/$username/.offlineimaprc
|
sed -i -e 's/UserName/'$username'/' /home/$username/.offlineimaprc
|
||||||
echo "sudo -u $username python3 /opt/OfflineIMAP3/offlineimap.py" >> /opt/mailsync.sh
|
echo "sudo -u $username python3 /usr/bin/offlineimap" >> /opt/mailsync.sh
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
#!/bin/ash
|
|
||||||
##Script for updating OfflineIMAP3
|
|
||||||
|
|
||||||
NewOfflineIMAPVer=$(curl -s https://api.github.com/repos/OfflineIMAP/offlineimap3/tags | grep 'name.*' |head -n 1 | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " | tr -d : )
|
|
||||||
|
|
||||||
printf "OfflineIMAP: checking for upgrades... "
|
|
||||||
|
|
||||||
if [ "$NewOfflineIMAPVer" != "$(cat /opt/OfflineIMAP3-installed)" ];
|
|
||||||
then
|
|
||||||
echo "update found"
|
|
||||||
curl -L https://github.com/OfflineIMAP/offlineimap3/archive/refs/tags/$NewOfflineIMAPVer.tar.gz -o /tmp/olim3.tar.gz
|
|
||||||
mkdir /opt/OfflineIMAP3
|
|
||||||
tar -C /opt/OfflineIMAP3 -xzf /tmp/olim3.tar.gz --strip 1
|
|
||||||
sed -i '/kerberos/c\' /opt/OfflineIMAP3/requirements.txt
|
|
||||||
sed -i '/cygwin/c\' /opt/OfflineIMAP3/requirements.txt
|
|
||||||
pip3 install -r /opt/OfflineIMAP3/requirements.txt
|
|
||||||
echo $NewOfflineIMAPVer > /opt/OfflineIMAP3-installed
|
|
||||||
echo " upgrade complete"
|
|
||||||
else
|
|
||||||
echo "update not found"
|
|
||||||
fi
|
|
||||||
|
|
||||||
17
install.sh
17
install.sh
@@ -7,21 +7,22 @@ cd "$( dirname "$0" )"
|
|||||||
if [ -z ${DistoBuilderINT+x} ]; then
|
if [ -z ${DistoBuilderINT+x} ]; then
|
||||||
ResourceFolder=/tmp
|
ResourceFolder=/tmp
|
||||||
#Install required software
|
#Install required software
|
||||||
apk add dovecot php83-xml php83-fpm php83-curl php83-dom php83-zip php83-mbstring php83-openssl py3-pip sudo curl openssl
|
apk add dovecot php83-xml php83-fpm php83-curl php83-dom php83-zip php83-mbstring php83-openssl php83-ctype sudo curl openssl
|
||||||
#Install Nginx and Nginx Repo
|
#Install Nginx and Nginx Repo
|
||||||
wget https://nginx.org/keys/nginx_signing.rsa.pub -O /etc/apk/keys/nginx_signing.rsa.pub
|
wget https://nginx.org/keys/nginx_signing.rsa.pub -O /etc/apk/keys/nginx_signing.rsa.pub
|
||||||
echo "@nginx http://nginx.org/packages/mainline/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories
|
echo "@nginx http://nginx.org/packages/mainline/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories
|
||||||
curl -L https://nginx.org/keys/nginx_signing.rsa.pub -o /etc/apk/keys/nginx_signing.rsa.pub
|
curl -L https://nginx.org/keys/nginx_signing.rsa.pub -o /etc/apk/keys/nginx_signing.rsa.pub
|
||||||
apk add nginx@nginx
|
apk add nginx@nginx
|
||||||
|
echo @CommunityEdge http://dl-4.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories
|
||||||
|
|
||||||
|
#Install OfflineIMAP3
|
||||||
|
apk add offlineimap@CommunityEdge
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Download Resources
|
#Download Resources
|
||||||
OfflineIMAPVer=$(curl -s https://api.github.com/repos/OfflineIMAP/offlineimap3/tags | grep 'name.*' |head -n 1 | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " "| tr -d : )
|
|
||||||
SnappyMailVer=$(curl -s https://api.github.com/repos/the-djmaze/snappymail/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " "| tr -d : )
|
SnappyMailVer=$(curl -s https://api.github.com/repos/the-djmaze/snappymail/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " "| tr -d : )
|
||||||
echo "$OfflineIMAPVer" > /opt/OfflineIMAP3-installed
|
|
||||||
echo "$SnappyMailVer" > /opt/SnappyMail-installed
|
echo "$SnappyMailVer" > /opt/SnappyMail-installed
|
||||||
curl -L https://github.com/the-djmaze/snappymail/releases/download/$SnappyMailVer/snappymail-${SnappyMailVer//v}.tar.gz -o /tmp/smc.tar.gz || exit 1
|
curl -L https://github.com/the-djmaze/snappymail/releases/download/$SnappyMailVer/snappymail-${SnappyMailVer//v}.tar.gz -o /tmp/smc.tar.gz || exit 1
|
||||||
curl -L https://github.com/OfflineIMAP/offlineimap3/archive/refs/tags/$OfflineIMAPVer.tar.gz -o /tmp/olim3.tar.gz || exit 1
|
|
||||||
|
|
||||||
#Configure Nginx
|
#Configure Nginx
|
||||||
rm -rf /etc/nginx/conf.d/*
|
rm -rf /etc/nginx/conf.d/*
|
||||||
@@ -51,13 +52,6 @@ chown -R nginx:nginx /opt/webmail
|
|||||||
find /opt/webmail -type d -exec chmod 755 {} \;
|
find /opt/webmail -type d -exec chmod 755 {} \;
|
||||||
find /opt/webmail -type f -exec chmod 644 {} \;
|
find /opt/webmail -type f -exec chmod 644 {} \;
|
||||||
|
|
||||||
#Install OfflineIMAP3
|
|
||||||
mkdir /opt/OfflineIMAP3
|
|
||||||
tar -C /opt/OfflineIMAP3 -xzf /tmp/olim3.tar.gz --strip 1
|
|
||||||
sed -i '/kerberos/c\' /opt/OfflineIMAP3/requirements.txt
|
|
||||||
sed -i '/cygwin/c\' /opt/OfflineIMAP3/requirements.txt
|
|
||||||
pip3 install -r /opt/OfflineIMAP3/requirements.txt
|
|
||||||
|
|
||||||
#Add OfflineIMAP config to user skeleton folder
|
#Add OfflineIMAP config to user skeleton folder
|
||||||
mkdir /etc/skel
|
mkdir /etc/skel
|
||||||
mv Configs/offlineimaprc /etc/skel/.offlineimaprc
|
mv Configs/offlineimaprc /etc/skel/.offlineimaprc
|
||||||
@@ -66,7 +60,6 @@ echo '30 2 * * 4 ash /opt/mailsync.sh > /dev/null' >
|
|||||||
|
|
||||||
#Add tool update scripts
|
#Add tool update scripts
|
||||||
mv Resources/UpdateSnappyMail.sh /opt/UpdateSnappyMail.sh
|
mv Resources/UpdateSnappyMail.sh /opt/UpdateSnappyMail.sh
|
||||||
mv Resources/UpdateOfflineImap3.sh /opt/UpdateOfflineImap3.sh
|
|
||||||
mv Resources/AddMailBox.sh /opt/AddMailBox.sh
|
mv Resources/AddMailBox.sh /opt/AddMailBox.sh
|
||||||
#Cleanup
|
#Cleanup
|
||||||
rm -f /tmp/olim3.tar.gz /tmp/smc.tar.gz
|
rm -f /tmp/olim3.tar.gz /tmp/smc.tar.gz
|
||||||
|
|||||||
Reference in New Issue
Block a user