get rid of the api all together
All checks were successful
Build and publish the docker image / build (push) Successful in 10s
All checks were successful
Build and publish the docker image / build (push) Successful in 10s
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
parent
ce81a54de1
commit
9868c6c7a5
@ -18,10 +18,10 @@ echo json_encode(
|
|||||||
"bot_protection" => config::BOT_PROTECTION,
|
"bot_protection" => config::BOT_PROTECTION,
|
||||||
"real_requests" => $real_requests === false ? 0 : $real_requests,
|
"real_requests" => $real_requests === false ? 0 : $real_requests,
|
||||||
"bot_requests" => $bot_requests === false ? 0 : $bot_requests,
|
"bot_requests" => $bot_requests === false ? 0 : $bot_requests,
|
||||||
"api_enabled" => config::API_ENABLED,
|
"api_enabled" => false,
|
||||||
"alt_addresses" => config::ALT_ADDRESSES,
|
"alt_addresses" => config::ALT_ADDRESSES,
|
||||||
"version" => config::VERSION
|
"version" => config::VERSION
|
||||||
],
|
],
|
||||||
"instances" => config::INSTANCES
|
"instances" => []
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
header("Content-Type: application/json");
|
|
||||||
http_response_code(404);
|
|
||||||
|
|
||||||
echo json_encode(
|
|
||||||
[
|
|
||||||
"status" => "Unknown endpoint"
|
|
||||||
]
|
|
||||||
);
|
|
@ -1,243 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
include "../../data/config.php";
|
|
||||||
new autocomplete();
|
|
||||||
|
|
||||||
class autocomplete{
|
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
|
|
||||||
header("Content-Type: application/json");
|
|
||||||
|
|
||||||
$this->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();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
header("Content-Type: application/json");
|
|
||||||
http_response_code(404);
|
|
||||||
|
|
||||||
echo json_encode(
|
|
||||||
[
|
|
||||||
"status" => "Unknown endpoint"
|
|
||||||
]
|
|
||||||
);
|
|
@ -18,7 +18,7 @@ class config{
|
|||||||
|
|
||||||
// Add your own themes in "static/themes". Set to "Dark" for default theme.
|
// Add your own themes in "static/themes". Set to "Dark" for default theme.
|
||||||
// Eg. To use "static/themes/Cream.css", specify "Cream".
|
// Eg. To use "static/themes/Cream.css", specify "Cream".
|
||||||
const DEFAULT_THEME = "Dark";
|
const DEFAULT_THEME = "black";
|
||||||
|
|
||||||
// Enable the API?
|
// Enable the API?
|
||||||
const API_ENABLED = true;
|
const API_ENABLED = true;
|
||||||
|
@ -30,13 +30,4 @@ echo
|
|||||||
'<Image width="16" height="16">' . $domain . '/favicon.ico</Image>' .
|
'<Image width="16" height="16">' . $domain . '/favicon.ico</Image>' .
|
||||||
'<Url type="text/html" method="GET" template="' . $domain . '/web?s={searchTerms}"/>';
|
'<Url type="text/html" method="GET" template="' . $domain . '/web?s={searchTerms}"/>';
|
||||||
|
|
||||||
if(
|
|
||||||
isset($_GET["ac"]) &&
|
|
||||||
is_string($_GET["ac"]) &&
|
|
||||||
$_GET["ac"] != "disabled"
|
|
||||||
){
|
|
||||||
|
|
||||||
echo '<Url rel="suggestions" type="application/x-suggestions+json" template="' . $domain . '/api/v1/ac?s={searchTerms}&scraper=' . htmlspecialchars($_GET["ac"]) . '"/>';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '</OpenSearchDescription>';
|
echo '</OpenSearchDescription>';
|
||||||
|
@ -720,266 +720,4 @@ if(searchbox_wrapper.length !== 0){
|
|||||||
break;
|
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<highlight.length; k++){
|
|
||||||
|
|
||||||
// espace regex
|
|
||||||
regex.push(
|
|
||||||
highlight[k].replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
regex = new RegExp(highlight.join("|"), "gi");
|
|
||||||
|
|
||||||
for(var i=0; i<list.length; i++){
|
|
||||||
|
|
||||||
html +=
|
|
||||||
'<div tabindex="0" class="entry" onclick="handle_entry_click(this);">' +
|
|
||||||
htmlspecialchars(
|
|
||||||
list[i]
|
|
||||||
).replace(
|
|
||||||
regex,
|
|
||||||
'<u>$&</u>'
|
|
||||||
) +
|
|
||||||
'</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
20
src/static/themes/black.css
Normal file
20
src/static/themes/black.css
Normal file
@ -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;
|
||||||
|
}
|
@ -1,77 +0,0 @@
|
|||||||
<a href="/" class="link">< Go back</a>
|
|
||||||
|
|
||||||
<h1>Set as default search engine</h1>
|
|
||||||
<a href="#firefox"><h2 id="firefox">On Firefox and other Gecko based browsers</h2></a>
|
|
||||||
To set this as your default search engine on Firefox, right click the URL bar and select <div class="code-inline">Add "4get"</div>. Then, visit <a href="about:preferences#search" target="_BLANK" class="link">about:preferences#search</a> and select <div class="code-inline">4get</div> in the dropdown menu.
|
|
||||||
|
|
||||||
<a href="#chrome"><h2 id="chrome">On Chromium and Blink based browsers</h2></a>
|
|
||||||
Click the 3 superpositioned dots at the top right of the screen and click on <div class="code-inline">Settings</div>, then search for <div class="code-inline">default search engine</div>, or visit <a href="chrome://settings/searchEngines">chrome://settings/searchEngines</a>.<br><br>
|
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td><b>Field</b></td>
|
|
||||||
<td><b>Value</b></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Search engine</td>
|
|
||||||
<td>{%server_name%}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Shortcut</td>
|
|
||||||
<td>{%server_name%}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>URL with %s in place of query</td>
|
|
||||||
<td>https://4get.ca/web?s=%s</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
Once that's done, click <div class="code-inline">Save</div>. Then, on the right handside of the newly created entry, open the dropdown menu and select <div class="code-inline">Make default</div>.
|
|
||||||
|
|
||||||
<h1>Frequently asked questions</h1>
|
|
||||||
<a href="#what-is-this"><h2 id="what-is-this">What is this?</h2></a>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<a href="#goal"><h2 id="goal">My goal</h2></a>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<a href="#logs"><h2 id="logs">Do you keep logs?</h2></a>
|
|
||||||
I store data temporarly to get the next page of results. This might include search queries, filters and tokens. These parameters are encrypted using <div class="code-inline">libsodium</div> on the serber, for which I give you a decryption key (also known internally as <div class="code-inline">npt</div> 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.<br><br>
|
|
||||||
|
|
||||||
I <b>don't</b> log IP addresses, user agents, or anything else. The <div class="code-inline">npt</div> tokens are the only thing that are stored (in RAM, mind you), temporarly, encrypted.
|
|
||||||
|
|
||||||
<a href="#information-sharing"><h2 id="information-sharing">Do you share information with third parties?</h2></a>
|
|
||||||
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, <u>unless you send out a search query that de-anonymises you.</u> 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.<br><br>
|
|
||||||
|
|
||||||
TL;DR assume those websites can see what you search for, but can't see who you are (unless you're really dumb).
|
|
||||||
|
|
||||||
<a href="#hosting"><h2 id="hosting">Where is this website hosted?</h2></a>
|
|
||||||
Please head over to the <a href="/instances">4get instances</a> page, select an instance and click on "IP lookup".
|
|
||||||
|
|
||||||
<a href="#keyboard-shortcuts"><h2 id="keyboard-shortcuts">Keyboard shortcuts?</h2></a>
|
|
||||||
Use <div class="code-inline">/</div> to focus the search box.<br><br>
|
|
||||||
|
|
||||||
When the image viewer is open, you can use the following keybinds:<br>
|
|
||||||
<div class="code-inline">Up</div>, <div class="code-inline">Down</div>, <div class="code-inline">Left</div>, <div class="code-inline">Right</div> to rotate the image.<br>
|
|
||||||
<div class="code-inline">CTRL+Up</div>, <div class="code-inline">CTRL+Down</div>, <div class="code-inline">CTRL+Left</div>, <div class="code-inline">CTRL+Right</div> to mirror the image.<br>
|
|
||||||
<div class="code-inline">Escape</div> to exit the image viewer.
|
|
||||||
|
|
||||||
<a href="#schizo"><h2 id="schizo">How can I trust you?</h2></a>
|
|
||||||
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 <a href="https://git.lolcat.ca/lolcat" class="link">git page</a> 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!
|
|
||||||
|
|
||||||
<a href="#donate"><h2 id="donate">Support the project</h2></a>
|
|
||||||
Donate to me trough ko-fi: <a href="https://ko-fi.com/lolcat" target="BLANK" rel="noreferrer">ko-fi.com/lolcat</a><br>
|
|
||||||
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!
|
|
||||||
|
|
||||||
<a href="#contact"><h2 id="contact">I want to report abuse or have erotic roleplay trough email</h2></a>
|
|
||||||
I don't know about that second part but if you want to talk to me, just drop me an email...<br><br>
|
|
||||||
|
|
||||||
<b>Message to all DMCA enforcers:</b> I don't host any of the content. Everything you see here is <u>proxied</u> trough my shitbox with no moderation. Please reach out to the people hosting the infringing content instead.<br><br>
|
|
||||||
|
|
||||||
<a href="https://lolcat.ca" rel="dofollow" class="link">Click here to contact me!</a><br><br>
|
|
||||||
|
|
||||||
<a href="https://validator.w3.org/nu/?doc=https%3A%2F%2F4get.ca" title="W3 Valid!">
|
|
||||||
<img src="/static/icon/w3html.png" alt="Valid W3C HTML 4.01" width="88" height="31">
|
|
||||||
</a>
|
|
@ -1,20 +0,0 @@
|
|||||||
<a href="/" class="link">< Go back</a>
|
|
||||||
|
|
||||||
<h1>Donate to the project</h1>
|
|
||||||
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!<br><br>
|
|
||||||
|
|
||||||
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, <a href="https://4get.ca">4get.ca</a> serves between 800-1400 users every day, or around 7000-10000 searches!
|
|
||||||
|
|
||||||
<h2>Ko-fi</h2>
|
|
||||||
This is the most convenient way to donate. Supports PayPal.
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://ko-fi.com/lolcat">ko-fi.com/lolcat</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2>Monero</h2>
|
|
||||||
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)!
|
|
||||||
<ul>
|
|
||||||
<li><a href="monero:85G95fXXfuh72oQd9LmdMHNqDTqsUPKkLCBEYE7XnnMLPvBfkdnan2FVTmVAwT4JEuXsRL7xPgqzuV2YdbFkWmxK2FgGBmB?tx_description=4get+donation">85G95fXXfuh72oQd9LmdMHNqDTqsUPKkLCBEYE7XnnMLPvBfkdnan2FVTmVAwT4JEuXsRL7xPgqzuV2YdbFkWmxK2FgGBmB</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
Thank you all for your generous support!!
|
|
@ -29,20 +29,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<a href="settings">Settings</a>
|
<a href="settings">Settings</a>
|
||||||
•
|
<span> | </span>
|
||||||
<a href="https://git.lolcat.ca/lolcat/4get_news">News</a>
|
<a href="https://git.lolcat.ca/lolcat/4get_news">News</a>
|
||||||
•
|
<span> | </span>
|
||||||
<a href="https://git.lolcat.ca/lolcat/4get">Source</a>
|
<a href="https://git.lolcat.ca/lolcat/4get">Source</a>
|
||||||
•
|
<span> | </span>
|
||||||
<a href="https://git.ngn.tf/ngn/4get">Modified Source</a>
|
<a href="https://git.ngn.tf/ngn/4get">Modified Source</a>
|
||||||
<div class="subtext">
|
|
||||||
<a href="https://4.ngn.tf">Clearnet</a>
|
|
||||||
•
|
|
||||||
<a href="http://4ngnt3r7ktzk2mdpxk2gnodnfnaggh55keswpx76zmsrxaabspw5riad.onion">TOR</a>
|
|
||||||
•
|
|
||||||
<a href="https://git.ngn.tf/ngn/4get/issues">Report a problem</a>
|
|
||||||
<br>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<script src="/static/client.js?v{%version%}"></script>
|
<script src="/static/client.js?v{%version%}"></script>
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
|
||||||
<title>Instance browser</title>
|
|
||||||
<link title="{%server_name%}" href="/opensearch{%ac%}" rel="search" type="application/opensearchdescription+xml">
|
|
||||||
<link rel="stylesheet" href="/static/style.css?v{%version%}">
|
|
||||||
{%style%}
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
||||||
<meta name="robots" content="index,follow">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
<meta name="description" content="{%server_name%}: Instances">
|
|
||||||
</head>
|
|
||||||
<body class="instances">
|
|
||||||
<h1>Instance browser</h1>
|
|
||||||
Learn how to setup your own instance here! <a href="https://git.lolcat.ca/lolcat/4get" target="_BLANK">https://git.lolcat.ca/lolcat/4get</a>
|
|
||||||
<noscript>
|
|
||||||
<div class="quote">For a better experience, whitelist javascript usage on this page.</div>
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="expand">Server</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{%instances_html%}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</noscript>
|
|
||||||
<a href="../" class="go-back">< Go back</a>
|
|
||||||
<div id="popup-bg"></div>
|
|
||||||
<div class="popup-wrapper">
|
|
||||||
<div class="popup"></div>
|
|
||||||
</div>
|
|
||||||
<script src="static/serverping.js?v{%version%}"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
x
Reference in New Issue
Block a user