Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
QuiteAFancyEmerald committed Jul 8, 2024
1 parent e2fd72b commit 0cb7f38
Show file tree
Hide file tree
Showing 35 changed files with 1,711 additions and 1,047 deletions.
22 changes: 16 additions & 6 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"name": "Holy Unblocker v5.5",
"description": "Holy Unblocker is a secure web proxy service supporting numerous sites while concentrating on detail with design, mechanics, and features. Bypass web filters regardless of whether it is an extension or network-based.",
"repository": "https://github.com/titaniumnetwork-dev/Holy-Unblocker",
"logo": "https://raw.githubusercontent.com/titaniumnetwork-dev/Holy-Unblocker/master/views/assets/img/icon.png",
"keywords": ["holyunblocker", "womginx", "corrosion", "titaniumnetwork", "node", "proxy", "unblocker", "webproxy", "games"]
}
"name": "Holy Unblocker v5.5",
"description": "Holy Unblocker is a secure web proxy service supporting numerous sites while concentrating on detail with design, mechanics, and features. Bypass web filters regardless of whether it is an extension or network-based.",
"repository": "https://github.com/titaniumnetwork-dev/Holy-Unblocker",
"logo": "https://raw.githubusercontent.com/titaniumnetwork-dev/Holy-Unblocker/master/views/assets/img/icon.png",
"keywords": [
"holyunblocker",
"womginx",
"corrosion",
"titaniumnetwork",
"node",
"proxy",
"unblocker",
"webproxy",
"games"
]
}
7 changes: 3 additions & 4 deletions backend.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
(async() => {
await
import ('./src/server.mjs');
})();
(async () => {
await import("./src/server.mjs");
})();
44 changes: 23 additions & 21 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
module.exports = {
apps: [{
name: 'HolyUB',
script: './backend.js',
env: {
PORT: 8078,
NODE_ENV: "development",
},
env_production: {
PORT: 8078,
NODE_ENV: "production",
},
instances: "1",
exec_interpreter: "babel-node",
exec_mode: "fork",
autorestart: true,
exp_backoff_restart_delay: 100,
cron_restart: "*/10 * * * *",
kill_timeout: 3000,
watch: false
}]
};
apps: [
{
name: "HolyUB",
script: "./backend.js",
env: {
PORT: 8078,
NODE_ENV: "development",
},
env_production: {
PORT: 8078,
NODE_ENV: "production",
},
instances: "1",
exec_interpreter: "babel-node",
exec_mode: "fork",
autorestart: true,
exp_backoff_restart_delay: 100,
cron_restart: "*/10 * * * *",
kill_timeout: 3000,
watch: false,
},
],
};
17 changes: 7 additions & 10 deletions src/config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"title": "HU LTS",
"port": "8080",
"ssl": false,
"ws": true,
"prefix": "/service/",
"codec": "xor",
"blacklist": [
"accounts.google.com",
"dcounter.space"
]
"title": "HU LTS",
"port": "8080",
"ssl": false,
"ws": true,
"prefix": "/service/",
"codec": "xor",
"blacklist": ["accounts.google.com", "dcounter.space"]
}
34 changes: 20 additions & 14 deletions src/data.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{
"chars": [
"­", "​", "­"
],
"keywords": [
"Example1", "Example2", "Example3", "Example4", "Example5", "Example6", "Example7", "Example8", "Example9"
],
"content": [
"Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1",
"Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2"
],
"splash": [
"This version is the public LTS build of the web proxy service project and may be hosted unofficially. Check your domain or jo‌&#173;in t‌he <a id='tnlink' target='_blank'>T⁡&#173;N Di‌s&#173;co⁡&#173;rd</a> for official pr&#173;iva️te sit‌e lin&#173;ks for your safety."
]
}
"chars": ["&#173;", "&#8203;", "&shy;"],
"keywords": [
"Example1",
"Example2",
"Example3",
"Example4",
"Example5",
"Example6",
"Example7",
"Example8",
"Example9"
],
"content": [
"Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1Example1",
"Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2Example2"
],
"splash": [
"This version is the public LTS build of the web proxy service project and may be hosted unofficially. Check your domain or jo‌&#173;in t‌he <a id='tnlink' target='_blank'>T⁡&#173;N Di‌s&#173;co⁡&#173;rd</a> for official pr&#173;iva️te sit‌e lin&#173;ks for your safety."
]
}
102 changes: 49 additions & 53 deletions src/randomization.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import pkg from './routes.mjs';
import { existsSync, readFileSync } from 'fs';
const { cookingInserts, vegetables, charRandom, splashRandom, cacheBustList, text404 } = pkg;
import pkg from "./routes.mjs";
import { existsSync, readFileSync } from "fs";
const {
cookingInserts,
vegetables,
charRandom,
splashRandom,
cacheBustList,
text404,
} = pkg;
export { insertText, paintSource, tryReadFile };

