Use mail rather than htdocs

This commit is contained in:
Bob Mottram 2016-11-06 15:07:15 +00:00
parent 6183b8dfde
commit 99ea6ab974
1 changed files with 12 additions and 12 deletions

View File

@ -83,7 +83,7 @@ function upgrade_mailpile {
read_config_param "MAILPILE_DOMAIN_NAME"
function_check set_repo_commit
set_repo_commit /var/www/$MAILPILE_DOMAIN_NAME/htdocs "mailpile commit" "$MAILPILE_COMMIT" $MAILPILE_REPO
set_repo_commit /var/www/$MAILPILE_DOMAIN_NAME/mail "mailpile commit" "$MAILPILE_COMMIT" $MAILPILE_REPO
}
function backup_local_mailpile {
@ -155,11 +155,11 @@ function install_mailpile {
fi
cd /var/www/$MAILPILE_DOMAIN_NAME
if [ -d /var/www/$MAILPILE_DOMAIN_NAME/htdocs ]; then
rm -rf /var/www/$MAILPILE_DOMAIN_NAME/htdocs
if [ -d /var/www/$MAILPILE_DOMAIN_NAME/mail ]; then
rm -rf /var/www/$MAILPILE_DOMAIN_NAME/mail
fi
git_clone $MAILPILE_REPO htdocs
cd htdocs
git_clone $MAILPILE_REPO mail
cd mail
git checkout $MAILPILE_COMMIT -b $MAILPILE_COMMIT
set_completion_param "mailpile commit" "$MAILPILE_COMMIT"
@ -169,11 +169,11 @@ function install_mailpile {
fi
pip install -r requirements.txt
adduser --system --home=/var/www/$MAILPILE_DOMAIN_NAME/htdocs/ --group mailpile
chown -R mailpile: /var/www/$MAILPILE_DOMAIN_NAME/htdocs/
adduser --system --home=/var/www/$MAILPILE_DOMAIN_NAME/mail/ --group mailpile
chown -R mailpile: /var/www/$MAILPILE_DOMAIN_NAME/mail/
# create folders and tags
su -c "cd /var/www/$MAILPILE_DOMAIN_NAME/htdocs && ./mp --setup" - mailpile
su -c "cd /var/www/$MAILPILE_DOMAIN_NAME/mail && ./mp --setup" - mailpile
echo '[Unit]' > /etc/systemd/system/mailpile.service
echo 'Description=Mailpile Email Client' >> /etc/systemd/system/mailpile.service
@ -182,8 +182,8 @@ function install_mailpile {
echo '[Service]' >> /etc/systemd/system/mailpile.service
echo 'User=mailpile' >> /etc/systemd/system/mailpile.service
echo 'Group=mailpile' >> /etc/systemd/system/mailpile.service
echo "WorkingDirectory=/var/www/$MAILPILE_DOMAIN_NAME/htdocs" >> /etc/systemd/system/mailpile.service
echo "ExecStart=/var/www/$MAILPILE_DOMAIN_NAME/htdocs/mp --www=0.0.0.0:${MAILPILE_PORT} --wait" >> /etc/systemd/system/mailpile.service
echo "WorkingDirectory=/var/www/$MAILPILE_DOMAIN_NAME/mail" >> /etc/systemd/system/mailpile.service
echo "ExecStart=/var/www/$MAILPILE_DOMAIN_NAME/mail/mp --www=0.0.0.0:${MAILPILE_PORT} --wait" >> /etc/systemd/system/mailpile.service
echo 'Restart=always' >> /etc/systemd/system/mailpile.service
echo 'RestartSec=10' >> /etc/systemd/system/mailpile.service
echo '' >> /etc/systemd/system/mailpile.service
@ -214,7 +214,7 @@ function install_mailpile {
echo ' error_log off;' >> $mailpile_nginx_site
echo '' >> $mailpile_nginx_site
echo ' # Root' >> $mailpile_nginx_site
echo " root /var/www/$MAILPILE_DOMAIN_NAME/htdocs;" >> $mailpile_nginx_site
echo " root /var/www/$MAILPILE_DOMAIN_NAME/mail;" >> $mailpile_nginx_site
echo '' >> $mailpile_nginx_site
echo ' location / {' >> $mailpile_nginx_site
function_check nginx_limits
@ -239,7 +239,7 @@ function install_mailpile {
echo ' error_log off;' >> $mailpile_nginx_site
echo '' >> $mailpile_nginx_site
echo ' # Root' >> $mailpile_nginx_site
echo " root /var/www/$MAILPILE_DOMAIN_NAME/htdocs;" >> $mailpile_nginx_site
echo " root /var/www/$MAILPILE_DOMAIN_NAME/mail;" >> $mailpile_nginx_site
echo '' >> $mailpile_nginx_site
echo ' location / {' >> $mailpile_nginx_site
function_check nginx_limits