Skip to content

Commit

Permalink
Updated CloakJS version
Browse files Browse the repository at this point in the history
  • Loading branch information
Thedogecraft committed Oct 26, 2024
1 parent a068ea0 commit 180688b
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 95 deletions.
16 changes: 8 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import express from "express";
import { createServer } from "node:http";
import chalk from "chalk";
import httpProxy from 'http-proxy';
import proxy from "express-http-proxy";
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
import { epoxyPath } from "@mercuryworkshop/epoxy-transport";
import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
Expand All @@ -11,7 +11,7 @@ import expressLayouts from "express-ejs-layouts";
import { fileURLToPath } from "url";
import packageJson from "./package.json" with { type: "json" };
import compression from "compression";
const cdnProxy = httpProxy.createProxyServer();

const app = express();
const __dirname = dirname(fileURLToPath(import.meta.url));
const publicPath = join(__dirname, "public");
Expand All @@ -32,12 +32,12 @@ app.disable('x-powered-by');
app.get("/", (req, res) => {
res.render("index");
});
app.use('/cdn', (req, res) => {
cdnProxy.web(req, res, {
target: 'https://glcdn.githack.com/Thedogecraft/assets/-/raw/main/public/',
changeOrigin: true
});
});
app.use(
'/cdn',
proxy(`https://glcdn.githack.com`, {
proxyReqPathResolver: (req) => `/Thedogecraft/assets/-/raw/main/public/${req.url}`,
})
);
app.get("/science", (req, res) => {
res.render("games");
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"ejs": "^3.1.10",
"express": "^4.18.2",
"express-ejs-layouts": "^2.5.1",
"express-http-proxy": "^2.1.1",
"http-proxy": "^1.18.1",
"wisp-server-node": "^1.1.0",
"ws": "^8.17.1"
Expand Down
20 changes: 20 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 0 additions & 78 deletions public/js/cloak.js

This file was deleted.

5 changes: 2 additions & 3 deletions public/uv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ const errorCode = document.getElementById("uv-error-code");
"://" +
location.host +
"/wisp/";
if ((await connection.getTransport()) !== "/epoxy/index.mjs") {
await connection.setTransport("/epoxy/index.mjs", [{ wisp: wispUrl }]);
}

await connection.setTransport("/epoxy/index.mjs", [{ wisp: wispUrl }]);
})();

try {
Expand Down
1 change: 1 addition & 0 deletions public/views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@
$("#version").text(`v${data.version}`);
});
</script>
<script></script>
2 changes: 1 addition & 1 deletion public/views/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<script src="/./uv/register-sw.js" defer></script>
<script src="/./uv/search.js" defer></script>
<script src="/./uv/index.js" defer></script>
<script src="https://cdn.jsdelivr.net/gh/Parcoil/cloak@main/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/Parcoil/cloak@main/src/index.min.js"></script>
<script src="/./js/preload.js" defer></script>
<script src="/./js/main.js" defer></script>
<script
Expand Down
10 changes: 5 additions & 5 deletions public/views/settings.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<select id="theme-select">
<option value="default">Default</option>
<option value="grey">Cool Grey</option>
<option value="new">Cool Purple</option>
<option value="new">Cool Purple</option>
<option value="light">Light</option>
<option value="mocha">Mocha</option>
<option value="orange">Orange</option>
Expand Down Expand Up @@ -74,7 +74,7 @@
<div class="card">
<h1>Tab Cloak</h1>
<p>Changes the icon and title of Lunaar.</p>
<select id="cloakSelect">
<select data-cloak-select>
<option value="default">Default Cloak</option>
<option value="canvas">Canvas</option>
<option value="wikipedia">Wikipedia</option>
Expand All @@ -84,9 +84,9 @@
<option value="zoom">Zoom</option>
</select>
<button onclick="resetCloak()">Reset</button>
<p class="small">
Made with <a href="https://github.com/Parcoil/cloak">CloakJS</a>
</p>
<a href="https://github.com/Parcoil/cloak" class="small">
Made with CloakJS
</a>
</div>

<div class="card">
Expand Down

0 comments on commit 180688b

Please sign in to comment.