/*
Expand All @@ -11,62 +18,51 @@ export { insertText, paintSource, tryReadFile };
// stringOrFunctionToGenerateNewText);
*/
const insertText = (lis, str, newText) => {
let position;

// The lis argument should be a list of strings containing placeholders.
// Ensure lis is formatted as a list, and loop through each of the
// placeholder strings.
for (let placeholder of [].concat(lis)) {
// Find all matches of a placeholder string and insert new text there.
while ((position = str.indexOf(placeholder)) >= 0)
str = str.slice(0, position)
+ (typeof newText == 'function' ? newText() : newText)
+ str.slice(position + placeholder.length);
}
return str;
let position;

// The lis argument should be a list of strings containing placeholders.
// Ensure lis is formatted as a list, and loop through each of the
// placeholder strings.
for (let placeholder of [].concat(lis)) {
// Find all matches of a placeholder string and insert new text there.
while ((position = str.indexOf(placeholder)) >= 0)
str =
str.slice(0, position) +
(typeof newText == "function" ? newText() : newText) +
str.slice(position + placeholder.length);
}
return str;
};



// Below are lots of function definitions used to obfuscate the website.
// This makes the website harder to properly categorize, as its source code
// changes with each time it is loaded.
const randomListItem = lis => () => lis[Math.random() * lis.length | 0],

charset = ['&#173;', '&#8203;', '&shy;', '<wbr>'],
getRandomChar = randomListItem(charRandom),
insertCharset = str => insertText(
charset,
str,
getRandomChar
),

getRandomSplash = randomListItem(splashRandom),
hutaoInsert = str => insertText(
'<!--HUTAOWOA-->',
str,
getRandomSplash
),

getCookingText = () => `<span style="display:none" data-fact="${randomListItem(vegetables)()}">${randomListItem(cookingInserts)()}</span>`,
insertCooking = str => insertText(
'<!-- IMPORTANT-HUTAOCOOKINGINSERT-DONOTDELETE -->',
str,
getCookingText
),

// This one isn't for obfuscation; it's just for dealing with cache issues.
cacheBusting = str => {
const randomListItem = (lis) => () => lis[(Math.random() * lis.length) | 0],
charset = ["&#173;", "&#8203;", "&shy;", "<wbr>"],
getRandomChar = randomListItem(charRandom),
insertCharset = (str) => insertText(charset, str, getRandomChar),
getRandomSplash = randomListItem(splashRandom),
hutaoInsert = (str) => insertText("<!--HUTAOWOA-->", str, getRandomSplash),
getCookingText = () =>
`<span style="display:none" data-fact="${randomListItem(vegetables)()}">${randomListItem(cookingInserts)()}</span>`,
insertCooking = (str) =>
insertText(
"<!-- IMPORTANT-HUTAOCOOKINGINSERT-DONOTDELETE -->",
str,
getCookingText
),
// This one isn't for obfuscation; it's just for dealing with cache issues.
cacheBusting = (str) => {
for (let item of Object.entries(cacheBustList))
str = insertText(item[0], str, item[1]);
str = insertText(item[0], str, item[1]);
return str;
},

// Applies the final obfuscation changes to an entire file.
paintSource = str => insertCharset(hutaoInsert(insertCooking(cacheBusting(str)))),

// Grabs the text content of a file.
tryReadFile = file => existsSync(file) ? readFileSync(file, 'utf8') : text404;
},
// Applies the final obfuscation changes to an entire file.
paintSource = (str) =>
insertCharset(hutaoInsert(insertCooking(cacheBusting(str)))),
// Grabs the text content of a file.
tryReadFile = (file) =>
existsSync(file) ? readFileSync(file, "utf8") : text404;

