Commit 6b333943 authored by Dennis Willers's avatar Dennis Willers 🏀

Mask Database Information

parent 01a9fdf5
Pipeline #434 failed with stages
in 27 seconds
DB_HOST=
DB_PORT=
DB_USER=
DB_PASS=
DB_DATABASE=
...@@ -44,3 +44,6 @@ testem.log ...@@ -44,3 +44,6 @@ testem.log
# System Files # System Files
.DS_Store .DS_Store
Thumbs.db Thumbs.db
# Ignore env
.env
...@@ -5,6 +5,10 @@ stages: ...@@ -5,6 +5,10 @@ stages:
- delete - delete
- deploy - deploy
before_script:
- chmod +x ./setup_env.sh
- ./setup_env.sh
docker-build: docker-build:
stage: build stage: build
script: script:
......
require('./socket'); require('./socket');
require('dotenv').config();
const express = require('express'); const express = require('express');
const cors = require('cors'); const cors = require('cors');
const bodyParser = require('body-parser'); const bodyParser = require('body-parser');
...@@ -6,11 +7,11 @@ const mysql = require('mysql'); ...@@ -6,11 +7,11 @@ const mysql = require('mysql');
const events = require('./events'); const events = require('./events');
const connection = mysql.createConnection({ const connection = mysql.createConnection({
host : '192.168.0.50', host : process.env.DB_HOST,
port : '3307', port : process.env.DB_PORT,
user : 'votingApp', user : process.env.DB_USER,
password : 'R0b0TecDev!', password : process.env.DB_PASS,
database : 'Voting', database : process.env.DB_DATABASE,
multipleStatements: true, multipleStatements: true,
}); });
......
This diff is collapsed.
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"cors": "^2.8.5", "cors": "^2.8.5",
"dotenv": "^10.0.0",
"express": "^4.17.1", "express": "^4.17.1",
"mysql": "^2.18.1" "mysql": "^2.18.1"
}, },
......
#!/bin/bash
echo DB_HOST=$DB_HOST >> .env
echo DB_PORT=$DB_PORT >> .env
echo DB_USER=$DB_USER >> .env
echo DB_PASS=$DB_PASS >> .env
echo DB_DATABASE=$DB_DATABASE >> .env
...@@ -254,7 +254,7 @@ client.on('data',function(data){ ...@@ -254,7 +254,7 @@ client.on('data',function(data){
// 87.78.129.86 | localhost // 87.78.129.86 | localhost
/*const testClient = net.connect({host: '87.78.129.86', port: 3201}, () => { const testClient = net.connect({host: 'localhost', port: 3000}, () => {
console.log('connected to server!'); console.log('connected to server!');
//testClient.write('Hello World Client!\r\n'); //testClient.write('Hello World Client!\r\n');
testClient.write(JSON.stringify({"mapId":"7fsfRSUCQ7YwfBEdRk_GivW6qzj","userId":"aKBNg9fbReqLedLiz1KFfA","name":"Summer 2021 - 01"})); testClient.write(JSON.stringify({"mapId":"7fsfRSUCQ7YwfBEdRk_GivW6qzj","userId":"aKBNg9fbReqLedLiz1KFfA","name":"Summer 2021 - 01"}));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment