From bab93f8145f5704f6a0ebbebde8ae426295a2615 Mon Sep 17 00:00:00 2001 From: Radu Ciocan Date: Sat, 6 Jul 2024 14:29:32 +0100 Subject: [PATCH] feat: doublezero template --- public/templates/doublezero.svg | 4 +++ templates/doublezero/docker-compose.yml | 33 +++++++++++++++++++++++++ templates/doublezero/index.ts | 26 +++++++++++++++++++ templates/templates.ts | 14 +++++++++++ 4 files changed, 77 insertions(+) create mode 100644 public/templates/doublezero.svg create mode 100644 templates/doublezero/docker-compose.yml create mode 100644 templates/doublezero/index.ts diff --git a/public/templates/doublezero.svg b/public/templates/doublezero.svg new file mode 100644 index 00000000..e28cbeb0 --- /dev/null +++ b/public/templates/doublezero.svg @@ -0,0 +1,4 @@ + + + + diff --git a/templates/doublezero/docker-compose.yml b/templates/doublezero/docker-compose.yml new file mode 100644 index 00000000..c124a0e3 --- /dev/null +++ b/templates/doublezero/docker-compose.yml @@ -0,0 +1,33 @@ +services: + doublezero: + restart: always + image: liltechnomancer/double-zero:latest + ports: + - 4000:4000 + networks: + - dokploy-network + volumes: + - db-data:/var/lib/doublezero/data + environment: + AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} + AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} + AWS_REGION: ${AWS_REGION} + SQS_URL: ${SQS_URL} + SYSTEM_EMAIL: ${SYSTEM_EMAIL} + SECRET_KEY_BASE: ${SECRET_KEY_BASE} + PHX_HOST: ${DOUBLEZERO_HOST} + DATABASE_PATH: ./00.db + labels: + - "traefik.enable=true" + - "traefik.http.routers.${HASH}.rule=Host(`${DOUBLEZERO_HOST}`)" + - "traefik.http.routers.${HASH}.entrypoints=websecure" + - "traefik.http.routers.${HASH}.tls.certResolver=letsencrypt" + - "traefik.http.services.${HASH}.loadbalancer.server.port=${DOUBLEZERO_PORT}" + +volumes: + db-data: + driver: local + +networks: + dokploy-network: + external: true diff --git a/templates/doublezero/index.ts b/templates/doublezero/index.ts new file mode 100644 index 00000000..e60c43f2 --- /dev/null +++ b/templates/doublezero/index.ts @@ -0,0 +1,26 @@ +import { + generateHash, + generateRandomDomain, + type Template, + type Schema, +} from "../utils"; + +export function generate(schema: Schema): Template { + const mainServiceHash = generateHash(schema.projectName); + const randomDomain = generateRandomDomain(schema); + const envs = [ + `DOUBLEZERO_HOST=${randomDomain}`, + "DOUBLEZERO_PORT=4000", + `HASH=${mainServiceHash}`, + "SECRET_KEY_BASE=", + "AWS_ACCESS_KEY_ID=", + "AWS_SECRET_ACCESS_KEY=", + "AWS_REGION=", + "SQS_URL=", + "SYSTEM_EMAIL=", + ]; + + return { + envs, + }; +} diff --git a/templates/templates.ts b/templates/templates.ts index 49bd596c..a9cade22 100644 --- a/templates/templates.ts +++ b/templates/templates.ts @@ -331,5 +331,19 @@ export const templates: TemplateData[] = [ }, tags: ['chat'], load: () => import('./open-webui/index').then((m) => m.generate), + }, + { + id: 'doublezero', + name: 'Double Zero', + version: 'v0.0', + description: 'A markdown email micro service for the people! 00 is a bring your own SES email monitoring service you self-host.', + logo: 'doublezero.svg', + links: { + github: 'https://github.com/technomancy-dev/00', + website: 'https://www.double-zero.cloud/', + docs: 'https://github.com/technomancy-dev/00', + }, + tags: ['email'], + load: () => import('./doublezero/index').then((m) => m.generate), } ];