GitHub(nextgroup2706/ken_nogi)は今後使わず自社Gitea運用に切替え。 NodeSrvは旧リポジトリの履歴を破棄しファイルのみ統合(Dokploy用サービスアカウントは 別途mygit-admin/NodeSrv.gitに履歴あり)。notepmエクスポート(12GB)とPleasanter インストーラzip(208MB)はサイズが大きいため.gitignoreで除外。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
35 lines
927 B
JavaScript
35 lines
927 B
JavaScript
const nodemailer = require('nodemailer');
|
|
|
|
function createTransport() {
|
|
return nodemailer.createTransport({
|
|
host: process.env.MAIL_RELAY_HOST,
|
|
port: Number(process.env.MAIL_RELAY_PORT || 587),
|
|
secure: false,
|
|
// mail-infra(postfix-relay)はプライベートIP直結・STARTTLS無効構成
|
|
// (apps/xwiki構築時と同じ設定、project_xwiki_oidc_lineworks_sso参照)
|
|
ignoreTLS: true,
|
|
});
|
|
}
|
|
|
|
async function sendAlert({ subject, text }) {
|
|
const to = (process.env.NOTIFY_EMAILS || '')
|
|
.split(',')
|
|
.map((s) => s.trim())
|
|
.filter(Boolean);
|
|
|
|
if (to.length === 0) {
|
|
console.warn('NOTIFY_EMAILS未設定のため通知をスキップしました:', subject);
|
|
return;
|
|
}
|
|
|
|
const transport = createTransport();
|
|
await transport.sendMail({
|
|
from: process.env.MAIL_FROM || 'keycloak-monitor@next-hd.co.jp',
|
|
to,
|
|
subject,
|
|
text,
|
|
});
|
|
}
|
|
|
|
module.exports = { sendAlert };
|