From 9868c6c7a5e8e12e111472d332184fc701bc9b74 Mon Sep 17 00:00:00 2001 From: ngn Date: Sun, 19 Jan 2025 07:15:56 +0300 Subject: [PATCH] get rid of the api all together Signed-off-by: ngn --- src/ami4get.php | 4 +- src/api/index.php | 10 - src/api/v1/ac.php | 243 --------------- src/api/v1/index.php | 10 - src/data/config.php | 42 +-- src/opensearch.php | 13 +- src/static/client.js | 576 ++++++++++-------------------------- src/static/themes/black.css | 20 ++ src/template/about.html | 77 ----- src/template/donate.html | 20 -- src/template/home.html | 14 +- src/template/instances.html | 37 --- 12 files changed, 205 insertions(+), 861 deletions(-) delete mode 100644 src/api/index.php delete mode 100644 src/api/v1/ac.php delete mode 100644 src/api/v1/index.php create mode 100644 src/static/themes/black.css delete mode 100644 src/template/about.html delete mode 100644 src/template/donate.html delete mode 100644 src/template/instances.html diff --git a/src/ami4get.php b/src/ami4get.php index 5bb9273..c5f4202 100644 --- a/src/ami4get.php +++ b/src/ami4get.php @@ -18,10 +18,10 @@ echo json_encode( "bot_protection" => config::BOT_PROTECTION, "real_requests" => $real_requests === false ? 0 : $real_requests, "bot_requests" => $bot_requests === false ? 0 : $bot_requests, - "api_enabled" => config::API_ENABLED, + "api_enabled" => false, "alt_addresses" => config::ALT_ADDRESSES, "version" => config::VERSION ], - "instances" => config::INSTANCES + "instances" => [] ] ); diff --git a/src/api/index.php b/src/api/index.php deleted file mode 100644 index dae86ab..0000000 --- a/src/api/index.php +++ /dev/null @@ -1,10 +0,0 @@ - "Unknown endpoint" - ] -); diff --git a/src/api/v1/ac.php b/src/api/v1/ac.php deleted file mode 100644 index 50d3095..0000000 --- a/src/api/v1/ac.php +++ /dev/null @@ -1,243 +0,0 @@ -scrapers = [ - "brave" => "https://search.brave.com/api/suggest?q={searchTerms}", - "ddg" => "https://duckduckgo.com/ac/?q={searchTerms}&type=list", - "yandex" => "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}&uil=en&v=3&sn=5&lr=21276&yu=4861394161661655015", - "google" => "https://www.google.com/complete/search?client=mobile-gws-lite&q={searchTerms}", - "qwant" => "https://api.qwant.com/v3/suggest/?q={searchTerms}&client=opensearch", - "yep" => "https://api.yep.com/ac/?query={searchTerms}", - "marginalia" => "https://search.marginalia.nu/suggest/?partial={searchTerms}", - "yt" => "https://suggestqueries-clients6.youtube.com/complete/search?client=youtube&q={searchTerms}", - "sc" => "", - "startpage" => "https://www.startpage.com/suggestions?q={searchTerms}&format=opensearch&segment=startpage.defaultffx&lui=english", - "kagi" => "https://kagi.com/api/autosuggest?q={searchTerms}", - "ghostery" => "https://ghosterysearch.com/suggest?q={searchTerms}" - ]; - - /* - Sanitize input - */ - if(!isset($_GET["s"])){ - - $this->do404("Missing search(s) parameter"); - } - - if(is_string($_GET["s"]) === false){ - - $this->do404("Invalid search(s) parameter"); - } - - if(strlen($_GET["s"]) > 500){ - - $this->do404("Search(s) exceeds the 500 char length"); - } - - /* - Get $scraper - */ - if(!isset($_GET["scraper"])){ - - if(isset($_COOKIE["scraper_ac"])){ - - $scraper = $_COOKIE["scraper_ac"]; - }else{ - - $scraper = "brave"; // default option - } - }else{ - - $scraper = $_GET["scraper"]; - } - - if($scraper == "disabled"){ - - // this shouldnt happen, but let's handle it anyways - $this->doempty(); - } - - // make sure it exists - if(!isset($this->scrapers[$scraper])){ - - $scraper = "brave"; // default option - } - - // return results - switch($scraper){ - - case "google": - case "yt": - // handle google cause they want to be a special snowflake :( - $js = $this->get($this->scrapers[$scraper], $_GET["s"]); - - preg_match( - '/\((\[.*\])\)/', - $js, - $js - ); - - if(!isset($js[1])){ - - $this->doempty(); - } - - $js = json_decode($js[1]); - $json = []; - - foreach($js[1] as $item){ - - $json[] = htmlspecialchars_decode(strip_tags($item[0])); - } - - echo json_encode( - [ - $_GET["s"], - $json - ], - JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_IGNORE - ); - break; - - case "sc": - // soundcloud - chdir("../../"); - include "scraper/sc.php"; - $sc = new sc(); - - $token = $sc->get_token("raw_ip::::"); - - $js = $this->get( - "https://api-v2.soundcloud.com/search/queries?q={searchTerms}&client_id=" . $token . "&limit=10&offset=0&linked_partitioning=1&app_version=1693487844&app_locale=en", - $_GET["s"] - ); - - $js = json_decode($js, true); - - if(!isset($js["collection"])){ - - $this->doempty(); - } - - $json = []; - foreach($js["collection"] as $item){ - - $json[] = $item["query"]; - } - - echo json_encode( - [ - $_GET["s"], - $json - ], - JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_IGNORE - ); - break; - - case "marginalia": - $json = $this->get($this->scrapers[$scraper], $_GET["s"]); - - $json = json_decode($json, true); - if($json === null){ - - - $this->doempty(); - } - - echo json_encode( - [ - $_GET["s"], - $json - ], - JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_IGNORE - ); - break; - - default: - // if it respects the openSearch protocol - $json = json_decode($this->get($this->scrapers[$scraper], $_GET["s"]), true); - - echo json_encode( - [ - $_GET["s"], - $json[1] // ensure it contains valid key 0 - ], - JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_IGNORE - ); - break; - } - } - - private function get($url, $query){ - - try{ - $curlproc = curl_init(); - - $url = str_replace("{searchTerms}", urlencode($query), $url); - - curl_setopt($curlproc, CURLOPT_URL, $url); - - curl_setopt($curlproc, CURLOPT_ENCODING, ""); // default encoding - curl_setopt($curlproc, CURLOPT_HTTPHEADER, - ["User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0", - "Accept: application/json, text/javascript, */*; q=0.01", - "Accept-Language: en-US,en;q=0.5", - "Accept-Encoding: gzip", - "DNT: 1", - "Connection: keep-alive", - "Sec-Fetch-Dest: empty", - "Sec-Fetch-Mode: cors", - "Sec-Fetch-Site: same-site"] - ); - - curl_setopt($curlproc, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curlproc, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($curlproc, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curlproc, CURLOPT_CONNECTTIMEOUT, 30); - curl_setopt($curlproc, CURLOPT_TIMEOUT, 30); - - $data = curl_exec($curlproc); - - if(curl_errno($curlproc)){ - - throw new Exception(curl_error($curlproc)); - } - - curl_close($curlproc); - return $data; - - }catch(Exception $error){ - - do404("Curl error: " . $error->getMessage()); - } - } - - private function do404($error){ - - echo json_encode( - ["error" => $error], - JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_IGNORE - ); - die(); - } - - private function doempty(){ - - echo json_encode( - [ - $_GET["s"], - [] - ], - JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_IGNORE - ); - die(); - } -} diff --git a/src/api/v1/index.php b/src/api/v1/index.php deleted file mode 100644 index dae86ab..0000000 --- a/src/api/v1/index.php +++ /dev/null @@ -1,10 +0,0 @@ - "Unknown endpoint" - ] -); diff --git a/src/data/config.php b/src/data/config.php index 46b83e5..a5ac0a4 100644 --- a/src/data/config.php +++ b/src/data/config.php @@ -3,34 +3,34 @@ class config{ // Welcome to the 4get configuration file // When updating your instance, please make sure this file isn't missing // any parameters. - + // 4get version. Please keep this updated const VERSION = 8; - + // Will be shown pretty much everywhere. const SERVER_NAME = "4get"; - + // Will be shown in tag on home page const SERVER_SHORT_DESCRIPTION = "4get is a proxy search engine that doesn't suck."; - + // Will be shown in server list ping (null for no description) const SERVER_LONG_DESCRIPTION = null; - + // Add your own themes in "static/themes". Set to "Dark" for default theme. // Eg. To use "static/themes/Cream.css", specify "Cream". - const DEFAULT_THEME = "Dark"; - + const DEFAULT_THEME = "black"; + // Enable the API? const API_ENABLED = true; - + // // BOT PROTECTION // - + // 0 = disabled, 1 = ask for image captcha, @TODO: 2 = invite only (users needs a pass) // VERY useful against a targetted attack const BOT_PROTECTION = 0; - + // if BOT_PROTECTION is set to 1, specify the available datasets here // images should be named from 1.png to X.png, and be 100x100 in size // Eg. data/captcha/birds/1.png up to 2263.png @@ -40,11 +40,11 @@ class config{ //["fumo_plushies", 1006], //["minecraft", 848] ]; - + // If this regex expression matches on the user agent, it blocks the request // Not useful at all against a targetted attack const HEADER_REGEX = '/bot|wget|curl|python-requests|scrapy|go-http-client|ruby|yahoo|spider|qwant/i'; - + // Block clients who present any of the following headers in their request (SPECIFY IN !!lowercase!!) // Eg: ["x-forwarded-for", "x-via", "forwarded-for", "via"]; // Useful for blocking *some* proxies used for botting @@ -62,7 +62,7 @@ class config{ //"remote-addr", //"via" ]; - + // Block SSL ciphers used by CLI tools used for botting // Basically a primitive version of Cloudflare's browser integrity check // ** If curl can still access the site (with spoofed headers), please make sure you use the new apache2 config ** @@ -70,12 +70,12 @@ class config{ const DISALLOWED_SSL = [ // "TLS_AES_256_GCM_SHA384" // used by WGET and CURL ]; - + // Maximal number of searches per captcha key/pass issued. Counter gets // reset on every APCU cache clear (should happen once a day). // Only useful when BOT_PROTECTION is NOT set to 0 const MAX_SEARCHES = 100; - + // List of domains that point to your servers. Include your tor/i2p // addresses here! Must be a valid URL. Won't affect links placed on // the homepage. @@ -83,7 +83,7 @@ class config{ //"https://4get.alt-tld", //"http://4getwebfrq5zr4sxugk6htxvawqehxtdgjrbcn2oslllcol2vepa23yd.onion" ]; - + // Known 4get instances. MUST use the https protocol if your instance uses // it. Is used to generate a distributed list of instances. // To appear in the list of an instance, contact the host and if everyone added @@ -116,11 +116,11 @@ class config{ "https://4get.sudovanilla.org", "https://search.mint.lgbt" ]; - + // Default user agent to use for scraper requests. Sometimes ignored to get specific webpages // Changing this might break things. const USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"; - + // Proxy pool assignments for each scraper // false = Use server's raw IP // string = will load a proxy list from data/proxies @@ -155,14 +155,14 @@ class config{ const PROXY_YANDEX_W = false; // yandex web const PROXY_YANDEX_I = false; // yandex images const PROXY_YANDEX_V = false; // yandex videos - + // // Scraper-specific parameters // - + // GOOGLE CSE const GOOGLE_CX_ENDPOINT = "d4e68b99b876541f0"; - + // MARGINALIA // Use "null" to default out to HTML scraping OR specify a string to // use the API (Eg: "public"). API has less filters. diff --git a/src/opensearch.php b/src/opensearch.php index 4bdf97c..131c9e3 100644 --- a/src/opensearch.php +++ b/src/opensearch.php @@ -15,10 +15,10 @@ if( $domain ) ){ - + $onion = true; }else{ - + $onion = false; } @@ -30,13 +30,4 @@ echo '' . $domain . '/favicon.ico' . ''; -if( - isset($_GET["ac"]) && - is_string($_GET["ac"]) && - $_GET["ac"] != "disabled" -){ - - echo ''; -} - echo ''; diff --git a/src/static/client.js b/src/static/client.js index 5935f92..adaca65 100644 --- a/src/static/client.js +++ b/src/static/client.js @@ -16,7 +16,7 @@ function htmlspecialchars(str){ } function htmlspecialchars_decode(str){ - + var map = { '&': '&', '<': '<', @@ -24,19 +24,19 @@ function htmlspecialchars_decode(str){ '"': '"', ''': "'" } - + return str.replace(/&|<|>|"|'/g, function(m){return map[m];}); } function is_click_within(elem, classname, is_id = false){ - + while(true){ - + if(elem === null){ - + return false; } - + if( ( is_id === false && @@ -47,10 +47,10 @@ function is_click_within(elem, classname, is_id = false){ elem.id == classname ) ){ - + return elem; } - + elem = elem.parentElement; } } @@ -69,32 +69,32 @@ if( window.location.pathname != "/settings" ){ form = form[0]; - + var scraper_dropdown = document.getElementsByName("scraper")[0]; - + scraper_dropdown.addEventListener("change", function(choice){ - + submit(form); }); - + form.addEventListener("submit", function(e){ - + e.preventDefault(); submit(e.srcElement); }); } function submit(e){ - + var GET = ""; var first = true; - + if((s = document.getElementsByName("s")).length !== 0){ - + GET += "?s=" + encodeURIComponent(s[0].value).replaceAll("%20", "+"); first = false; } - + Array.from( e.getElementsByTagName("select") ).concat( @@ -102,9 +102,9 @@ function submit(e){ e.getElementsByTagName("input") ) ).forEach(function(el){ - + var firstelem = el.getElementsByTagName("option"); - + if( ( ( @@ -118,20 +118,20 @@ function submit(e){ el.name == "scraper" || el.name == "nsfw" ){ - + if(first){ - + GET += "?"; first = false; }else{ - + GET += "&"; } - + GET += encodeURIComponent(el.name).replaceAll("%20", "+") + "=" + encodeURIComponent(el.value).replaceAll("%20", "+"); } }); - + window.location.href = GET; } @@ -152,18 +152,18 @@ if(answer_div.length !== 0){ window.addEventListener("resize", hide_show_more); function hide_show_more(){ - + var height = window.innerWidth >= 1000 ? 600 : 200; - + for(i=0; i(' + collection.length + ')' + + '' + '' + '' + htmlspecialchars(title) + ''; - + popup_body.innerHTML = ''; - + // make changes to DOM popup_body.style.display = "block"; popup_bg.style.display = "block"; popup_status.style.display = "table"; - + // store for rotation functions & changeimage() popup_image = document.getElementById("popup-image"); - + scalepopup(collection[collection_index], scale); centerpopup(); }else{ - + // click inside the image viewer // resize image if(is_click_within(click.target, "popup", true)){ - + if(mouse_move === false){ scale = 80; scalepopup(collection[collection_index], scale); centerpopup(); } }else{ - + if(is_click_within(click.target, "popup-status", true) === false){ - + // click outside the popup while its open // close it if(is_popup_shown){ - + hidepopup(); } } } } }); - + /* Scale image viewer */ popup_body.addEventListener("wheel", function(scroll){ - + event.preventDefault(); - + if( scroll.altKey || scroll.ctrlKey || scroll.shiftKey ){ - + var increment = 7; }else{ - + var increment = 14; } - + if(scroll.wheelDelta > 0){ - + // scrolling up scale = scale + increment; }else{ - + // scrolling down if(scale - increment > 7){ scale = scale - increment; } } - + // calculate relative size before scroll var pos = popup_body.getBoundingClientRect(); var x = (scroll.x - pos.x) / pos.width; var y = (scroll.y - pos.y) / pos.height; - + scalepopup(collection[collection_index], scale); - + // move popup to % we found pos = popup_body.getBoundingClientRect(); - + movepopup( popup_body, scroll.clientX - (x * pos.width), scroll.clientY - (y * pos.height) ); }); - + /* Keyboard controls */ - + document.addEventListener("keydown", function(key){ - + // close popup if( is_popup_shown && key.keyCode === 27 ){ - + hidepopup(); return; } - + if(is_popup_shown === false){ - + return; } - + if( key.altKey || key.ctrlKey || key.shiftKey ){ - + // mirror image switch(key.keyCode){ - + case 37: // left key.preventDefault(); mirror_x = true; break; - + case 38: // up key.preventDefault(); mirror_y = false; break; - + case 39: // right key.preventDefault(); mirror_x = false; break; - + case 40: // down key.preventDefault(); @@ -569,28 +569,28 @@ if(image_class !== null){ break; } }else{ - + // rotate image switch(key.keyCode){ - + case 37: // left key.preventDefault(); rotation = -90; break; - + case 38: // up key.preventDefault(); rotation = 0; break; - + case 39: // right key.preventDefault(); rotation = 90; break; - + case 40: // down key.preventDefault(); @@ -598,7 +598,7 @@ if(image_class !== null){ break; } } - + popup_image.style.transform = "scale(" + (mirror_x ? "-1" : "1") + @@ -612,18 +612,18 @@ if(image_class !== null){ } function getproxylink(url){ - + if(url.startsWith("data:")){ - + return htmlspecialchars(url); }else{ - + return '/proxy?i=' + encodeURIComponent(url); } } function hidepopup(){ - + is_popup_shown = false; popup_status.style.display = "none"; popup_body.style.display = "none"; @@ -631,24 +631,24 @@ function hidepopup(){ } function scalepopup(size, scale){ - + var ratio = Math.min( (window.innerWidth * (scale / 100)) / collection[collection_index].width, (window.innerHeight * (scale / 100)) / collection[collection_index].height ); - + popup_body.style.width = size.width * ratio + "px"; popup_body.style.height = size.height * ratio + "px"; } function centerpopup(){ - + var size = popup_body.getBoundingClientRect(); var size = { "width": parseInt(size.width), "height": parseInt(size.height) }; - + movepopup( popup_body, (window.innerWidth / 2) - (size.width / 2), @@ -657,29 +657,29 @@ function centerpopup(){ } function movepopup(popup_body, x, y){ - + popup_body.style.left = x + "px"; popup_body.style.top = y + "px"; } function changeimage(event){ - + // reset rotation params mirror_x = false; mirror_y = false; rotation = 0; - + scale = 60; - + collection_index = parseInt(event.target.value); - + // we set innerHTML otherwise old image lingers a little popup_body.innerHTML = ''; - + // store for rotation functions & changeimage() popup_image = document.getElementById("popup-image"); - + scalepopup(collection[collection_index], scale); centerpopup(); } @@ -687,299 +687,37 @@ function changeimage(event){ var searchbox_wrapper = document.getElementsByClassName("searchbox"); if(searchbox_wrapper.length !== 0){ - + searchbox_wrapper = searchbox_wrapper[0]; var searchbox = searchbox_wrapper.getElementsByTagName("input")[1]; - + /* Textarea shortcuts */ document.addEventListener("keydown", function(key){ - + switch(key.keyCode){ - + case 191: // 191 = / if(document.activeElement.tagName == "INPUT"){ - + // already focused, ignore break; } - + if( typeof is_popup_shown != "undefined" && is_popup_shown ){ - + hidepopup(); } - + window.scrollTo(0, 0); searchbox.focus(); key.preventDefault(); break; } }); - - /* - Autocompleter - */ - if( // make sure the user wants it - document.cookie.includes("scraper_ac=") && - document.cookie.includes("scraper_ac=disabled") === false - ){ - - var autocomplete_cache = []; - var focuspos = -1; - var list = []; - var autocomplete_div = document.getElementsByClassName("autocomplete")[0]; - - if( - document.cookie.includes("scraper_ac=auto") && - typeof scraper_dropdown != "undefined" - ){ - - var ac_req_appendix = "&scraper=" + scraper_dropdown.value; - }else{ - - var ac_req_appendix = ""; - } - - function getsearchboxtext(){ - - var value = - searchbox.value - .trim() - .replace( - / +/g, - " " - ) - .toLowerCase(); - - return value; - } - - searchbox.addEventListener("input", async function(){ - - // ratelimit on input only - // dont ratelimit if we already have res - if(typeof autocomplete_cache[getsearchboxtext()] != "undefined"){ - - await getac(); - }else{ - - await getac_ratelimit(); - } - }); - - async function getac(){ - - var curvalue = getsearchboxtext(); - - if(curvalue == ""){ - - // hide autocompleter - autocomplete_div.style.display = "none"; - return; - } - - if(typeof autocomplete_cache[curvalue] == "undefined"){ - - /* - Fetch autocomplete - */ - // make sure we dont fetch same thing twice - autocomplete_cache[curvalue] = []; - - var res = await fetch("/api/v1/ac?s=" + (encodeURIComponent(curvalue).replaceAll("%20", "+")) + ac_req_appendix); - if(!res.ok){ - - return; - } - - var json = await res.json(); - - autocomplete_cache[curvalue] = json[1]; - - if(curvalue == getsearchboxtext()){ - - render_ac(curvalue, autocomplete_cache[curvalue]); - } - return; - } - - render_ac(curvalue, autocomplete_cache[curvalue]); - } - - var ac_func = null; - function getac_ratelimit(){ - - return new Promise(async function(resolve, reject){ - - if(ac_func !== null){ - - clearTimeout(ac_func); - }//else{ - - // no ratelimits - //getac(); - //} - - ac_func = - setTimeout(function(){ - - ac_func = null; - getac(); // get results after 100ms of no keystroke - resolve(); - }, 200); - }); - } - - function render_ac(query, list){ - - if(list.length === 0){ - - autocomplete_div.style.display = "none"; - return; - } - - html = ""; - - // prepare regex - var highlight = query.split(" "); - var regex = []; - - for(var k=0; k' + - htmlspecialchars( - list[i] - ).replace( - regex, - '$&' - ) + - ''; - } - - autocomplete_div.innerHTML = html; - autocomplete_div.style.display = "block"; - } - - var should_focus = false; - document.addEventListener("keydown", function(event){ - - if(event.key == "Escape"){ - - document.activeElement.blur(); - focuspos = -1; - autocomplete_div.style.display = "none"; - return; - } - - if( - is_click_within(event.target, "searchbox") === false || - typeof autocomplete_cache[getsearchboxtext()] == "undefined" - ){ - - return; - } - - switch(event.key){ - - case "ArrowUp": - event.preventDefault(); - focuspos--; - if(focuspos === -2){ - - focuspos = autocomplete_cache[getsearchboxtext()].length - 1; - } - break; - - case "ArrowDown": - case "Tab": - event.preventDefault(); - - focuspos++; - if(focuspos >= autocomplete_cache[getsearchboxtext()].length){ - - focuspos = -1; - } - break; - - case "Enter": - should_focus = true; - - if(focuspos !== -1){ - - // replace input content - event.preventDefault(); - searchbox.value = - autocomplete_div.getElementsByClassName("entry")[focuspos].innerText; - break; - } - break; - - default: - focuspos = -1; - break; - } - - if(focuspos === -1){ - - searchbox.focus(); - return; - } - - autocomplete_div.getElementsByClassName("entry")[focuspos].focus(); - }); - - window.addEventListener("blur", function(){ - - autocomplete_div.style.display = "none"; - }); - - document.addEventListener("keyup", function(event){ - - // handle ENTER key on entry - if(should_focus){ - - should_focus = false; - searchbox.focus(); - } - }); - - document.addEventListener("mousedown", function(event){ - - // hide input if click is outside - if(is_click_within(event.target, "searchbox") === false){ - - autocomplete_div.style.display = "none"; - return; - } - }); - - function handle_entry_click(event){ - - searchbox.value = event.innerText; - focuspos = -1; - searchbox.focus(); - } - - searchbox.addEventListener("focus", function(){ - - focuspos = -1; - getac(); - }); - } } diff --git a/src/static/themes/black.css b/src/static/themes/black.css new file mode 100644 index 0000000..cbb9da8 --- /dev/null +++ b/src/static/themes/black.css @@ -0,0 +1,20 @@ +:root{ + /* background */ + --1d2021: #000; + --282828: #080808; + --3c3836: #27273c; + --504945: #989898; + + /* font */ + --928374: #fcfcfc; + --a89984: #d9d9d9; + --bdae93: #ffffff; + --8ec07c: #2fce00; + --ebdbb2: #64d142; + + /* code highlighter */ + --comment: #a0c0a4; + --default: #f00; + --keyword: #9376e4; + --string: #ecd78f; +} diff --git a/src/template/about.html b/src/template/about.html deleted file mode 100644 index 6398884..0000000 --- a/src/template/about.html +++ /dev/null @@ -1,77 +0,0 @@ -< Go back - -

Set as default search engine

-

On Firefox and other Gecko based browsers

-To set this as your default search engine on Firefox, right click the URL bar and select
Add "4get"
. Then, visit about:preferences#search and select
4get
in the dropdown menu. - -

On Chromium and Blink based browsers

-Click the 3 superpositioned dots at the top right of the screen and click on
Settings
, then search for
default search engine
, or visit chrome://settings/searchEngines.

- -Once you're there, click the pencil on the last entry under "Search engines" (it's probably DuckDuckGo). Once you do that, a popup will appear. Populate it with the following information: - - - - - - - - - - - - - - - - - - -
FieldValue
Search engine{%server_name%}
Shortcut{%server_name%}
URL with %s in place of queryhttps://4get.ca/web?s=%s
- -Once that's done, click
Save
. Then, on the right handside of the newly created entry, open the dropdown menu and select
Make default
. - -

Frequently asked questions

-

What is this?

-This is a metasearch engine that gets results from other engines, and strips away all of the tracking parameters and Microsoft/globohomo bullshit they add. Most of the other alternatives to Google jack themselves off about being ""privacy respecting"" or whatever the fuck but it always turns out to be a total lie, and I just got fed up with their shit honestly. Alternatives like Searx or YaCy all fucking sucks so I made my own thing. - -

My goal

-Provide users with a privacy oriented, extremely lightweight, ad free, free as in freedom (and free beer!) way to search for documents around the internet, with minimal, optional javascript code. My long term goal would be to build my own index (that doesn't suck) and provide users with an unbiased search engine, with no political inclinations. - -

Do you keep logs?

-I store data temporarly to get the next page of results. This might include search queries, filters and tokens. These parameters are encrypted using
libsodium
on the serber, for which I give you a decryption key (also known internally as
npt
token). When you make a request to get the next page, you supply the token, the data is decrypted and the request is fulfilled. This encrypted data is deleted after 15 minutes, or after it's used, whichever comes first.

- -I don't log IP addresses, user agents, or anything else. The
npt
tokens are the only thing that are stored (in RAM, mind you), temporarly, encrypted. - -

Do you share information with third parties?

-Your search queries and supplied filters are shared with the scraper you chose (so I can get the search results, duh). I don't share anything else (that means I don't share your IP address, location, or anything of this kind). There is no way that site can know you're the one searching for something, unless you send out a search query that de-anonymises you. For example, a search query like "hello my full legal name is jonathan gallindo and i want pictures of cloacas" would definitively blow your cover. 4get doesn't contain ads or any third party javascript applets or trackers. I don't profile you, and quite frankly, I don't give a shit about what you search on there.

- -TL;DR assume those websites can see what you search for, but can't see who you are (unless you're really dumb). - -

