Skip to content

Commit

Permalink
Search Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoryammilwalrus committed Feb 1, 2024
1 parent 61b70f3 commit 4b23dfb
Show file tree
Hide file tree
Showing 24 changed files with 395 additions and 73 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
ssl/cert.*
ssl/key.*
ssl/key.*
.tmp
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,10 @@ You CANNOT deploy to Vercel, Netifly, GitHub Pages, or Cloudflare pages. [Read m
<a href="https://amethystnetwork-dev.github.io/docs/projects/incognito/manual-deployment/#terminal-with-deno"><img src="https://img.shields.io/badge/deno%20js-000000?style=for-the-badge&logo=deno&logoColor=white" alt="Deno JS"></img></a>
<a href="https://amethystnetwork-dev.github.io/docs/projects/incognito/manual-deployment/#terminal-with-nodejs"><img src="https://img.shields.io/badge/terminal-%23121011.svg?style=for-the-badge&logo=gnu-bash&logoColor=white" alt="Terminal"></img></a>
<a href="https://amethystnetwork-dev.github.io/docs/projects/incognito/manual-deployment/#docker-with-nodejs"><img src="https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white" alt="Docker"></img></a>
<br>
<br>
<a href="https://alienhub.xyz/?utm_source=incog_gh&utm_medium=amethystnetwork">
<img src="https://alienhub.xyz/alien1.gif" width="450" height="150"></img>
</a>
</div>

## Discord Server

Press the join button to join the server:

[![Join us on Discord](https://invidget.switchblade.xyz/985982201302769765?theme=light)](https://amethystnetwork-dev.github.io/discord/invite)

## Overview
Expand Down Expand Up @@ -82,10 +75,6 @@ This repo is for people that want an easy way to deploy Incognito to cloud hosti

They are located in [another repo](https://github.com/amethystnetwork-dev/Incognito-gfiles) because of the large file sizes.

**X website is not working?**

Proxies can have issues, like websites not working, websites blocking the proxy or data being locked to that website. [AlienHub](https://alienhub.xyz/?utm_medium=amethystnetwork) fixes these issues and more!

**What proxies are used?**

Incognito uses [Ultraviolet](https://github.com/titaniumnetwork-dev/Ultraviolet) as its only proxy.
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"type": "module",
"scripts": {
"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"
"install-webretro-linux": "chmod u+x ./src/webretro.sh && ./src/webretro.sh"
},
"files": [
"static",
Expand Down
17 changes: 17 additions & 0 deletions src/analytics.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Incognito
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import crypto from "node:crypto";
import bodyParser from "body-parser";
import { METHODS } from "node:http";
Expand Down
29 changes: 27 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Incognito
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import { createBareServer } from "@tomphttp/bare-server-node";
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
import { gamesPath } from "@amethystnetwork-dev/incognito-gfiles";
Expand All @@ -13,8 +30,16 @@ import serveIndex from "serve-index";
import connect from "connect";
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");
console.log(`Incognito
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
You should have received a copy of the GNU General Public License\
along with this program. If not, see <https://www.gnu.org/licenses/>.
`);

const app = connect();
const bare = createBareServer("/bare/");
Expand Down
2 changes: 1 addition & 1 deletion ssl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ To enable SSL when using a provider that does not provide them, place your certi

The certificate should be named `cert.pem` and the private key named `key.pem`.

When SSL is enabled port 443 will be used instead of 8080.
When SSL is enabled port 443 will be used by default.
17 changes: 17 additions & 0 deletions static/css/appearance.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Incognito
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

body {
--border-color: rgb(255, 255, 255, .2);
--text-color: #FFF;
Expand Down
17 changes: 17 additions & 0 deletions static/css/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Incognito
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

@import 'appearance.css';
@import 'fa/fa.css';

Expand Down
1 change: 1 addition & 0 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<!--
Incognito
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down
14 changes: 4 additions & 10 deletions static/load.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<!--
Incognito
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down Expand Up @@ -84,21 +85,14 @@
responded to.
</p>
</div>
<script>
const engines = {
google: 'https://google.com/search?q=%s',
ddg: 'https://duckduckgo.com/?q=%s',
bing: 'https://bing.com/search?q=%s',
brave: 'https://search.brave.com/search?q=%s',
startpage: 'https://www.startpage.com/sp/search?query=%s'
};
<script type="module">
import { searchProviders } from "./script/search.js";
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistration("./uv.sw-handler.js").then(async worker => {
if(!worker) await navigator.serviceWorker.register('./uv.sw-handler.js', { scope: __uv$config.prefix });
let url = atob(decodeURIComponent(window.location.hash.slice(1)));
let search = engines[localStorage.getItem('incog||search') || 'google'];
let search = searchProviders[localStorage.getItem('incog||search') || 'google'].frontend;
if (url) {
console.log(search, url);
if (!isUrl(url)) url = search.replace('%s', url);
else if (!(url.startsWith('https://') || url.startsWith('http://'))) { url = 'http://' + url; };
} else { url = new URL(search).origin }
Expand Down
17 changes: 17 additions & 0 deletions static/script/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Incognito
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*
_____ _ _ _
| __ \ | | | | | |
Expand Down
17 changes: 17 additions & 0 deletions static/script/apps.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Incognito
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*
_____ _ _ _
| __ \ | | | | | |
Expand Down
31 changes: 27 additions & 4 deletions static/script/community.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Incognito
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*
_____ _ _ _
| __ \ | | | | | |
Expand All @@ -16,23 +33,29 @@
__/ |
|___/
*/

var invite_code;
async function community(app) {
app.search.title.style.display = 'block';
app.search.title.textContent = 'Community';
app.search.input.style.display = 'none';

const res = await app.bare.fetch("https://cdn.jsdelivr.net/gh/amethystnetwork-dev/.github/meta/discord.json");
const json = await res.json();
if(!invite_code) {
const res = await app.bare.fetch('https://cdn.jsdelivr.net/gh/amethystnetwork-dev/.github/meta/discord.json');
const json = await res.json();
invite_code = json.invite_code;
}

app.main.support = app.createElement(
'div',
[
app.createElement('section', [
app.createElement('p', `You are being taken to the Amethyst Network discord server (discord.gg/${json.invite_code}).`, {
app.createElement('p', `You are being taken to the Amethyst Network discord server (discord.gg/${invite_code}).`, {
style: {
'margin-bottom': '0'
}
}),
app.createElement('p', `Are you sure you want to <a href="https://discord.gg/${json.invite_code}">proceed</a>?`, {
app.createElement('p', `Are you sure you want to <a href="https://discord.gg/${invite_code}">proceed</a>?`, {
style: {
'margin-bottom': '0'
}
Expand Down
17 changes: 17 additions & 0 deletions static/script/component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Incognito
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*
_____ _ _ _
| __ \ | | | | | |
Expand Down
17 changes: 17 additions & 0 deletions static/script/gs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Incognito
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*
_____ _ _ _
| __ \ | | | | | |
Expand Down
Loading

0 comments on commit 4b23dfb

Please sign in to comment.