Renewal avisos left behind only a `RenewalNotice` row, whose sole job is gating: a row with `sentAt` drops the policy off the pending list. It cannot represent a failed send or a customer with no address, so the Pólizas tab had no "Registro de envíos" to show and a sent notice simply vanished from the list. Renewals now write `email_notification_log` — the same table the four bulk jobs write — as `RENEWAL_NOTICE` / `POLICIES`, with rows for failures and no-email skips too. `RenewalNotice` keeps its gating role unchanged; the two are complementary, not redundant. - extend `EmailNotificationType` (+RENEWAL_NOTICE) and `EmailNotificationServicio` (+POLICIES); `level` now carries the aviso generation on renewal rows, so every reader must branch on the type first (`notificationLevelLabel()` is the one place that lives) - backfill emailed notices (`channel = 'EMAIL'`) into the log; MAIL-channel rows are legacy printed letters and are deliberately left out - extract `NotificationLogService`/`NotificationLogModule` as the single writer, so a feature that sends mail records it without pulling the bulk-job pipelines into its module - `GET /notifications/log` and `/stats` take a comma-separated `servicio` list; each tab reads its own slice. This also fixes the "Omitidos" view, which mapped to no filter at all and showed every row - share one `NotificationLogPanel` between both tabs - pass SES_* / NOTIFICATION_ADMIN_EMAILS through the galactus compose, which was missing them entirely — mail is runtime config, not a CI secret, and the prod image sets NODE_ENV=production so a blank config fails loudly instead of falling back to stdout Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
58 lines
2.5 KiB
Bash
58 lines
2.5 KiB
Bash
# Stack env for deploy/jorgecuadros-app.stack.yml (PROD).
|
|
# Paste these into the Portainer stack's "Environment variables" at deploy time.
|
|
# Do NOT commit real secrets — this file is a template only.
|
|
#
|
|
# HOST below = the swarm host the db/minio/app stacks publish on (cubex).
|
|
|
|
# Which built image tag to run. latest = default-branch build; or pin sha-<x> / vX.Y.Z.
|
|
APP_TAG=latest
|
|
|
|
# --- Public URLs (what the end user's BROWSER hits) ---------------------------
|
|
# API_ORIGIN is injected into the web app at runtime and used for browser fetches
|
|
# + document download links, so it must be browser-reachable (not swarm-internal).
|
|
# WEB_ORIGIN is the web app's own public origin; the API allows it via CORS.
|
|
API_ORIGIN=http://192.168.4.212:3001
|
|
WEB_ORIGIN=http://192.168.4.212:3000
|
|
|
|
# Published ports on the swarm host.
|
|
API_PORT=3001
|
|
WEB_PORT=3000
|
|
|
|
# --- Database (points at the jorgecuadros-prod-db stack) ----------------------
|
|
# prod db publishes 3306 on the host (see deploy/jorgecuadros-db.stack.yml).
|
|
DATABASE_URL=mysql://jorgecuadros:CHANGE_ME@192.168.4.212:3306/jorgecuadros
|
|
|
|
# --- Auth --------------------------------------------------------------------
|
|
# 64-hex random. Generate: openssl rand -hex 32
|
|
SESSION_SECRET=CHANGE_ME
|
|
|
|
# --- Object storage (points at the jorgecuadros-prod-minio stack) -------------
|
|
# Server-side only; prod minio API publishes 9000 on the host.
|
|
S3_ENDPOINT=http://192.168.4.212:9000
|
|
S3_BUCKET=jorgecuadros-documents
|
|
MINIO_ROOT_USER=jc_minio
|
|
MINIO_ROOT_PASSWORD=CHANGE_ME
|
|
|
|
# --- Outbound mail (Amazon SES) ----------------------------------------------
|
|
# Belongs HERE, in the stack's env file on the host — not in Gitea Actions
|
|
# secrets. The build never sends mail; the running container does, and it reads
|
|
# these at boot (apps/api/src/mail/mail.service.ts).
|
|
#
|
|
# The production image sets NODE_ENV=production, which turns OFF the stdout dev
|
|
# fallback. Leaving these blank does not silently swallow mail — every send
|
|
# fails with "El envío de correo no está configurado.", and the failure is
|
|
# recorded in the notification log. Fill them in before enabling any envío.
|
|
#
|
|
# SES_FROM must be a verified SES sending identity.
|
|
SES_REGION=us-west-2
|
|
SES_FROM=mail@jorgecuadros.com
|
|
SES_FROM_NAME=Information Server
|
|
SES_ACCESS_KEY=
|
|
SES_SECRET_KEY=
|
|
# Optional — only needed to publish bounce/complaint events.
|
|
SES_CONFIGURATION_SET=
|
|
|
|
# Recipients of the per-job summary email. Comma-separated; unset falls back to
|
|
# the defaults in NotificationsService.
|
|
NOTIFICATION_ADMIN_EMAILS=rmancinas@freakma.net,mpulido@freakma.net
|