Add Mailpit SMTP test server for Notification Service email testing

Adds a fourth Docker service (Mailpit) to capture outgoing emails without
delivery, with CLI tool for sending test emails, listing/reading captured
messages, and clearing the inbox. Supports BCC pattern matching ScadaLink's
notification delivery model.
This commit is contained in:
Joseph Doherty
2026-03-16 14:10:44 -04:00
parent 652378b470
commit 40610271d6
5 changed files with 337 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
# Test Infrastructure
This document describes the local Docker-based test infrastructure for ScadaLink development. Three services provide the external dependencies needed to run and test the system locally.
This document describes the local Docker-based test infrastructure for ScadaLink development. Four services provide the external dependencies needed to run and test the system locally.
## Services
@@ -9,6 +9,7 @@ This document describes the local Docker-based test infrastructure for ScadaLink
| OPC UA Server | `mcr.microsoft.com/iotedge/opc-plc:latest` | 50000 (OPC UA), 8080 (web) | `infra/opcua/nodes.json` |
| LDAP Server | `glauth/glauth:latest` | 3893 | `infra/glauth/config.toml` |
| MS SQL 2022 | `mcr.microsoft.com/mssql/server:2022-latest` | 1433 | `infra/mssql/setup.sql` |
| SMTP (Mailpit) | `axllent/mailpit:latest` | 1025 (SMTP), 8025 (web) | Environment vars |
## Quick Start
@@ -32,6 +33,7 @@ Each service has a dedicated document with configuration details, verification s
- [test_infra_opcua.md](test_infra_opcua.md) — OPC UA test server (Azure IoT OPC PLC)
- [test_infra_ldap.md](test_infra_ldap.md) — LDAP test server (GLAuth)
- [test_infra_db.md](test_infra_db.md) — MS SQL 2022 database
- [test_infra_smtp.md](test_infra_smtp.md) — SMTP test server (Mailpit)
## Connection Strings
@@ -51,6 +53,13 @@ For use in `appsettings.Development.json`:
},
"OpcUa": {
"EndpointUrl": "opc.tcp://localhost:50000"
},
"Smtp": {
"Server": "localhost",
"Port": 1025,
"AuthMode": "None",
"FromAddress": "scada-notifications@company.com",
"ConnectionTimeout": 30
}
}
```
@@ -60,7 +69,7 @@ For use in `appsettings.Development.json`:
```bash
cd infra
docker compose down # stop containers, preserve SQL data volume
docker compose stop opcua # stop a single service (also: ldap, mssql)
docker compose stop opcua # stop a single service (also: ldap, mssql, smtp)
```
**Full teardown** (removes volumes, optionally images and venv):
@@ -77,11 +86,11 @@ After a full teardown, the next `docker compose up -d` starts fresh — re-run t
```
infra/
docker-compose.yml # All three services
docker-compose.yml # All four services
teardown.sh # Teardown script (volumes, images, venv)
glauth/config.toml # LDAP users and groups
mssql/setup.sql # Database and user creation
opcua/nodes.json # Custom OPC UA tag definitions
tools/ # Python CLI tools (opcua, ldap, mssql)
tools/ # Python CLI tools (opcua, ldap, mssql, smtp)
README.md # Quick-start for the infra folder
```