From 71a582026e27784568a06d49b310f5cd63dac342 Mon Sep 17 00:00:00 2001 From: codewithkamal Date: Sat, 26 Oct 2024 23:55:10 +0530 Subject: [PATCH] feat: add tolgee template --- apps/dokploy/public/templates/tolgee.svg | 5 +++ apps/dokploy/templates/templates.ts | 15 +++++++ .../templates/tolgee/docker-compose.yml | 24 +++++++++++ apps/dokploy/templates/tolgee/index.ts | 41 +++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 apps/dokploy/public/templates/tolgee.svg create mode 100644 apps/dokploy/templates/tolgee/docker-compose.yml create mode 100644 apps/dokploy/templates/tolgee/index.ts diff --git a/apps/dokploy/public/templates/tolgee.svg b/apps/dokploy/public/templates/tolgee.svg new file mode 100644 index 00000000..0f216e0c --- /dev/null +++ b/apps/dokploy/public/templates/tolgee.svg @@ -0,0 +1,5 @@ + + + + diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 205bc857..ce52d6b1 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -512,4 +512,19 @@ export const templates: TemplateData[] = [ tags: ["self-hosted", "email", "webmail"], load: () => import("./roundcube/index").then((m) => m.generate), }, + { + id: "tolgee", + name: "Tolgee", + version: "v3.80.4", + description: + "Developer & translator friendly web-based localization platform", + logo: "tolgee.svg", + links: { + github: "https://github.com/tolgee/tolgee-platform", + website: "https://tolgee.io", + docs: "https://tolgee.io/platform", + }, + tags: ["self-hosted", "i18n", "localization", "translations"], + load: () => import("./tolgee/index").then((m) => m.generate), + }, ]; diff --git a/apps/dokploy/templates/tolgee/docker-compose.yml b/apps/dokploy/templates/tolgee/docker-compose.yml new file mode 100644 index 00000000..d90e22af --- /dev/null +++ b/apps/dokploy/templates/tolgee/docker-compose.yml @@ -0,0 +1,24 @@ +version: "3" + +services: + app: + image: tolgee/tolgee:v3.80.4 + volumes: + - ./data:/data + - ./config.yaml:/config.yaml + ports: + - '8080:8080' + environment: + TOLGEE_FRONT_END_URL: ${TOLGEE_HOST} + TOLGEE_AUTHENTICATION_ENABLED: ${TOLGEE_AUTHENTICATION_ENABLED} + TOLGEE_AUTHENTICATION_INITIAL_PASSWORD: ${TOLGEE_AUTHENTICATION_INITIAL_PASSWORD} + TOLGEE_AUTHENTICATION_INITIAL_USERNAME: ${TOLGEE_AUTHENTICATION_INITIAL_USERNAME} + TOLGEE_AUTHENTICATION_JWT_SECRET: ${TOLGEE_AUTHENTICATION_JWT_SECRET} + TOLGEE_MACHINE_TRANSLATION_GOOGLE_API_KEY: ${TOLGEE_MACHINE_TRANSLATION_GOOGLE_API_KEY} + TOLGEE_SMTP_AUTH: ${TOLGEE_SMTP_AUTH} + TOLGEE_SMTP_FROM: ${TOLGEE_SMTP_FROM} + TOLGEE_SMTP_HOST: ${TOLGEE_SMTP_HOST} + TOLGEE_SMTP_PASSWORD: ${TOLGEE_SMTP_PASSWORD} + TOLGEE_SMTP_PORT: ${TOLGEE_SMTP_PORT} + TOLGEE_SMTP_SSL_ENABLED: ${TOLGEE_SMTP_SSL_ENABLED} + TOLGEE_SMTP_USERNAME: ${TOLGEE_SMTP_USERNAME} diff --git a/apps/dokploy/templates/tolgee/index.ts b/apps/dokploy/templates/tolgee/index.ts new file mode 100644 index 00000000..e88d3a88 --- /dev/null +++ b/apps/dokploy/templates/tolgee/index.ts @@ -0,0 +1,41 @@ +import { + type Template, + type Schema, + generateRandomDomain, + DomainSchema, + generateBase64, + } from "../utils"; + + export function generate(schema: Schema): Template { + const mainDomain = generateRandomDomain(schema); + const jwtSecret = generateBase64(32); + + const domains: DomainSchema[] = [ + { + host: mainDomain, + port: 8080, + serviceName: "app", + }, + ]; + + const envs = [ + `TOLGEE_HOST=${mainDomain}`, + "TOLGEE_AUTHENTICATION_ENABLED=true", + "TOLGEE_AUTHENTICATION_INITIAL_PASSWORD=admin", + "TOLGEE_AUTHENTICATION_INITIAL_USERNAME=admin", + `TOLGEE_AUTHENTICATION_JWT_SECRET=${jwtSecret}`, + "TOLGEE_MACHINE_TRANSLATION_GOOGLE_API_KEY=my_google_api_key", + "TOLGEE_SMTP_AUTH=true", + "TOLGEE_SMTP_FROM=Tolgee ", + "TOLGEE_SMTPHOST=email-smtp.regional-region.amazonaws.com", + "TOLGEE_SMTP_PASSWORD=omg/my/password", + "TOLGEE_SMTP_PORT=465", + "TOLGEE_SMTP_SSL_ENABLED=true", + "TOLGEE_SMTP_USERNAME=user@company.com", + ]; + + return { + envs, + domains, + }; + }