Where is this website hosted?

-Please head over to the 4get instances page, select an instance and click on "IP lookup". - -

Keyboard shortcuts?

-Use
/
to focus the search box.

- -When the image viewer is open, you can use the following keybinds:
-
Up
,
Down
,
Left
,
Right
to rotate the image.
-
CTRL+Up
,
CTRL+Down
,
CTRL+Left
,
CTRL+Right
to mirror the image.
-
Escape
to exit the image viewer. - -

How can I trust you?

-You just sort of have to take my word for it right now. If you'd rather trust yourself instead of me (I believe in you!!), all of the code on this website is available trough my git page for you to host on your own machines. Just a reminder: if you're the sole user of your instance, it doesn't take immense brain power for Microshit to figure out you basically just switched IP addresses. Invite your friends to use your instance! - - -Donate to me trough ko-fi: ko-fi.com/lolcat
-Please donate I sent myself a donation for testing if it works and it looks fucking dumb. Reasons to donate are listed on there. Thank you! - -

I want to report abuse or have erotic roleplay trough email

-I don't know about that second part but if you want to talk to me, just drop me an email...

- -Message to all DMCA enforcers: I don't host any of the content. Everything you see here is proxied trough my shitbox with no moderation. Please reach out to the people hosting the infringing content instead.

