From c3ffbc00afeb302f93113341b6235379b1388318 Mon Sep 17 00:00:00 2001
From: Leo <95978312+yaefdb@users.noreply.github.com>
Date: Sat, 27 Jan 2024 16:59:14 +0800
Subject: [PATCH] f
---
consumerWebsite/database/mySQL.js | 6 +-
consumerWebsite/public/js/apikey.js | 98 -----------------------------
2 files changed, 3 insertions(+), 101 deletions(-)
delete mode 100644 consumerWebsite/public/js/apikey.js
diff --git a/consumerWebsite/database/mySQL.js b/consumerWebsite/database/mySQL.js
index cb3d6fc..275674f 100644
--- a/consumerWebsite/database/mySQL.js
+++ b/consumerWebsite/database/mySQL.js
@@ -6,8 +6,8 @@ const fs = require('fs');
const sequelize = new Sequelize(
"eco_saver",
- "DB_USER='mpuser",
- "DB_PASS='majorprojectpassword1234!",
+ process.env.DB_USER,
+ process.env.DB_PASS,
{
host: "mpsqldatabasean.mysql.database.azure.com",
dialect: 'mysql',
@@ -15,7 +15,7 @@ const sequelize = new Sequelize(
attributeBehavior: 'escape',
dialectOptions: {
ssl: {
- ca: fs.readFileSync(path.resolve(__dirname, '../cert/DigiCertGlobalRootCA.crt_3.pem')),
+ ca: fs.readFileSync(path.resolve(__dirname, '../cert/DigiCertGlobalRootCA.crt.pem')),
},
},
diff --git a/consumerWebsite/public/js/apikey.js b/consumerWebsite/public/js/apikey.js
deleted file mode 100644
index fe1d021..0000000
--- a/consumerWebsite/public/js/apikey.js
+++ /dev/null
@@ -1,98 +0,0 @@
-function generateKey() {
- // Create the overlay dynamically
- var overlay = document.createElement('div');
- overlay.className = 'overlay';
-
- // Create the small screen dynamically
- var generateKeyScreen = document.createElement('div');
- generateKeyScreen.className = 'generate-key-screen';
-
- // Generate random public and private keys
- var publicKey = generateRandomKey();
- var privateKey = generateRandomKey();
-
- // Add input fields for Name, Public Key, Private Key, Key Type, and Created
- generateKeyScreen.innerHTML = `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- `;
-
- // Append the overlay and small screen to the body
- document.body.appendChild(overlay);
- document.body.appendChild(generateKeyScreen);
-
- // Display the overlay and small screen
- overlay.style.display = 'block';
- generateKeyScreen.style.display = 'block';
-}
-
-function generateRandomKey() {
- // Generate a random string as a key (you might want to use a more robust key generation method)
- return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
-}
-
-function getCurrentDate() {
- // Get the current date and format it as 'YYYY-MM-DD'
- return new Date().toISOString().split('T')[0];
-}
-
-function copyToClipboard(elementId) {
- // Copy the text from the specified input field to the clipboard
- var element = document.getElementById(elementId);
- element.select();
- document.execCommand('copy');
-
- // Optionally, you can provide feedback to the user (e.g., display a tooltip)
- alert('Copied to clipboard: ' + element.value);
-}
-
-
-function saveKey() {
- // Retrieve values from input fields
- var name = document.getElementById('name').value;
- var publicKey = document.getElementById('publicKey').value;
- var privateKey = document.getElementById('privateKey').value;
- var created = document.getElementById('created').value;
-
- // Create a new table row with the key information
- var newRow = document.createElement('tr');
- newRow.innerHTML = `
-