Skip to content
Snippets Groups Projects
Commit 99ea6ab9 authored by Bob Mottram's avatar Bob Mottram
Browse files

Use mail rather than htdocs

parent 6183b8df
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment