Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature for installing Mailpit and disabling Mailhog #1864

Merged
merged 2 commits into from Mar 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 41 additions & 0 deletions scripts/features/mailpit.sh
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

if [ -f ~/.homestead-features/wsl_user_name ]; then
WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)"
WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)"
else
WSL_USER_NAME=vagrant
WSL_USER_GROUP=vagrant
fi

export DEBIAN_FRONTEND=noninteractive

if [ -f /home/$WSL_USER_NAME/.homestead-features/mailpit ]
then
echo "mailpit already installed."
exit 0
fi

touch /home/$WSL_USER_NAME/.homestead-features/mailpit
chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features

curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh | sh

chown -f $WSL_USER_NAME:$WSL_USER_GROUP /usr/local/bin/mailpit

cat > /etc/systemd/system/mailpit.service << EOF
[Unit]
Description=Mailpit
After=network.target

[Service]
User=vagrant
ExecStart=/usr/bin/env /usr/local/bin/mailpit

[Install]
WantedBy=multi-user.target
EOF

systemctl disable --now mailhog

systemctl enable --now mailpit