Bug Fixes

This commit is contained in:
Benjamin Toby
2024-11-05 15:18:40 +01:00
parent 3cdf78e58d
commit 748ff55092
507 changed files with 3719 additions and 1231 deletions
@@ -59,6 +59,37 @@ module.exports = require("fs");
module.exports = require("path");
/***/ }),
/***/ 5425:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
// @ts-check
const { scryptSync , createDecipheriv } = __webpack_require__(6113);
const { Buffer } = __webpack_require__(4300);
/**
* @param {string} encryptedString
* @returns {string | null}
*/ const decrypt = (encryptedString)=>{
const algorithm = "aes-192-cbc";
const password = process.env.DSQL_ENCRYPTION_PASSWORD || "";
const salt = process.env.DSQL_ENCRYPTION_SALT || "";
let key = scryptSync(password, salt, 24);
let iv = Buffer.alloc(16, 0);
// @ts-ignore
const decipher = createDecipheriv(algorithm, key, iv);
try {
let decrypted = decipher.update(encryptedString, "hex", "utf8");
decrypted += decipher.final("utf8");
return decrypted;
} catch (error) {
return null;
}
};
module.exports = decrypt;
/***/ }),
/***/ 8144:
@@ -244,7 +275,7 @@ __webpack_require__.r(__webpack_exports__);
var __webpack_require__ = require("../../../webpack-api-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [5425,2224,2163,3017,3403,7547,5886,5338,1007,6147,6715,5910], () => (__webpack_exec__(8144)));
var __webpack_exports__ = __webpack_require__.X(0, [2224,2163,3017,3403,7547,5886,5338,1007,6147,6715,5910], () => (__webpack_exec__(8144)));
module.exports = __webpack_exports__;
})();
File diff suppressed because one or more lines are too long
@@ -59,6 +59,37 @@ module.exports = require("fs");
module.exports = require("path");
/***/ }),
/***/ 5425:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
// @ts-check
const { scryptSync , createDecipheriv } = __webpack_require__(6113);
const { Buffer } = __webpack_require__(4300);
/**
* @param {string} encryptedString
* @returns {string | null}
*/ const decrypt = (encryptedString)=>{
const algorithm = "aes-192-cbc";
const password = process.env.DSQL_ENCRYPTION_PASSWORD || "";
const salt = process.env.DSQL_ENCRYPTION_SALT || "";
let key = scryptSync(password, salt, 24);
let iv = Buffer.alloc(16, 0);
// @ts-ignore
const decipher = createDecipheriv(algorithm, key, iv);
try {
let decrypted = decipher.update(encryptedString, "hex", "utf8");
decrypted += decipher.final("utf8");
return decrypted;
} catch (error) {
return null;
}
};
module.exports = decrypt;
/***/ }),
/***/ 2518:
@@ -231,7 +262,7 @@ __webpack_require__.r(__webpack_exports__);
var __webpack_require__ = require("../../../webpack-api-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [5425,2224,2163,3017,3403,7547,5886,5338,1007,6147,6715,5910], () => (__webpack_exec__(2518)));
var __webpack_exports__ = __webpack_require__.X(0, [2224,2163,3017,3403,7547,5886,5338,1007,6147,6715,5910], () => (__webpack_exec__(2518)));
module.exports = __webpack_exports__;
})();
File diff suppressed because one or more lines are too long
@@ -38,6 +38,37 @@ module.exports = require("fs");
module.exports = require("path");
/***/ }),
/***/ 5425:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
// @ts-check
const { scryptSync , createDecipheriv } = __webpack_require__(6113);
const { Buffer } = __webpack_require__(4300);
/**
* @param {string} encryptedString
* @returns {string | null}
*/ const decrypt = (encryptedString)=>{
const algorithm = "aes-192-cbc";
const password = process.env.DSQL_ENCRYPTION_PASSWORD || "";
const salt = process.env.DSQL_ENCRYPTION_SALT || "";
let key = scryptSync(password, salt, 24);
let iv = Buffer.alloc(16, 0);
// @ts-ignore
const decipher = createDecipheriv(algorithm, key, iv);
try {
let decrypted = decipher.update(encryptedString, "hex", "utf8");
decrypted += decipher.final("utf8");
return decrypted;
} catch (error) {
return null;
}
};
module.exports = decrypt;
/***/ }),
/***/ 2201:
@@ -139,7 +170,7 @@ __webpack_require__.r(__webpack_exports__);
if (!path) return "";
if (path?.match(/\.\./)) return "";
if (path?.match(/^\@/)) {
return path.replace(/@\/media\//, `./jsonData/dbSchemas/users/user-${user_id}/media/`);
return path.replace(/@\/media\//, `${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${user_id}/media/`);
}
return path.replace(process.env.DSQL_STATIC_HOST || "", STATIC_ROOT);
};
@@ -208,7 +239,7 @@ __webpack_require__.r(__webpack_exports__);
var __webpack_require__ = require("../../../webpack-api-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [5425,2224,2163,3403,1007,6147], () => (__webpack_exec__(2201)));
var __webpack_exports__ = __webpack_require__.X(0, [2224,2163,3403,1007,6147], () => (__webpack_exec__(2201)));
module.exports = __webpack_exports__;
})();
File diff suppressed because one or more lines are too long
@@ -31,6 +31,37 @@ module.exports = require("fs");
module.exports = require("path");
/***/ }),
/***/ 5425:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
// @ts-check
const { scryptSync , createDecipheriv } = __webpack_require__(6113);
const { Buffer } = __webpack_require__(4300);
/**
* @param {string} encryptedString
* @returns {string | null}
*/ const decrypt = (encryptedString)=>{
const algorithm = "aes-192-cbc";
const password = process.env.DSQL_ENCRYPTION_PASSWORD || "";
const salt = process.env.DSQL_ENCRYPTION_SALT || "";
let key = scryptSync(password, salt, 24);
let iv = Buffer.alloc(16, 0);
// @ts-ignore
const decipher = createDecipheriv(algorithm, key, iv);
try {
let decrypted = decipher.update(encryptedString, "hex", "utf8");
decrypted += decipher.final("utf8");
return decrypted;
} catch (error) {
return null;
}
};
module.exports = decrypt;
/***/ }),
/***/ 2875:
@@ -166,7 +197,7 @@ __webpack_require__.r(__webpack_exports__);
var __webpack_require__ = require("../../../webpack-api-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [5425,2163,1007,6715], () => (__webpack_exec__(2875)));
var __webpack_exports__ = __webpack_require__.X(0, [2163,1007,6715], () => (__webpack_exec__(2875)));
module.exports = __webpack_exports__;
})();
@@ -1 +1 @@
{"version":1,"files":["../../../webpack-api-runtime.js","../../../chunks/5425.js","../../../chunks/2163.js","../../../chunks/1007.js","../../../chunks/6715.js","../../../../package.json","../../../../../package.json"]}
{"version":1,"files":["../../../webpack-api-runtime.js","../../../chunks/2163.js","../../../chunks/1007.js","../../../chunks/6715.js","../../../../package.json","../../../../../package.json"]}
@@ -31,6 +31,37 @@ module.exports = require("fs");
module.exports = require("path");
/***/ }),
/***/ 5425:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
// @ts-check
const { scryptSync , createDecipheriv } = __webpack_require__(6113);
const { Buffer } = __webpack_require__(4300);
/**
* @param {string} encryptedString
* @returns {string | null}
*/ const decrypt = (encryptedString)=>{
const algorithm = "aes-192-cbc";
const password = process.env.DSQL_ENCRYPTION_PASSWORD || "";
const salt = process.env.DSQL_ENCRYPTION_SALT || "";
let key = scryptSync(password, salt, 24);
let iv = Buffer.alloc(16, 0);
// @ts-ignore
const decipher = createDecipheriv(algorithm, key, iv);
try {
let decrypted = decipher.update(encryptedString, "hex", "utf8");
decrypted += decipher.final("utf8");
return decrypted;
} catch (error) {
return null;
}
};
module.exports = decrypt;
/***/ }),
/***/ 1640:
@@ -98,7 +129,7 @@ const path = __webpack_require__(1017);
* @description Create new user folder and file
*/ try {
const dbFullName = database && typeof database == "string" ? `datasquirel_user_${user_id}_${database?.toLowerCase().replace(/[^a-z0-9\_]/g, "")}` : null;
/** @type {string} */ const dbSchemaPath = path.join(process.cwd(), "jsonData/dbSchemas/users", `user-${user_id.toString().replace(/\//g, "")}`, "main.json");
/** @type {string} */ const dbSchemaPath = path.join(String(process.env.DSQL_USER_DB_SCHEMA_PATH), `user-${user_id.toString().replace(/\//g, "")}`, "main.json");
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType[]} */ const dbSchema = JSON.parse(fs.readFileSync(dbSchemaPath, "utf8"));
const targetDbSchema = dbFullName ? dbSchema.find((db)=>db.dbFullName == dbFullName) : null;
if (table && database && targetDbSchema?.tables?.[0]) {
@@ -169,7 +200,7 @@ const path = __webpack_require__(1017);
var __webpack_require__ = require("../../../webpack-api-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [5425,2163,1007], () => (__webpack_exec__(1640)));
var __webpack_exports__ = __webpack_require__.X(0, [2163,1007], () => (__webpack_exec__(1640)));
module.exports = __webpack_exports__;
})();
@@ -1 +1 @@
{"version":1,"files":["../../../webpack-api-runtime.js","../../../chunks/5425.js","../../../chunks/2163.js","../../../chunks/1007.js","../../../../package.json","../../../../../package.json","../../../../../jsonData/dbSchemas/users/user-1/main.json","../../../../../jsonData/dbSchemas/users/user-10/main.json","../../../../../jsonData/dbSchemas/users/user-11/main.json","../../../../../jsonData/dbSchemas/users/user-13/main.json","../../../../../jsonData/dbSchemas/users/user-14/main.json","../../../../../jsonData/dbSchemas/users/user-18/main.json","../../../../../jsonData/dbSchemas/users/user-12/main.json","../../../../../jsonData/dbSchemas/users/user-19/main.json","../../../../../jsonData/dbSchemas/users/user-20/main.json","../../../../../jsonData/dbSchemas/users/user-3/main.json","../../../../../jsonData/dbSchemas/users/user-21/main.json","../../../../../jsonData/dbSchemas/users/user-22/main.json","../../../../../jsonData/dbSchemas/users/user-4/main.json","../../../../../jsonData/dbSchemas/users/user-6/main.json","../../../../../jsonData/dbSchemas/users/user-9/main.json"]}
{"version":1,"files":["../../../webpack-api-runtime.js","../../../chunks/2163.js","../../../chunks/1007.js","../../../../package.json","../../../../../package.json"]}
@@ -140,7 +140,7 @@ __webpack_require__.r(__webpack_exports__);
* @description Create new user folder and file
*/ let results;
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */ let dbSchema;
const targetDbSchemaPath = `./jsonData/dbSchemas/users/user-${user_id.toString().replace(/\//g, "")}/main.json`;
const targetDbSchemaPath = `${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${user_id.toString().replace(/\//g, "")}/main.json`;
if (fs.existsSync(targetDbSchemaPath)) {
try {
dbSchema = JSON.parse(fs.readFileSync(targetDbSchemaPath, "utf8")).filter((/** @type {any} */ db)=>db.dbFullName === dbFullName)[0];
@@ -217,7 +217,7 @@ __webpack_require__.r(__webpack_exports__);
var __webpack_require__ = require("../../../webpack-api-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [5425,2224,2163,3017,3403,7547,5886,5338,8326,1007,6147,8499], () => (__webpack_exec__(7082)));
var __webpack_exports__ = __webpack_require__.X(0, [2224,2163,3017,3403,7547,5886,5338,8326,1007,6147,4733], () => (__webpack_exec__(7082)));
module.exports = __webpack_exports__;
})();
File diff suppressed because one or more lines are too long
@@ -165,7 +165,7 @@ const { execSync } = __webpack_require__(2081);
/**
* Grab db Schema
*/ /** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */ let dbSchema;
const targetDbSchemaPath = `./jsonData/dbSchemas/users/user-${user_id.toString().replace(/\//g, "")}/main.json`;
const targetDbSchemaPath = `${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${user_id.toString().replace(/\//g, "")}/main.json`;
if (fs.existsSync(targetDbSchemaPath)) {
try {
dbSchema = JSON.parse(fs.readFileSync(targetDbSchemaPath, "utf8")).filter((/** @type {any} */ db)=>db.dbFullName === dbFullName)[0];
@@ -244,7 +244,7 @@ const { execSync } = __webpack_require__(2081);
var __webpack_require__ = require("../../../webpack-api-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [5425,2224,2163,3017,3403,7547,5886,5338,8326,1007,6147,8499], () => (__webpack_exec__(5830)));
var __webpack_exports__ = __webpack_require__.X(0, [2224,2163,3017,3403,7547,5886,5338,8326,1007,6147,4733], () => (__webpack_exec__(5830)));
module.exports = __webpack_exports__;
})();
File diff suppressed because one or more lines are too long
@@ -38,6 +38,37 @@ module.exports = require("fs");
module.exports = require("path");
/***/ }),
/***/ 5425:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
// @ts-check
const { scryptSync , createDecipheriv } = __webpack_require__(6113);
const { Buffer } = __webpack_require__(4300);
/**
* @param {string} encryptedString
* @returns {string | null}
*/ const decrypt = (encryptedString)=>{
const algorithm = "aes-192-cbc";
const password = process.env.DSQL_ENCRYPTION_PASSWORD || "";
const salt = process.env.DSQL_ENCRYPTION_SALT || "";
let key = scryptSync(password, salt, 24);
let iv = Buffer.alloc(16, 0);
// @ts-ignore
const decipher = createDecipheriv(algorithm, key, iv);
try {
let decrypted = decipher.update(encryptedString, "hex", "utf8");
decrypted += decipher.final("utf8");
return decrypted;
} catch (error) {
return null;
}
};
module.exports = decrypt;
/***/ }),
/***/ 4260:
@@ -110,7 +141,7 @@ const path = __webpack_require__(1017);
* @type {import("@/package-shared/types").DSQL_DatabaseSchemaType}
*/ //@ts-ignore
const schema = req.query.schema;
/** @type {string} */ const dbSchemaPath = `./jsonData/dbSchemas/users/user-${user_id.toString().replace(/\//g, "")}/main.json`;
/** @type {string} */ const dbSchemaPath = `${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${user_id.toString().replace(/\//g, "")}/main.json`;
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType[]} */ const dbSchema = JSON.parse(fs.readFileSync(dbSchemaPath, "utf8"));
const targetDbSchemaIndex = dbSchema.findIndex((db)=>db.dbFullName == schema?.dbFullName);
const targetDbSchema = schema?.dbFullName ? dbSchema.find((db)=>db.dbFullName == schema.dbFullName) : null;
@@ -156,7 +187,7 @@ const path = __webpack_require__(1017);
var __webpack_require__ = require("../../../webpack-api-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [5425,2163,1007], () => (__webpack_exec__(4260)));
var __webpack_exports__ = __webpack_require__.X(0, [2163,1007], () => (__webpack_exec__(4260)));
module.exports = __webpack_exports__;
})();
@@ -1 +1 @@
{"version":1,"files":["../../../webpack-api-runtime.js","../../../chunks/5425.js","../../../chunks/2163.js","../../../chunks/1007.js","../../../../package.json","../../../../../package.json","../../../../../shell/checkDb.js","../../../../../shell/createDbFromSchema.js","../../../../../shell/encodingUpdate.js","../../../../../shell/deploy.js","../../../../../shell/grantFullPriviledges.js","../../../../../shell/lessWatch.js","../../../../../shell/readImage.js","../../../../../shell/recoverMainJsonFromDb.js","../../../../../shell/resetSQLCredentials.js","../../../../../shell/resetSQLCredentialsPasswords.js","../../../../../shell/setSQLCredentials.js","../../../../../shell/tailwindWatch.js","../../../../../shell/test-external-server.js","../../../../../shell/test.js","../../../../../shell/testSQLEscape.js","../../../../../shell/updateChildrenTablesOnDb.js","../../../../../shell/updateDateTimestamps.js","../../../../../shell/updateDbSlugsForTableRecords.js","../../../../../shell/updateSSLUsers.js","../../../../../shell/utils/createTable.js","../../../../../shell/utils/dbHandler.js","../../../../../shell/utils/generateColumnDescription.js","../../../../../shell/utils/noDatabaseDbHandler.js","../../../../../shell/utils/supplementTable.js","../../../../../shell/utils/updateTable.js","../../../../../shell/utils/varDatabaseDbHandler.js","../../../../../shell/functions/jsonToBase64.js","../../../../../shell/mariadb-users/handleGrants.js","../../../../../shell/mariadb-users/refreshUsersAndGrants.js","../../../../../shell/mariadb-users/resetSQLPasswords.js","../../../../../shell/mariadb-users/users/create-user.js","../../../../../shell/mariadb-users/users/new-user.json","../../../../../shell/mariadb-users/users/update-user.json","../../../../../shell/mariadb-users/users/update-user.js"]}
{"version":1,"files":["../../../webpack-api-runtime.js","../../../chunks/2163.js","../../../chunks/1007.js","../../../../package.json","../../../../../package.json","../../../../../shell/createDbFromSchema.js","../../../../../shell/deploy.js","../../../../../shell/checkDb.js","../../../../../shell/grantFullPriviledges.js","../../../../../shell/lessWatch.js","../../../../../shell/encodingUpdate.js","../../../../../shell/readImage.js","../../../../../shell/recoverMainJsonFromDb.js","../../../../../shell/resetSQLCredentials.js","../../../../../shell/setSQLCredentials.js","../../../../../shell/resetSQLCredentialsPasswords.js","../../../../../shell/tailwindWatch.js","../../../../../shell/test-external-server.js","../../../../../shell/test.js","../../../../../shell/testSQLEscape.js","../../../../../shell/updateChildrenTablesOnDb.js","../../../../../shell/updateDateTimestamps.js","../../../../../shell/updateDbSlugsForTableRecords.js","../../../../../shell/updateSSLUsers.js","../../../../../shell/utils/createTable.js","../../../../../shell/utils/dbHandler.js","../../../../../shell/utils/generateColumnDescription.js","../../../../../shell/utils/noDatabaseDbHandler.js","../../../../../shell/utils/supplementTable.js","../../../../../shell/utils/updateTable.js","../../../../../shell/utils/varDatabaseDbHandler.js","../../../../../shell/functions/jsonToBase64.js","../../../../../shell/mariadb-users/refreshUsersAndGrants.js","../../../../../shell/mariadb-users/handleGrants.js","../../../../../shell/mariadb-users/resetSQLPasswords.js","../../../../../shell/mariadb-users/users/create-user.js","../../../../../shell/mariadb-users/users/update-user.js","../../../../../shell/mariadb-users/users/new-user.json","../../../../../shell/mariadb-users/users/update-user.json"]}