From a53066c411b08fd502007a5d70a4b0ae554559bd Mon Sep 17 00:00:00 2001 From: choehn86 <42713647+choehn86@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:26:56 -0500 Subject: [PATCH 1/8] Create mailrise.sh --- ct/mailrise.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 ct/mailrise.sh diff --git a/ct/mailrise.sh b/ct/mailrise.sh new file mode 100644 index 00000000..640e47c8 --- /dev/null +++ b/ct/mailrise.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 tteck +# Author: tteck (tteckster) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/YoRyan/mailrise + +# App Default Values +APP="Mailrise" +var_tags="SMTP;notifications" +var_cpu="1" +var_ram="512" +var_disk="2" +var_os="debian" +var_version="12" +var_unprivileged="1" + +# App Output & Base Settings +header_info "$APP" +base_settings + +# Core +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -f /usr/local/bin/mailrise ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating ${APP} LXC" + pip3 install mailrise --upgrade &>/dev/null + systemctl restart mailrise.service + msg_ok "Updated Successfully" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8025${CL}" 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 2/8] 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" From 14f52fba1e4d54a58c651bb6243de70098c612b7 Mon Sep 17 00:00:00 2001 From: choehn86 <42713647+choehn86@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:27:48 -0500 Subject: [PATCH 3/8] Create mailrise.json --- json/mailrise.json | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 json/mailrise.json diff --git a/json/mailrise.json b/json/mailrise.json new file mode 100644 index 00000000..69017687 --- /dev/null +++ b/json/mailrise.json @@ -0,0 +1,39 @@ +{ + "name": "Mailrise", + "slug": "mailrise", + "categories": [ + 0 + ], + "date_created": "2025-01-08", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8025, + "documentation": null, + "website": "https://github.com/YoRyan/mailrise", + "logo": "https://github.com/YoRyan/mailrise/blob/main/src/mailrise/asset/mailrise-logo.png?raw=true", + "description": "An SMTP gateway for Apprise notifications.", + "install_methods": [ + { + "type": "default", + "script": "ct/mailrise.sh", + "resources": { + "cpu": 1, + "ram": 512, + "hdd": 2, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "After the initial installation: Edit the configuration file at /opt/mailrise/mailrise.conf", + "type": "info" + } + ] +} From c3fd5c83a6d9d5162282633d6a81c6e9713b317d Mon Sep 17 00:00:00 2001 From: choehn86 <42713647+choehn86@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:44:57 -0500 Subject: [PATCH 4/8] Update mailrise.sh updated copyright/author --- ct/mailrise.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/mailrise.sh b/ct/mailrise.sh index 640e47c8..1effe0d1 100644 --- a/ct/mailrise.sh +++ b/ct/mailrise.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) -# Copyright (c) 2021-2025 tteck -# Author: tteck (tteckster) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: choehn86 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/YoRyan/mailrise From 12696b6720efe024cfd077b987402279f165e1e5 Mon Sep 17 00:00:00 2001 From: choehn86 <42713647+choehn86@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:48:13 -0500 Subject: [PATCH 5/8] Update install/mailrise-install.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- install/mailrise-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/mailrise-install.sh b/install/mailrise-install.sh index 909899c6..ce8b4a21 100644 --- a/install/mailrise-install.sh +++ b/install/mailrise-install.sh @@ -64,7 +64,7 @@ User=root WantedBy=multi-user.target EOF -$STD systemctl enable --now mailrise.service +systemctl enable -q --now mailrise.service msg_ok "Installed Mailrise" motd_ssh From 499117f3694c234080881ee79e20987147ad27e8 Mon Sep 17 00:00:00 2001 From: choehn86 <42713647+choehn86@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:48:24 -0500 Subject: [PATCH 6/8] Update install/mailrise-install.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- install/mailrise-install.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/install/mailrise-install.sh b/install/mailrise-install.sh index ce8b4a21..7fe14a19 100644 --- a/install/mailrise-install.sh +++ b/install/mailrise-install.sh @@ -14,18 +14,15 @@ 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 + curl \ + sudo \ + mc \ + python3 \ + python3-dev \ + python3-pip rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Updated Python3" +msg_ok "Installed Dependencies" msg_info "Installing Mailrise" $STD pip install mailrise From 920da7e9b702ec1a54d87de9e6efd25ce5c9dcce Mon Sep 17 00:00:00 2001 From: choehn86 <42713647+choehn86@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:49:40 -0500 Subject: [PATCH 7/8] Update mailrise-install.sh corrected copyright/author/license, added source --- install/mailrise-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/mailrise-install.sh b/install/mailrise-install.sh index 7fe14a19..f11124a6 100644 --- a/install/mailrise-install.sh +++ b/install/mailrise-install.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash -# Copyright (c) 2021-2025 tteck -# Author: tteck (tteckster) -# License: MIT -# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Copyright (c) 2021-2025 community-scripts ORG +# Author: choehn86 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/YoRyan/mailrise source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" color From 126d2df00c35ce4f2bcc7b9f608bc283c0d11d82 Mon Sep 17 00:00:00 2001 From: choehn86 <42713647+choehn86@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:59:25 -0500 Subject: [PATCH 8/8] Update mailrise.json Added link to discussion/guide --- json/mailrise.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json/mailrise.json b/json/mailrise.json index 69017687..abe3cb2e 100644 --- a/json/mailrise.json +++ b/json/mailrise.json @@ -32,7 +32,7 @@ }, "notes": [ { - "text": "After the initial installation: Edit the configuration file at /opt/mailrise/mailrise.conf", + "text": "After the initial installation: See https://github.com/community-scripts/ProxmoxVE/discussions/1356 for basic setup guide", "type": "info" } ]