From 0f6896bb9905bf64eea303f74603da0afc587939 Mon Sep 17 00:00:00 2001 From: Russell2259 <84256826+Russell2259@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:29:37 -0700 Subject: [PATCH] sync --- config.js | 2 +- pages/404.html | 15 +++++++---- server/utils/rewriter.js | 12 +++++---- static/apps.html | 4 +++ static/assets/css/main.css | 48 +---------------------------------- static/assets/css/nav.css | 1 + static/assets/css/view.css | 29 +++++++++++++++++++++ static/cheats.html | 4 +++ static/games.html | 4 +++ static/index.html | 2 ++ static/privacy.html | 4 ++- static/search.html | 4 +++ static/tos.html | 38 +++++++++++++++------------- static/view.html | 28 ++++++++------------ templates/development.html | 4 +-- templates/navbar.html | 52 +------------------------------------- templates/sidebar.html | 49 +++++++++++++++++++++++++++++++++++ 17 files changed, 153 insertions(+), 147 deletions(-) create mode 100644 static/assets/css/view.css create mode 100644 templates/sidebar.html diff --git a/config.js b/config.js index bcd0056..57c1a30 100644 --- a/config.js +++ b/config.js @@ -3,5 +3,5 @@ export default { mode: 'dev', minify: true, assetScrambling: true, - allowDangerousTemplateInsert: false + allowDangerousTemplateInsert: true }; \ No newline at end of file diff --git a/pages/404.html b/pages/404.html index f868356..3024870 100644 --- a/pages/404.html +++ b/pages/404.html @@ -2,16 +2,19 @@ - - - - + + + + 404 Error | Polaris + + +

404

@@ -19,11 +22,13 @@ Looks you found a page that does not exist! Try checking your url for spelling mistakes.

- Or, you can report it in our discord server. + Or, you can report it in our discord server.

+ + \ No newline at end of file diff --git a/server/utils/rewriter.js b/server/utils/rewriter.js index 24acf77..45dc292 100644 --- a/server/utils/rewriter.js +++ b/server/utils/rewriter.js @@ -50,7 +50,7 @@ const html = (data) => { for (let i = 0; i < dom.window.document.documentElement.querySelectorAll('script').length; i++) { const script = dom.window.document.documentElement.querySelectorAll('script')[i]; - if (script.src.startsWith('/') && !script.src.startsWith('//')) script.setAttribute('src', `/asset/${TokenManager.generate('asset', 20000, { + if (script.src.startsWith('/') && !script.src.startsWith('//') && fs.existsSync(path.join(__dirname, '../static', script.src))) script.setAttribute('src', `/asset/${TokenManager.generate('asset', 20000, { asset: path.join(__dirname, '../static', script.src), type: 'application/javascript' }).token}`); @@ -59,7 +59,7 @@ const html = (data) => { for (let i = 0; i < dom.window.document.documentElement.querySelectorAll('link[rel="stylesheet"]').length; i++) { const css = dom.window.document.documentElement.querySelectorAll('link[rel="stylesheet"]')[i]; - if (css.href.startsWith('/') && !css.href.startsWith('//')) css.setAttribute('href', `/asset/${TokenManager.generate('asset', 20000, { + if (css.href.startsWith('/') && !css.href.startsWith('//') && fs.existsSync(path.join(__dirname, '../static', css.href))) css.setAttribute('href', `/asset/${TokenManager.generate('asset', 20000, { asset: path.join(__dirname, '../static', css.href), type: 'text/css' }).token}`); @@ -68,7 +68,7 @@ const html = (data) => { for (let i = 0; i < dom.window.document.documentElement.querySelectorAll('img').length; i++) { const img = dom.window.document.documentElement.querySelectorAll('img')[i]; - if (img.src.startsWith('/') && !img.src.startsWith('//')) img.setAttribute('src', `/asset/${TokenManager.generate('asset', 20000, { + if (img.src.startsWith('/') && !img.src.startsWith('//') && fs.existsSync(path.join(__dirname, '../static', img.src))) img.setAttribute('src', `/asset/${TokenManager.generate('asset', 20000, { asset: path.join(__dirname, '../static', img.src), type: mime.getType(path.join(__dirname, '../static', img.src)) }).token}`); @@ -96,7 +96,8 @@ const javascript = (data) => { .map(data => data.split(';')[0] .replaceAll('\'', '') .replaceAll('`', '') - .replaceAll('"', '')); + .replaceAll('"', '')) + .filter(data => fs.existsSync(path.join(__dirname, '../templates', data + '.javascript'))); let javascript = String(data); @@ -150,7 +151,8 @@ const css = (data) => { else return false; } } else return false; - }); + }) + .filter(data => fs.existsSync(path.join(__dirname, '../templates', data + mime.getExtension(data)))); let css = String(data); diff --git a/static/apps.html b/static/apps.html index 3dd1d7b..963ca2d 100644 --- a/static/apps.html +++ b/static/apps.html @@ -13,6 +13,7 @@ +

Apps

@@ -21,6 +22,9 @@
+ + + + + + + + + + diff --git a/static/privacy.html b/static/privacy.html index 6382ea6..c7915c5 100644 --- a/static/privacy.html +++ b/static/privacy.html @@ -12,4 +12,6 @@ We do not store your personal information outside of advertising services and ou Our sites code is open source and is hosted on github, it can be found here: https://github.com/Skoolgq -If you have any questions please contact us at skoolwrld@gmail.com \ No newline at end of file +If you have any questions please contact us at skoolwrld@gmail.com + + \ No newline at end of file diff --git a/static/search.html b/static/search.html index 48c2880..b8a16a1 100644 --- a/static/search.html +++ b/static/search.html @@ -13,6 +13,7 @@ +
@@ -27,6 +28,9 @@
+ + + + + \ No newline at end of file diff --git a/templates/development.html b/templates/development.html index f4e7345..2c73580 100644 --- a/templates/development.html +++ b/templates/development.html @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/templates/navbar.html b/templates/navbar.html index 17dd9ff..2ae8ee6 100644 --- a/templates/navbar.html +++ b/templates/navbar.html @@ -1,7 +1,7 @@ -
- - \ No newline at end of file diff --git a/templates/sidebar.html b/templates/sidebar.html new file mode 100644 index 0000000..d652412 --- /dev/null +++ b/templates/sidebar.html @@ -0,0 +1,49 @@ + \ No newline at end of file