From c8b1fd36bd47fe53d1d1e6791abe991331963e05 Mon Sep 17 00:00:00 2001 From: Nicholas Penree Date: Wed, 19 Feb 2025 22:27:36 -0500 Subject: [PATCH] feat: add Mailpit template --- apps/dokploy/public/templates/mailpit.svg | 6 ++++ .../templates/mailpit/docker-compose.yml | 25 +++++++++++++++ apps/dokploy/templates/mailpit/index.ts | 31 +++++++++++++++++++ apps/dokploy/templates/templates.ts | 15 +++++++++ 4 files changed, 77 insertions(+) create mode 100644 apps/dokploy/public/templates/mailpit.svg create mode 100644 apps/dokploy/templates/mailpit/docker-compose.yml create mode 100644 apps/dokploy/templates/mailpit/index.ts diff --git a/apps/dokploy/public/templates/mailpit.svg b/apps/dokploy/public/templates/mailpit.svg new file mode 100644 index 000000000..58675a267 --- /dev/null +++ b/apps/dokploy/public/templates/mailpit.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/apps/dokploy/templates/mailpit/docker-compose.yml b/apps/dokploy/templates/mailpit/docker-compose.yml new file mode 100644 index 000000000..d0dbdb8ec --- /dev/null +++ b/apps/dokploy/templates/mailpit/docker-compose.yml @@ -0,0 +1,25 @@ +services: + mailpit: + image: axllent/mailpit:v1.22.3 + restart: unless-stopped + ports: + - '1025:1025' + volumes: + - 'mailpit-data:/data' + environment: + - MP_SMTP_AUTH_ALLOW_INSECURE=true + - MP_MAX_MESSAGES=5000 + - MP_DATABASE=/data/mailpit.db + - MP_UI_AUTH=${MP_UI_AUTH} + - MP_SMTP_AUTH=${MP_SMTP_AUTH} + healthcheck: + test: + - CMD + - /mailpit + - readyz + interval: 5s + timeout: 20s + retries: 10 + +volumes: + mailpit-data: \ No newline at end of file diff --git a/apps/dokploy/templates/mailpit/index.ts b/apps/dokploy/templates/mailpit/index.ts new file mode 100644 index 000000000..25f18f7e6 --- /dev/null +++ b/apps/dokploy/templates/mailpit/index.ts @@ -0,0 +1,31 @@ +import { + type DomainSchema, + type Schema, + type Template, + generateBase64, + generatePassword, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const domains: DomainSchema[] = [ + { + host: generateRandomDomain(schema), + port: 8025, + serviceName: "mailpit", + }, + ]; + + const defaultPassword = generatePassword(); + + const envs = [ + "# Uncomment below if you want basic auth on UI and SMTP", + `#MP_UI_AUTH=mailpit:${defaultPassword}`, + `#MP_SMTP_AUTH=mailpit:${defaultPassword}`, + ]; + + return { + domains, + envs, + }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 17498e035..29a9b5751 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -393,6 +393,21 @@ export const templates: TemplateData[] = [ tags: ["chat"], load: () => import("./open-webui/index").then((m) => m.generate), }, + { + id: "mailpit", + name: "Mailpit", + version: "v1.22.3", + description: + "Mailpit is a tiny, self-contained, and secure email & SMTP testing tool with API for developers.", + logo: "mailpit.svg", + links: { + github: "https://github.com/axllent/mailpit", + website: "https://mailpit.axllent.org/", + docs: "https://mailpit.axllent.org/docs/", + }, + tags: ["email", "smtp"], + load: () => import("./mailpit/index").then((m) => m.generate), + }, { id: "listmonk", name: "Listmonk",