feat: add Kimai 2 template

This commit is contained in:
Nicholas Penree
2024-12-07 20:45:11 -05:00
parent c8b5889414
commit e023cad72d
4 changed files with 104 additions and 0 deletions

View File

@@ -0,0 +1 @@
<svg cursor="default" enable-background="new" height="512" viewBox="0 0 440 440" width="512" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><radialGradient id="a" cx="611" cy="41.266644" gradientTransform="matrix(1.1673343 0 0 1.4196623 -102.24121 -19.722475)" gradientUnits="userSpaceOnUse" r="160.5"><stop offset="0" stop-color="#01fd00"/><stop offset="1" stop-color="#009d39"/></radialGradient><radialGradient id="b" cx="873.78265" cy="-16.37981" gradientTransform="matrix(1.9295131 -1.1140049 1.1550268 2.0005649 -1087.6858 1104.8947)" gradientUnits="userSpaceOnUse" r="55.747124"><stop offset="0" stop-color="#f9f9f9"/><stop offset="1" stop-color="#fff"/></radialGradient><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="611.14288" x2="610.57141" y1="234.57143" y2="-110.91601"><stop offset="0" stop-color="#f2f2f2"/><stop offset="1" stop-color="#f2f2f2"/></linearGradient><g transform="translate(-390.56693 181.56689)"><g><path d="m391.020508-182.838852h439.95895v439.95895h-439.95895z" fill="#fff" stroke="#58dd58" stroke-linejoin="round" stroke-width=".040996" visibility="hidden"/><circle cx="611" cy="38" fill="url(#c)" r="187.776825"/><circle cx="611" cy="38" fill="url(#a)" r="166.285645" stroke="#fff" stroke-linejoin="round" stroke-width="3"/><path d="m571.156433 108.308197 110-63.999998-110-64z" fill="url(#b)" fill-rule="evenodd"/></g><g fill="#c7efc4" fill-rule="evenodd"><rect height="32" opacity=".5" ry="7" transform="matrix(-.83616052 -.5484848 .5484848 -.83616052 0 0)" width="14" x="-542.46875" y="419.410309"/><rect height="32" opacity=".5" ry="7" transform="matrix(-.45720822 -.88935968 .88935968 -.45720822 0 0)" width="14" x="-320.158203" y="642.978027"/><rect height="41" opacity=".5" ry="9" transform="rotate(-90)" width="18" x="-48.536366" y="718.754395"/><rect height="32" opacity=".5" ry="7" transform="matrix(.47159375 -.88181593 .88181593 .47159375 0 0)" width="14" x="244.405457" y="673.798523"/><rect height="32" opacity=".5" ry="7" transform="matrix(-.8503618 .52619845 -.52619845 -.8503618 0 0)" width="14" x="-505.884949" y="-503.867859"/><rect height="41" opacity=".5" ry="9" transform="scale(-1)" width="18" x="-620.297424" y="-187.942719"/><rect height="32" opacity=".5" ry="7" transform="matrix(-.84033379 -.54206929 .54206929 -.84033379 0 0)" width="14" x="-539.16571" y="148.581909"/><rect height="32" opacity=".5" ry="7" transform="matrix(-.45720822 -.88935968 .88935968 -.45720822 0 0)" width="14" x="-319.728088" y="374.804901"/><rect height="41" opacity=".5" ry="9" transform="rotate(-90)" width="18" x="-48.536366" y="460.964569"/><rect height="32" opacity=".5" ry="7" transform="matrix(.47159375 -.88181593 .88181593 .47159375 0 0)" width="14" x="250.841736" y="406.195648"/><rect height="32" opacity=".5" ry="7" transform="matrix(-.849305 .52790248 -.52790248 -.849305 0 0)" width="14" x="-505.957611" y="-236.959518"/><g transform="scale(-1)"><rect height="41" opacity=".5" ry="9" width="18" x="-633.02533" y="69.120789"/><rect height="41" opacity=".5" ry="9" width="18" x="-606.761353" y="69.120789"/></g></g></g></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,51 @@
services:
app:
image: kimai/kimai2:apache-2.26.0
restart: unless-stopped
environment:
APP_ENV: prod
DATABASE_URL: mysql://kimai:${KI_MYSQL_PASSWORD:-kimai}@db/kimai
TRUSTED_PROXIES: localhost
APP_SECRET: ${KI_APP_SECRET}
MAILER_FROM: ${KI_MAILER_FROM:-admin@kimai.local}
MAILER_URL: ${KI_MAILER_URL:-null://null}
ADMINMAIL: ${KI_ADMINMAIL:-admin@kimai.local}
ADMINPASS: ${KI_ADMINPASS}
volumes:
- kimai-data:/opt/kimai/var
depends_on:
db:
condition: service_healthy
networks:
- dokploy-network
db:
image: mariadb:10.11
restart: unless-stopped
environment:
- MYSQL_DATABASE=kimai
- MYSQL_USER=kimai
- MYSQL_PASSWORD=${KI_MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${KI_MYSQL_ROOT_PASSWORD}
volumes:
- mysql-data:/var/lib/mysql
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --innodb-buffer-pool-size=256M
- --innodb-flush-log-at-trx-commit=2
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "kimai", "-p${KI_MYSQL_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- dokploy-network
networks:
dokploy-network:
external: true
volumes:
kimai-data:
mysql-data:

View File

@@ -0,0 +1,37 @@
import {
type DomainSchema,
type Schema,
type Template,
generatePassword,
generateRandomDomain,
} from "../utils";
export function generate(schema: Schema): Template {
const domain = generateRandomDomain(schema);
const domains: DomainSchema[] = [
{
host: domain,
port: 8001,
serviceName: "app",
},
];
const adminPassword = generatePassword(32);
const mysqlPassword = generatePassword(32);
const mysqlRootPassword = generatePassword(32);
const appSecret = generatePassword(32);
const envs = [
`KI_HOST=${domain}`,
"KI_ADMINMAIL=admin@kimai.local",
`KI_ADMINPASS=${adminPassword}`,
`KI_MYSQL_ROOT_PASSWORD=${mysqlRootPassword}`,
`KI_MYSQL_PASSWORD=${mysqlPassword}`,
`KI_APP_SECRET=${appSecret}`,
];
return {
envs,
domains,
};
}

View File

@@ -987,4 +987,19 @@ export const templates: TemplateData[] = [
tags: ["event-driven", "applications"],
load: () => import("./triggerdotdev/index").then((m) => m.generate),
},
{
id: "kimai",
name: "Kimai",
version: "2.26.0",
description:
"Kimai is a web-based multi-user time-tracking application. Works great for everyone: freelancers, companies, organizations - everyone can track their times, generate reports, create invoices and do so much more.",
logo: "kimai.svg",
links: {
github: "https://github.com/kimai/kimai",
website: "https://www.kimai.org",
docs: "https://www.kimai.org/documentation",
},
tags: ["invoice", "business", "finance"],
load: () => import("./kimai/index").then((m) => m.generate),
},
];