diff --git a/.gitignore b/.gitignore index 3091ee84..9aeaa78e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ node_modules -package-lock.json +.gitpod.yml .vscode .gitattributes +.well-known +package-lock.json diff --git a/.gitmodules b/.gitmodules index 083fb3c9..2c80b43c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,10 +2,6 @@ path = views/archive/g/house url = https://github.com/razh/game-off-2013 -[submodule "views/archive/gfiles"] - path = views/archive/gfiles - url = https://github.com/BinBashBanana/gfiles - [submodule "views/archive/g/househorror"] path = views/archive/g/househorror url = https://github.com/arturkot/the-house-game @@ -26,3 +22,6 @@ path = views/archive/g/nsshaft url = https://github.com/iPel/NS-SHAFT +[submodule "views/archive/g/adarkroom"] + path = views/archive/g/adarkroom + url = https://github.com/doublespeakgames/adarkroom diff --git a/README.md b/README.md index 3ab0fcee..b87b2f06 100644 --- a/README.md +++ b/README.md @@ -78,47 +78,49 @@ The default place for the proxy when it started is `http://localhost:8080`, but This website has been hosted locally on Alloy Proxy. For more information, head over to the Alloy Proxy repository below. ## Structure -- `index.html`: The official homepage of the site. -- `surf.html`: Web Proxies page, the page offers to be redirected to any proxies you would like to add. In this case, Alloy, Womginx, Powermouse, and Via Unblocker. -- `alloy.html`: Official Alloy Proxy page, which features Alloy hosted locally but can be configured to redirect to an external instance. -- `womginx.html`: Womginx Proxy page. Script links to a subdomain for Womginx, a highly fast proxy with captcha support. -- `pmprox.html`: SysYA Proxy page. Script links to a subdomain for SysYA Proxy, a flexible secondary proxy compared to Alloy with Discord support. -- `pydodge.html`: Via Unblocker page. Links to a subdomain with PyDodge or Via, a proxy which successes Node Unblocker -- `youtube.html`: An proxied version of Youtube running off of the locally hosted Alloy Proxy. -- `discordhub.html`: Hub for the Discord proxy and its links using a mixture of Alloy and Womginx. -- `gtools.html`: Games page, help from @BinBashBanana and @kinglalu. -- `flash.html`: Games page for flash games, credits are given to @BinBashBanana and Titanium Network for its assets. -- `emulators.html`: Emulator navigation page, hosted locally on Holy Unblocker. -- `bookmarklets.html`: Bookmarklets page to be worked on more in the future. -- `icons.html`: Information regarding Options Menu. -- `info.html`: Official Documentation page. -- `terms.html`: Terms of Services, AUP, and Privacy Policy page. -## Deprecated -Left all of these just if you would like to set up the site differently as surf.js can be used instead. -- `ythub.html`: Page linking proxied Youtube. -- `ytmobile.html`: Page linking to a proxied YouTube for mobile users -- `discordprox.html`: Links to a discord proxied through Alloy. -- `gba.html`: Locally hosted Gameboy Emulator. -- `chatbox.html`: Links to an externally hosted Chatbox. -- `krunker.html`: An iframe version of Krunker with keyword changes. It can be removed if not needed. +- `index.html` : The official homepage of the site. +- `404.html` : The 404 page. +- `error.html` : Other misc errors that are not 404. +- `info.html` : Documentation (This page!) +- `faq.html` : Frequently asked questions page. +- `status.html` : Has 3 backup Holy Unblocker links. +- `hidden.html` : Fake "Site not Found" page (unused) +- `frame.html` : Handles any pages under stealth. +- `surf.html` : Web Proxies page, page offers to be redirected to any proxies you would like to add. In this case Alloy, Womginx, SysYa and Via Unblocker. +- `credits.html` : List of all contributors to the site. +- `bookmarklets.html` : Bookmarklets page to be worked on more in the future. +- `icons.html` : Information regarding Settings Menu page. Added this in for standard users. +- `terms.html` : Terms of Services, AUP and Privacy Policy page. +- `gtools.html` : Games page, help from @BinBashBanana and @kinglalu. +- `games5.html` : HTML5 game navigation page. +- `emulators.html` : Emulator navigation page, using [webretro](https://github.com/BinBashBanana/webretro). +- `flash.html` : Games page for flash games, credits given to @BinBashBanana and Titanium Network for its assets. +- `alloy.html` : Official Alloy Proxy page which features Alloy hosted locally but can be configured to redirect to an external instance. +- `womginx.html` : Womginx Proxy page. Script links to a subdomain for Womginx, a highly fast proxy with reCaptcha and discord support. +- `pmprox.html` : SysYa Proxy page. Script links to a subdomain for SysYa, a flexible secondary proxy. +- `pydodge.html` : Via Unblocker page. Links to a subdomain with PyDodge or Via. +- `youtube.html` : An proxied version of Youtube running off of the locally hosted Alloy Proxy. +- `discordhub.html` : Hub for the Discord proxy (Currently Womginx only). ### Structure Information -- `/views/`: The physical site base of Holy Unblocker goes here where static assets are served. -- `/src/`: For future implementation of obfuscation and keyword removing features. -#### Details of /views/ +- `/views/` : The physical site base of Holy Unblocker goes here where static assets are served. +- `/src/` : For future implementation of obfuscation and keyword removing features. + +#### Details of `/views/` - `/pages/` is used for important pages for the site. - `/expr/` is used for important proxy scripts. - `/archive/` is used for game related assets and pages. -- `/assets/` is used for various assets for CSS, JS and Bootstrap. +- `/assets/` is used for various assets for CSS, JS and Bootstrap. - `/vibeOS/` is used for vibeOS, an in-browser OS enviroment. -#### Scripts located in /expr -- `surf.js` is used for proxy navigation, both Stealth mode and Classic mode. -- `h5-nav.js` is used for navigation on the games page, Stealth mode only. -- `surf-dev.js` is used for proxy navigation on the official sites. + +#### Scripts located in `/expr` +- `common.js` is used on all of the pages for common useful functions. +- `surf.js` is used for proxy navigation; both stealth mode and classic mode. +- `h5-nav.js`, `emu-nav.js`, `flash-nav.js` are used for navigation on the games pages. + ## Future Additions -- Expand the game library -- Go through various parity changes. -- Clean up the source a bit -A- dd more locally hosted proxies possibly. +- Expansive game library +- Various parity changes. + ## An explanation for Beginners With External Proxies and Hosting You will first want to host your proxies locally or externally. Note that an older version of Alloy proxy is the only proxy hosted locally with this distribution of Holy Unblocker. @@ -255,7 +257,7 @@ There are two methods for fixing this: - Reloading the page usually when the error above happens should load the video. - Alternatively, right-clicking the page and doing Reload Frame if you are using some form of Stealth Mode may work. -**When using Discord under Alloy or Powermouse, why does the page stay gray/white, or the QR code not loading? ** +**When using Discord under Alloy or SysYa, why does the page stay gray/white, or the QR code not loading? ** Womginx now supports logging in, usually for Discord. However, here are the steps related to Alloy troubleshooting. Note that this is for the older discord proxy steps with Alloy and SysYA Proxy. diff --git a/app.js b/app.js index ba848ca9..5275b1e4 100644 --- a/app.js +++ b/app.js @@ -1,240 +1,116 @@ /* ----------------------------------------------- -/* Author : QuiteAFancyEmerald, YÖCTDÖNALD'S and SexyDuceDuce with help from Divide -/* MIT license: http://opensource.org/licenses/MIT -/* ----------------------------------------------- */ -const [express, alloy, http, fs, path, char_insert] = [require('express'), require('./src/alloyproxy'), require('http'), require('fs'), require('path'), require('./src/charinsert.js')], [app, config] = [express(), JSON.parse(fs.readFileSync('./config.json', { encoding: 'utf8' }))], server = http.createServer(app), localprox = new alloy({ - prefix: '/fetch/', - error: (proxy) => { proxy.res.send(fs.readFileSync('./views/error.html', { encoding: 'utf8' }).replace('%ERR%', proxy.error.info.message.replace(//gi, '>'))); }, // Doing replace functions on "<" and ">" to prevent XSS. - request: [], - response: [], - injection: true -}); - -app.use(localprox.app); - -//Cloudflare Attack Mode Fix - -app.post('/', async(req, res) => res.send(fs.readFileSync(path.join(__dirname, 'views', 'index.html'), 'utf8'))); - -//Querystring Navigation - -app.get('/', async(req, res, t) => res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages,index.html,info.html,faq.html,status.html,archive,archive,hidden.html'.split(',')['/,/?in,/?faq,/?status,/?fg,/?rr,/?j'.split(',').indexOf(req.url) + 1], ',surf.html,f.html,run.html,frames,proxnav7,nav9'.replace(/,[^,]+/g, e => ([] + e.match(/\D+/)).repeat(+e.match(/\d+/) + 1)).split(',')[t = 'z,fg,rr,k,a,au,w,y,e,d,p,c,f,g,h,el,i,m,t,x'.split(',').indexOf(req.url.slice(2)) + 1], (t = ',,,,krunker,alloy,alloy,womginx,youtube,pydodge,discordhub,pmprox,credits,flash,gtools,games5,emulators,icons,gba,terms,bookm'.split(',')[t]) && t + '.html'), 'utf8'))); - -app.use(char_insert.static(path.join(__dirname, 'views'))); - -app.use(function(req, res) { - res.status(404, res.send(fs.readFileSync(path.join(__dirname, 'views', 'error.html'), 'utf8'))); -}); - -localprox.ws(server); - -server.listen(process.env.PORT || config.port); - - -/* -// Easier to read version of app.js. Remove this if you would like an optimized version - - const express = require('express'), - alloy = require('alloyproxy'), - app = express(), - http = require('http'), - fs = require('fs'), - path = require('path'), - char_insert = require('./src/charinsert.js'); - -const config = JSON.parse(fs.readFileSync('./config.json', { - encoding: 'utf8' -})); - -const server = http.createServer(app); - -//Local Alloy Proxy - -const localprox = new alloy({ - prefix: '/fetch/', - error: (proxy) => { return proxy.res.send(fs.readFileSync(path.join(__dirname, 'views', 'error.html'), 'utf8'));}, - request: [], - response: [], - injection: true -}); - -app.get('/', async (req, res) => { - - const path = require("path"); //Use this for path. - - fs.readFileSync( path, options ); - Use this for improved navigation. Massive help from MikeLime and Duce. - if (req.url == '/?querystringhere') { - return res.send(fs.readFileSync(path.resolve() + 'filepath', { - encoding: 'utf8' - })); - } - - - var hbsites = {}; - && hostname == hbsites - - - switch (req.url) { - case '/': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'index.html'), 'utf8')); - } - - switch (req.url) { - case '/?z': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'surf.html'), 'utf8')); - } - - switch (req.url) { - case '/?a': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'proxnav', 'alloy.html'), 'utf8')); - } - - switch (req.url) { - case '/?dd': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'redirects', 'discordprox.html'), 'utf8')); - } - - switch (req.url) { - case '/?b': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'proxnav', 'node.html'), 'utf8')); - } - - switch (req.url) { - case '/?y': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'proxnav', 'youtube.html'), 'utf8')); - } - - switch (req.url) { - case '/?e': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'proxnav', 'pydodge.html'), 'utf8')); - } - - switch (req.url) { - case '/?d': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'proxnav', 'discordhub.html'), 'utf8')); - } - - switch (req.url) { - case '/?c': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'nav', 'credits.html'), 'utf8')); - } - - switch (req.url) { - case '/?f': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'nav', 'flash.html'), 'utf8')); - } - - switch (req.url) { - case '/?g': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'nav', 'gtools.html'), 'utf8')); - } - - switch (req.url) { - case '/?h': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'nav', 'games5.html'), 'utf8')); - } - - switch (req.url) { - case '/?i': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'nav', 'icons.html'), 'utf8')); - } - - switch (req.url) { - case '/?in': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'info.html'), 'utf8')); - } - - switch (req.url) { - case '/?v': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'redirect.html'), 'utf8')); - } - - switch (req.url == '/?k') { - case '/?k': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'frames', 'krunker.html'), 'utf8')); - } - - switch (req.url) { - case '/?m': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'nav', 'gba.html'), 'utf8')); - } - - switch (req.url) { - case '/?n': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'redirects', 'chatbox.html'), 'utf8')); - } - - switch (req.url) { - case '/?update': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'update.html'), 'utf8')); - } - - switch (req.url) { - case '/?p': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'proxnav', 'pmprox.html'), 'utf8')); - } - - switch (req.url) { - case '/?t': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'nav', 'terms.html'), 'utf8')); - } - - switch (req.url) { - case '/?x': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'nav', 'bookmarklets.html'), 'utf8')); - } - - switch (req.url) { - case '/?yh': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'redirects', 'ythub.html'), 'utf8')); - } - - switch (req.url) { - case '/?ym': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'pages', 'redirects', 'ytmobile.html'), 'utf8')); - } - - switch (req.url) { - case '/?fg': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'archive', 'f.html'), 'utf8')); - } - - switch (req.url) { - case '/?rr': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'archive', 'run.html'), 'utf8')); - } - - - switch (req.url) { - case '/?j': - return res.send(fs.readFileSync(path.join(__dirname, 'views', 'hidden.html'), 'utf8')) - } - -}); */ - -/* No proxy hosted locally + * Authors: QuiteAFancyEmerald, YÖCTDÖNALD'S, SexyDuceDuce, BinBashBanana (OlyB) + * Additional help from Divide + * MIT license: http://opensource.org/licenses/MIT + * ----------------------------------------------- */ const - char_insert = require('./src/charinsert.js'), - path = require('path'), - config = require('./config.json'), - fs = require('fs'), - http = require('http'), - express = require('express'), - app = express(); + char_insert = require('./src/charinsert.js'), + alloy = require('./src/alloyproxy'), + path = require('path'), + config = require('./config.json'), + fs = require('fs'), + http = require('http'), + express = require('express'), + app = express(), + port = process.env.PORT || config.port; -var server = 'http://'; - -server = http.createServer(app); +let server = http.createServer(app); btoa = (str) => { - str = new Buffer.from(str).toString('base64'); - return str; -}; + return new Buffer.from(str).toString('base64'); +} atob = (str) => { - str = new Buffer.from(str, 'base64').toString('utf-8'); - return str; + return new Buffer.from(str, 'base64').toString('utf-8'); +} + +let text404 = fs.readFileSync(path.normalize(__dirname + '/views/404.html'), 'utf8'); + +// List of the querystring pages +let siteIndex = 'index.html'; + +let pages = { + // Main + 'in': 'info.html', + 'faq': 'faq.html', + 'status': 'status.html', + 'j': 'hidden.html', + + 's': 'pages/frame.html', + 'z': 'pages/surf.html', + + 'c': 'pages/nav/credits.html', + 'x': 'pages/nav/bookmarklets.html', + 'i': 'pages/nav/icons.html', + 't': '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', + + // Proxies + 'a': 'pages/proxnav/alloy.html', + 'w': 'pages/proxnav/womginx.html', + 'p': 'pages/proxnav/pmprox.html', + 'e': 'pages/proxnav/pydodge.html', + 'y': 'pages/proxnav/youtube.html', + 'd': 'pages/proxnav/discordhub.html', + + // Ruffle and Webretro + 'fg': 'archive/gfiles/flash/index.html', + 'eg': 'archive/gfiles/rarch/index.html' }; -*/ \ No newline at end of file +// List of random cooking-related strings to mess with web filters +var cookingInserts = [ + "Boost your confidence in the kitchen with our trusted tips, tricks and expert advice to master the basics and build upon your existing cooking skills and knowledge.", + "Methods Heat can transform the flavor and texture of ingredients. Browning meat and other ingredients, for example, involves complex chemical reactions. Fruits and vegetables contain sugars that caramelize when browned. The reaction in browning proteins, such as those in meat and poultry, is called the Maillard reaction after Louis Camille Maillard, the French chemist who discovered it. The Maillard reaction produces many new chemical compounds. These compounds give the food new flavors and aromas. The browned bits of food that stick to a pan are called fond, a French word meaning bottom. Many sauces make use of the rich, complex flavors of fond. Browning can only occur at temperatures above the boiling point of water, which is 212 °F (100 °C) at sea level. For this reason, moisture around the exterior of food must evaporate before the food can brown. Air and fat, as well as the metal surfaces of pans, can reach extremely high temperatures in browning. But cooking ingredients at high temperature for too long removes moisture, turning food dry and chewy. Skilled cooks will therefore carefully control both heat and moisture when cooking. Cooking with dry heat involves exposing food to hot air. As the air moves around the food’s surface, its heat is transferred to the cooler food. Roasting traditionally involved cooking large pieces of meat—or even a whole animal, such as a pig or a lamb—over an open fire. But today, roasting generally refers to cooking food in a hot oven. Roasting meat or vegetables in a high temperature oven—above 400 °F (205 °C)—causes the food to brown quickly. But high temperatures can also dry out food.", + "Cuisines Often, a certain combination of ingredients forms the foundation of a particular cuisine. For example, Cantonese cuisine, based in southern China, makes much use of scallions, garlic, and ginger. Greek dishes often include garlic, olive oil, and oregano. Cuisines are often based on locally available ingredients. In the coastal city of Boston, for example, traditional favorites include such seafood dishes as clam chowder and lobster. Many cuisines reflect the variety of cultures in an area. In Louisiana, for example, such dishes as gumbo (a spicy stew) combine African American, Native American, and French cooking traditions. Preparation of ingredients Many ingredients must be prepared before cooking. Some fruits and vegetables must be peeled. Cooks may remove the skin, bones, and fat from meat or the shells from seafood. Cooks may also cut ingredients in a variety of ways, including dicing (cutting into small cubes) and mincing (chopping extremely fine). The size of the pieces helps determine how fast they cook, as well as the texture of the finished dish. Many cooks season food with salt, spices, and herbs before cooking. Ingredients must be prepared with safety in mind. Fruits and vegetables should generally be rinsed to remove any residues from agricultural chemicals. In addition, raw meats may contain disease-causing organisms. Proper cooking usually kills such organisms. But anything the meat touches can also become contaminated. Cooks must thus be careful when handling raw meat. They can help prevent food-borne illness by using soap and hot water to wash their hands, along with any surface that has touched raw meat.", + "The key to good salmon is not overthinking it. Today, all we’re doing is rubbing the fillets with a little oil and sprinkling them with salt and pepper before popping them in the oven. Even thick fillets of salmon will cook very quickly so don’t wander too far from the oven. Aim for four to six minutes per half-inch of thickness. Since most fillets are about one inch thick in the thickest part, start checking around eight minutes. When the fish starts to flake easily with a fork and the flesh looks opaque, it’s time for dinner!", + "Rice is a staple in any kitchen, and with so many different types, it lends itself to a limitless number of recipes. Before you add the same type of rice to every recipe you prepare, however, think twice. Substituting one type of rice for another can really alter the result of a recipe. Each type of rice has its own taste, texture, and unique properties that work well with different cooking applications. So how do you know which one is the best type of rice to use? This guide examines factors that differentiate types of rice, from nutty basmati to fragrant jasmine and more!", + "Healthy oatmeal recipes I really enjoy the taste of plain oatmeal with simple brown sugar and nothing else. It’s my comfort zone. But I also like to vary up my oatmeal and use it as my base to enjoy some fresh fruit for the day. I like to have fun with some healthy oatmeal recipes that take the simple humble bowl of oats and make them an extraordinary superfood breakfast bowl. Here are 3 of my favorite recipes: Maple Brown Sugar: This is a classic flavor most oatmeal packets come in. But the homemade maple brown sugar is so much better. I make it with brown sugar, maple syrup, pecans and cinnamon. How to make oatmeal - maple brown sugar variation Banana Nut: This is another one of the classic oatmeal flavors that comes in a packet, so I love recreating it with actual fresh bananas (not the taste of bananas). I usually slice half a banana and add walnuts, ground flaxseeds and cinnamon. How to make oatmeal - banana nut variation Strawberry & Cream: This is such a dreamy yummy combination. Just add fresh sliced strawberries, a splash of half and half or coconut cream or any non-dairy creamer, along with some honey and a touch of vanilla extract.", + "Working one ball of dough at a time, take one ball of dough and flatten it with your hands on a lightly floured work surface. Starting at the center and working outwards, use your fingertips to press the dough to 1/2-inch thick. Turn and stretch the dough until it will not stretch further. Let the dough relax 5 minutes and then continue to stretch it until it reaches the desired diameter - 10 to 12 inches. Treat the dough gently! You can also hold up the edges of the dough with your fingers, letting the dough hang and stretch, while working around the edges of the dough. If a hole appears in your dough, place the dough on a floured surface and push the dough back together to seal the hole. Use your palm to flatten the edge of the dough where it is thicker. Pinch the edges if you want to form a lip.", + "Add the beef to a large skillet over medium-high heat. Break the meat apart with a wooden spoon. Add the chili powder, cumin, salt, oregano, garlic powder, and pepper to the meat. Stir well. Cook until the meat is cooked through, about 6-8 minutes, stirring occasionally. Reduce the heat to medium. Add the tomato sauce and water. Stir to combine. Cook, stirring occasionally, for 7-8 minutes, until some of the liquid evaporates but the meat mixture is still a little saucy. Remove from the heat. Warm the taco shells according to their package directions. Fill the taco shells with 2 heaping tablespoons of taco meat. Top with desired taco toppings: shredded cheese, shredded lettuce, chopped tomatoes, diced red onion, taco sauce, sour cream, guacamole, etc.", + "Warm and inviting, home cooking has resurfaced with all the kudos it deserves. Diana's menu reflects some of the most sought after recipes there are. They call it comfort food for a reason! Mac and Cheese with Butternut Squash, Chicken Pot Pie, Pork Ragu over Easy Creamy Polenta, Beef and Bacon Meatloaf with Garlic Mashed Potatoes, Boston Cream...", + "Sous Vide is a cooking method that came from a French term that means under pressure. In the process, food is sealed in an airtight bag made from plastic material. The food is then cooked in the water longer than the usual cooking time. This can be done in meats and vegetables through precisely regulated temperature, which is much lower than usually used for cooking. The temperature normally ranges from 120 deg to 160 deg depending of desired doneness. This method is intentionally done so that meats and vegetables are cooked evenly without overcooking the outside portion while keeping the food's inside portion properly done as well as keeping its juiciness. There are several ways how the Sous Vide method can be used in our property whether or not using a Sous Vide machine. The Sous Vide method is a practice that has been used in many fine-dining restaurants with famous chefs. However, this kind of cooking method is now being used for home cooking because available solutions are now increasing its availability in the market." +]; + +var vegetables = ['Beet', 'Radish', 'Potato', 'Yam', 'Carrot', 'Garlic', 'Onion', 'Asparagus', 'Rhubarb', 'Celery', 'Lettuce', 'Spinach', 'Kale', 'Cabbage', 'Arugula', 'Broccoli', 'Artichoke', 'Cauliflower', 'Tomato', 'Avocado', 'Pepper', 'Squash', 'Pumpkin', 'Zucchini']; + +function randomListItem(lis) { + return lis[Math.floor(Math.random() * lis.length)]; +} + +function insertCooking(str) { + return str.replace(//g, function() { return '
+ '; }); +} + +function tryReadFile(file) { + return fs.existsSync(file) ? fs.readFileSync(file, 'utf8') : text404; +} + +// Local alloy proxy +const localAlloy = new alloy({ + prefix: '/fetch/', + error: (proxy) => { proxy.res.send(tryReadFile(path.normalize(__dirname + '/views/error.html')).replace('%ERR%', proxy.error.info.message.replace(/<|>/g, ''))); }, // Doing replace functions on "<" and ">" to prevent XSS. + request: [], + response: [], + injection: true +}); +app.use(localAlloy.app); +localAlloy.ws(server); + +// Querystring navigation +app.get('/', async(req, res) => res.send(insertCooking(tryReadFile(path.normalize(__dirname + '/views/' + (['/', '/?'].includes(req.url) ? siteIndex : pages[Object.keys(req.query)[0]])))))); + +// Static files served +app.use(char_insert.static(path.normalize(__dirname + '/views'))); + +// 404 Page +app.use((req, res) => res.status(404, res.send(insertCooking(text404)))); + +// Start +server.listen(port); +console.log('Listening on port ' + port + '!'); diff --git a/package.json b/package.json index 24ab713a..08283f47 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,23 @@ { - "name": "holyub", - "version": "4.5.0", - "repository": "https://github.com/QuiteAFancyEmerald/HolyUnblockerPublic", - "description": "A pretty fancy website.", - "main": "app.js", - "scripts": { - "test": "node app.js", - "start": "node app.js" - }, - "keywords": [ - "proxy", - "node.js", - "unblocker" - ], - "author": "Titanium Network", - "license": "MIT", - "dependencies": { - "ws": "^7.4.3", - "cookie-parser": "^1.4.5", - "express": "^4.17.1", - "express-session": "^1.17.1", - "mime-types": "^2.1.27", - "xss": "^1.0.8" - } + "name": "holyub", + "version": "4.5.0", + "repository": "https://github.com/QuiteAFancyEmerald/HolyUnblockerPublic", + "description": "A pretty fancy website.", + "main": "app.js", + "scripts": { + "start": "node app.js" + }, + "keywords": [ + "proxy", + "node.js", + "unblocker" + ], + "author": "Titanium Network", + "license": "MIT", + "dependencies": { + "express": "^4.17.1", + "express-session": "^1.17.1", + "mime-types": "^2.1.27", + "pm2": "^4.5.5" + } } diff --git a/views/404.html b/views/404.html new file mode 100644 index 00000000..2520cfb2 --- /dev/null +++ b/views/404.html @@ -0,0 +1,65 @@ + + + +