diff --git a/.env b/.env new file mode 100644 index 00000000..d0330008 --- /dev/null +++ b/.env @@ -0,0 +1,5 @@ +MYSQL_USER=dvna +MYSQL_DATABASE=dvna +MYSQL_PASSWORD=passw0rd +MYSQL_HOST=127.0.0.1 +MYSQL_PORT=3306 diff --git a/README.md b/README.md index 4f04de66..9b6facbc 100644 --- a/README.md +++ b/README.md @@ -107,15 +107,10 @@ Clone the repository git clone https://github.com/appsecco/dvna; cd dvna ``` -Configure the environment variables with your database information +Configure the environment variables with your database information and node version -```bash -export MYSQL_USER=dvna -export MYSQL_DATABASE=dvna -export MYSQL_PASSWORD=passw0rd -export MYSQL_HOST=127.0.0.1 -export MYSQL_PORT=3306 -``` +1. Required Node Version v18.20.5 +2. Configure your .env variables Install Dependencies diff --git a/config/db.js b/config/db.js index ed3ea58b..51730e0d 100644 --- a/config/db.js +++ b/config/db.js @@ -1,3 +1,5 @@ +require('dotenv').config(); // Load environment variables from .env file + module.exports = { username: process.env.MYSQL_USER, password: process.env.MYSQL_PASSWORD, @@ -5,4 +7,4 @@ module.exports = { host: process.env.MYSQL_HOST || 'mysql-db', port: process.env.MYSQL_PORT || 3306, dialect: 'mysql' -} \ No newline at end of file +}; diff --git a/package.json b/package.json index 7841e55c..782e66ed 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,9 @@ "author": "sns", "license": "MIT", "dependencies": { - "bcrypt": "^1.0.3", + "bcrypt": "latest", "csurf": "^1.9.0", + "dotenv": "^16.4.5", "ejs": "^2.5.7", "express": "^4.16.2", "express-fileupload": "^0.4.0", @@ -25,12 +26,13 @@ "mathjs": "3.10.1", "md5": "^2.2.1", "morgan": "^1.9.0", - "mysql2": "^1.4.2", + "mysql2": "^3.11.3", "node-serialize": "0.0.4", "passport": "^0.4.0", "passport-local": "^1.0.0", "sequelize": "^4.13.10", "winston": "^3.0.0", "x-xss-protection": "^1.1.0" - } + }, + "devDependencies": {} }