diff --git a/README.md b/README.md index 500366ac..cfec6692 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

Dokploy

- +
diff --git a/apps/dokploy/package.json b/apps/dokploy/package.json index 3eb58abc..2fadd0a4 100644 --- a/apps/dokploy/package.json +++ b/apps/dokploy/package.json @@ -1,6 +1,6 @@ { "name": "dokploy", - "version": "v0.6.1", + "version": "v0.6.2", "private": true, "license": "Apache-2.0", "type": "module", diff --git a/apps/dokploy/server/utils/builders/index.ts b/apps/dokploy/server/utils/builders/index.ts index 432138d2..b3ca2e05 100644 --- a/apps/dokploy/server/utils/builders/index.ts +++ b/apps/dokploy/server/utils/builders/index.ts @@ -54,7 +54,11 @@ export const buildApplication = async ( await mechanizeDockerContainer(application); writeStream.write("Docker Deployed: ✅"); } catch (error) { - writeStream.write("Error ❌"); + if (error instanceof Error) { + writeStream.write(`Error ❌\n${error?.message}`); + } else { + writeStream.write("Error ❌"); + } throw error; } finally { writeStream.end(); diff --git a/apps/dokploy/server/utils/providers/git.ts b/apps/dokploy/server/utils/providers/git.ts index b6f23705..cf3e28ae 100644 --- a/apps/dokploy/server/utils/providers/git.ts +++ b/apps/dokploy/server/utils/providers/git.ts @@ -33,7 +33,9 @@ export const cloneGitRepository = async ( const knownHostsPath = path.join(SSH_PATH, "known_hosts"); try { - await addHostToKnownHosts(customGitUrl); + if (!isHttpOrHttps(customGitUrl)) { + await addHostToKnownHosts(customGitUrl); + } await recreateDirectory(outputPath); // const command = `GIT_SSH_COMMAND="ssh -i ${keyPath} -o UserKnownHostsFile=${knownHostsPath}" git clone --branch ${customGitBranch} --depth 1 ${customGitUrl} ${gitCopyPath} --progress`; // const { stdout, stderr } = await execAsync(command); @@ -56,6 +58,7 @@ export const cloneGitRepository = async ( customGitBranch, "--depth", "1", + "--recurse-submodules", customGitUrl, outputPath, "--progress", @@ -84,6 +87,11 @@ export const cloneGitRepository = async ( } }; +const isHttpOrHttps = (url: string): boolean => { + const regex = /^https?:\/\//; + return regex.test(url); +}; + const addHostToKnownHosts = async (repositoryURL: string) => { const { domain, port } = sanitizeRepoPathSSH(repositoryURL); const knownHostsPath = path.join(SSH_PATH, "known_hosts"); @@ -121,7 +129,7 @@ const sanitizeRepoPathSSH = (input: string) => { return { user: found.groups?.user ?? "git", domain: found.groups?.domain, - port: 22, + port: Number(found.groups?.port ?? 22), owner: found.groups?.owner ?? "", repo: found.groups?.repo, get repoPath() {