mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor(multi-server): improve alerts and add instructions to ssh keys
This commit is contained in:
@@ -276,16 +276,20 @@ export const settingsRouter = createTRPCRouter({
|
||||
readDirectories: protectedProcedure
|
||||
.input(apiServerSchema)
|
||||
.query(async ({ ctx, input }) => {
|
||||
if (ctx.user.rol === "user") {
|
||||
const canAccess = await canAccessToTraefikFiles(ctx.user.authId);
|
||||
try {
|
||||
if (ctx.user.rol === "user") {
|
||||
const canAccess = await canAccessToTraefikFiles(ctx.user.authId);
|
||||
|
||||
if (!canAccess) {
|
||||
throw new TRPCError({ code: "UNAUTHORIZED" });
|
||||
if (!canAccess) {
|
||||
throw new TRPCError({ code: "UNAUTHORIZED" });
|
||||
}
|
||||
}
|
||||
const { MAIN_TRAEFIK_PATH } = paths(!!input?.serverId);
|
||||
const result = await readDirectory(MAIN_TRAEFIK_PATH, input?.serverId);
|
||||
return result || [];
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
const { MAIN_TRAEFIK_PATH } = paths(!!input?.serverId);
|
||||
const result = await readDirectory(MAIN_TRAEFIK_PATH, input?.serverId);
|
||||
return result || [];
|
||||
}),
|
||||
|
||||
updateTraefikFile: protectedProcedure
|
||||
|
||||
@@ -337,8 +337,6 @@ export const deployRemoteCompose = async ({
|
||||
|
||||
await execAsyncRemote(compose.serverId, command);
|
||||
await getBuildComposeCommand(compose, deployment.logPath);
|
||||
|
||||
console.log(" ---- done ----");
|
||||
}
|
||||
|
||||
await updateDeploymentStatus(deployment.deploymentId, "done");
|
||||
@@ -443,9 +441,6 @@ export const stopCompose = async (composeId: string) => {
|
||||
try {
|
||||
const { COMPOSE_PATH } = paths(!!compose.serverId);
|
||||
if (compose.composeType === "docker-compose") {
|
||||
console.log(
|
||||
`cd ${join(COMPOSE_PATH, compose.appName)} && docker compose -p ${compose.appName} stop`,
|
||||
);
|
||||
if (compose.serverId) {
|
||||
await execAsyncRemote(
|
||||
compose.serverId,
|
||||
|
||||
@@ -58,7 +58,11 @@ export const getContainers = async (serverId?: string | null) => {
|
||||
.filter((container) => !container.name.includes("dokploy"));
|
||||
|
||||
return containers;
|
||||
} catch (error) {}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
export const getConfig = async (
|
||||
|
||||
@@ -72,11 +72,9 @@ export const setupDockerContainerLogsWebSocketServer = (
|
||||
})
|
||||
.on("data", (data: string) => {
|
||||
ws.send(data.toString());
|
||||
// console.log(`OUTPUT: ${data.toString()}`);
|
||||
})
|
||||
.stderr.on("data", (data) => {
|
||||
ws.send(data.toString());
|
||||
// console.error(`STDERR: ${data.toString()}`);
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
@@ -71,11 +71,9 @@ export const setupDeploymentLogsWebSocketServer = (
|
||||
})
|
||||
.on("data", (data: string) => {
|
||||
ws.send(data.toString());
|
||||
// console.log(`OUTPUT: ${data.toString()}`);
|
||||
})
|
||||
.stderr.on("data", (data) => {
|
||||
ws.send(data.toString());
|
||||
// console.error(`STDERR: ${data.toString()}`);
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user