Add origin_proxy cookie (ty sm binaryperson), and remove helmet.
This commit is contained in:
parent
d5ecbaadac
commit
32cfc7676e
4 changed files with 5 additions and 26 deletions
1
index.js
1
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();
|
||||
|
|
|
|||
9
package-lock.json
generated
9
package-lock.json
generated
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
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(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue