From 610ef8f35c776c407e9fad702f0609eb1db9721b Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:23:46 -0600 Subject: [PATCH 1/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 500366ac..cfec6692 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

Dokploy

- +
From 90a1bd90274e8352666fb55f9b4847cd8c86c336 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Wed, 7 Aug 2024 20:51:27 -0600 Subject: [PATCH 2/5] fix(git): don't add to ssh known host when is a http or https url --- apps/dokploy/server/utils/providers/git.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/server/utils/providers/git.ts b/apps/dokploy/server/utils/providers/git.ts index b6f23705..d9d16d1f 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); @@ -84,6 +86,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 +128,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() { From fb013fe4ec63c0ddbbda891218e51aafd8850a92 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Wed, 7 Aug 2024 20:58:16 -0600 Subject: [PATCH 3/5] fix(git): add --recursive-submodules flag --- apps/dokploy/server/utils/providers/git.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/dokploy/server/utils/providers/git.ts b/apps/dokploy/server/utils/providers/git.ts index b6f23705..34215bd5 100644 --- a/apps/dokploy/server/utils/providers/git.ts +++ b/apps/dokploy/server/utils/providers/git.ts @@ -56,6 +56,7 @@ export const cloneGitRepository = async ( customGitBranch, "--depth", "1", + "--recurse-submodules", customGitUrl, outputPath, "--progress", From 161e479a0b8d5dfc4fe437592f3f8e82619bf0cf Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Wed, 7 Aug 2024 21:08:42 -0600 Subject: [PATCH 4/5] chore(version): bump version --- apps/dokploy/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From c70089ee5336442a9570f3dce1095fc2f04d542d Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Wed, 7 Aug 2024 21:41:25 -0600 Subject: [PATCH 5/5] refactor(logs): add error log in build application --- apps/dokploy/server/utils/builders/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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();