Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b313017
Add some proxied games (1v1.lol, shellshockers)
MotorTruck1221 Mar 5, 2023
baa9037
Format commit
MotorTruck1221 Mar 5, 2023
a29880f
Clean yarn.lock generation
MotorTruck1221 Mar 5, 2023
1ca3199
I forgot what I was doing
MotorTruck1221 Mar 5, 2023
498966d
Fix merge issue
MotorTruck1221 Mar 6, 2023
a582b1f
Merge pull request #21 from Ruby-Network/main
MotorTruck1221 Mar 6, 2023
c701597
Merge pull request #22 from Ruby-Network/main
MotorTruck1221 Mar 6, 2023
d7a9a50
Merge pull request #23 from Ruby-Network/main
MotorTruck1221 Mar 7, 2023
cd0bbde
Merge pull request #24 from Ruby-Network/main
MotorTruck1221 Mar 8, 2023
544355d
Start to add aero
MotorTruck1221 Mar 9, 2023
b2ae593
A little bit more aero
MotorTruck1221 Mar 9, 2023
d108131
Aero but it has errors
MotorTruck1221 Mar 9, 2023
b80c5d5
Can't figure it out
MotorTruck1221 Mar 9, 2023
035f4ac
Click off cloaking
MotorTruck1221 Mar 10, 2023
ebdebe6
Oops
MotorTruck1221 Mar 10, 2023
aae8cb9
Statistics
MotorTruck1221 Mar 10, 2023
2aa1630
Nah
MotorTruck1221 Mar 10, 2023
bf8228f
Add CSS for search bar (in the near future)
MotorTruck1221 Mar 12, 2023
c0f20b3
Added the wrong one lol
MotorTruck1221 Mar 12, 2023
0227275
Fix Render
MotorTruck1221 Mar 12, 2023
e7c2852
Fix Render
MotorTruck1221 Mar 12, 2023
c0778b9
Fix Render
MotorTruck1221 Mar 12, 2023
99a61e8
oops
MotorTruck1221 Mar 12, 2023
d75bd83
Update README
MotorTruck1221 Mar 12, 2023
3ca2cee
Update README
MotorTruck1221 Mar 12, 2023
7469727
Update README
MotorTruck1221 Mar 12, 2023
3225727
Spelling Error correction
MotorTruck1221 Mar 12, 2023
f433eca
Add some stuff to the README including some warnings
MotorTruck1221 Mar 12, 2023
d8a579a
Formatting error
MotorTruck1221 Mar 12, 2023
df029ab
Format commit
MotorTruck1221 Mar 12, 2023
c3bc821
Start to add the ability to enable ADS
MotorTruck1221 Mar 12, 2023
c53191c
Add Ad Blocking Option
MotorTruck1221 Mar 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pnpm-debug.log*
/public/dip/
/public/osana/
/public/js/lib/
/public/aero/
.vscode/
.github/
/public/assets/fontawesome/
Expand All @@ -29,4 +30,4 @@ docker-compose.yml

*.htpasswd

/public/ruby-assets/
/public/ruby-assets/
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
src="https://img.shields.io/badge/render-4f65f1.svg?style=for-the-badge&logo=render&logoColor=46e3b7"
/>
</a>
<a href="https://heroku.com/deploy?template=https://github.com/Ruby-Network/ruby">
<img height="30px" src="https://raw.githubusercontent.com/amethystnetwork-dev/Tsunami/main/deploy/heroku.svg">
</img>
</a>
<a href="https://repl.it/github/Ruby-Network/ruby">
<img height="30px" src="https://raw.githubusercontent.com/FogNetwork/Tsunami/main/deploy/replit.svg">
<img>
Expand Down Expand Up @@ -54,6 +50,11 @@
</a>
</div>

## NOTE:

- For Cyclic users this will **not** work as it is too big
- This will **NOT** deploy on Github Pages, Netlify, Vercel, Gitlab Pages or any other _static_ host

---

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

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

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

- Multiple Proxy Backends:

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

Soon to be added:

