2022-08-30 19:17:31 +02:00
|
|
|
const fs = require('fs');
|
|
|
|
|
const os = require('os');
|
2022-03-24 23:08:59 +01:00
|
|
|
|
2025-10-12 03:48:21 +03:00
|
|
|
// Configure SyncedCron to suppress console logging
|
|
|
|
|
// This must be done before any SyncedCron operations
|
|
|
|
|
if (Meteor.isServer) {
|
|
|
|
|
const { SyncedCron } = require('meteor/percolate:synced-cron');
|
|
|
|
|
SyncedCron.config({
|
|
|
|
|
log: false, // Disable console logging
|
|
|
|
|
collectionName: 'cronJobs', // Use custom collection name
|
|
|
|
|
utc: false, // Use local time
|
|
|
|
|
collectionTTL: 172800 // 2 days TTL
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-02 11:48:14 +02:00
|
|
|
let errors = [];
|
2022-03-24 23:08:59 +01:00
|
|
|
if (!process.env.WRITABLE_PATH) {
|
2022-04-02 11:48:14 +02:00
|
|
|
errors.push("WRITABLE_PATH environment variable missing and/or unset, please configure !");
|
2022-03-24 23:08:59 +01:00
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
fs.accessSync(process.env.WRITABLE_PATH, fs.constants.W_OK);
|
|
|
|
|
} catch (err) {
|
2022-08-30 19:17:31 +02:00
|
|
|
const userInfo = os.userInfo();
|
2022-04-02 11:48:14 +02:00
|
|
|
errors.push("can't write to " + process.env.WRITABLE_PATH, err);
|
|
|
|
|
errors.push("the path of WRITABLE_PATH (" + process.env.WRITABLE_PATH + ") must be writable !!!");
|
2022-04-25 15:54:25 +02:00
|
|
|
errors.push("username: " + userInfo["username"] + " - uid: " + userInfo["uid"] + " - gid: " + userInfo["gid"]);
|
2022-03-24 23:08:59 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-02 11:48:14 +02:00
|
|
|
if (errors.length > 0) {
|
|
|
|
|
console.error("\n\n");
|
|
|
|
|
console.error(errors.join("\n"));
|
|
|
|
|
console.error("\n");
|
2022-03-24 23:08:59 +01:00
|
|
|
console.error("Stopping Wekan");
|
2022-04-02 11:48:14 +02:00
|
|
|
console.error("Wekan isn't runnable. Please resolve the error's above and restart Wekan !");
|
|
|
|
|
console.error("\n\n");
|
2022-03-24 23:08:59 +01:00
|
|
|
process.exit(1);
|
|
|
|
|
}
|
2025-10-11 19:23:47 +03:00
|
|
|
|
2025-10-11 20:33:31 +03:00
|
|
|
// Import cron job storage for persistent job tracking
|
|
|
|
|
import './cronJobStorage';
|
|
|
|
|
|
2025-10-20 00:22:26 +03:00
|
|
|
// Note: Automatic migrations are disabled - migrations only run when opening boards
|
|
|
|
|
// import './boardMigrationDetector';
|
|
|
|
|
// import './cronMigrationManager';
|