Skip to content

Commit

Permalink
Release 1.10.0 (#79)
Browse files Browse the repository at this point in the history
* Revert README formatting.

* Bump release v1.10.0.
  • Loading branch information
janjaali authored Jul 31, 2024
1 parent bb32718 commit 133a44f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 37 deletions.
60 changes: 25 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ SendGrid-Mock serves as a simple server mocking the sendgrid-apis for developmen
* Send mails `POST /v3/mail/send`

* Retrieve sent mails `GET /api/mails`
* Filter capabilities are included and can be combined:
* **To**: `GET /api/[email protected]`
* **Subject**:
* `GET /api/mails?subject=The subject` (*exact match*)
* `GET /api/mails?subject=%subject%` (*contains*)
* **Datetime**: `GET /api/mails?dateTimeSince=2020-12-06T10:00:00Z` (
*[ISO-8601 format](https://en.wikipedia.org/wiki/ISO_8601)*)
* Filter capabilities are included and can be combined:
* **To**: `GET /api/[email protected]`
* **Subject**:
* `GET /api/mails?subject=The subject` (*exact match*)
* `GET /api/mails?subject=%subject%` (*contains*)
* **Datetime**: `GET /api/mails?dateTimeSince=2020-12-06T10:00:00Z` (
*[ISO-8601 format](https://en.wikipedia.org/wiki/ISO_8601)*)

* Delete sent mails `DELETE /api/mails`
* Filter capabilities are included and can be combined:
* **To**: `DELETE /api/[email protected]`
* Filter capabilities are included and can be combined:
* **To**: `DELETE /api/[email protected]`

### UI

Expand All @@ -30,34 +30,26 @@ SendGrid-Mock serves as a simple server mocking the sendgrid-apis for developmen

### Extras

* Basic authentication support: Add basic authentication credentials by specifying environment variable `AUTHENTICATION`
to the following format: `user1:passwordForUser1;user2:passwordForUser2`
* Basic authentication support: Add basic authentication credentials by specifying environment variable `AUTHENTICATION` to the following format: `user1:passwordForUser1;user2:passwordForUser2`

* Request rate limiting: Both the actual SendGrid API server as well as the SSL server can be rate limited by specifying
environment variables:
* `RATE_LIMIT_ENABLED`: `true` or `false` (default)
* `RATE_LIMIT_WINDOW_IN_MS`: The time window in milliseconds (default: `60000`)
* `RATE_LIMIT_MAX_REQUESTS`: The maximum number of requests allowed in the time window (default: `100`)
* `SSL_RATE_LIMIT_ENABLED`: `true` or `false` (default)
* `SSL_RATE_LIMIT_WINDOW_IN_MS`: The time window in milliseconds (default: `60000`)
* `SSL_RATE_LIMIT_MAX_REQUESTS`: The maximum number of requests allowed in the time window (default: `100`)
* Request rate limiting: Both the actual SendGrid API server as well as the SSL server can be rate limited by specifying environment variables:
* `RATE_LIMIT_ENABLED`: `true` or `false` (default)
* `RATE_LIMIT_WINDOW_IN_MS`: The time window in milliseconds (default: `60000`)
* `RATE_LIMIT_MAX_REQUESTS`: The maximum number of requests allowed in the time window (default: `100`)
* `SSL_RATE_LIMIT_ENABLED`: `true` or `false` (default)
* `SSL_RATE_LIMIT_WINDOW_IN_MS`: The time window in milliseconds (default: `60000`)
* `SSL_RATE_LIMIT_MAX_REQUESTS`: The maximum number of requests allowed in the time window (default: `100`)

* By default, all emails older than 24 hours will be deleted. This can be configured using environment
variable `MAIL_HISTORY_DURATION` which
uses [ISO-8601 Duration format](https://en.wikipedia.org/wiki/ISO_8601#Durations) such as *'PT24H'*.
* By default, all emails older than 24 hours will be deleted. This can be configured using environment variable `MAIL_HISTORY_DURATION` which uses [ISO-8601 Duration format](https://en.wikipedia.org/wiki/ISO_8601#Durations) such as *'PT24H'*.

* Event support: Add basic [event](https://www.twilio.com/docs/sendgrid/for-developers/tracking-events/event#events)
support by specifying the environment variable `EVENT_DELIVERY_URL`. When set,
[delivered](https://www.twilio.com/docs/sendgrid/for-developers/tracking-events/event#delivered) events will be
sent to the specified webhook URL when an email is sent.
* Event support: Add basic [event](https://www.twilio.com/docs/sendgrid/for-developers/tracking-events/event#events) support by specifying the environment variable `EVENT_DELIVERY_URL`. When set, [delivered](https://www.twilio.com/docs/sendgrid/for-developers/tracking-events/event#delivered) events will be sent to the specified webhook URL when an email is sent.

## Dockerized

The SendGrid-Mock server and the UI are both contained in the same docker-image which you can pull
from [Docker Hub](https://cloud.docker.com/u/ghashange/repository/docker/ghashange/sendgrid-mock) and start it via:
The SendGrid-Mock server and the UI are both contained in the same docker-image which you can pull from [Docker Hub](https://cloud.docker.com/u/ghashange/repository/docker/ghashange/sendgrid-mock) and start it via:

```shell
docker run -it -p 3000:3000 -e "API_KEY=sendgrid-api-key" ghashange/sendgrid-mock:1.9.2
docker run -it -p 3000:3000 -e "API_KEY=sendgrid-api-key" ghashange/sendgrid-mock:1.10.0
```

Some prepared HTTP calls can be found [here](./http-calls).
Expand All @@ -69,21 +61,20 @@ The UI can be accessed at <http://localhost:3000>.
SendGrid-Mock also supports SSL using [Let's Encrypt](https://letsencrypt.org/). To enable SSL, run it as follows:

```shell
docker run -it -p 3000:3000 -e "API_KEY=sendgrid-api-key" -e "CERT_DOMAINNAMES=[your-domain-name]" -e "CERT_EMAIL=[your-email-address]" ghashange/sendgrid-mock:1.9.2
docker run -it -p 3000:3000 -e "API_KEY=sendgrid-api-key" -e "CERT_DOMAINNAMES=[your-domain-name]" -e "CERT_EMAIL=[your-email-address]" ghashange/sendgrid-mock:1.10.0
```

## Development

Setup with `npm ci` and start both server and UI concurrently with `npm run dev`. Per default the server is reachable
via <http://localhost:3000> and the UI via <http://localhost:1234>.
Setup with `npm ci` and start both server and UI concurrently with `npm run dev`. Per default the server is reachable via <http://localhost:3000> and the UI via <http://localhost:1234>.

Some prepared HTTP calls can be found [here](./http-calls).

The UI can be accessed at <http://localhost:3000>.

### Build

Create docker image with `docker build -t ghashange/sendgrid-mock:1.9.2 .`.
Create docker image with `docker build -t ghashange/sendgrid-mock:1.10.0 .`.

### Release

Expand All @@ -93,5 +84,4 @@ Create docker image with `docker build -t ghashange/sendgrid-mock:1.9.2 .`.

3. Merge PR

4. Create GitHub release and
update [Docker Hub description](https://hub.docker.com/repository/docker/ghashange/sendgrid-mock)
4. Create GitHub release and update [Docker Hub description](https://hub.docker.com/repository/docker/ghashange/sendgrid-mock)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sendgrid-mock",
"version": "1.9.2",
"version": "1.10.0",
"description": "SendGrid API mock",
"engines": {
"node": ">=16",
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.2
1.10.0

0 comments on commit 133a44f

Please sign in to comment.