- [Aero](https://github.com/proxyhaven/aero)
---

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

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

- Easy to self host

- Tab cloaking

- Multithreading for performance

- **NEW:** Off click cloaking (make the tab look like a Google search when you are doing something else)

- And more!

---
Expand Down
30 changes: 27 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ if (numCPUs > 0 && cluster.isPrimary) {
//uv config
app.use('/uv/', express.static(uvPath));
//env vars for the unlock feature
//analytics object
let key = process.env.KEY || '';
if (!key || key === undefined || key === null || key === '') {
key = 'unlock';
Expand All @@ -65,9 +66,13 @@ if (numCPUs > 0 && cluster.isPrimary) {
//only block /,/404,/apps,/error,/search,/settings and /index if the key or cookie is not present
if (bare.shouldRoute(req)) {
try {
for (let i in blacklisted)
if (req.headers['x-bare-host']?.includes(blacklisted[i]))
return res.end('Denied');
if (!req.headers.cookie?.includes('allowads')) {
for (let i in blacklisted)
if (
req.headers['x-bare-host']?.includes(blacklisted[i])
)
return res.end('Denied');
}
bare.routeRequest(req, res);
} catch (error) {
console.error(error);
Expand Down Expand Up @@ -180,6 +185,25 @@ if (numCPUs > 0 && cluster.isPrimary) {
return;
}
});
app.get('/disable-ads', (req, res) => {
if (req.headers.cookie?.includes('allowads')) {
res.clearCookie('allowads');
res.writeHead(302, {
Location: '/settings',
});
res.end('Disabled ads');
return;
} else {
res.writeHead(302, {
Location: '/settings',
'Set-Cookie':
'allowads=allowads; Path=/; expires=Thu, 31 Dec 2099 23:59:59 GMT;',
});
res.end('Ads enabled');
return;
}
});
// Define the /analytics endpoint
app.use((req, res) => {
res.writeHead(302, {
Location: '/404',
Expand Down
52 changes: 0 additions & 52 deletions public/aero/config.js

This file was deleted.

Binary file added public/assets/games-thumb/1v1-lol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/games-thumb/shellshock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions public/assets/games.json
Original file line number Diff line number Diff line change
Expand Up @@ -414,5 +414,21 @@
"cdn": "false",
"proxy": "false",
"url": ""
},
{
"img": "/assets/games-thumb/1v1-lol.png",
"baseFile": "none",
"name": "1v1.lol",
"cdn": "false",
"proxy": "true",
"url": "https://1v1.lol"
},
{
"img": "/assets/games-thumb/shellshock.png",
"baseFile": "none",
"name": "Shell Shockers",
"cdn": "false",
"proxy": "true",
"url": "https://shellshock.io"
}
]
4 changes: 2 additions & 2 deletions public/js/appSuggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ window.onload = function () {
if (window.location.hash.includes('#custom')) {
// Get the custom URL after the = sign
let customURL = window.location.hash.split('=')[1];
if (localStorage.getItem('reloaded') !== 'true' && localStorage.getItem('customApps')) {
if (localStorage.getItem('reloaded') !== 'true') {
adress.value = customURL;
form.dispatchEvent(new Event('submit'));
}
Expand All @@ -90,4 +90,4 @@ window.onload = function () {
adress.value = link;
form.dispatchEvent(new Event('submit'));
}
}
};
3 changes: 2 additions & 1 deletion public/js/gameload.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ await fetch('/assets/games.json')
if (gameData.cdn === 'true') {
//not needed as of now but added for future use
} else if (gameData.proxy === 'true') {
window.location.replace('/search/#custom=' + gameData.url);
localStorage.setItem('reloaded', 'false');
window.location.replace('/search#custom=' + gameData.url);
} else {
iframe.src = `/ruby-assets/${gameName}/${gameData.baseFile}`;
}
Expand Down
2 changes: 1 addition & 1 deletion public/js/games.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ await fetch('/assets/games.json')
//make game.name lowercase and replace spaces with dashes
let gn = game.name.toLowerCase().replace(/\s/g, '-');
return `
<div onclick='window.location.href = "/games/${gn}"' class="game-tile hover:border-[var(--border-color)] hover:rounded-xl hover:border-2">
<div onclick='window.location.href = "/games/${gn}"' data-game="${gn}" class="game-tile hover:border-[var(--border-color)] hover:rounded-xl hover:border-2">
<img src="${game.img}" alt="${game.name}" />
<p> ${game.name} </p>
</div>
Expand Down
59 changes: 25 additions & 34 deletions public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,21 @@ if (proxytype === 'DIP') {
.querySelector('.dipform')
.addEventListener('submit', async (event) => {
event.preventDefault();

let url;
function searchURI(value) {
url = search(value, searchEngine.value);
}
worker().then((event) => {
let search = document.querySelector('.dipinput');
let searchURL =
document.getElementById('uv-search-engine').value;
searchURL = searchURL.replace('%s', '');
let location;
//if search.value is a url then set location to that url without using .includes
if (
search.value.includes('https://') ||
search.value.includes('http://')
) {
location = search.value;
} else {
location = searchURL + encodeURIComponent(search.value);
}
let address = document.getElementById('uv-address');
searchURI(address.value);
//loadingIframe.classList.remove('dnone');
let textcolor = getComputedStyle(
document.body
).getPropertyValue('--text-color');
//loadingIframe.src = `/loading#${textcolor}`;
iframe.src =
window.__DIP.config.prefix +
window.__DIP.encodeURL(location);
window.__DIP.config.prefix + window.__DIP.encodeURL(url);
//iframe.addEventListener('load', function () {
//loadingIframe.classList.add('dnone');
document.getElementById('control').classList.remove('dnone');
Expand All @@ -102,30 +93,20 @@ if (proxytype === 'Osana') {
.getElementById('uv-form')
.addEventListener('submit', async (event) => {
event.preventDefault();
let url;
function searchURI(value) {
url = search(value, searchEngine.value);
}
worker().then((event) => {
let search = document.querySelector('.dipinput');
let searchURL =
document.getElementById('uv-search-engine').value;
searchURL = searchURL.replace('%s', '');
let location;
//if search.value is a url then set location to that url without using .includes
if (
search.value.includes('https://') ||
search.value.includes('http://')
) {
location = search.value;
} else {
console.log(search.value);
location = searchURL + encodeURIComponent(search.value);
}
//loadingIframe.classList.remove('dnone');
let address = document.getElementById('uv-address');
searchURI(address.value);
let textcolor = getComputedStyle(
document.body
).getPropertyValue('--text-color');
//loadingIframe.src = `/loading#${textcolor}`;
iframe.src = `${
__osana$config.prefix
}${__osana$config.codec.encode(location)}`;
iframe.src =
__osana$config.prefix + __osana$config.codec.encode(url);
//iframe.addEventListener('load', function () {
//loadingIframe.classList.add('dnone');
document.getElementById('control').classList.remove('dnone');
Expand All @@ -149,3 +130,13 @@ function decoded(str) {
)
.join('');
}
function search(input, template) {
try {
return new URL(input).toString();
} catch (err) {}
try {
const url = new URL(`http://${input}`);
if (url.hostname.includes('.')) return url.toString();
} catch (err) {}
return template.replace('%s', encodeURIComponent(input));
}
Loading