Archived
1
Fork 0
forked from Korbs/4get
This repository has been archived on 2024-09-29. You can view files and clone it, but cannot push or open issues or pull requests.
NarviSearch/data/config.php

126 lines
4 KiB
PHP
Raw Normal View History

2023-11-07 08:04:56 -05:00
<?php
class config{
// Welcome to the NarviSearch configuration file
2023-11-07 08:04:56 -05:00
// When updating your instance, please make sure this file isn't missing
// any parameters.
// NarviSearch version. Please keep this updated
2024-04-21 18:31:56 -05:00
const VERSION = 8;
2023-11-07 08:04:56 -05:00
// Will be shown pretty much everywhere.
const SERVER_NAME = "NarviSearch";
2023-11-07 08:04:56 -05:00
// Will be shown in <meta> tag on home page
const SERVER_SHORT_DESCRIPTION = "They live in our walls!";
// 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";
// Enable the API?
const API_ENABLED = true;
2024-03-24 21:31:19 -05:00
//
// BOT PROTECTION
//
2023-11-07 08:04:56 -05:00
2024-03-24 21:31:19 -05:00
// 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;
2024-01-06 19:43:54 -05:00
2023-11-07 08:04:56 -05:00
// 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
const CAPTCHA_DATASET = [
// example:
2024-01-06 19:46:13 -05:00
// ["birds", 2263],
// ["fumo_plushies", 1006],
// ["minecraft", 848]
2023-11-07 08:04:56 -05:00
];
2024-03-24 21:31:19 -05:00
// 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';
2024-03-24 21:31:19 -05:00
// 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
const FILTERED_HEADER_KEYS = [
"x-forwarded-for",
2024-03-26 10:06:31 -05:00
"x-cluster-client-ip",
"x-client-ip",
"x-real-ip",
"client-ip",
"real-ip",
2024-03-24 21:31:19 -05:00
"forwarded-for",
2024-03-26 10:06:31 -05:00
"forwarded-for-ip",
"forwarded",
"proxy-connection",
"remote-addr",
2024-03-26 10:06:53 -05:00
"via"
2024-03-24 21:31:19 -05:00
];
// 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;
2023-11-07 08:04:56 -05:00
// 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.
const ALT_ADDRESSES = [];
2023-11-07 08:04:56 -05:00
// Known NarviSearch instances. MUST use the https protocol if your instance uses
2023-11-07 08:04:56 -05:00
// 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
// eachother your serber should appear everywhere.
const INSTANCES = [
"https://search.sudovanilla.org"
2023-11-07 08:04:56 -05:00
];
// Default user agent to use for scraper requests. Sometimes ignored to get specific webpages
// Changing this might break things.
2024-04-21 18:31:56 -05:00
const USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0";
2023-11-07 08:04:56 -05:00
// Proxy pool assignments for each scraper
// false = Use server's raw IP
// string = will load a proxy list from data/proxies
// Eg. "onion" will load data/proxies/onion.txt
const PROXY_DDG = false; // duckduckgo
const PROXY_BRAVE = false;
const PROXY_FB = false; // facebook
2024-03-20 10:00:38 -05:00
const PROXY_GOOGLE = false;
2024-04-21 18:31:56 -05:00
const PROXY_QWANT = false;
2023-11-07 08:04:56 -05:00
const PROXY_MARGINALIA = false;
const PROXY_MOJEEK = false;
const PROXY_SC = false; // soundcloud
2024-01-06 19:43:54 -05:00
const PROXY_SPOTIFY = false;
2023-11-07 08:04:56 -05:00
const PROXY_WIBY = false;
2024-01-06 19:43:54 -05:00
const PROXY_CURLIE = false;
2023-11-07 08:04:56 -05:00
const PROXY_YT = false; // youtube
const PROXY_YEP = false;
const PROXY_PINTEREST = false;
2024-02-17 23:22:19 -05:00
const PROXY_SEZNAM = false;
const PROXY_NAVER = false;
const PROXY_GREPPR = false;
2024-03-22 20:31:06 -05:00
const PROXY_CROWDVIEW = false;
2024-02-26 11:31:52 -05:00
const PROXY_MWMBL = false;
2023-11-07 08:04:56 -05:00
const PROXY_FTM = false; // findthatmeme
const PROXY_IMGUR = false;
const PROXY_YANDEX_W = false; // yandex web
const PROXY_YANDEX_I = false; // yandex images
const PROXY_YANDEX_V = false; // yandex videos
//
// Scraper-specific parameters
//
// MARGINALIA
2024-04-21 18:31:56 -05:00
// Use "null" to default out to HTML scraping OR specify a string to
// use the API (Eg: "public"). API has less filters.
const MARGINALIA_API_KEY = null;
2023-11-07 08:04:56 -05:00
}