diff --git a/components/dashboard/project/add-application.tsx b/components/dashboard/project/add-application.tsx index 9d1019f9..cbe48b6d 100644 --- a/components/dashboard/project/add-application.tsx +++ b/components/dashboard/project/add-application.tsx @@ -40,7 +40,7 @@ const AddTemplateSchema = z.object({ }) .regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, { message: - "App name supports letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", + "App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", }), description: z.string().optional(), }); diff --git a/components/dashboard/project/add-compose.tsx b/components/dashboard/project/add-compose.tsx index bea9a30e..a6697eb6 100644 --- a/components/dashboard/project/add-compose.tsx +++ b/components/dashboard/project/add-compose.tsx @@ -48,7 +48,7 @@ const AddComposeSchema = z.object({ }) .regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, { message: - "App name supports letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", + "App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", }), description: z.string().optional(), }); diff --git a/components/dashboard/project/add-database.tsx b/components/dashboard/project/add-database.tsx index 1e83dc32..e6b36e63 100644 --- a/components/dashboard/project/add-database.tsx +++ b/components/dashboard/project/add-database.tsx @@ -66,7 +66,7 @@ const baseDatabaseSchema = z.object({ }) .regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, { message: - "App name supports letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", + "App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", }), databasePassword: z.string(), dockerImage: z.string(), diff --git a/public/templates/umami.png b/public/templates/umami.png new file mode 100644 index 00000000..de2f7615 Binary files /dev/null and b/public/templates/umami.png differ diff --git a/templates/templates.ts b/templates/templates.ts index fc997fcb..0063013e 100644 --- a/templates/templates.ts +++ b/templates/templates.ts @@ -363,4 +363,19 @@ export const templates: TemplateData[] = [ tags: ["email"], load: () => import("./doublezero/index").then((m) => m.generate), }, + { + id: "umami", + name: "Umami", + version: "v2.12.1", + description: + "Umami is a simple, fast, privacy-focused alternative to Google Analytics.", + logo: "umami.png", + links: { + github: "https://github.com/umami-software/umami", + website: "https://umami.is", + docs: "https://umami.is/docs", + }, + tags: ["analytics"], + load: () => import("./umami/index").then((m) => m.generate), + }, ]; diff --git a/templates/umami/docker-compose.yml b/templates/umami/docker-compose.yml new file mode 100644 index 00000000..43d843af --- /dev/null +++ b/templates/umami/docker-compose.yml @@ -0,0 +1,46 @@ +services: + umami: + image: ghcr.io/umami-software/umami:postgresql-v2.12.1 + restart: always + healthcheck: + test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"] + interval: 5s + timeout: 5s + retries: 5 + depends_on: + db: + condition: service_healthy + ports: + - ${UMAMI_PORT} + networks: + - dokploy-network + environment: + DATABASE_URL: postgresql://umami:umami@db:5432/umami + DATABASE_TYPE: postgresql + APP_SECRET: ${APP_SECRET} + labels: + - "traefik.enable=true" + - "traefik.http.routers.${HASH}.rule=Host(`${UMAMI_HOST}`)" + - "traefik.http.services.${HASH}.loadbalancer.server.port=${UMAMI_PORT}" + db: + image: postgres:15-alpine + restart: always + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 5s + timeout: 5s + retries: 5 + networks: + - dokploy-network + volumes: + - db-data:/var/lib/postgresql/data + environment: + POSTGRES_DB: umami + POSTGRES_USER: umami + POSTGRES_PASSWORD: umami + +networks: + dokploy-network: + external: true +volumes: + db-data: diff --git a/templates/umami/index.ts b/templates/umami/index.ts new file mode 100644 index 00000000..364fbbe9 --- /dev/null +++ b/templates/umami/index.ts @@ -0,0 +1,24 @@ +import { + type Schema, + type Template, + generateBase64, + generateHash, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const mainServiceHash = generateHash(schema.projectName); + const randomDomain = generateRandomDomain(schema); + const randomSecret = generateBase64(); + + const envs = [ + `UMAMI_HOST=${randomDomain}`, + "UMAMI_PORT=3000", + `APP_SECRET=${randomSecret}`, + `HASH=${mainServiceHash}`, + ]; + + return { + envs, + }; +}