/*
// All of this is now old code.
Expand Down Expand Up @@ -105,4 +101,4 @@ export function tryReadFile(file) {
return existsSync(file) ? readFileSync(file, 'utf8') : text404;
}
*/
*/
85 changes: 48 additions & 37 deletions src/routes.mjs
Original file line number Diff line number Diff line change
@@ -1,51 +1,62 @@
import { readFileSync } from 'fs';
import path from 'path';
import { readFile } from 'fs/promises';
import { readFileSync } from "fs";
import path from "path";
import { readFile } from "fs/promises";


const insert = JSON.parse(await readFile(new URL('./data.json',
import.meta.url)));
const insert = JSON.parse(
await readFile(new URL("./data.json", import.meta.url))
);

const __dirname = path.resolve();

const text404 = readFileSync(path.normalize(__dirname + '/views/error.html'), 'utf8');
const text404 = readFileSync(
path.normalize(__dirname + "/views/error.html"),
"utf8"
);
const pages = {
'index': 'index.html',
/* Main */
'documentation': 'docs.html',
'faq': 'faq.html',
's': 'pages/frame.html',
'browse': 'pages/surf.html',
'credits': 'pages/nav/credits.html',
'x': 'pages/nav/bookmarklets.html',
'terms': 'pages/nav/terms.html',
/* Games */
'g': 'pages/nav/gtools.html',
'h': 'pages/nav/games5.html',
'el': 'pages/nav/emulators.html',
'f': 'pages/nav/flash.html',
'm': 'pages/nav/emulibrary.html',
/* Proxies */
'q': 'pages/proxnav/ultraviolet.html',
'rh': 'pages/proxnav/rammerhead.html',
/* Proxy Presets */
'y': 'pages/proxnav/preset/youtube.html',
'apps': 'pages/proxnav/preset/applications.html',
/* Misc */
'fg': 'archive/gfiles/flash/index.html',
'eg': 'archive/gfiles/rarch/index.html',
'vos': 'archive/vibeOS/index.html'
index: "index.html",
/* Main */
documentation: "docs.html",
faq: "faq.html",
s: "pages/frame.html",
browse: "pages/surf.html",
credits: "pages/nav/credits.html",
x: "pages/nav/bookmarklets.html",
terms: "pages/nav/terms.html",
/* Games */
g: "pages/nav/gtools.html",
h: "pages/nav/games5.html",
el: "pages/nav/emulators.html",
f: "pages/nav/flash.html",
m: "pages/nav/emulibrary.html",
/* Proxies */
q: "pages/proxnav/ultraviolet.html",
rh: "pages/proxnav/rammerhead.html",
/* Proxy Presets */
y: "pages/proxnav/preset/youtube.html",
apps: "pages/proxnav/preset/applications.html",
/* Misc */
fg: "archive/gfiles/flash/index.html",
eg: "archive/gfiles/rarch/index.html",
vos: "archive/vibeOS/index.html",
};

const cookingInserts = insert.content;
const vegetables = insert.keywords;
const charRandom = insert.chars;
const splashRandom = insert.splash;
const cacheBustList = {
"styles.css": "styles-1644738239.css",
"h5-nav.js": "h5-nav-1644738239.js",
"common.js": "common-16451543478.js",
"links.js": "links-1644738239.js"
"styles.css": "styles-1644738239.css",
"h5-nav.js": "h5-nav-1644738239.js",
"common.js": "common-16451543478.js",
"links.js": "links-1644738239.js",
};

export default { pages, text404, cookingInserts, vegetables, charRandom, splashRandom, cacheBustList };
export default {
pages,
text404,
cookingInserts,
vegetables,
charRandom,
splashRandom,
cacheBustList,
};
Loading

0 comments on commit 0cb7f38

Please sign in to comment.