aboutsummaryrefslogtreecommitdiff
path: root/org/4get-guide.org
blob: a81545159fd4ca725261c357551892e0a3a4d4c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#+SETUPFILE: ../org-templates/level-1.org
#+BACKGROUND_IMAGE: images/4get-guide-background.jpg
#+TITLE: 4get guide

* About 4get
:PROPERTIES:
:CUSTOM_ID: about
:END:
4get is a meta search engine similar to searxng. Its faster, less resource
intense, and more reliable than searxng. *This guide is made for peeps using
4get with lighttpd+freebsd*. Those using a more sane setup should just check
out [[https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/][the 4getdocs]].

* Installing 4get
:PROPERTIES:
:CUSTOM_ID: installing
:END:
First install a few packages. Replace =84= with whatever php version your using.
#+begin_src shell
  pkp install lighttpd curl git php84 php84-curl php84-fileinfo php84-filter \
  php84-mbstring php84-pecl-APCu php84-pecl-imagick php84-sodium php84-zlib
#+end_src

Next cd into =/usr/local/www= or wherever you keep your website data and clone
the repo with =git clone --depth 1 https://git.lolcat.ca/lolcat/4get <whatever
the fuck you want>=

Now that you have it downloaded check out =data/config.php= and change it to
your liking. It's not my job to tell you how you want your 4get instance
configured (:

* Setting up lighttpd
:PROPERTIES:
:CUSTOM_ID: lighttpd
:END:
If your reading this you likely already used lighttpd since there is no other
reason you would pick lighttpd out of all the other web servers rofl. Well
anyways here is a basic config for 4get to get you started.
#+begin_src
  server.modules += ("mod_cgi", "mod_rewrite", "mod_fastcgi")
  server.name = "<whatever the fuck you want>"
  server.document-root = "/usr/local/www/<whatever the fuck you want>"
  index-file.names = ("index.php")
  cgi.execute-x-only = "disable"
  cgi.assign = (".php" => "/usr/local/bin/php-cgi")
  fastcgi.server = ( ".php" =>
                     ( "localhost" =>
                       (
                         "host" => "127.0.0.1",
                         "port" => 9123
                       )
                     )
                   )
  url.rewrite-once = (  "^(.*)/$" => "$1/" )
  url.rewrite-if-not-file = ( "^([^?]*)(\?.*)?$" => "$1.php$2" )
#+end_src
Start lighttpd with =service lighttpd enable= and =service lighttpd start=
*btw in freebsd =service lighttpd restart= doesn't work so instead you have to
kill it with something like htop.*

To prevent those annoying php warnings from showing up put these in
=/usr/local/etc/php.ini=
#+begin_src
  error_reporting = E_ALL &amp; ~E_DEPRECATED
  display_errors = On
#+end_src

* Tor proxy
:PROPERTIES:
:CUSTOM_ID: tor
:END:
Using a proxy is likely something you will want to do. Meta search engines tend
to get IP banned and all of that funky stuff.

** torrc
:PROPERTIES:
:CUSTOM_ID: torrc
:END:
To use tor as your proxy add these lines to =/usr/local/etc/tor/torrc=
#+begin_src
  SOCKSPort 127.0.0.1:9050
  DNSPort 53
  AutomapHostsOnResolve 1
#+end_src
The reason to also use torDNS is that if you don't you will get DNS leaks.

** Tor service
:PROPERTIES:
:CUSTOM_ID: service
:END:
For tor to be able to create a DNS server in freebsd add this to =/etc/rc.conf=
#+begin_src
  tor_setuid="YES"
#+end_src

To use tor DNS change the content of =/etc/resolv.conf= to
=nameserver 127.0.0.1=

Run =service tor enable= and =service tor start= to get it going

To config 4get to use tor edit =<4get directory>/data/config.php= and set all
the =const PROXY_<...>= to ="onion"=
#+begin_src php
  ...
  const PROXY_DDG = "onion"; // duckduckgo
  const PROXY_BRAVE = "onion";
  const PROXY_FB = "onion"; // facebook
  ...
#+end_src

** Freebsd pkg issue
:PROPERTIES:
:CUSTOM_ID: pkg
:END:
Freebsd pkg doesn't like torDNS. To fix that run
=mkdir -p /usr/local/etc/pkg/repos=
then =cp /etc/pkg/FreeBSD.conf /usr/local/etc/pkg/repos/=

Now change =/usr/local/etc/pkg/repos/FreeBSD.conf= to something like this:
#+begin_src
  FreeBSD: {
    url: "https://pkg.FreeBSD.org/${ABI}/quarterly",
    mirror_type: "none",
    signature_type: "fingerprints",
    fingerprints: "/usr/share/keys/pkg",
    enabled: yes
  }
#+end_src