From 869e58739f43c76b2dabfc13dda1ed1a83bcc3d9 Mon Sep 17 00:00:00 2001 From: seppulcro Date: Tue, 17 Sep 2024 19:48:55 +0100 Subject: [PATCH 1/7] feat: add roundcube template --- apps/dokploy/public/templates/roundcube.svg | 15 ++++++++++++++ .../templates/roundcube/docker-compose.yml | 20 +++++++++++++++++++ apps/dokploy/templates/roundcube/index.ts | 11 ++++++++++ apps/dokploy/templates/templates.ts | 15 ++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 apps/dokploy/public/templates/roundcube.svg create mode 100644 apps/dokploy/templates/roundcube/docker-compose.yml create mode 100644 apps/dokploy/templates/roundcube/index.ts diff --git a/apps/dokploy/public/templates/roundcube.svg b/apps/dokploy/public/templates/roundcube.svg new file mode 100644 index 000000000..04238a06a --- /dev/null +++ b/apps/dokploy/public/templates/roundcube.svg @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/apps/dokploy/templates/roundcube/docker-compose.yml b/apps/dokploy/templates/roundcube/docker-compose.yml new file mode 100644 index 000000000..56defe043 --- /dev/null +++ b/apps/dokploy/templates/roundcube/docker-compose.yml @@ -0,0 +1,20 @@ +version: '2' +services: + roundcubemail: + image: roundcube/roundcubemail:latest + container_name: roundcubemail + volumes: + - ./www:/var/www/html + - ./db/sqlite:/var/roundcube/db + ports: + - '9002:80' + environment: + - ROUNDCUBEMAIL_DB_TYPE=sqlite + - ROUNDCUBEMAIL_SKIN=elastic + - ROUNDCUBEMAIL_DEFAULT_HOST=${DEFAULT_HOST} + - ROUNDCUBEMAIL_SMTP_SERVER=${SMTP_SERVER} + networks: + - dokploy-network +networks: + dokploy-network: + external: true \ No newline at end of file diff --git a/apps/dokploy/templates/roundcube/index.ts b/apps/dokploy/templates/roundcube/index.ts new file mode 100644 index 000000000..81ba7456b --- /dev/null +++ b/apps/dokploy/templates/roundcube/index.ts @@ -0,0 +1,11 @@ +import type { Schema, Template } from "../utils"; + +export function generate(schema: Schema): Template { + const envs = [ + "DEFAULT_HOST=tls://mail.example.com", + "SMTP_SERVER=tls://mail.example.com", + + ]; + + return { envs }; +} \ No newline at end of file diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 5603b188a..4dcf85cac 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -497,4 +497,19 @@ export const templates: TemplateData[] = [ tags: ["self-hosted", "storage"], load: () => import("./gitea/index").then((m) => m.generate), }, + { + id: "roundcube", + name: "Roundcube", + version: "1.6.9", + description:"Free and open source webmail software for the masses, written in PHP.", + logo:"roundcube.svg", + links:{ + github:"", + website:"", + docs:"", + }, + tags:["self-hosted","mail","webmail"], + load: () => import("./roundcube/index").then((m) => m.generate), + + } ]; From 8e227a3286baf4d486b49219eefa50044daaf7ff Mon Sep 17 00:00:00 2001 From: seppulcro Date: Thu, 19 Sep 2024 08:37:37 +0100 Subject: [PATCH 2/7] fix: update roundcube template to match spec --- .../templates/roundcube/docker-compose.yml | 7 ++----- apps/dokploy/templates/roundcube/index.ts | 21 +++++++++++++++---- apps/dokploy/templates/templates.ts | 18 ++++++++-------- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/apps/dokploy/templates/roundcube/docker-compose.yml b/apps/dokploy/templates/roundcube/docker-compose.yml index 56defe043..562f350fb 100644 --- a/apps/dokploy/templates/roundcube/docker-compose.yml +++ b/apps/dokploy/templates/roundcube/docker-compose.yml @@ -1,13 +1,9 @@ -version: '2' services: roundcubemail: image: roundcube/roundcubemail:latest - container_name: roundcubemail volumes: - ./www:/var/www/html - ./db/sqlite:/var/roundcube/db - ports: - - '9002:80' environment: - ROUNDCUBEMAIL_DB_TYPE=sqlite - ROUNDCUBEMAIL_SKIN=elastic @@ -15,6 +11,7 @@ services: - ROUNDCUBEMAIL_SMTP_SERVER=${SMTP_SERVER} networks: - dokploy-network + networks: dokploy-network: - external: true \ No newline at end of file + external: true``` diff --git a/apps/dokploy/templates/roundcube/index.ts b/apps/dokploy/templates/roundcube/index.ts index 81ba7456b..8df8c743c 100644 --- a/apps/dokploy/templates/roundcube/index.ts +++ b/apps/dokploy/templates/roundcube/index.ts @@ -1,11 +1,24 @@ -import type { Schema, Template } from "../utils"; +import { + type DomainSchema, + type Schema, + type Template, + generateRandomDomain, +} from "../utils"; export function generate(schema: Schema): Template { + const randomDomain = generateRandomDomain(schema); const envs = [ "DEFAULT_HOST=tls://mail.example.com", "SMTP_SERVER=tls://mail.example.com", - ]; - return { envs }; -} \ No newline at end of file + const domains: DomainSchema[] = [ + { + host: randomDomain, + port: 80, + serviceName: "roundcubemail", + }, + ]; + + return { envs, domains }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 4dcf85cac..ebd0a6492 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -501,15 +501,15 @@ export const templates: TemplateData[] = [ id: "roundcube", name: "Roundcube", version: "1.6.9", - description:"Free and open source webmail software for the masses, written in PHP.", - logo:"roundcube.svg", - links:{ - github:"", - website:"", - docs:"", + description: + "Free and open source webmail software for the masses, written in PHP.", + logo: "roundcube.svg", + links: { + github: "https://github.com/roundcube/roundcubemail", + website: "https://roundcube.net/", + docs: "https://roundcube.net/about/", }, - tags:["self-hosted","mail","webmail"], + tags: ["self-hosted", "mail", "webmail"], load: () => import("./roundcube/index").then((m) => m.generate), - - } + }, ]; From 5b0bf99cbfb05773f39957b418d50c5e49752c1d Mon Sep 17 00:00:00 2001 From: seppulcro Date: Thu, 19 Sep 2024 14:40:20 +0100 Subject: [PATCH 3/7] fix: update roundcube template remove bad chars --- apps/dokploy/templates/roundcube/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dokploy/templates/roundcube/docker-compose.yml b/apps/dokploy/templates/roundcube/docker-compose.yml index 562f350fb..4dd6097ab 100644 --- a/apps/dokploy/templates/roundcube/docker-compose.yml +++ b/apps/dokploy/templates/roundcube/docker-compose.yml @@ -14,4 +14,4 @@ services: networks: dokploy-network: - external: true``` + external: true From 59386ed4b7314c405348fedf94d687a1c25cd8fb Mon Sep 17 00:00:00 2001 From: seppulcro Date: Mon, 23 Sep 2024 16:13:16 +0100 Subject: [PATCH 4/7] fix: Update docs; Fix useMDXComponents for li override: add missing id for correct remark-gfm footnotes functionallity --- .../content/docs/core/templates/overview.mdx | 5 ++-- apps/docs/mdx-components.tsx | 24 ++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/apps/docs/content/docs/core/templates/overview.mdx b/apps/docs/content/docs/core/templates/overview.mdx index 363650f6a..6c8a7e8cb 100644 --- a/apps/docs/content/docs/core/templates/overview.mdx +++ b/apps/docs/content/docs/core/templates/overview.mdx @@ -31,8 +31,7 @@ The following templates are available: - **Wordpress**: Open Source Content Management System - **Open WebUI**: Free and Open Source ChatGPT Alternative - **Teable**: Open Source Airtable Alternative, Developer Friendly, No-code Database Built on Postgres - - +- **Roundcube**: Free and open source webmail software for the masses, written in PHP, uses SMTP[^1]. ## Create your own template @@ -41,3 +40,5 @@ We accept contributions to upload new templates to the dokploy repository. Make sure to follow the guidelines for creating a template: [Steps to create your own template](https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#templates) + +[^1]: Please note that if you're self-hosting a mail server you need port 25 to be open for SMTP (Mail Transmission Protocol that allows you to send and receive) to work properly. Some VPS providers like [Hetzner](https://docs.hetzner.com/cloud/servers/faq/#why-can-i-not-send-any-mails-from-my-server) block this port by default for new clients. diff --git a/apps/docs/mdx-components.tsx b/apps/docs/mdx-components.tsx index 96c5b74b3..913f33e1c 100644 --- a/apps/docs/mdx-components.tsx +++ b/apps/docs/mdx-components.tsx @@ -3,15 +3,17 @@ import defaultComponents from "fumadocs-ui/mdx"; import type { MDXComponents } from "mdx/types"; export function useMDXComponents(components: MDXComponents): MDXComponents { - return { - ...defaultComponents, - ...components, - ImageZoom, - p: ({ children }) => ( -

