Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Globalfun32y439y54 authored Jun 20, 2024
1 parent 304f629 commit b590a26
Show file tree
Hide file tree
Showing 21 changed files with 369 additions and 153 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ package.json
**/*.min.*
.prettierrc
*.md
bun.lockb
bun.lockb
Failed.html
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": false,
"bracketSameLine": true,
"printWidth": 95
}
10 changes: 7 additions & 3 deletions Failed.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p>
<p>
If you see this page, the nginx web server is successfully installed and working. Further
configuration is required.
</p>

<p>
For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br />
For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br />
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.
</p>
</p

<p><em>Thank you for using nginx.</em></p>
</body>
Expand Down
7 changes: 0 additions & 7 deletions Masqr.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ export function setupMasqr(app) {

const authheader = req.headers.authorization

// biome-ignore lint/complexity/useLiteralKeys: <explanation>
if (req.cookies["authcheck"]) {
next()
return
}

// biome-ignore lint/complexity/useLiteralKeys: <explanation>
if (req.cookies["refreshcheck"] !== "true") {
res.cookie("refreshcheck", "true", { maxAge: 10000 })
MasqFail(req, res)
Expand All @@ -39,13 +37,10 @@ export function setupMasqr(app) {

try {
const licenseCheckResponse = await fetch(
// biome-ignore lint/style/useTemplate: <explanation>
LICENSE_SERVER_URL + pass + "&host=" + req.headers.host
)
// biome-ignore lint/complexity/useLiteralKeys: <explanation>
const licenseCheck = (await licenseCheckResponse.json())["status"]
console.log(
// biome-ignore lint/style/useTemplate: <explanation>
LICENSE_SERVER_URL + pass + "&host=" + req.headers.host + " returned " + licenseCheck
)
if (licenseCheck === "License valid") {
Expand All @@ -68,10 +63,8 @@ async function MasqFail(req, res) {
if (!req.headers.host) {
return
}
// biome-ignore lint/style/useTemplate: <explanation>
const unsafeSuffix = req.headers.host + ".html"
const safeSuffix = path.normalize(unsafeSuffix).replace(/^(\.\.(\/|\\|$))+/, "")
// biome-ignore lint/style/useTemplate: <explanation>
const safeJoin = path.join(process.cwd() + "/Masqrd", safeSuffix)
try {
await fs.promises.access(safeJoin)
Expand Down
13 changes: 12 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.0/schema.json",
"files": {
"ignore": ["static/assets/-dy/**", "static/assets/-uv/**", "static/assets/json/*.min.json"]
"ignore": [
"static/assets/-dy/**",
"static/assets/-uv/**",
"static/assets/json/*.min.json",
"Masqr.js",
"node_modules/**",
"package-lock.json",
"package.json",
"*.md",
"bun.lockb",
"Failed.html"
]
},
"organizeImports": {
"enabled": true
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "Project-Raptor",
"version": "2.5.2",
"version": "2.5.3",
"type": "module",
"engines": {
"npm": ">=10.0.0",
"node": ">=20.0.0"
},
"scripts": {
"start": "node index.js",
"prettier": "npx prettier . --write",
"format": "npx prettier . --write",
"precommit": "biome check --write .",
"lint": "biome lint --write .",
"biome-format": "biome format --write ."
"lint": "biome lint --write ."
},
"author": "Project-Raptor",
"license": "GPL-3.0-or-later",
Expand Down
19 changes: 14 additions & 5 deletions static/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@
<h1>404</h1>
<h3>Page not found.</h3>
<p>Keep getting this error? Report it down below.</p>
<button class="one" type="button" onclick="window.location.href = '/';">Go Back Home</button>
<button class="two" type="button" onclick="window.location.href = 'https://discord.gg/interstellar'">Join our Discord (Direct)</button>
<button class="three" type="button" onclick="go('https://discord.gg/interstellar')">Join our Discord (Proxied)</button>
<button class="one" type="button" onclick="window.location.href = '/';">
Go Back Home
</button>
<button
class="two"
type="button"
onclick="window.location.href = 'https://discord.gg/interstellar'">
Join our Discord (Direct)
</button>
<button class="three" type="button" onclick="go('https://discord.gg/interstellar')">
Join our Discord (Proxied)
</button>
</div>
</body>
<script src="/assets/js/index.js?v=44"></script>
<script src="/assets/js/index.js?v=46"></script>
<script src="/assets/-uv/bundle.js?v=6-17-2024"></script>
<script src="/assets/-uv/config.js?v=6-17-2024"></script>
<script src="/assets/js/main.js?v=88"></script>
<script src="/assets/js/main.js?v=90"></script>
</html>
7 changes: 3 additions & 4 deletions static/apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
<link rel="stylesheet" href="/assets/css/global.css?v=6" />
<link rel="stylesheet" href="/assets/css/container.css?v=2" />
<link rel="stylesheet" href="/assets/css/nav.css?v=2" />
<script src="/assets/js/main.js?v=88"></script>
<script src="/assets/js/index.js?v=44"></script>
<script src="/assets/js/index.js?v=46"></script>
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>
</head>
<body>
Expand All @@ -38,8 +37,8 @@
</div>
<div class="pinned-apps"></div>
<div class="container-apps"></div>
<script src="assets/js/container.js?v=124"></script>
<script src="/assets/js/main.js?v=88"></script>
<script src="assets/js/container.js?v=126"></script>
<script src="/assets/js/main.js?v=90"></script>
<!-- DO NOT REMOVE-->
<script>
window.dataLayer = window.dataLayer || []
Expand Down
12 changes: 9 additions & 3 deletions static/assets/js/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ fetch(path)
} else if (app.partial) {
paragraph.style.color = "yellow"
if (!app.say) {
app.say = "This app is currently experiencing some issues, it may not work for you. (Dynamic doesn't work in about:blank)"
app.say =
"This app is currently experiencing some issues, it may not work for you. (Dynamic doesn't work in about:blank)"
}
}

Expand Down Expand Up @@ -369,13 +370,18 @@ fetch(path)
})

function show_category() {
const selectedCategories = Array.from(document.querySelectorAll("#category option:checked")).map((option) => option.value)
const selectedCategories = Array.from(
document.querySelectorAll("#category option:checked")
).map((option) => option.value)
const games = document.getElementsByClassName("column")

for (const game of games) {
const categories = game.getAttribute("data-category").split(" ")

if (selectedCategories.length === 0 || selectedCategories.some((category) => categories.includes(category))) {
if (
selectedCategories.length === 0 ||
selectedCategories.some((category) => categories.includes(category))
) {
game.style.display = "block"
} else {
game.style.display = "none"
Expand Down
10 changes: 8 additions & 2 deletions static/assets/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ try {
inFrame = true
}
if (!localStorage.getItem("ab")) localStorage.setItem("ab", true)
if (!inFrame && !navigator.userAgent.includes("Firefox") && localStorage.getItem("ab") === "true") {
if (
!inFrame &&
!navigator.userAgent.includes("Firefox") &&
localStorage.getItem("ab") === "true"
) {
const popup = open("about:blank", "_blank")
if (!popup || popup.closed) {
alert(
Expand All @@ -19,7 +23,9 @@ if (!inFrame && !navigator.userAgent.includes("Firefox") && localStorage.getItem
const link = doc.createElement("link")

const name = localStorage.getItem("name") || "My Drive - Google Drive"
const icon = localStorage.getItem("icon") || "https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"
const icon =
localStorage.getItem("icon") ||
"https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"

doc.title = name
link.rel = "icon"
Expand Down
32 changes: 24 additions & 8 deletions static/assets/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,25 @@ body {

function saveTheme() {
const themeData = {
background: document.querySelector("#background-input").value || "url('/./assets/media/background/full-main.png')",
background:
document.querySelector("#background-input").value ||
"url('/./assets/media/background/full-main.png')",
backgroundColor: document.querySelector("#background-color-input").value || "#222",
inputColor: document.querySelector("#input-color-input").value || "#4545459e",
appCardColor: document.querySelector("#app-card-color-input").value || "#353535",
settingsCardColor: document.querySelector("#settings-card-color-input").value || "#2a2a2a",
buttonColor: document.querySelector("#button-color-input").value || "#333",
tabAccentColor: document.querySelector("#tab-accent-color-input").value || "#444",
sliderActiveColor: document.querySelector("#slider-active-color-input").value || "#4caf50",
sliderInactiveColor: document.querySelector("#slider-inactive-color-input").value || "#ccc",
logoColor: document.querySelector("#white-logo").classList.contains("selected") ? "white" : "black",
sliderInactiveColor:
document.querySelector("#slider-inactive-color-input").value || "#ccc",
logoColor: document.querySelector("#white-logo").classList.contains("selected")
? "white"
: "black",
primaryTextColor: document.querySelector("#primary-text-color-input").value || "#fff",
darkTextColor: document.querySelector("#dark-text-color-input").value || "#555",
placeholderTextColor: document.querySelector("#placeholder-text-color-input").value || "#aaa",
placeholderTextColor:
document.querySelector("#placeholder-text-color-input").value || "#aaa",
}

const cssContent = generateCSSContent(themeData)
Expand Down Expand Up @@ -181,7 +187,10 @@ document.addEventListener("DOMContentLoaded", () => {
})

function dataURItoBlob(dataURI) {
const byteString = dataURI.split(",")[0].indexOf("base64") >= 0 ? atob(dataURI.split(",")[1]) : unescape(dataURI.split(",")[1])
const byteString =
dataURI.split(",")[0].indexOf("base64") >= 0
? atob(dataURI.split(",")[1])
: unescape(dataURI.split(",")[1])
const mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0]

const arrayBuffer = new ArrayBuffer(byteString.length)
Expand Down Expand Up @@ -259,7 +268,10 @@ document.addEventListener("DOMContentLoaded", () => {
const storedP = localStorage.getItem("uv")
if (storedP === "true") {
pChangeElement.value = "uv"
} else if (localStorage.getItem("dy") === "true" || localStorage.getItem("dy") === "auto") {
} else if (
localStorage.getItem("dy") === "true" ||
localStorage.getItem("dy") === "auto"
) {
pChangeElement.value = "dy"
} else {
pChangeElement.value = "uv"
Expand Down Expand Up @@ -303,7 +315,9 @@ function saveEventKey() {
const dropdown = document.getElementById("dropdown")
const options = dropdown.getElementsByTagName("option")

const sortedOptions = Array.from(options).sort((a, b) => a.textContent.localeCompare(b.textContent))
const sortedOptions = Array.from(options).sort((a, b) =>
a.textContent.localeCompare(b.textContent)
)

while (dropdown.firstChild) {
dropdown.removeChild(dropdown.firstChild)
Expand Down Expand Up @@ -428,7 +442,9 @@ function AB() {
const link = doc.createElement("link")

const name = localStorage.getItem("name") || "My Drive - Google Drive"
const icon = localStorage.getItem("icon") || "https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"
const icon =
localStorage.getItem("icon") ||
"https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"

doc.title = name
link.rel = "icon"
Expand Down
28 changes: 21 additions & 7 deletions static/assets/js/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ window.addEventListener("load", () => {
form.addEventListener("submit", async (event) => {
event.preventDefault()
const formValue = input.value.trim()
const url = isUrl(formValue) ? prependHttps(formValue) : `https://www.google.com/search?q=${formValue}`
const url = isUrl(formValue)
? prependHttps(formValue)
: `https://www.google.com/search?q=${formValue}`
processUrl(url)
})
}
function processUrl(url) {
sessionStorage.setItem("GoUrl", __uv$config.encodeUrl(url))
const iframeContainer = document.getElementById("iframe-container")
const activeIframe = Array.from(iframeContainer.querySelectorAll("iframe")).find((iframe) => iframe.classList.contains("active"))
const activeIframe = Array.from(iframeContainer.querySelectorAll("iframe")).find(
(iframe) => iframe.classList.contains("active")
)
activeIframe.src = `/a/${__uv$config.encodeUrl(url)}`
activeIframe.dataset.tabUrl = url
input.value = url
Expand Down Expand Up @@ -45,7 +49,8 @@ document.addEventListener("DOMContentLoaded", (event) => {
const newTab = document.createElement("li")
const tabTitle = document.createElement("span")
const newIframe = document.createElement("iframe")
newIframe.sandbox = "allow-same-origin allow-scripts allow-forms allow-pointer-lock allow-modals allow-orientation-lock"
newIframe.sandbox =
"allow-same-origin allow-scripts allow-forms allow-pointer-lock allow-modals allow-orientation-lock"
// When Top Navigation is not allowed links with the "top" value will be entirely blocked, if we allow Top Navigation it will overwrite the tab, which is obviously not wanted.
tabTitle.textContent = `New Tab ${tabCounter}`
tabTitle.className = "tab-title"
Expand Down Expand Up @@ -134,7 +139,9 @@ document.addEventListener("DOMContentLoaded", (event) => {
const nextTabIndex = remainingTabs.findIndex((tab) => tab.dataset.tabId !== tabId)
if (nextTabIndex > -1) {
const nextTabToActivate = remainingTabs[nextTabIndex]
const nextIframeToActivate = iframeContainer.querySelector(`[data-tab-id='${nextTabToActivate.dataset.tabId}']`)
const nextIframeToActivate = iframeContainer.querySelector(
`[data-tab-id='${nextTabToActivate.dataset.tabId}']`
)
for (const tab of remainingTabs) {
tab.classList.remove("active")
}
Expand Down Expand Up @@ -198,19 +205,24 @@ document.addEventListener("DOMContentLoaded", (event) => {
function reload() {
const activeIframe = document.querySelector("#iframe-container iframe.active")
if (activeIframe) {
// biome-ignore lint/correctness/noSelfAssign:
activeIframe.src = activeIframe.src
Load()
} else {
console.error("No active iframe found")
}
}

// Popout
function popout() {
const activeIframe = document.querySelector("#iframe-container iframe.active")
if (activeIframe) {
const newWindow = window.open("about:blank", "_blank")
if (newWindow) {
const name = localStorage.getItem("name") || "My Drive - Google Drive"
const icon = localStorage.getItem("icon") || "https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"
const icon =
localStorage.getItem("icon") ||
"https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"
newWindow.document.title = name
const link = newWindow.document.createElement("link")
link.rel = "icon"
Expand Down Expand Up @@ -367,7 +379,9 @@ function decodeXor(input) {
return (
decodeURIComponent(str)
.split("")
.map((char, ind) => (ind % 2 ? String.fromCharCode(char.charCodeAt(Number.NaN) ^ 2) : char))
.map((char, ind) =>
ind % 2 ? String.fromCharCode(char.charCodeAt(Number.NaN) ^ 2) : char
)
.join("") + (search.length ? `?${search.join("?")}` : "")
)
}
}
Loading

0 comments on commit b590a26

Please sign in to comment.