diff --git a/apps/dokploy/components/dashboard/settings/github/github-setup.tsx b/apps/dokploy/components/dashboard/settings/github/github-setup.tsx index 99f71e6d..fa6dd41f 100644 --- a/apps/dokploy/components/dashboard/settings/github/github-setup.tsx +++ b/apps/dokploy/components/dashboard/settings/github/github-setup.tsx @@ -9,36 +9,11 @@ import { import { Input } from "@/components/ui/input"; import { Switch } from "@/components/ui/switch"; import { api } from "@/utils/api"; +import { format } from "date-fns"; import { BadgeCheck } from "lucide-react"; import Link from "next/link"; import React, { useEffect, useState } from "react"; import { RemoveGithubApp } from "./remove-github-app"; -export const generateName = () => { - const n1 = ["Blue", "Green", "Red", "Orange", "Violet", "Indigo", "Yellow"]; - const n2 = [ - "One", - "Two", - "Three", - "Four", - "Five", - "Six", - "Seven", - "Eight", - "Nine", - "Zero", - ]; - return `Dokploy-${n1[Math.round(Math.random() * (n1.length - 1))]}-${ - n2[Math.round(Math.random() * (n2.length - 1))] - }`; -}; -function slugify(text: string) { - return text - .toLowerCase() - .replace(/[\s\^&*()+=!]+/g, "-") - .replace(/[\$.,*+~()'"!:@^&]+/g, "") - .replace(/-+/g, "-") - .replace(/^-+|-+$/g, ""); -} export const GithubSetup = () => { const [isOrganization, setIsOrganization] = useState(false); @@ -52,10 +27,9 @@ export const GithubSetup = () => { const manifest = JSON.stringify( { redirect_url: `${origin}/api/redirect?authId=${data?.authId}`, - name: generateName(), + name: `Dokploy-${format(new Date(), "yyyy-MM-dd")}`, url: origin, hook_attributes: { - // JUST FOR TESTING url: `${url}/api/deploy/github`, // url: `${origin}/api/webhook`, // AquĆ­ especificas la URL del endpoint de tu webhook }, @@ -95,8 +69,8 @@ export const GithubSetup = () => {
- {/* { })} > Manage Github App - */} +
) : ( @@ -119,9 +93,9 @@ export const GithubSetup = () => {
Install Github App diff --git a/apps/dokploy/pages/api/redirect.ts b/apps/dokploy/pages/api/redirect.ts index b03d9b01..785b078c 100644 --- a/apps/dokploy/pages/api/redirect.ts +++ b/apps/dokploy/pages/api/redirect.ts @@ -35,7 +35,7 @@ export default async function handler( .update(admins) .set({ githubAppId: data.id, - githubAppName: data.name, + githubAppName: data.html_url, githubClientId: data.client_id, githubClientSecret: data.client_secret, githubWebhookSecret: data.webhook_secret,