@misterhuydo/sentinel 1.4.93 → 1.4.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -57,7 +57,8 @@ class SentinelConfig:
|
|
|
57
57
|
auto_upgrade: bool = True # auto-upgrade on new patch versions
|
|
58
58
|
version_pin: str = "" # if set, never upgrade beyond this version
|
|
59
59
|
upgrade_check_hours: int = 6 # hours between npm upgrade checks
|
|
60
|
-
|
|
60
|
+
smtp_from: str = "" # sender address (required for SES; defaults to smtp_user)
|
|
61
|
+
slack_bot_token: str = ""
|
|
61
62
|
slack_app_token: str = "" # xapp-... (Socket Mode)
|
|
62
63
|
slack_channel: str = "" # optional: restrict to one channel ID or name
|
|
63
64
|
slack_dm_submitter: bool = True # DM the submitter when a fix is applied or blocked
|
|
@@ -190,6 +191,7 @@ class ConfigLoader:
|
|
|
190
191
|
c.auto_upgrade = d.get("AUTO_UPGRADE", "true").lower() != "false"
|
|
191
192
|
c.version_pin = d.get("VERSION_PIN", "")
|
|
192
193
|
c.upgrade_check_hours = int(d.get("UPGRADE_CHECK_HOURS", 6))
|
|
194
|
+
c.smtp_from = d.get("SMTP_FROM", "")
|
|
193
195
|
c.slack_bot_token = d.get("SLACK_BOT_TOKEN", "")
|
|
194
196
|
c.slack_app_token = d.get("SLACK_APP_TOKEN", "")
|
|
195
197
|
c.slack_channel = d.get("SLACK_CHANNEL", "")
|
package/python/sentinel/main.py
CHANGED
|
@@ -646,7 +646,7 @@ async def poll_cycle(cfg_loader: ConfigLoader, store: StateStore):
|
|
|
646
646
|
f":white_check_mark: *{hr['repo_name']}* is back online.",
|
|
647
647
|
)
|
|
648
648
|
|
|
649
|
-
if cfg_loader.sentinel.send_health and
|
|
649
|
+
if _report_requested or (cfg_loader.sentinel.send_health and _report_due(cfg_loader, store)):
|
|
650
650
|
_report_requested = False
|
|
651
651
|
logger.info("Sending health digest...")
|
|
652
652
|
build_and_send(cfg_loader.sentinel, store)
|
|
@@ -105,7 +105,7 @@ def build_and_send(cfg: SentinelConfig, store: StateStore):
|
|
|
105
105
|
def _send_email(cfg: SentinelConfig, subject: str, html: str):
|
|
106
106
|
msg = MIMEMultipart("alternative")
|
|
107
107
|
msg["Subject"] = subject
|
|
108
|
-
msg["From"] = cfg.smtp_user
|
|
108
|
+
msg["From"] = cfg.smtp_from or cfg.smtp_user
|
|
109
109
|
msg["To"] = ", ".join(cfg.mails)
|
|
110
110
|
msg.attach(MIMEText(html, "html"))
|
|
111
111
|
if cfg.smtp_host.lower() == "ses":
|
|
@@ -119,7 +119,7 @@ def _send_smtp(cfg: SentinelConfig, msg: MIMEMultipart):
|
|
|
119
119
|
smtp.ehlo()
|
|
120
120
|
smtp.starttls()
|
|
121
121
|
smtp.login(cfg.smtp_user, cfg.smtp_password)
|
|
122
|
-
smtp.sendmail(cfg.smtp_user, cfg.mails, msg.as_string())
|
|
122
|
+
smtp.sendmail(cfg.smtp_from or cfg.smtp_user, cfg.mails, msg.as_string())
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
def _send_ses(cfg: SentinelConfig, msg: MIMEMultipart):
|
|
@@ -9,6 +9,7 @@ SMTP_HOST=smtp.gmail.com
|
|
|
9
9
|
SMTP_PORT=587
|
|
10
10
|
SMTP_USER=sentinel@yourdomain.com
|
|
11
11
|
SMTP_PASSWORD=<app-password>
|
|
12
|
+
# SMTP_FROM=huy@yourdomain.com # Required when using AWS SES (smtp_user is the IAM key, not an email)
|
|
12
13
|
|
|
13
14
|
# GitHub token for opening PRs (when AUTO_PUBLISH=false).
|
|
14
15
|
# Shared across all projects — override per-project in config/sentinel.properties if needed.
|