Files
dokploy/packages/server/src/setup/config-paths.ts
Mauricio Siu f2bb01c800 Add schedule logs feature and enhance schedule management
- Introduced a new component `ShowSchedulesLogs` to display logs for each schedule, allowing users to view deployment logs associated with their schedules.
- Updated the `ShowSchedules` component to integrate the new logs feature, providing a button to access logs for each schedule.
- Enhanced the `schedule` schema by adding an `appName` column to better identify applications associated with schedules.
- Updated the API to support fetching deployments with their associated schedules, improving data retrieval for the frontend.
- Implemented utility functions for managing schedule-related operations, including creating and removing deployments linked to schedules.
2025-05-02 04:29:32 -06:00

46 lines
911 B
TypeScript

import { chmodSync, existsSync, mkdirSync } from "node:fs";
import { paths } from "../constants";
const createDirectoryIfNotExist = (dirPath: string) => {
if (!existsSync(dirPath)) {
mkdirSync(dirPath, { recursive: true });
console.log(`Directory created: ${dirPath}`);
}
};
export const setupDirectories = () => {
const {
APPLICATIONS_PATH,
BASE_PATH,
CERTIFICATES_PATH,
DYNAMIC_TRAEFIK_PATH,
LOGS_PATH,
MAIN_TRAEFIK_PATH,
MONITORING_PATH,
SSH_PATH,
SCHEDULES_PATH,
} = paths();
const directories = [
BASE_PATH,
MAIN_TRAEFIK_PATH,
DYNAMIC_TRAEFIK_PATH,
LOGS_PATH,
APPLICATIONS_PATH,
SSH_PATH,
CERTIFICATES_PATH,
MONITORING_PATH,
SCHEDULES_PATH,
];
for (const dir of directories) {
try {
createDirectoryIfNotExist(dir);
if (dir === SSH_PATH) {
chmodSync(SSH_PATH, "700");
}
} catch (error) {
console.log(error, " On path: ", dir);
}
}
};