{children}

- ), - li: ({ children }) => ( -
  • {children}
  • - ), - }; + return { + ...defaultComponents, + ...components, + ImageZoom, + p: ({ children }) => ( +

    {children}

    + ), + li: ({ children, id }) => ( +
  • + {children} +
  • + ), + }; } From 4715f34e1516400df3e245d65359f0f2f2eb2714 Mon Sep 17 00:00:00 2001 From: seppulcro Date: Tue, 24 Sep 2024 17:01:24 +0100 Subject: [PATCH 5/7] fix: mdx-components formatting with biome --- apps/docs/mdx-components.tsx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/docs/mdx-components.tsx b/apps/docs/mdx-components.tsx index 913f33e1c..10488dcab 100644 --- a/apps/docs/mdx-components.tsx +++ b/apps/docs/mdx-components.tsx @@ -3,17 +3,17 @@ import defaultComponents from "fumadocs-ui/mdx"; import type { MDXComponents } from "mdx/types"; export function useMDXComponents(components: MDXComponents): MDXComponents { - return { - ...defaultComponents, - ...components, - ImageZoom, - p: ({ children }) => ( -

    {children}

    - ), - li: ({ children, id }) => ( -
  • - {children} -
  • - ), - }; + return { + ...defaultComponents, + ...components, + ImageZoom, + p: ({ children }) => ( +

    {children}

    + ), + li: ({ children, id }) => ( +
  • + {children} +
  • + ), + }; } From 0aff344bc0fa513e9f8aa24f63794090f3d0757c Mon Sep 17 00:00:00 2001 From: seppulcro Date: Tue, 24 Sep 2024 17:27:11 +0100 Subject: [PATCH 6/7] fix: change tags for roundcube template --- apps/dokploy/templates/templates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index ebd0a6492..afe9d1b69 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -509,7 +509,7 @@ export const templates: TemplateData[] = [ website: "https://roundcube.net/", docs: "https://roundcube.net/about/", }, - tags: ["self-hosted", "mail", "webmail"], + tags: ["self-hosted", "email", "webmail"], load: () => import("./roundcube/index").then((m) => m.generate), }, ]; From a36518a8f0eb0b8ae2efd989b8732bb2de09160c Mon Sep 17 00:00:00 2001 From: seppulcro Date: Thu, 3 Oct 2024 08:09:21 +0100 Subject: [PATCH 7/7] fix: set static docker image version --- apps/dokploy/templates/roundcube/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dokploy/templates/roundcube/docker-compose.yml b/apps/dokploy/templates/roundcube/docker-compose.yml index 4dd6097ab..440f907dd 100644 --- a/apps/dokploy/templates/roundcube/docker-compose.yml +++ b/apps/dokploy/templates/roundcube/docker-compose.yml @@ -1,6 +1,6 @@ services: roundcubemail: - image: roundcube/roundcubemail:latest + image: roundcube/roundcubemail:1.6.9-apache volumes: - ./www:/var/www/html - ./db/sqlite:/var/roundcube/db