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

Commit f05b002

Browse files
Merge pull request #49 from Ruby-Network/dev
v1.0.2
2 parents 77c4edb + 6e7767c commit f05b002

File tree

149 files changed

+13318
-523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+13318
-523
lines changed

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ docker-compose.yml
3131
*.htpasswd
3232

3333
/public/ruby-assets/
34+
/public/chrome-tabs/
35+
/src/pages/tabs.astro

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ This is our second edition of [Ruby](https://github.com/ruby-network/ruby-v1). T
6060

6161
## Features
6262

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

6565
- We prefetch everything to speed up your experience
6666

@@ -69,6 +69,7 @@ This is our second edition of [Ruby](https://github.com/ruby-network/ruby-v1). T
6969
- [Ultraviolet](https://github.com/titaniumnetwork-dev/ultraviolet)
7070
- [Dynamic Interception Proxy (DIP)](https://github.com/Dynamic-Interception-Proxy/DIP)
7171
- [Osana](https://github.com/nebulaservices/osana)
72+
- [aero](https://github.com/nebulaservices/aero) **NOTE: aero is unstable and may cause issues** (We currently use our own [fork](https://github.com/ruby-network/aero))
7273

7374
---
7475

index.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,17 @@ import dotenv from 'dotenv';
1414
import fs from 'fs';
1515
import auth from 'http-auth';
1616
dotenv.config();
17+
//getting environment vars
1718
const numCPUs = process.env.CPUS || os.cpus().length;
19+
let key = process.env.KEY || 'unlock';
20+
let url = process.env.URL || 'rubynetwork.tech';
21+
let user = process.env.USERNAME || 'ruby';
22+
let pass = process.env.PASSWORD || 'ruby';
23+
let disableKEY = process.env.KEYDISABLE || 'false';
1824
let educationWebsite = fs.readFileSync(join(__dirname, 'education/index.html'));
1925
let loadingPage = fs.readFileSync(join(__dirname, 'education/load.html'));
2026
const blacklisted: string[] = [];
27+
const disableyt: string[] = [];
2128
fs.readFile(join(__dirname, 'blocklists/ADS.txt'), (err, data) => {
2229
if (err) {
2330
console.error(err);
@@ -26,7 +33,6 @@ fs.readFile(join(__dirname, 'blocklists/ADS.txt'), (err, data) => {
2633
const lines = data.toString().split('\n');
2734
for (let i in lines) blacklisted.push(lines[i]);
2835
});
29-
3036
if (numCPUs > 0 && cluster.isPrimary) {
3137
console.log(`Primary ${process.pid} is running`);
3238
for (let i = 0; i < numCPUs; i++) {
@@ -52,12 +58,6 @@ if (numCPUs > 0 && cluster.isPrimary) {
5258
app.use(express.urlencoded({ extended: false }));
5359
//uv config
5460
app.use('/uv/', express.static(uvPath));
55-
//env vars for the unlock feature
56-
//analytics object
57-
let key = process.env.KEY || '';
58-
if (!key || key === undefined || key === null || key === '') {
59-
key = 'unlock';
60-
}
6161
const server = createServer();
6262
server.on('request', (req, res) => {
6363
//@ts-ignore
@@ -82,11 +82,13 @@ if (numCPUs > 0 && cluster.isPrimary) {
8282
res.end();
8383
return;
8484
}
85-
} else if (req.headers.host === 'rubynetwork.tech') {
85+
//@ts-ignore
86+
} else if (req.headers.host === url) {
8687
app(req, res);
8788
} else if (
8889
url.search === `?${key}` &&
89-
!req.headers.cookie?.includes(key)
90+
!req.headers.cookie?.includes(key) &&
91+
disableKEY === 'false'
9092
) {
9193
res.writeHead(302, {
9294
Location: '/',
@@ -168,8 +170,6 @@ if (numCPUs > 0 && cluster.isPrimary) {
168170
});
169171
app.post('/login-form', (req, res) => {
170172
let body = req.body;
171-
let user = process.env.USERNAME || 'ruby';
172-
let pass = process.env.PASSWORD || 'ruby';
173173
body = JSON.stringify(body);
174174
body = JSON.parse(body);
175175
if (body.username === user && body.password === pass) {

public/aero-sw.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import handle from './aero/handle.js';
2+
import './aero/init.js';
3+
4+
self.addEventListener('fetch', (event) => {
5+
if (event.request.url.startsWith(location.origin + '/go/'))
6+
event.respondWith(
7+
handle(event).catch(
8+
(err) => new Response(err.stack, { status: 500 })
9+
)
10+
);
11+
});

public/aero/.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[*]
2+
charset = utf-8
3+
insert_final_newline = false
4+
end_of_line = lf
5+
indent_style = tabs
6+
indent_size = 4

public/aero/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
config.js
2+
this/misc/bare/BareClient.js

public/aero/.prettierrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"useTabs": true,
3+
"arrowParens": "avoid"
4+
}

0 commit comments

Comments
 (0)