python-dotenv. config.py reads the local .env in the pipeline directory; shell variables take precedence.
Required variables
Microsoft Graph (Outlook fetch)
The app registration needs application permissions (not delegated) on Microsoft Graph:
Mail.ReadMail.ReadWrite(to mark messages as read)
ValueError: AZURE_TENANT_ID is required.
PostgreSQL (Cloud SQL)
Cloud SQL Connector tunnels via Google’s IAM auth — no public IP needed on the database. The service account must have at least
cloudsql.instances.connect and cloudsql.client IAM roles on the instance.
If any are missing, the writer fails when the first session is opened with a Cloud SQL Connector error.
Optional variables
Encryption key
If you change this in the pipeline, you must also change it in the form’s CryptoJS config — the two must match exactly, byte-for-byte. The key length must remain 16 bytes (AES-128).
To rotate the key:
- Generate a new 16-character ASCII string
- Update
MW_AES_KEYin the pipeline env - Update the form’s embedded key constant
- Re-export the configured HTML for each vessel
- Distribute the new HTML to the fleet
- Existing emails encrypted with the old key will fail decryption — keep both keys for the transition window if needed
Other constants
These live insrc/config.py as module constants (not env vars). Override by editing the file.
Markers
Subject regex
Report type mapping
metaweave_report.report_type. Add new entries here when the form ships a new report type.
Sample .env
cat service-account.json | base64 | tr -d '\n')
How config is loaded
What’s not configurable
The pipeline does not support:- Multiple Outlook mailboxes per run (one mailbox per invocation)
- Multiple databases per run
- Different schema per environment (use different
POSTGRES_DB) - Different table prefix (the
metaweave_prefix is hardcoded)
See also
- Installation — initial setup
- Running — operational invocation