00checkStartup.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. const fs = require('fs');
  2. const os = require('os');
  3. let errors = [];
  4. if (!process.env.WRITABLE_PATH) {
  5. errors.push("WRITABLE_PATH environment variable missing and/or unset, please configure !");
  6. } else {
  7. try {
  8. fs.accessSync(process.env.WRITABLE_PATH, fs.constants.W_OK);
  9. } catch (err) {
  10. const userInfo = os.userInfo();
  11. errors.push("can't write to " + process.env.WRITABLE_PATH, err);
  12. errors.push("the path of WRITABLE_PATH (" + process.env.WRITABLE_PATH + ") must be writable !!!");
  13. errors.push("username: " + userInfo["username"] + " - uid: " + userInfo["uid"] + " - gid: " + userInfo["gid"]);
  14. }
  15. }
  16. if (errors.length > 0) {
  17. console.error("\n\n");
  18. console.error(errors.join("\n"));
  19. console.error("\n");
  20. console.error("Stopping Wekan");
  21. console.error("Wekan isn't runnable. Please resolve the error's above and restart Wekan !");
  22. console.error("\n\n");
  23. process.exit(1);
  24. }
  25. // Import migration runner for on-demand migrations
  26. import './migrationRunner';
  27. // Import cron job storage for persistent job tracking
  28. import './cronJobStorage';
  29. // Import board migration detector for automatic board migrations
  30. import './boardMigrationDetector';
  31. // Import cron migration manager for cron-based migrations
  32. import './cronMigrationManager';