diff --git a/index.js b/index.js index 5988670..60a0d0d 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,6 @@ import { build } from "astro"; import chalk from "chalk"; import { existsSync } from "fs"; import dotenv from "dotenv"; -import helmet from "helmet"; dotenv.config(); if (!existsSync("./dist")) build(); diff --git a/package-lock.json b/package-lock.json index de05d44..578bd5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "compression": "^1.7.4", "dotenv": "^16.3.1", "express": "^4.18.2", - "helmet": "^7.1.0", "npm": "^10.2.5", "path": "^0.12.7", "rammerhead": "https://github.com/NebulaServices/rammerhead/releases/download/rammerhead-1.2.41-nebula.8/rammerhead-1.2.41-nebula.7.tgz", @@ -3466,14 +3465,6 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.3.0.tgz", "integrity": "sha512-5e57etwBpNcDc0b6KCVWEh/Ro063OxPvzVimUdM0/tsYM/T7Hfy3kknIGj78SFTOhNd8AZY41U8mOHoO4LzmIQ==" }, - "node_modules/helmet": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/helmet/-/helmet-7.1.0.tgz", - "integrity": "sha512-g+HZqgfbpXdCkme/Cd/mZkV0aV3BZZZSugecH03kl38m/Kmdx8jKjBikpDj2cr+Iynv4KpYEviojNdTJActJAg==", - "engines": { - "node": ">=16.0.0" - } - }, "node_modules/html-escaper": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz", diff --git a/package.json b/package.json index 605926f..c3c7017 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "compression": "^1.7.4", "dotenv": "^16.3.1", "express": "^4.18.2", - "helmet": "^7.1.0", "npm": "^10.2.5", "path": "^0.12.7", "rammerhead": "https://github.com/NebulaServices/rammerhead/releases/download/rammerhead-1.2.41-nebula.8/rammerhead-1.2.41-nebula.7.tgz", diff --git a/src/components/ProxyRegistrar.astro b/src/components/ProxyRegistrar.astro index 0851049..4135ce6 100644 --- a/src/components/ProxyRegistrar.astro +++ b/src/components/ProxyRegistrar.astro @@ -39,26 +39,18 @@ // Disable URL shuffling on rewrite, eventually I'll try and figure out how it works, but for now, it's disabled. await fetch("/editsession?id=" + sessionID + "&enableShuffling=0"); // Now save it in a cookie that expires in 72 hours. - document.cookie = `rammerhead-session=${sessionID}; max-age=${60 * 60 * 72}; path=/`; + document.cookie += `rammerhead-session=${sessionID}; max-age=${60 * 60 * 72}; path=/`; + // Now add an origin_proxy cookie for our domain + document.cookie += `origin_proxy=${window.location.origin}; max-age=${60 * 60 * 72}; path=/`; } - try { - iframe.src = `https://aluu.xyz/${getCookie("rammerhead-session")}/${url}`; - } catch { - window.open(`https://aluu.xyz/${getCookie("rammerhead-session")}/${url}`); - } - + iframe.src = `/${getCookie("rammerhead-session")}/${url}`; } else { // Default to UV iframe.src = window.__uv$config.prefix + window.__uv$config.encodeUrl(url); } iframe.style.pointerEvents = "auto"; iframe.classList.add("proxy-frame"); - try { - document.body.appendChild(iframe); - } catch { - window.open(iframe.src); - } - + document.body.appendChild(iframe); iframeURLChange(iframe, (newURL) => updateTopbarURL(preference, newURL)); const boundIFrameLoad = iframeLoad.bind(null, iframe, loadingContent, topbar, closeButton); iframe.addEventListener("load", boundIFrameLoad); @@ -68,14 +60,12 @@ iframe.style.opacity = 1; topbar.style.opacity = 1; topbar.style.pointerEvents = "auto"; - document.body.style.overflow = "hidden"; closeButton.onclick = () => { iframe.style.opacity = 0; topbar.style.opacity = 0; iframe.style.pointerEvents = "none"; topbar.style.pointerEvents = "none"; - document.body.style.overflow = "auto"; iframe.removeEventListener("load", boundIFrameLoad); setTimeout(() => {