Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoryammilwalrus committed Nov 4, 2022
1 parent 5d019c6 commit 2b20a4e
Show file tree
Hide file tree
Showing 24 changed files with 641 additions and 355 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
node_modules
ssl/cert.*
ssl/key.*
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
</div>

<div align="center">
<h2>Get Started</h2>
<a>To get started, press one of the buttons below to deploy Incognito</a>
<br>
<br>
<a href="https://amethystnetwork-dev.github.io/utils/deploy/heroku?repo=Incognito"><img height="30px" src="https://img.shields.io/badge/heroku-%23430098.svg?style=for-the-badge&logo=heroku&logoColor=white"><img></a>
<a href="https://amethystnetwork-dev.github.io/utils/deploy/replit?repo=Incognito"><img height="30px" src="https://amethystnetwork-dev.github.io/assets/replit.svg"><img></a>
<a href="https://railway.app/new/template/TNmjSs?referralCode=8zUUBB?template=https://github.com/amethystnetwork-dev/Incognito"><img height="30px" src="https://img.shields.io/badge/Railway-%234f0599.svg?style=for-the-badge&logo=railway&logoColor=white"><img></a>
<h2>Get Started</h2>
<a>To get started, press one of the buttons below to deploy Incognito</a>
<br>
<br>
<a href="https://render.com/deploy?repo=https://github.com/amethystnetwork-dev/Incognito"><img height="30px" src="https://img.shields.io/badge/render-4f65f1.svg?style=for-the-badge&logo=render&logoColor=46e3b7"><img></a>
<a href="https://amethystnetwork-dev.github.io/utils/deploy/heroku?repo=Incognito"><img height="30px" src="https://img.shields.io/badge/heroku-%23430098.svg?style=for-the-badge&logo=heroku&logoColor=white"><img></a>
<a href="https://amethystnetwork-dev.github.io/utils/deploy/replit?repo=Incognito"><img height="30px" src="https://amethystnetwork-dev.github.io/assets/replit.svg"><img></a>
<a href="https://railway.app/new/template?template=https://github.com/amethystnetwork-dev/Incognito"><img height="30px" src="https://img.shields.io/badge/Railway-%234f0599.svg?style=for-the-badge&logo=railway&logoColor=white"><img></a>
<a href="https://app.koyeb.com/deploy?type=git&repository=github.com/amethystnetwork-dev/Incognito&branch=main&name=incognito"><img height="30px" src="https://img.shields.io/badge/koyeb-121212.svg?style=for-the-badge&logo=koyeb&logoColor=87fcc4"><img></a>
</div>

## Discord Server
Expand Down Expand Up @@ -63,7 +65,7 @@ This repo is for people that want a easy way to deploy Incognito to cloud hostin

**My question is not answered**

Because we can't answer every question here, you may want to check the [wiki](https://github.com/amethystnetwork-dev/Incognito/wiki). If you still have questions, you might want to join our Discord [#discord-server]((link)))
Because we can't answer every question here, you may want to check the [wiki](https://github.com/amethystnetwork-dev/Incognito/wiki). If you still have questions, you might want to join our Discord [#discord-server (link)](#discord-server)

## Credits

Expand Down
6 changes: 3 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Incognito",
"description": "Unofficial Incognito easy deployment version with TompHTTP bare server included.",
"repository": "https://github.com/IDontCodee/Incognito",
"logo": "https://github.com/IDontCodee/Incognito/blob/main/static/index.svg?raw=true",
"keywords": ["unoffical", "ultraviolet", "unblock", "titaniumnetwork", "bypass-filter"]
"repository": "https://github.com/amethystnetwork-dev/Incognito",
"logo": "https://github.com/amethystnetwork-dev/Incognito/blob/main/static/index.svg?raw=true",
"keywords": ["unoffical", "ultraviolet", "unblock", "titaniumnetwork", "bypass-filter", "amethystnetwork-dev"]
}
43 changes: 0 additions & 43 deletions index.js

