Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 4ec89d3

Browse files
Merge pull request #25 from Ruby-Network/dev
v1.0.1
2 parents 2d0d318 + c53191c commit 4ec89d3

File tree

20 files changed

+223
-121
lines changed

20 files changed

+223
-121
lines changed

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pnpm-debug.log*
2121
/public/dip/
2222
/public/osana/
2323
/public/js/lib/
24+
/public/aero/
2425
.vscode/
2526
.github/
2627
/public/assets/fontawesome/
@@ -29,4 +30,4 @@ docker-compose.yml
2930

3031
*.htpasswd
3132

32-
/public/ruby-assets/
33+
/public/ruby-assets/

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
src="https://img.shields.io/badge/render-4f65f1.svg?style=for-the-badge&logo=render&logoColor=46e3b7"
2121
/>
2222
</a>
23-
<a href="https://heroku.com/deploy?template=https://github.com/Ruby-Network/ruby">
24-
<img height="30px" src="https://raw.githubusercontent.com/amethystnetwork-dev/Tsunami/main/deploy/heroku.svg">
25-
</img>
26-
</a>
2723
<a href="https://repl.it/github/Ruby-Network/ruby">
2824
<img height="30px" src="https://raw.githubusercontent.com/FogNetwork/Tsunami/main/deploy/replit.svg">
2925
<img>
@@ -54,6 +50,11 @@
5450
</a>
5551
</div>
5652

53+
## NOTE:
54+
55+
- For Cyclic users this will **not** work as it is too big
56+
- This will **NOT** deploy on Github Pages, Netlify, Vercel, Gitlab Pages or any other _static_ host
57+
5758
---
5859

5960
This is our second edition of [Ruby](https://github.com/ruby-network/ruby-v1). This edition focuses on speed and more features.
@@ -64,17 +65,15 @@ This is our second edition of [Ruby](https://github.com/ruby-network/ruby-v1). T
6465

6566
- Tons of themes (you can even make your own)
6667

67-
- We preload everything so you don't have to wait for the page to load
68+
- We prefetch everything to speed up your experience
6869

6970
- Multiple Proxy Backends:
7071

7172
- [Ultraviolet](https://github.com/titaniumnetwork-dev/ultraviolet)
7273
- [Dynamic Interception Proxy (DIP)](https://github.com/Dynamic-Interception-Proxy/DIP)
7374
- [Osana](https://github.com/nebulaservices/osana)
7475

75-
Soon to be added:
76-
77-
- [Aero](https://github.com/proxyhaven/aero)
76+
---
7877

7978
- Basic Password protection for the website (you can set a password in the settings page)
8079

@@ -88,6 +87,12 @@ This is our second edition of [Ruby](https://github.com/ruby-network/ruby-v1). T
8887

8988
- Easy to self host
9089

90+
- Tab cloaking
91+
92+
- Multithreading for performance
93+
94+
- **NEW:** Off click cloaking (make the tab look like a Google search when you are doing something else)
95+
9196
- And more!
9297

9398
---

index.ts

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ if (numCPUs > 0 && cluster.isPrimary) {
5353
//uv config
5454
app.use('/uv/', express.static(uvPath));
5555
//env vars for the unlock feature
56+
//analytics object
5657
let key = process.env.KEY || '';
5758
if (!key || key === undefined || key === null || key === '') {
5859
key = 'unlock';
@@ -65,9 +66,13 @@ if (numCPUs > 0 && cluster.isPrimary) {
6566
//only block /,/404,/apps,/error,/search,/settings and /index if the key or cookie is not present
6667
if (bare.shouldRoute(req)) {
6768
try {
68-
for (let i in blacklisted)
69-
if (req.headers['x-bare-host']?.includes(blacklisted[i]))
70-
return res.end('Denied');
69+
if (!req.headers.cookie?.includes('allowads')) {
70+
for (let i in blacklisted)
71+
if (
72+
req.headers['x-bare-host']?.includes(blacklisted[i])
73+
)
74+
return res.end('Denied');
75+
}
7176
bare.routeRequest(req, res);
7277
} catch (error) {
7378
console.error(error);
@@ -180,6 +185,25 @@ if (numCPUs > 0 && cluster.isPrimary) {
180185
return;
181186
}
182187
});
188+
app.get('/disable-ads', (req, res) => {
189+
if (req.headers.cookie?.includes('allowads')) {
190+
res.clearCookie('allowads');
191+
res.writeHead(302, {
192+
Location: '/settings',
193+
});
194+
res.end('Disabled ads');
195+
return;
196+
} else {
197+
res.writeHead(302, {
198+
Location: '/settings',
199+
'Set-Cookie':
200+
'allowads=allowads; Path=/; expires=Thu, 31 Dec 2099 23:59:59 GMT;',
201+
});
202+
res.end('Ads enabled');
203+
return;
204+
}
205+
});
206+
// Define the /analytics endpoint
183207
app.use((req, res) => {
184208
res.writeHead(302, {
185209
Location: '/404',

public/aero/config.js

Lines changed: 0 additions & 52 deletions
This file was deleted.
15.5 KB
Loading
12 KB
Loading

public/assets/games.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,5 +414,21 @@
414414
"cdn": "false",
415415
"proxy": "false",
416416
"url": ""
417+
},
418+
{
419+
"img": "/assets/games-thumb/1v1-lol.png",
420+
"baseFile": "none",
421+
"name": "1v1.lol",
422+
"cdn": "false",
423+
"proxy": "true",
424+
"url": "https://1v1.lol"
425+
},
426+
{
427+
"img": "/assets/games-thumb/shellshock.png",
428+
"baseFile": "none",
429+
"name": "Shell Shockers",
430+
"cdn": "false",
431+
"proxy": "true",
432+
"url": "https://shellshock.io"
417433
}
418434
]

public/js/appSuggestions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ window.onload = function () {
7070
if (window.location.hash.includes('#custom')) {
7171
// Get the custom URL after the = sign
7272
let customURL = window.location.hash.split('=')[1];
73-
if (localStorage.getItem('reloaded') !== 'true' && localStorage.getItem('customApps')) {
73+
if (localStorage.getItem('reloaded') !== 'true') {
7474
adress.value = customURL;
7575
form.dispatchEvent(new Event('submit'));
7676
}
@@ -90,4 +90,4 @@ window.onload = function () {
9090
adress.value = link;
9191
form.dispatchEvent(new Event('submit'));
9292
}
93-
}
93+
};

public/js/gameload.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ await fetch('/assets/games.json')
1111
if (gameData.cdn === 'true') {
1212
//not needed as of now but added for future use
1313
} else if (gameData.proxy === 'true') {
14-
window.location.replace('/search/#custom=' + gameData.url);
14+
localStorage.setItem('reloaded', 'false');
15+
window.location.replace('/search#custom=' + gameData.url);
1516
} else {
1617
iframe.src = `/ruby-assets/${gameName}/${gameData.baseFile}`;
1718
}

public/js/games.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ await fetch('/assets/games.json')
66
//make game.name lowercase and replace spaces with dashes
77
let gn = game.name.toLowerCase().replace(/\s/g, '-');
88
return `
9-
<div onclick='window.location.href = "/games/${gn}"' class="game-tile hover:border-[var(--border-color)] hover:rounded-xl hover:border-2">
9+
<div onclick='window.location.href = "/games/${gn}"' data-game="${gn}" class="game-tile hover:border-[var(--border-color)] hover:rounded-xl hover:border-2">
1010
<img src="${game.img}" alt="${game.name}" />
1111
<p> ${game.name} </p>
1212
</div>

0 commit comments

Comments
 (0)