Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Configuration and Setup Enhancements #42

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MYSQL_USER=dvna
MYSQL_DATABASE=dvna
MYSQL_PASSWORD=passw0rd
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion config/db.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
require('dotenv').config(); // Load environment variables from .env file

module.exports = {
username: process.env.MYSQL_USER,
password: process.env.MYSQL_PASSWORD,
database: process.env.MYSQL_DATABASE,
host: process.env.MYSQL_HOST || 'mysql-db',
port: process.env.MYSQL_PORT || 3306,
dialect: 'mysql'
}
};
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {}
}