From 5dbf18605f4b6681ad8f694aefe63e1ed86030e6 Mon Sep 17 00:00:00 2001 From: Freilyn Bernabe Date: Mon, 26 Aug 2024 11:28:23 -0400 Subject: [PATCH 1/4] feat: add Typebot template with email login configuration. --- apps/dokploy/public/templates/typebot.svg | 13 +++++ apps/dokploy/templates/templates.ts | 14 +++++ .../templates/typebot/docker-compose.yml | 53 +++++++++++++++++++ apps/dokploy/templates/typebot/index.ts | 44 +++++++++++++++ 4 files changed, 124 insertions(+) create mode 100644 apps/dokploy/public/templates/typebot.svg create mode 100644 apps/dokploy/templates/typebot/docker-compose.yml create mode 100644 apps/dokploy/templates/typebot/index.ts diff --git a/apps/dokploy/public/templates/typebot.svg b/apps/dokploy/public/templates/typebot.svg new file mode 100644 index 000000000..83d04de25 --- /dev/null +++ b/apps/dokploy/public/templates/typebot.svg @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 100802e55..6047a7c6d 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -453,4 +453,18 @@ export const templates: TemplateData[] = [ tags: ["analytics", "self-hosted"], load: () => import("./aptabase/index").then((m) => m.generate), }, + { + id: "typebot", + name: "Typebot", + version: "latest", + description: "Typebot is an open-source chatbot builder platform.", + logo: "typebot.svg", + links: { + github: "https://github.com/baptisteArno/typebot.io", + website: "https://typebot.io/", + docs: "https://docs.typebot.io/get-started/introduction", + }, + tags: ["chatbot", "builder", "open-source"], + load: () => import("./typebot/index").then((m) => m.generate), + }, ]; diff --git a/apps/dokploy/templates/typebot/docker-compose.yml b/apps/dokploy/templates/typebot/docker-compose.yml new file mode 100644 index 000000000..036ffea5e --- /dev/null +++ b/apps/dokploy/templates/typebot/docker-compose.yml @@ -0,0 +1,53 @@ +version: '3.3' + +volumes: + db-data: + +services: + typebot-db: + image: postgres:14-alpine + restart: always + volumes: + - db-data:/var/lib/postgresql/data + environment: + POSTGRES_USER: typebot + POSTGRES_DB: typebot + POSTGRES_PASSWORD: typebot + networks: + - dokploy-network + + typebot-builder: + image: baptistearno/typebot-builder:latest + restart: always + depends_on: + - typebot-db + ports: + - '8080:3000' + environment: + ENCRYPTION_SECRET: '${ENCRYPTION_SECRET}' + DATABASE_URL: 'postgresql://typebot:typebot@typebot-db:5432/typebot' + NEXTAUTH_URL: '${NEXTAUTH_URL}' + NEXT_PUBLIC_VIEWER_URL: '${NEXT_PUBLIC_VIEWER_URL}' + ADMIN_EMAIL: '${ADMIN_EMAIL}' + SMTP_HOST: '${SMTP_HOST}' + NEXT_PUBLIC_SMTP_FROM: '${NEXT_PUBLIC_SMTP_FROM}' + SMTP_USERNAME: '${SMTP_USERNAME}' + SMTP_PASSWORD: '${SMTP_PASSWORD}' + DEFAULT_WORKSPACE_PLAN: '${DEFAULT_WORKSPACE_PLAN}' + + typebot-viewer: + image: baptistearno/typebot-viewer:latest + restart: always + ports: + - '8081:3000' + environment: + ENCRYPTION_SECRET: '${ENCRYPTION_SECRET}' + DATABASE_URL: postgresql://typebot:typebot@typebot-db:5432/typebot + NEXTAUTH_URL: http://localhost:8080 + NEXT_PUBLIC_VIEWER_URL: http://localhost:8081 + ADMIN_EMAIL: '${ADMIN_EMAIL}' + SMTP_HOST: '${SMTP_HOST}' + NEXT_PUBLIC_SMTP_FROM: '${NEXT_PUBLIC_SMTP_FROM}' + SMTP_USER: '${SMTP_USER}' + SMTP_PASSWORD: '${SMTP_PASSWORD}' + DEFAULT_WORKSPACE_PLAN: '${DEFAULT_WORKSPACE_PLAN}' \ No newline at end of file diff --git a/apps/dokploy/templates/typebot/index.ts b/apps/dokploy/templates/typebot/index.ts new file mode 100644 index 000000000..a0703d71f --- /dev/null +++ b/apps/dokploy/templates/typebot/index.ts @@ -0,0 +1,44 @@ +import { + type DomainSchema, + type Schema, + type Template, + generateBase64, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const builderDomain = generateRandomDomain(schema); + const viewerDomain = generateRandomDomain(schema); + const encryptionSecret = generateBase64(24); + + const domains: DomainSchema[] = [ + { + host: builderDomain, + port: 8080, + serviceName: "typebot-builder", + }, + { + host: viewerDomain, + port: 8081, + serviceName: "typebot-viewer", + }, + ]; + + const envs = [ + `ENCRYPTION_SECRET=${encryptionSecret}`, + `NEXTAUTH_URL=http://${builderDomain}`, + `NEXT_PUBLIC_VIEWER_URL=http://${viewerDomain}`, + "ADMIN_EMAIL=typebot@example.com", + "SMTP_HOST=", + "SMTP_PORT=25", + "SMTP_USERNAME=", + "SMTP_PASSWORD=", + "NEXT_PUBLIC_SMTP_FROM=typebot@example.com", + "DEFAULT_WORKSPACE_PLAN=UNLIMITED", + ]; + + return { + envs, + domains, + }; +} From da8955dabb1917155cf1e9d3f12a53845f2c0a12 Mon Sep 17 00:00:00 2001 From: Freilyn Bernabe Date: Mon, 26 Aug 2024 14:44:43 -0400 Subject: [PATCH 2/4] chore: clean up code and update Docker images to stable versions --- apps/dokploy/templates/typebot/docker-compose.yml | 14 +++++--------- apps/dokploy/templates/typebot/index.ts | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/apps/dokploy/templates/typebot/docker-compose.yml b/apps/dokploy/templates/typebot/docker-compose.yml index 036ffea5e..739793fe2 100644 --- a/apps/dokploy/templates/typebot/docker-compose.yml +++ b/apps/dokploy/templates/typebot/docker-compose.yml @@ -17,12 +17,10 @@ services: - dokploy-network typebot-builder: - image: baptistearno/typebot-builder:latest + image: baptistearno/typebot-builder:2.27 restart: always depends_on: - typebot-db - ports: - - '8080:3000' environment: ENCRYPTION_SECRET: '${ENCRYPTION_SECRET}' DATABASE_URL: 'postgresql://typebot:typebot@typebot-db:5432/typebot' @@ -36,18 +34,16 @@ services: DEFAULT_WORKSPACE_PLAN: '${DEFAULT_WORKSPACE_PLAN}' typebot-viewer: - image: baptistearno/typebot-viewer:latest + image: baptistearno/typebot-viewer:2.27.0 restart: always - ports: - - '8081:3000' environment: ENCRYPTION_SECRET: '${ENCRYPTION_SECRET}' DATABASE_URL: postgresql://typebot:typebot@typebot-db:5432/typebot - NEXTAUTH_URL: http://localhost:8080 - NEXT_PUBLIC_VIEWER_URL: http://localhost:8081 + NEXTAUTH_URL: '${NEXTAUTH_URL}' + NEXT_PUBLIC_VIEWER_URL: '${NEXT_PUBLIC_VIEWER_URL}' ADMIN_EMAIL: '${ADMIN_EMAIL}' SMTP_HOST: '${SMTP_HOST}' NEXT_PUBLIC_SMTP_FROM: '${NEXT_PUBLIC_SMTP_FROM}' - SMTP_USER: '${SMTP_USER}' + SMTP_USERNAME: '${SMTP_USERNAME}' SMTP_PASSWORD: '${SMTP_PASSWORD}' DEFAULT_WORKSPACE_PLAN: '${DEFAULT_WORKSPACE_PLAN}' \ No newline at end of file diff --git a/apps/dokploy/templates/typebot/index.ts b/apps/dokploy/templates/typebot/index.ts index a0703d71f..9861650af 100644 --- a/apps/dokploy/templates/typebot/index.ts +++ b/apps/dokploy/templates/typebot/index.ts @@ -14,12 +14,12 @@ export function generate(schema: Schema): Template { const domains: DomainSchema[] = [ { host: builderDomain, - port: 8080, + port: 3000, serviceName: "typebot-builder", }, { host: viewerDomain, - port: 8081, + port: 3000, serviceName: "typebot-viewer", }, ]; From 4d2354df47d39d539e3808e5a4babdee1300a097 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Thu, 29 Aug 2024 22:05:16 -0600 Subject: [PATCH 3/4] Update index.ts --- apps/dokploy/templates/typebot/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dokploy/templates/typebot/index.ts b/apps/dokploy/templates/typebot/index.ts index 9861650af..87a7fe83b 100644 --- a/apps/dokploy/templates/typebot/index.ts +++ b/apps/dokploy/templates/typebot/index.ts @@ -29,10 +29,10 @@ export function generate(schema: Schema): Template { `NEXTAUTH_URL=http://${builderDomain}`, `NEXT_PUBLIC_VIEWER_URL=http://${viewerDomain}`, "ADMIN_EMAIL=typebot@example.com", - "SMTP_HOST=", + "SMTP_HOST='Fill'", "SMTP_PORT=25", - "SMTP_USERNAME=", - "SMTP_PASSWORD=", + "SMTP_USERNAME='Fill'", + "SMTP_PASSWORD='Fill'", "NEXT_PUBLIC_SMTP_FROM=typebot@example.com", "DEFAULT_WORKSPACE_PLAN=UNLIMITED", ]; From 3e1063306f8191c4157191751b7377dc476bfde8 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Thu, 29 Aug 2024 22:06:22 -0600 Subject: [PATCH 4/4] Update templates.ts --- 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 6047a7c6d..ed29eddd3 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -456,7 +456,7 @@ export const templates: TemplateData[] = [ { id: "typebot", name: "Typebot", - version: "latest", + version: "2.27.0", description: "Typebot is an open-source chatbot builder platform.", logo: "typebot.svg", links: {