From 15c4bfa8519dc1908d7949283623cc921ee2a66f Mon Sep 17 00:00:00 2001 From: tildeman Date: Thu, 27 May 2021 11:40:28 +0700 Subject: [PATCH 1/2] password instead of gjp + css fix --- html/leaderboard.html | 4 ++-- index.js | 9 +++++---- misc/secretStuff.json | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/html/leaderboard.html b/html/leaderboard.html index 3153cd3..09a008c 100644 --- a/html/leaderboard.html +++ b/html/leaderboard.html @@ -173,8 +173,8 @@ function leaderboard(val) {
${x.icon.icon == -1 && type == "accurate" ? `` : - ``} -

${y+1}

+ ``} +

${y+1}

`) }) diff --git a/index.js b/index.js index 63f9cac..60611c6 100644 --- a/index.js +++ b/index.js @@ -134,12 +134,15 @@ directories.forEach(d => { fs.readdirSync('./api/' + d).forEach(x => {if (x.includes('.')) app.run[x.split('.')[0]] = require('./api/' + d + "/" + x) }) }) +app.xor = new XOR() //why complicated gjp stuff just xor it + try { const secrets = require("./misc/secretStuff.json") app.id = secrets.id - app.gjp = secrets.gjp + app.password = secrets.password + app.gjp = app.xor.encrypt(app.password) app.sheetsKey = secrets.sheetsKey - if (app.id == "account id goes here" || app.gjp == "account gjp goes here") console.warn("Warning: No account ID and/or GJP has been provided in secretStuff.json! These are required for level leaderboards to work.") + if (app.id == "account id goes here" || app.password == "account password goes here") console.warn("Warning: No account ID and/or GJP has been provided in secretStuff.json! These are required for level leaderboards to work.") if (app.sheetsKey.startsWith("google sheets api key")) app.sheetsKey = undefined } @@ -160,8 +163,6 @@ app.parseResponse = function (responseBody, splitter) { return res } -app.xor = new XOR() - //xss bad app.clean = function(text) {if (!text || typeof text != "string") return text; else return text.replace(/&/g, "&").replace(//g, ">").replace(/=/g, "=").replace(/"/g, """).replace(/'/g, "'")} diff --git a/misc/secretStuff.json b/misc/secretStuff.json index 687928a..4dcbda6 100644 --- a/misc/secretStuff.json +++ b/misc/secretStuff.json @@ -1,5 +1,5 @@ { "id": "account id goes here", - "gjp": "account gjp goes here", + "password": "account password goes here", "sheetsKey": "google sheets api key (for accurate leaderboard - delete this line if you don't need it)" } \ No newline at end of file -- 2.48.1 From f9b454f9f8afa9ea342865da0f1a3bd22d9435d7 Mon Sep 17 00:00:00 2001 From: tildeman Date: Thu, 27 May 2021 11:52:34 +0700 Subject: [PATCH 2/2] Modified account warning --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 60611c6..c1de239 100644 --- a/index.js +++ b/index.js @@ -142,14 +142,14 @@ try { app.password = secrets.password app.gjp = app.xor.encrypt(app.password) app.sheetsKey = secrets.sheetsKey - if (app.id == "account id goes here" || app.password == "account password goes here") console.warn("Warning: No account ID and/or GJP has been provided in secretStuff.json! These are required for level leaderboards to work.") + if (app.id == "account id goes here" || app.password == "account password goes here") console.warn("Warning: No account ID and/or password has been provided in secretStuff.json! These are required for level leaderboards to work.") if (app.sheetsKey.startsWith("google sheets api key")) app.sheetsKey = undefined } catch(e) { app.id = 0 app.gjp = 0 - console.warn("Warning: secretStuff.json has not been created! These are required for level leaderboards to work.") + console.warn("Warning: secretStuff.json has not been created! This file is required for level leaderboards to work.") } app.parseResponse = function (responseBody, splitter) { -- 2.48.1