mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
@@ -1,7 +1,7 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<h1 align="center">Dokploy</h1>
|
<h1 align="center">Dokploy</h1>
|
||||||
<div>
|
<div>
|
||||||
<img style="object-fit: cover; border-radius:20px;" align="center" width="50%"src="https://raw.githubusercontent.com/Dokploy/docs/main/public/logo.png" >
|
<img style="object-fit: cover; border-radius:20px;" align="center" width="50%"src="https://dokploy.com/og.png" >
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dokploy",
|
"name": "dokploy",
|
||||||
"version": "v0.6.1",
|
"version": "v0.6.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -54,7 +54,11 @@ export const buildApplication = async (
|
|||||||
await mechanizeDockerContainer(application);
|
await mechanizeDockerContainer(application);
|
||||||
writeStream.write("Docker Deployed: ✅");
|
writeStream.write("Docker Deployed: ✅");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
writeStream.write("Error ❌");
|
if (error instanceof Error) {
|
||||||
|
writeStream.write(`Error ❌\n${error?.message}`);
|
||||||
|
} else {
|
||||||
|
writeStream.write("Error ❌");
|
||||||
|
}
|
||||||
throw error;
|
throw error;
|
||||||
} finally {
|
} finally {
|
||||||
writeStream.end();
|
writeStream.end();
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ export const cloneGitRepository = async (
|
|||||||
const knownHostsPath = path.join(SSH_PATH, "known_hosts");
|
const knownHostsPath = path.join(SSH_PATH, "known_hosts");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await addHostToKnownHosts(customGitUrl);
|
if (!isHttpOrHttps(customGitUrl)) {
|
||||||
|
await addHostToKnownHosts(customGitUrl);
|
||||||
|
}
|
||||||
await recreateDirectory(outputPath);
|
await recreateDirectory(outputPath);
|
||||||
// const command = `GIT_SSH_COMMAND="ssh -i ${keyPath} -o UserKnownHostsFile=${knownHostsPath}" git clone --branch ${customGitBranch} --depth 1 ${customGitUrl} ${gitCopyPath} --progress`;
|
// 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);
|
// const { stdout, stderr } = await execAsync(command);
|
||||||
@@ -56,6 +58,7 @@ export const cloneGitRepository = async (
|
|||||||
customGitBranch,
|
customGitBranch,
|
||||||
"--depth",
|
"--depth",
|
||||||
"1",
|
"1",
|
||||||
|
"--recurse-submodules",
|
||||||
customGitUrl,
|
customGitUrl,
|
||||||
outputPath,
|
outputPath,
|
||||||
"--progress",
|
"--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 addHostToKnownHosts = async (repositoryURL: string) => {
|
||||||
const { domain, port } = sanitizeRepoPathSSH(repositoryURL);
|
const { domain, port } = sanitizeRepoPathSSH(repositoryURL);
|
||||||
const knownHostsPath = path.join(SSH_PATH, "known_hosts");
|
const knownHostsPath = path.join(SSH_PATH, "known_hosts");
|
||||||
@@ -121,7 +129,7 @@ const sanitizeRepoPathSSH = (input: string) => {
|
|||||||
return {
|
return {
|
||||||
user: found.groups?.user ?? "git",
|
user: found.groups?.user ?? "git",
|
||||||
domain: found.groups?.domain,
|
domain: found.groups?.domain,
|
||||||
port: 22,
|
port: Number(found.groups?.port ?? 22),
|
||||||
owner: found.groups?.owner ?? "",
|
owner: found.groups?.owner ?? "",
|
||||||
repo: found.groups?.repo,
|
repo: found.groups?.repo,
|
||||||
get repoPath() {
|
get repoPath() {
|
||||||
|
|||||||
Reference in New Issue
Block a user