Skip to content

Commit

Permalink
v4.4.10 - Fixes, Proxy Upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpmanDev committed Aug 18, 2024
1 parent 5d3ddf8 commit 49be27f
Show file tree
Hide file tree
Showing 40 changed files with 397 additions and 425 deletions.
32 changes: 14 additions & 18 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import express from 'express';
import http from 'node:http';
import path from 'node:path';
import { createBareServer } from '@tomphttp/bare-server-node';
import { libcurlPath } from "@mercuryworkshop/libcurl-transport";
import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
import wisp from "wisp-server-node";
import request from '@cypress/request';
import chalk from 'chalk';
import packageJson from './package.json' assert { type: 'json' }; // Ensure package.json is treated as a JSON module
import packageJson from './package.json' assert { type: 'json' };

const __dirname = path.resolve();
const server = http.createServer();
const app = express(server);
const bareServer = createBareServer('/bear/');

const version = packageJson.version;

const discord = 'https://discord.gg/unblocking';

app.use(express.json());
Expand All @@ -22,7 +21,10 @@ app.use(
})
);

app.use("/libcurl/", express.static(libcurlPath));
app.use("/baremux/", express.static(baremuxPath));
app.use(express.static(path.join(__dirname, 'static')));

app.get('/app', (req, res) => {
res.sendFile(path.join(__dirname, './static/index.html'));
});
Expand All @@ -41,7 +43,7 @@ app.get('/lessons', (req, res) => {
app.get('/info', (req, res) => {
res.sendFile(path.join(__dirname, './static/info.html'));
});
app.get('/go', (req, res) => {
app.get('/edu', (req, res) => {
res.sendFile(path.join(__dirname, './static/loading.html'));
});
app.get('/worker.js', (req, res) => {
Expand All @@ -60,20 +62,14 @@ app.use((req, res) => {
res.sendFile(path.join(__dirname, './static/404.html'));
});

server.on('request', (req, res) => {
if (bareServer.shouldRoute(req)) {
bareServer.routeRequest(req, res);
} else {
app(req, res);
}
server.on("request", (req, res) => {
app(req, res);
});

server.on('upgrade', (req, socket, head) => {
if (bareServer.shouldRoute(req)) {
bareServer.routeUpgrade(req, socket, head);
} else {
socket.end();
}
server.on("upgrade", (req, socket, head) => {
if (req.url.endsWith("/wisp/")) {
wisp.routeRequest(req, socket, head);
} else socket.end();
});

server.on('listening', () => {
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "surfdoge",
"version": "4.4.9",
"version": "4.4.10",
"description": "",
"type": "module",
"engines": {
Expand All @@ -15,8 +15,10 @@
"license": "GPL-3.0-or-later",
"dependencies": {
"@cypress/request": "^3.0.0",
"@tomphttp/bare-server-node": "2.0.3",
"@mercuryworkshop/bare-mux": "^2.0.4",
"@mercuryworkshop/libcurl-transport": "^1.3.7",
"wisp-server-node": "^1.1.3",
"chalk": "^5.3.0",
"express": "^4.18.2"
}
}
}
12 changes: 10 additions & 2 deletions static/assets/css/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@
.tab-button-container {
position: relative;
margin-top: 6px;
border-radius: 5px;
border-radius: 10px;
font-size: 15px;
display: flex;
align-items: center;
align-self: center;
font-family: poppins;
font-weight: 600;
cursor: pointer;
box-sizing: border-box;
border: 2px solid rgba(0, 0, 0, 0.116);
transition: .2s ease-in-out;
}

.tab-button-container:active {
transform: scale(0.96);
}

.tab-button-container i {
Expand All @@ -39,7 +47,7 @@

.tab-close {
position: absolute;
top: 5px;
top: 1px;
right: 5px;
cursor: pointer;
}
Expand Down
114 changes: 88 additions & 26 deletions static/assets/css/ubar.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,25 @@
}

#urlBar input {
color: rgb(140,148,160);
background-color: transparent;
font-family: ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
min-width: 10vw;
height: 37px;
width: calc(80vw + 20%);
margin: 0 17px;
padding-left: 35px;
padding-left: 36px;
padding-right: 20px;
margin-right: 10px;
margin-left: 13px;
font-weight: 500;
font-size: 14px;
border: 0.5px solid rgb(38,53,65);
border-radius: 10px;
}

iframe {
display: block;
border: none;
height: calc(100vh - 3.2em);
width: 100vw;
position: absolute;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
#urlBar input::placeholder {
color: rgb(140,148,160);
}

#siteurl {
Expand All @@ -58,25 +57,15 @@ iframe {
#urlBar {
display: flex;
align-items: center;
padding: 8px;
padding: 6px;
position: fixed;
top: 0;
left: 0;
right: 0;
}

.searchBar {
min-width: 10vw;
height: 37px;
width: calc(80vw + 20%);
margin: 0 17px;
padding-left: 35px;
padding-right: 20px;
margin-right: 10px;
font-size: 14px;
}

button {
color: rgb(140,148,160);
display: flex;
float: left;
margin-right: 3px;
Expand Down Expand Up @@ -107,8 +96,9 @@ iframe {
display: none;
position: fixed;
margin-top: 40px;
height: 120px;
right: 0;
height: 155px;
height: 90px;
border-radius: 5px;
width: 200px;
box-shadow:
Expand All @@ -123,10 +113,82 @@ iframe {

#menu button {
width: 91%;
height: 30px;
background: transparent;
font-family: poppins;
font-weight: 800;
border-radius: 3px;
margin-left: 11px;
margin-top: -16px;
margin-bottom: 16px;
background: transparent;
border: none;
}
transition: .1s ease-in-out;
}

#menu button:hover {
transform: scale(0.97);
background-color: rgba(204, 204, 204, 0.062);
}

#menu button:active {
transform: scale(0.95);
}

#menu .icon {
margin-right: 6px;
}

.btn {
color: rgb(140,148,160);
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.5rem 1rem;
font-size: 1rem;
border-radius: 0.375rem;
border: 1px solid transparent;
cursor: pointer;
transition: all 0.1s ease-in-out;
user-select: none;
text-align: center;
white-space: nowrap;
line-height: 1.5;
}

.btn-sm {
padding: 0.25rem 0.5rem;
font-size: 0.875rem;
border-radius: 0.25rem;
}
.btn-ghost {
background-color: transparent;
border-color: transparent;
color: inherit;
box-shadow: none;
}

.btn-ghost:hover {
background-color: rgba(255, 255, 255, 0.253);
}

.btn-ghost:active {
background-color: rgba(0, 0, 0, 0.1);
transform: scale(0.9);
}

.btn-circle {
border-radius: 90px;
padding: 0.5rem;
color: rgb(140,148,160);
width: 2.5rem;
height: 1px;
display: inline-flex;
align-items: center;
justify-content: center;
}

.btn-circle.btn-sm {
padding: 0.25rem;
width: 2rem;
height: 2rem;
}
Binary file added static/assets/img/mchost.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 7 additions & 19 deletions static/assets/js/ag.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
function openAg(url, ag) {
localStorage.setItem("currentAg", ag)
location.href = '/go?url=' + url;
location.href = '/edu?login=' + Ultraviolet.codec.base64.encode(url);
}

function openAgDy(url) {
location.href = '/search/route?url=' + url;
}

window.navigator.serviceWorker
.register("/sw.js", {
scope: "/search/",
});

/*apps*/
function gpt() {
openAg('https://ub7.org');
openAg('https://julius.ai/ai-chatbot');
}

function nf() {
Expand Down Expand Up @@ -70,8 +61,7 @@ function twitch() {
}

function yt() {
alert(`Doge's URL bar will not be available for this app.\n\nClick "OK" to proceed.`)
openAgDy('https://youtube.com');
openAg('https://youtube.com');
}

function y8() {
Expand All @@ -83,7 +73,7 @@ function vscode() {
}

function sFlix() {
openAg('https://sflix.se');
openAg('https://vidstream.to');
}

function netflix() {
Expand Down Expand Up @@ -140,8 +130,8 @@ function p2048() {
}

function rbx() {
alert(`Note: Roblox should be working now, but if it still gives you an VPN/Proxy detection message, refresh it.`);
openAg('https://now.derpman.lol');
alert(`This app might not work as expected. Refresh the page if it detects a VPN.`);
openAg('https://educationbluesky.com/apps/roblox-corporation/5349/roblox.html');
}

function slope() {
Expand Down Expand Up @@ -235,7 +225,7 @@ function monkeyMart() {
}

function idleBreakout() {
openAg('https://html-classic.itch.zone/html/9150519/index.html');
openAg('https://www.onlinegames.io/games/2024/more/idle-breakout/index.html');
}

function motoX3M() {
Expand Down Expand Up @@ -282,8 +272,6 @@ function stickManHook() {
openAg('https://stickman-hook.io/iframe/index.html');
}



function stackBounce() {
openAg('https://storage.googleapis.com/bento-developer-games/stackbounce/gameCode/index.html');
}
Expand Down
9 changes: 3 additions & 6 deletions static/assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ const input = document.querySelector("input");
const remove = document.querySelectorAll('body > :not(#particles-js)');
form.addEventListener("submit", async (event) => {
event.preventDefault();
window.navigator.serviceWorker.register("/sw.js", {
scope: "/search/",
});
window.navigator.serviceWorker.register("/sw.js", {
scope: __uv$config.prefix,
}).then(() => {
let url = input.value.trim();
if(!isUrl(url)) url = "https://www.google.com/search?q=" + url;
else if(!(url.startsWith("https://") || url.startsWith("http://"))) url = "http://" + url;
if (!isUrl(url)) url = "https://www.google.com/search?q=" + url;
else if (!(url.startsWith("https://") || url.startsWith("http://"))) url = "http://" + url;
localStorage.setItem("encodedUrl", __uv$config.encodeUrl(url));
remove.forEach(element => {
element.remove();
Expand All @@ -21,6 +18,6 @@ form.addEventListener("submit", async (event) => {
});

function isUrl(val = "") {
if(/^http(s?):\/\//.test(val) || (val.includes(".") && val.substr(0, 1) !== " ")) return true;
if (/^http(s?):\/\//.test(val) || (val.includes(".") && val.substr(0, 1) !== " ")) return true;
return false;
}
Loading

0 comments on commit 49be27f

Please sign in to comment.