Files
dtf-system/deploy/portainer.env.example
Cauê Faleiros 3664fe827e feat: password recovery by e-mail, team alerts, and a price for files opened by hand
Pilot customers had no way to reset a forgotten password, and the 7 October
meeting asked for two things that only needed the client's inputs to go live.

Password recovery: "Esqueci minha senha" in Minha conta sends a link that
works once, for an hour (/conta/redefinir#token, in the fragment so it never
reaches a server or a Referer). Only the token's hash is stored, the e-mail's
text is erased once sent, the answer never says whether an account exists,
and a reset signs out every other session. Limited per address and source.

Team alerts: Kanban users who tick "Receber alertas por e-mail" in Usuários
get one when an order is paid, a cart waits for review, or a payment needs
attention. Messages are queued in the transaction that caused them and sent
by the worker with retries (app/mail.py). Integrações shows an E-mail row
with "Enviar teste".

E-mail is off in production (MAIL_ADAPTER=off; recovery keeps offering
WhatsApp) until the client's SMTP account exists; then it is only settings
(docs/PORTAINER.md). The local stack keeps messages in the database and log.

Files opened by hand: a finished sheet in CDR, AI, PSD or TIFF (or with a
length the customer typed) pays the full price plus MANUAL_FILE_EXTRA_CENTS
per metre, to steer customers to PNG as the meeting asked. It is 0 until
Marcus gives the amount. The Site shows it before checkout, the server
charges it, Tiny gets it in the unit price, and the Kanban says it.

Tested: new tests/mail_test (reset flow, SMTP delivery against a local SMTP
server, retry, who gets alerts), pricing unit tests, and the browser test now
checks the Site total equals the server's, run with the charge at 0 and at
R$ 5,00. The full CI suite passes in a CI-style stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 11:48:24 -03:00

83 lines
2.6 KiB
Plaintext

# Non-secret Portainer stack variables. Never put credential values in this file.
PRODUCTION_DEPLOY_ENABLED=TBD
PRODUCTION_INPUTS_APPROVED=TBD
PRODUCTION_SECURITY_REVIEW_APPROVED=TBD
PRODUCTION_RESTORE_REHEARSED=TBD
API_IMAGE=gitea.blyzer.com.br/blyzer/dtf-api
WEB_IMAGE=gitea.blyzer.com.br/blyzer/dtf-web
IMAGE_TAG=latest
POSTGRES_IMAGE=postgres@sha256:0000000000000000000000000000000000000000000000000000000000000000
CLAMAV_IMAGE=clamav/clamav@sha256:0000000000000000000000000000000000000000000000000000000000000000
PUBLIC_ORIGIN=https://dtf.example.invalid
PUBLIC_HOST=dtf.example.invalid
KANBAN_HOST=kanban-dtf.example.invalid
SITE_PORT=8080
KANBAN_PORT=8081
R2_ENDPOINT=TBD
R2_PUBLIC_ENDPOINT=TBD
R2_BUCKET=TBD
POSTGRES_DB=dtf
POSTGRES_USER=dtf_admin
APP_DB_USER=dtf_app
POSTGRES_VOLUME=TBD
OPERATOR_EMAIL=TBD
PAYMENT_ADAPTER=TBD
# With PAYMENT_ADAPTER=mercadopago. MP_ACCESS_TOKEN and MP_WEBHOOK_SECRET are
# secrets: enter them in Portainer only, never in this file.
MP_NOTIFICATION_URL=https://<SITE_DOMAIN>/api/payments/webhook
MP_PUBLIC_KEY=
FREIGHT_ADAPTER=TBD
TINY_ADAPTER=TBD
# Tiny API v3 application (Configurações > Geral > Aplicativos in Tiny). The
# redirect URL registered there must equal TINY_REDIRECT_URI.
TINY_CLIENT_ID=TBD
TINY_REDIRECT_URI=https://<KANBAN_DOMAIN>/api/operator/tiny/callback
TINY_PRODUCT_TEXTIL_FOLHA=TBD
TINY_PRODUCT_TEXTIL_AVULSA=TBD
TINY_PRODUCT_UV_FOLHA=TBD
TINY_PRODUCT_UV_AVULSA=TBD
TINY_FORMA_ENVIO_RETIRADA=TBD
# true only at go-live, after the n8n DTFIMP designer branch is removed.
TINY_STATUS_UPDATES=false
WHATSAPP_ADAPTER=TBD
# E-mail (password recovery and team alerts). off until the SMTP account exists.
MAIL_ADAPTER=off
MAIL_FROM=DTF Dropstar <nao-responda@SITE_DOMAIN>
MAIL_REPLY_TO=
SMTP_HOST=TBD
SMTP_PORT=587
SMTP_SECURITY=starttls
SMTP_USER=TBD
SMTP_PASSWORD=TBD
STORAGE_QUOTA_BYTES=TBD
OWNER_UPLOAD_QUOTA_BYTES=TBD
MAX_PENDING_UPLOADS=10
MAX_UPLOAD_BYTES=5368709120
UPLOAD_PART_BYTES=8388608
SCAN_MAX_BYTES=134217728
# Daily encrypted database backup to its own bucket (docs/BACKUP.md).
BACKUP_S3_ENDPOINT=https://<account>.r2.cloudflarestorage.com
BACKUP_BUCKET=dtf-backups
BACKUP_ACCESS_KEY_ID=TBD
BACKUP_SECRET_ACCESS_KEY=TBD
BACKUP_AGE_RECIPIENT=age1...
BACKUP_HOUR=3
# Names of external Portainer/Docker Swarm secrets, never their values.
DATABASE_URL_SECRET=TBD
DATABASE_ADMIN_URL_SECRET=TBD
DB_ADMIN_PASSWORD_SECRET=TBD
APP_DB_PASSWORD_SECRET=TBD
R2_ACCESS_KEY_ID_SECRET=TBD
R2_SECRET_ACCESS_KEY_SECRET=TBD
OPERATOR_PASSWORD_SECRET=TBD
PAYMENT_TOKEN_SECRET=TBD
PAYMENT_WEBHOOK_SECRET=TBD
TINY_TOKEN_SECRET=TBD
WHATSAPP_TOKEN_SECRET=TBD