This file was deleted.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"name": "Incognito",
"name": "incognito",
"version": "1.0.0",
"description": "Unofficial Incognito easy deployment version with TompHTTP bare server included.",
"type": "module",
"scripts": {
"start": "node index.js"
"start": "node src/index.js",
"install-webretro-linux": "chmod u+x ./src/webretro.sh && ./src/webretro.sh",
"install-webretro-win": "echo \"Error: not finshed\" && exit 1"
},
"files": ["static", ".gitignore", "app.json", ".replit", "replit.nix", "Procfile", "webretro.sh"],
"files": ["static", "src", ".gitignore", "app.json", ".replit", "replit.nix", "Procfile"],
"repository": {
"type": "git",
"url": "git+https://github.com/amethystnetwork-dev/Incognito"
},
"keywords": ["unoffical", "ultraviolet", "unblock", "titaniumnetwork", "bypass-filter"],
"keywords": ["unoffical", "ultraviolet", "unblock", "titaniumnetwork", "bypass-filter", "amethystnetwork-dev"],
"author": "",
"license": "GPL-3.0-or-later",
"dependencies": {
Expand Down
6 changes: 6 additions & 0 deletions render.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
- type: web
name: incognito
env: node
buildCommand: npm install
startCommand: npm start
2 changes: 1 addition & 1 deletion analytics.js → src/analytics.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import crypto from 'node:crypto'

export default function analytics(req, res, data) {
export default function(req, res, data) {
switch(req.url) {
case '/data/visit':
data.live++
Expand Down
52 changes: 52 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import createServer from '@tomphttp/bare-server-node';
import { fileURLToPath } from "url";
import https from "node:https";
import { readFileSync, existsSync } from "node:fs";
import serveStatic from "serve-static";
import analytics from './analytics.js';

// The following message MAY NOT be removed
console.log("Incognito\nThis program comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to redistribute it\nunder the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <https://www.gnu.org/licenses/>.\n");

var data = { live: 0, peak: 0, visits: 0 }
const bare = createServer("/bare/");
const serve = serveStatic(fileURLToPath(new URL("../static/", import.meta.url)), { fallthrough: false });
var ssl = {};
if(existsSync("../ssl/key.pem") && existsSync("../ssl/cert.pem")) ssl = {
key: readFileSync("../ssl/key.pem"),
cert: readFileSync("../ssl/cert.pem")
};

const server = https.createServer(ssl);

server.on("request", (req, res) => {
if(bare.shouldRoute(req)) bare.routeRequest(req, res); else {
if(req.url.startsWith("/data")) {
analytics(req, res, data)
} else {
serve(req, res, (err) => {
res.writeHead(err?.statusCode || 500, null, {
"Content-Type": "text/plain",
});
res.end('Error')
})
}}
});

server.on("upgrade", (req, socket, head) => {
if(bare.shouldRoute(req, socket, head)) bare.routeUpgrade(req, socket, head); else socket.end();
});

server.on('listening', () => {
const addr = server.address();

console.log(`Server running on port ${addr.port}`)
console.log('');
console.log('You can now view it in your browser.')
/* Code for listing IPS from website-aio */
console.log(`Local: http://${addr.family === 'IPv6' ? `[${addr.address}]` : addr.address}:${addr.port}`);
try { console.log(`On Your Network: http://${address.ip()}:${addr.port}`); } catch (err) {/* Can't find LAN interface */};
if(process.env.REPL_SLUG && process.env.REPL_OWNER) console.log(`Replit: https://${process.env.REPL_SLUG}.${process.env.REPL_OWNER}.repl.co`);
});

server.listen({ port: (process.env.PORT || 8080) })
File renamed without changes.
5 changes: 5 additions & 0 deletions ssl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SSL config

To enable SSL when using a provider that does not provide them, place your certificates in the SSL folder.

The certificate should be named `cert.pem` and the private key named `key.pem`
72 changes: 0 additions & 72 deletions static/blank.js

This file was deleted.

Binary file added static/css/Roboto-Italic.ttf
Binary file not shown.
Binary file added static/css/Roboto-Regular.ttf
Binary file not shown.
2 changes: 0 additions & 2 deletions static/css/appearance.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono&display=swap');

body {
--border-color: rgb(255, 255, 255, .2);
--text-color: #FFF;
Expand Down
37 changes: 31 additions & 6 deletions static/css/index.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
@import 'https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500&display=swap';
@import 'https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap';
@import 'appearance.css';
@import 'fa/fa.css';

@font-face {
font-family: 'material icons';
font-style: normal;
font-weight: 400;
src: url("./material.woff2") format('woff2');
}

@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
font-stretch: 100%;
src: url('./OpenSans-wght.ttf') format('truetype');
}

@font-face {
font-family: 'Ubuntu Mono';
font-style: normal;
Expand All @@ -29,8 +26,36 @@
font-weight: 400;
src: url('./UbuntuMono.ttf') format('truetype');
}


@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: url('./Roboto-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: italic;
font-weight: 300;
src: url('./Roboto-Italic.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: url('./Roboto-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: italic;
font-weight: 400;
src: url('./Roboto-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: url('./Roboto-Regular.ttf') format('truetype');
}

* {
box-sizing: border-box;
Expand Down
5 changes: 1 addition & 4 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
</script>
</head>
<body>
<script>
document.body.setAttribute('data-appearance', (localStorage.getItem('incog||appearance')))
</script>
<script>document.body.setAttribute('data-appearance', (localStorage.getItem('incog||appearance')))</script>
<header data-init>
<div class="search"></div>
<nav></nav>
Expand All @@ -73,7 +71,6 @@
<script src="uv/uv.bundle.js"></script>
<script src="uv/uv.config.js"></script>
<script src="script/index.js" type="module"></script>
<script src="blank.js"></script>
<!--
_____ _ _ _
| __ \ | | | | | |
Expand Down
Loading

0 comments on commit 2b20a4e

Please sign in to comment.