Set up SMTP secrets for fund-digest service

t-699·WorkTask·
·
·
Created1 month ago·Updated1 month ago·pipeline runs →

Description

Edit

Context

fund-digest service is deployed and running on beryllium, but failing because the secrets env file doesn't exist yet. The deployer already picked up the new service.

What's needed

Create the SMTP secrets file on beryllium:

sudo tee /var/lib/deployer-secrets/fund-digest.env << 'ENVEOF'
SMTP_HOST=smtp.fastmail.com
SMTP_PORT=587
SMTP_USER=ben@harrisjr.com
SMTP_PASS=<your-fastmail-app-password>
SMTP_FROM=ben@harrisjr.com
DIGEST_TO=ben@harrisjr.com,kate@harrisjr.com
ENVEOF
sudo chmod 600 /var/lib/deployer-secrets/fund-digest.env
sudo systemctl restart fund-digest

Replace <your-fastmail-app-password> with a Fastmail app-specific password. (Or whatever SMTP provider you use — Postmark, SendGrid, etc.)

Testing before deploy

# Test dry-run locally
SMTP_HOST=x SMTP_PORT=587 SMTP_USER=x SMTP_PASS=x SMTP_FROM=x DIGEST_TO=x \
  /nix/store/s75gwpp992nlqf4064mvqv00yal2ci2d-fund-digest/bin/fund-digest \
  --data-dir /var/fund --dry-run 2>/dev/null > /tmp/digest.html
# Open /tmp/digest.html in a browser to preview

# Send immediately when ready:
systemctl status fund-digest   # check it's running

Service behavior

  • Runs continuously, sleeping until next Monday 12:00 UTC (7am EST / 8am EDT)
  • Reads /var/fund/strategy.json + balance.json + projection.json
  • Sends HTML email to both recipients in DIGEST_TO
  • Restarts after 5 minutes on failure (restartSec=300)

Timeline (0)

No activity yet.