WRITABLE_PATH must be writable, otherwise abort starting Wekan

This commit is contained in:
Martin Filser 2022-03-24 23:08:59 +01:00
parent 5fc5500845
commit 0426e09cd7

22
server/00checkStartup.js Normal file
View file

@ -0,0 +1,22 @@
var fs = require('fs');
let error = false
if (!process.env.WRITABLE_PATH) {
console.error("WRITABLE_PATH environment variable missing and/or unset, please configure !");
error = true;
} else {
try {
fs.accessSync(process.env.WRITABLE_PATH, fs.constants.W_OK);
} catch (err) {
error = true;
console.error("can't write to " + process.env.WRITABLE_PATH, err);
console.error("the path of WRITABLE_PATH (" + process.env.WRITABLE_PATH + ") must be writable !!!");
}
}
if (error) {
console.error("Stopping Wekan");
console.error("Wekan isn't runable. Please resolve the error's above and restart Wekan !");
process.exit(1);
}