1
0

config.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <?php
  2. class config{
  3. // Welcome to the 4get configuration file
  4. // When updating your instance, please make sure this file isn't missing
  5. // any parameters.
  6. // 4get version. Please keep this updated
  7. const VERSION = 8;
  8. // Will be shown pretty much everywhere.
  9. const SERVER_NAME = "4get";
  10. // Will be shown in <meta> tag on home page
  11. const SERVER_SHORT_DESCRIPTION = "4get is a proxy search engine that doesn't suck.";
  12. // Will be shown in server list ping (null for no description)
  13. const SERVER_LONG_DESCRIPTION = null;
  14. // Add your own themes in "static/themes". Set to "Dark" for default theme.
  15. // Eg. To use "static/themes/Cream.css", specify "Cream".
  16. const DEFAULT_THEME = "Dark";
  17. // Enable the API?
  18. const API_ENABLED = true;
  19. //
  20. // 4play settings
  21. //
  22. // Enable 4get's /api/v2/provide_sesh endpoint
  23. const FPLAY_ENABLE_API = false;
  24. // 4play password. Please set this to something secure if you use this extension.
  25. // This password is used to POST sessions to /api/v2/provide_sesh
  26. // It's also used as the external endpoint password.
  27. const FPLAY_PASSWORD = "cnc";
  28. // Endpoint 4get hits to render webpages
  29. // Eg: null=no endpoint provided
  30. // Or "https://your-endpoint.com/my-endpoint" (excluding get parameters like &pw)
  31. const FPLAY_EXTERNAL_ENDPOINT = null;
  32. //
  33. // BOT PROTECTION
  34. //
  35. // 0 = disabled, 1 = ask for image captcha, @TODO: 2 = invite only (users needs a pass)
  36. // VERY useful against a targetted attack
  37. const BOT_PROTECTION = 0;
  38. // if BOT_PROTECTION is set to 1, specify the available datasets here
  39. // images should be named from 1.png to X.png, and be 100x100 in size
  40. // Eg. data/captcha/birds/1.png up to 2263.png
  41. const CAPTCHA_DATASET = [
  42. // example:
  43. //["birds", 2263],
  44. //["fumo_plushies", 1006],
  45. //["minecraft", 848]
  46. ];
  47. // If this regex expression matches on the user agent, it blocks the request
  48. // Not useful at all against a targetted attack
  49. const HEADER_REGEX = '/bot|wget|curl|python-requests|scrapy|go-http-client|ruby|yahoo|spider|qwant|meta/i';
  50. // Block clients who present any of the following headers in their request (SPECIFY IN !!lowercase!!)
  51. // Eg: ["x-forwarded-for", "x-via", "forwarded-for", "via"];
  52. // Useful for blocking *some* proxies used for botting
  53. const FILTERED_HEADER_KEYS = [
  54. //"x-forwarded-for",
  55. //"x-cluster-client-ip",
  56. //"x-client-ip",
  57. //"x-real-ip",
  58. //"client-ip",
  59. //"real-ip",
  60. //"forwarded-for",
  61. //"forwarded-for-ip",
  62. //"forwarded",
  63. //"proxy-connection",
  64. //"remote-addr",
  65. //"via"
  66. ];
  67. // Block SSL ciphers used by CLI tools used for botting
  68. // Basically a primitive version of Cloudflare's browser integrity check
  69. // ** If curl can still access the site (with spoofed headers), please make sure you use the new apache2 config **
  70. // https://git.lolcat.ca/lolcat/4get/docs/apache2.md
  71. const DISALLOWED_SSL = [
  72. // "TLS_AES_256_GCM_SHA384" // used by WGET and CURL
  73. ];
  74. // Maximal number of searches per captcha key/pass issued. Counter gets
  75. // reset on every APCU cache clear (should happen once a day).
  76. // Only useful when BOT_PROTECTION is NOT set to 0
  77. const MAX_SEARCHES = 100;
  78. // List of domains that point to your servers. Include your tor/i2p
  79. // addresses here! Must be a valid URL. Won't affect links placed on
  80. // the homepage.
  81. const ALT_ADDRESSES = [
  82. //"https://4get.alt-tld",
  83. //"http://4getwebfrq5zr4sxugk6htxvawqehxtdgjrbcn2oslllcol2vepa23yd.onion"
  84. ];
  85. // Known 4get instances. MUST use the https protocol if your instance uses
  86. // it. Is used to generate a distributed list of instances.
  87. // To appear in the list of an instance, contact the host and if everyone added
  88. // eachother your serber should appear everywhere.
  89. const INSTANCES = [
  90. "https://4get.ca",
  91. "https://4get.zzls.xyz",
  92. "https://4getus.zzls.xyz",
  93. "https://4get.silly.computer",
  94. "https://4get.konakona.moe",
  95. "https://4get.lvkaszus.pl",
  96. "https://4g.ggtyler.dev",
  97. "https://4get.perennialte.ch",
  98. "https://4get.sijh.net",
  99. "https://4get.hbubli.cc",
  100. "https://4get.plunked.party",
  101. "https://4get.etenie.pl",
  102. "https://4get.lunar.icu",
  103. "https://4get.dcs0.hu",
  104. "https://4get.kizuki.lol",
  105. "https://4get.psily.garden",
  106. "https://search.milivojevic.in.rs",
  107. "https://4get.snine.nl",
  108. "https://4get.datura.network",
  109. "https://4get.neco.lol",
  110. "https://4get.lol",
  111. "https://4get.ch",
  112. "https://4get.edmateo.site",
  113. "https://4get.sudovanilla.org",
  114. "https://search.mint.lgbt"
  115. ];
  116. // Default user agent to use for scraper requests. Sometimes ignored to get specific webpages
  117. // Changing this might break things.
  118. const USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:153.0) Gecko/20100101 Firefox/153.0";
  119. // User agent to use with 4get-friendly APIs
  120. const USER_AGENT_FRIENDLY = "4get-scrapist (+https://4get.ca)";
  121. // Proxy pool assignments for each scraper
  122. // false = Use server's raw IP
  123. // string = will load a proxy list from data/proxies
  124. // Eg. "onion" will load data/proxies/onion.txt
  125. const PROXY_DDG = false; // duckduckgo
  126. const PROXY_YAHOO = false;
  127. const PROXY_YAHOO_JAPAN = false;
  128. const PROXY_BRAVE = false;
  129. const PROXY_GOOGLE = false;
  130. const PROXY_GOOGLE_API = false;
  131. const PROXY_GOOGLE_CSE = false;
  132. const PROXY_STARTPAGE = false;
  133. const PROXY_QWANT = false;
  134. const PROXY_BAIDU = false;
  135. const PROXY_COCCOC = false;
  136. const PROXY_GHOSTERY = false;
  137. const PROXY_MARGINALIA = false;
  138. const PROXY_MOJEEK = false;
  139. const PROXY_SC = false; // soundcloud
  140. const PROXY_SWISSCOWS = false;
  141. const PROXY_SPOTIFY = false;
  142. const PROXY_SOLOFIELD = false;
  143. const PROXY_PURILI = false;
  144. const PROXY_WIBY = false;
  145. const PROXY_CURLIE = false;
  146. const PROXY_YT = false; // youtube
  147. const PROXY_ARCHIVEORG = false;
  148. const PROXY_SEPIASEARCH = false;
  149. const PROXY_ODYSEE = false;
  150. const PROXY_VIMEO = false;
  151. const PROXY_YEP = false;
  152. const PROXY_PINTEREST = false;
  153. const PROXY_FLICKR = false;
  154. const PROXY_PIXABAY = false;
  155. const PROXY_UNSPLASH = false;
  156. const PROXY_PEXELS = false;
  157. const PROXY_FIVEHPX = false;
  158. const PROXY_VSCO = false;
  159. const PROXY_SEZNAM = false;
  160. const PROXY_NAVER = false;
  161. const PROXY_MWMBL = false;
  162. const PROXY_FTM = false; // findthatmeme
  163. const PROXY_IMGUR = false;
  164. const PROXY_CARA = false;
  165. const PROXY_YANDEX_W = false; // yandex web
  166. const PROXY_YANDEX_I = false; // yandex images
  167. const PROXY_YANDEX_V = false; // yandex videos
  168. const PROXY_SAFEBOORU = false;
  169. const PROXY_KONACHAN = false;
  170. const PROXY_YANDERE = false;
  171. const PROXY_TBIB = false;
  172. const PROXY_GELBOORU = false;
  173. //
  174. // Scraper-specific parameters
  175. //
  176. // GOOGLE CSE & GOOGLE API
  177. const GOOGLE_CX_ENDPOINT = "d4e68b99b876541f0";
  178. // MARGINALIA
  179. // Use "null" to default out to HTML scraping OR specify a string to
  180. // use the API (Eg: "public"). API has less filters.
  181. const MARGINALIA_API_KEY = null;
  182. // Yep
  183. const YEP_USE_API = false;
  184. }