- -Click here to contact me!

- - - Valid W3C HTML 4.01 - diff --git a/src/template/donate.html b/src/template/donate.html deleted file mode 100644 index f6f45bf..0000000 --- a/src/template/donate.html +++ /dev/null @@ -1,20 +0,0 @@ -< Go back - -

Donate to the project

-This project takes up most of my free time and costs money to run. If you feel like this project is worthy of a donation, please do so using the resources on this page!

- -To run smoothly, 4get requires 20$/month for the server fees and 15-25$ for residential proxies. I also have plans to build my own index to provide better search results; funds raised here will go directly towards better hardware for these purposes. According to the number of captchas solved, 4get.ca serves between 800-1400 users every day, or around 7000-10000 searches! - -

Ko-fi

-This is the most convenient way to donate. Supports PayPal. - - -

Monero

-Due to popular demand, I have added an XMR addy. I'm planning to reward users who donate to me once paid tiers are introduced to 4get, so please let me know through email that you donated to me (don't forget your transaction ID)! - - -Thank you all for your generous support!! diff --git a/src/template/home.html b/src/template/home.html index 41fe626..73ebea6 100644 --- a/src/template/home.html +++ b/src/template/home.html @@ -29,20 +29,12 @@ Settings - • + | News - • + | Source - • + | Modified Source -
- Clearnet - • - TOR - • - Report a problem -
-
diff --git a/src/template/instances.html b/src/template/instances.html deleted file mode 100644 index 06752c0..0000000 --- a/src/template/instances.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Instance browser - - - {%style%} - - - - - - -

Instance browser

- Learn how to setup your own instance here! https://git.lolcat.ca/lolcat/4get - - < Go back - - - - -