From bc1c473dbca13719a0ebb711dfb8bec8d20d50e6 Mon Sep 17 00:00:00 2001 From: choehn86 <42713647+choehn86@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:27:24 -0500 Subject: [PATCH] Create mailrise-install.sh --- install/mailrise-install.sh | 76 +++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 install/mailrise-install.sh diff --git a/install/mailrise-install.sh b/install/mailrise-install.sh new file mode 100644 index 00000000..909899c6 --- /dev/null +++ b/install/mailrise-install.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +msg_ok "Installed Dependencies" + +msg_info "Updating Python3" +$STD apt-get install -y \ + python3 \ + python3-dev \ + python3-pip +rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED +msg_ok "Updated Python3" + +msg_info "Installing Mailrise" +$STD pip install mailrise + +mkdir -p /opt/mailrise +cat </opt/mailrise/mailrise.conf +configs: + # You can send to this config with "basic_assistant@mailrise.xyz". + # + # The "-" is *very* important, even when configuring just a single URL. + # Apprise requires urls to be a YAML *list*. + # + basic_assistant: + urls: + - hasio://HOST/ACCESS_TOKEN + # You can send to this config with "telegram_and_discord@mailrise.xyz". + # + telegram_and_discord: + urls: + - tgram://MY_BOT_TOKEN + - discord://WEBHOOK_ID/WEBHOOK_TOKEN + + # See https://github.com/YoRyan/mailrise?tab=readme-ov-file#sample-file for additional examples + +EOF + +cat </etc/systemd/system/mailrise.service +[Unit] +Description=Mailrise SMTP notification relay +After=network.target +[Service] +ExecStart=/usr/local/bin/mailrise /opt/mailrise/mailrise.conf +Restart=always +User=root +[Install] +WantedBy=multi-user.target +EOF + +$STD systemctl enable --now mailrise.service +msg_ok "Installed Mailrise" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned"