From f6770e2eb8abf2236662a40588e959255d442bd4 Mon Sep 17 00:00:00 2001 From: "HerpieDerpie@example.com" Date: Wed, 10 Jan 2024 12:06:48 +0100 Subject: [PATCH] Initial commit added whole syswtem becuz i forgot to keep up with the github hihi hiha added startServer.sh hihi hiha fixed some packages fixed every bug with the stupid oop Revert "fixed every bug with the stupid oop" This reverts commit d2255863aa44e2504f9f2cec9e1ae5d1094cb9cd. added prevention of breaking the system by manually filling in the project id fixed bug when adding bot made user-id not just count up from 0 fixed the issue where if you load project page it woulnt show the commands until you refresh the page added a config.json functionality added a config.json functionality added a config.json functionality Remove file from tracking hihi haha rebase so hihi --- .gitignore | 2 ++ config.json.example | 8 ++++++++ package-lock.json | 33 ++++++++++++++++++++++++++++++++- package.json | 3 ++- server.js | 9 +++++---- 5 files changed, 49 insertions(+), 6 deletions(-) create mode 100755 config.json.example diff --git a/.gitignore b/.gitignore index c6bba59..03be642 100755 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,5 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* + +config.json \ No newline at end of file diff --git a/config.json.example b/config.json.example new file mode 100755 index 0000000..af5325a --- /dev/null +++ b/config.json.example @@ -0,0 +1,8 @@ +{ + "db": { + "username":"root", + "password": "example_password", + "location": "localhost", + "db_name": "Your database name" + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index bb84775..8aba646 100755 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,8 @@ "fs-extra": "^11.2.0", "mysql": "^2.18.1", "mysql2": "^3.6.5", - "nodemon": "^3.0.1" + "nodemon": "^3.0.1", + "path": "^0.12.7" } }, "node_modules/@mapbox/node-pre-gyp": { @@ -1524,6 +1525,15 @@ "node": ">= 0.8" } }, + "node_modules/path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==", + "dependencies": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1548,6 +1558,14 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -2006,11 +2024,24 @@ "node": ">= 0.8" } }, + "node_modules/util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dependencies": { + "inherits": "2.0.3" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", diff --git a/package.json b/package.json index c47c30a..8f8d101 100755 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "fs-extra": "^11.2.0", "mysql": "^2.18.1", "mysql2": "^3.6.5", - "nodemon": "^3.0.1" + "nodemon": "^3.0.1", + "path": "^0.12.7" } } diff --git a/server.js b/server.js index 0726c7c..be2f256 100755 --- a/server.js +++ b/server.js @@ -10,6 +10,7 @@ const fs = require('fs-extra'); const path = require('path'); const archiver = require('archiver'); +const {db} = require("./config.json") /* Creating some handy constants @@ -25,10 +26,10 @@ const webserverPort = 3000 */ const createConnection = () => { return mysql.createConnection({ - host: "localhost", - user: "dcBB", - password: "DiscordBotBuilder", - database: "PS_DISCORD_BOT_BUILDER", + host: db.location, + user: db.username, + password: db.password, + database: db.db_name, connectTimeout: 20000, }); };