00checkStartup.js 874 B

12345678910111213141516171819202122232425
  1. var fs = require('fs');
  2. var 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. errors.push("can't write to " + process.env.WRITABLE_PATH, err);
  11. errors.push("the path of WRITABLE_PATH (" + process.env.WRITABLE_PATH + ") must be writable !!!");
  12. errors.push("username: " + userInfo["username"] + " - uid: " + userInfo["uid"] + " - gid: " + userInfo["gid"]);
  13. }
  14. }
  15. if (errors.length > 0) {
  16. console.error("\n\n");
  17. console.error(errors.join("\n"));
  18. console.error("\n");
  19. console.error("Stopping Wekan");
  20. console.error("Wekan isn't runnable. Please resolve the error's above and restart Wekan !");
  21. console.error("\n\n");
  22. process.exit(1);
  23. }