Use the i2p user for bdsmail daemon

This commit is contained in:
Bob Mottram 2018-02-12 10:34:24 +00:00
parent 6562d131f7
commit 97d6524c90
1 changed files with 7 additions and 10 deletions

View File

@ -86,7 +86,7 @@ function upgrade_bdsmail {
# update to the next commit
set_repo_commit /etc/bdsmail "bdsmail commit" "$BDSMAIL_COMMIT" $BDSMAIL_REPO
chown -R bdsmail:bdsmail /etc/bdsmail
chown -R i2psvc:i2psvc /etc/bdsmail
}
function backup_local_bdsmail {
@ -118,7 +118,7 @@ function restore_local_bdsmail {
fi
cp -rp $temp_restore_dir/* $bdsmail_dir
fi
chown -R bdsmail:bdsmail $bdsmail_dir
chown -R i2psvc:i2psvc $bdsmail_dir
rm -rf $temp_restore_dir
fi
@ -154,7 +154,7 @@ function restore_remote_bdsmail {
fi
cp -rp $temp_restore_dir/* $bdsmail_dir
fi
chown -R bdsmail:bdsmail $bdsmail_dir
chown -R i2psvc:i2psvc $bdsmail_dir
rm -rf $temp_restore_dir
fi
@ -167,7 +167,6 @@ function remove_bdsmail {
systemctl disable bdsmail
rm /etc/systemd/system/bdsmail.service
fi
userdel -r bdsmail
remove_i2p
remove_app bdsmail
@ -202,8 +201,6 @@ function install_bdsmail {
git checkout $BDSMAIL_COMMIT -b $BDSMAIL_COMMIT
set_completion_param "bdsmail commit" "$BDSMAIL_COMMIT"
useradd -d /etc/bdsmail -s /bin/false bdsmail
make GOROOT=/home/go/go${GO_VERSION}
if [ ! -f /etc/bdsmail/bin/bdsconfig ]; then
echo $'Unable to make bdsmail'
@ -232,17 +229,17 @@ function install_bdsmail {
echo '' >> /etc/systemd/system/bdsmail.service
echo '[Service]' >> /etc/systemd/system/bdsmail.service
echo 'Type=simple' >> /etc/systemd/system/bdsmail.service
echo 'User=bdsmail' >> /etc/systemd/system/bdsmail.service
echo 'Group=bdsmail' >> /etc/systemd/system/bdsmail.service
echo 'User=i2psvc' >> /etc/systemd/system/bdsmail.service
echo 'Group=i2psvc' >> /etc/systemd/system/bdsmail.service
echo 'WorkingDirectory=/etc/bdsmail' >> /etc/systemd/system/bdsmail.service
echo 'ExecStart=/etc/bdsmail/bin/maild /etc/bdsmail/config.ini' >> /etc/systemd/system/bdsmail.service
echo 'Restart=always' >> /etc/systemd/system/bdsmail.service
echo 'Environment="USER=bdsmail"' >> /etc/systemd/system/bdsmail.service
echo 'Environment="USER=i2psvc"' >> /etc/systemd/system/bdsmail.service
echo '' >> /etc/systemd/system/bdsmail.service
echo '[Install]' >> /etc/systemd/system/bdsmail.service
echo 'WantedBy=multi-user.target' >> /etc/systemd/system/bdsmail.service
systemctl enable bdsmail
chown -R bdsmail:bdsmail /etc/bdsmail
chown -R i2psvc:i2psvc /etc/bdsmail
systemctl start bdsmail
echo '#!/usr/bin/env python2' > /etc/bdsmail/get_address