neon_arch commited on
Commit
e8ac546
β€’
1 Parent(s): 5bcf396

πŸ“ docs: update & improve the installation documentation (#281)

Browse files
Files changed (1) hide show
  1. docs/installation.md +231 -35
docs/installation.md CHANGED
@@ -2,16 +2,17 @@
2
 
3
  ## Arch Linux
4
 
5
- You can install `Websurfx` through the [Aur](https://aur.archlinux.org/packages/websurfx-git), Currently we only support `Rolling/Edge` version. You can install the rolling/edge version by running the following command (using [paru](https://github.com/Morganamilo/paru)):
6
 
7
- ```bash
 
 
8
  paru -S websurfx-edge-git
9
  ```
10
 
11
  After installing it you can run the websurfx server by running the following commands:
12
 
13
- ```bash
14
- redis-server --port 8082 &
15
  websurfx
16
  ```
17
 
@@ -19,40 +20,78 @@ Once you have started the server, open your preferred web browser and navigate t
19
 
20
  If you want to change the port or the ip or any other configuration setting checkout the [configuration docs](./configuration.md).
21
 
 
 
 
 
22
  ## NixOS
23
 
24
  A `flake.nix` has been provided to allow installing `websurfx` easily. It utilizes [nearsk](https://github.com/nix-community/naersk) to automatically generate a derivation based on `Cargo.toml` and `Cargo.lock`.
25
 
26
- The flake has several outputs, which may be consumed:
27
 
28
- ```bash
 
 
 
 
 
 
 
 
 
29
  nix build .#websurfx
30
  nix run .#websurfx
31
  ```
32
 
33
- You may include it in your own flake by adding this repo to its inputs and adding it to `environment.systemPackages` as follows:
 
34
 
35
- ```nix
36
- {
37
- description = "My awesome configuration";
38
 
39
- inputs = {
40
- websurfx.url = "github:neon-mmd/websurfx";
41
- };
42
 
43
- outputs = { nixpkgs, ... }@inputs: {
44
- nixosConfigurations = {
45
- hostname = nixpkgs.lib.nixosSystem {
46
- system = "x86_64-linux";
47
- modules = [{
48
- environment.systemPackages = [inputs.websurfx.packages.x86_64-linux.websurfx];
49
- }];
50
- };
51
- };
52
- };
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  ```
55
 
 
 
 
56
  ## Other Distros
57
 
58
  The package is currently not available on other Linux distros. With contribution and support it can be made available on other distros as well πŸ™‚.
@@ -87,21 +126,61 @@ git clone https://github.com/neon-mmd/websurfx.git
87
  cd websurfx
88
  ```
89
 
90
- Once you have changed the directory to the `websurfx` directory then follow the build options listed in the [building docs](./building.md).
91
 
92
- After that run the following command if you have build the app with the `redis-cache` feature:
93
 
94
- ``` shell
95
- redis-server --port 8082 &
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  ```
97
 
98
- After that run the following command to start the search engine:
 
 
 
 
99
 
100
- ``` shell
 
 
101
  ./target/release/websurfx
102
  ```
103
 
104
- Once you have started the server, open your preferred web browser and navigate to http://127.0.0.1:8080/ to start using Websurfx.
105
 
106
  If you want to change the port or the ip or any other configuration setting checkout the [configuration docs](./configuration.md).
107
 
@@ -109,7 +188,121 @@ If you want to change the port or the ip or any other configuration setting chec
109
 
110
  Before you start, you will need [Docker](https://docs.docker.com/get-docker/) installed on your system first.
111
 
112
- ## Unstable/Edge/Rolling
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
  First clone the the repository by running the following command:
115
 
@@ -178,15 +371,18 @@ upstream_search_engines = {
178
  } -- select the upstream search engines from which the results should be fetched.
179
  ```
180
 
181
- After this run the following command to deploy the app:
182
 
183
  ```bash
184
- docker compose up -d --build
185
  ```
186
 
 
 
 
187
  This will take around 5-10 mins for first deployment, afterwards the docker build stages will be cached so it will be faster to be build from next time onwards. After the above step finishes launch your preferred browser and then navigate to `http://<ip_address_of_the_device>:<whatever_port_you_provided_in_the_config>`.
188
 
189
- ## Stable
190
 
191
  For the stable version, follow the same steps as above (as mentioned for the unstable/rolling/edge version) with an addition of one command which has to be performed after cloning and changing directory into the repository which makes the cloning step as follows:
192
 
 
2
 
3
  ## Arch Linux
4
 
5
+ ### Rolling/Edge/Unstable
6
 
7
+ You can install `Websurfx` through the [Aur](https://aur.archlinux.org/packages/websurfx-git), By running the following command (using [paru](https://github.com/Morganamilo/paru)):
8
+
9
+ ```shell
10
  paru -S websurfx-edge-git
11
  ```
12
 
13
  After installing it you can run the websurfx server by running the following commands:
14
 
15
+ ```shell
 
16
  websurfx
17
  ```
18
 
 
20
 
21
  If you want to change the port or the ip or any other configuration setting checkout the [configuration docs](./configuration.md).
22
 
23
+ ### Stable
24
+
25
+ For the stable version, follow the same steps as above (as mentioned for the `unstable/rolling/edge` version) with the only difference being that the package to be installed for stable version is called `websurfx-git` instead of `websurfx-edge-git`.
26
+
27
  ## NixOS
28
 
29
  A `flake.nix` has been provided to allow installing `websurfx` easily. It utilizes [nearsk](https://github.com/nix-community/naersk) to automatically generate a derivation based on `Cargo.toml` and `Cargo.lock`.
30
 
31
+ The Websurfx project provides 2 versions/flavours for the flake `stable` and `rolling/unstable/edge`. The steps for each are covered below in different sections.
32
 
33
+ ### Rolling/Edge/Unstable
34
+
35
+ To get started, First clone the repository, edit the config file which is located in the `websurfx` directory and then build and run the websurfx server by running the following commands:
36
+
37
+ ```shell
38
+ git clone https://github.com/neon-mmd/websurfx.git
39
+ cd websurfx
40
+ cp -rf ./websurfx/ ~/.config/
41
+ $ mkdir /opt/websurfx/
42
+ $ cp -rf ./public/ /opt/websurfx/
43
  nix build .#websurfx
44
  nix run .#websurfx
45
  ```
46
 
47
+ > **Note**
48
+ > In the above command the dollar sign(**$**) refers to running the command in privilaged mode by using utilities `sudo`, `doas`, `pkgexec` or any other privilage access methods.
49
 
50
+ Once you have run the above set of commands, then open your preferred web browser and navigate to http://127.0.0.1:8080/ to start using Websurfx.
 
 
51
 
52
+ If you want to change the port or the ip or any other configuration setting checkout the [configuration docs](./configuration.md).
 
 
53
 
54
+ > Optionally, you may include it in your own flake by adding this repo to its inputs and adding it to `environment.systemPackages` as follows:
55
+ >
56
+ > ```nix
57
+ > {
58
+ > description = "My awesome configuration";
59
+ >
60
+ > inputs = {
61
+ > websurfx.url = "github:neon-mmd/websurfx";
62
+ > };
63
+ >
64
+ > outputs = { nixpkgs, ... }@inputs: {
65
+ > nixosConfigurations = {
66
+ > hostname = nixpkgs.lib.nixosSystem {
67
+ > system = "x86_64-linux";
68
+ > modules = [{
69
+ > environment.systemPackages = [inputs.websurfx.packages.x86_64-linux.websurfx];
70
+ > }];
71
+ > };
72
+ > };
73
+ > };
74
+ > }
75
+ > ```
76
+
77
+ ### Stable
78
+
79
+ For the stable version, follow the same steps as above (as mentioned for the `unstable/rolling/edge version`) with an addition of one command which has to be performed after cloning and changing directory into the repository which makes the building step as follows:
80
+
81
+ ```shell
82
+ git clone https://github.com/neon-mmd/websurfx.git
83
+ cd websurfx
84
+ git checkout stable
85
+ cp -rf ./websurfx/ ~/.config/
86
+ $ mkdir /opt/websurfx/
87
+ $ cp -rf ./public/ /opt/websurfx/
88
+ nix build .#websurfx
89
+ nix run .#websurfx
90
  ```
91
 
92
+ > **Note**
93
+ > In the above command the dollar sign(**$**) refers to running the command in privilaged mode by using utilities `sudo`, `doas`, `pkgexec` or any other privilage access methods.
94
+
95
  ## Other Distros
96
 
97
  The package is currently not available on other Linux distros. With contribution and support it can be made available on other distros as well πŸ™‚.
 
126
  cd websurfx
127
  ```
128
 
129
+ Once you have changed the directory to the `websurfx` directory then follow the build options listed below:
130
 
131
+ ### Hybrid Cache
132
 
133
+ > For more information on the features and their pros and cons. see: [**Features**](./features.md)
134
+
135
+ To build the search engine with the `Hybrid caching` feature. Run the following build command:
136
+
137
+ ```shell
138
+ cargo build -r --features redis-cache
139
+ ```
140
+
141
+ ### Memory Cache (Default Feature)
142
+
143
+ > For more information on the features and their pros and cons. see: [**Features**](./features.md)
144
+
145
+ To build the search engine with the `In-Memory caching` feature. Run the following build command:
146
+
147
+ ```shell
148
+ cargo build -r
149
+ ```
150
+
151
+ ### No Cache
152
+
153
+ > For more information on the features and their pros and cons. see: [**Features**](./features.md)
154
+
155
+ To build the search engine with the `No caching` feature. Run the following build command:
156
+
157
+ ```shell
158
+ cargo build -r --no-default-features
159
+ ```
160
+
161
+ ### Redis Cache
162
+
163
+ > For more information on the features and their pros and cons. see: [**Features**](./features.md)
164
+
165
+ To build the search engine with the `hybrid caching` feature. Run the following build command:
166
+
167
+ ```shell
168
+ cargo build -r --no-default-features --features redis-cache
169
  ```
170
 
171
+ > Optionally, If you have build the app with the `Redis cache`or `Hybrid cache` feature (as mentioned above) then before launching the search engine run the following command:
172
+ >
173
+ > ```shell
174
+ > redis-server --port 8082 &
175
+ > ```
176
 
177
+ Once you have finished building the `search engine`. then run the following command to start the search engine:
178
+
179
+ ```shell
180
  ./target/release/websurfx
181
  ```
182
 
183
+ Once you have started the server, then launch your preferred web browser and navigate to http://127.0.0.1:8080/ to start using Websurfx.
184
 
185
  If you want to change the port or the ip or any other configuration setting checkout the [configuration docs](./configuration.md).
186
 
 
188
 
189
  Before you start, you will need [Docker](https://docs.docker.com/get-docker/) installed on your system first.
190
 
191
+ ## Prebuild
192
+
193
+ The Websurfx project provides several prebuild images based on the different features provided by the search engine. To get started using the prebuild image, you will first need to create a `docker-compose.yml` file with the following content:
194
+
195
+ ```yaml
196
+ ---
197
+ version: '3.9'
198
+ services:
199
+ app:
200
+ # Comment the line below if you don't want to use the `hybrid/latest` image.
201
+ image: neonmmd/websurfx:latest
202
+ # Uncomment the line below if you want to use the `no cache` image.
203
+ # image: neonmmd/websurfx:nocache
204
+ # Uncomment the line below if you want to use the `memory` image.
205
+ # image: neonmmd/websurfx:memory
206
+ # Uncomment the line below if you want to use the `redis` image.
207
+ # image: neonmmd/websurfx:redis
208
+ ports:
209
+ - 8080:8080
210
+ # Uncomment the following lines if you are using the `hybrid/latest` or `redis` image.
211
+ # depends_on:
212
+ # - redis
213
+ # links:
214
+ # - redis
215
+ volumes:
216
+ - ./websurfx/:/etc/xdg/websurfx/
217
+ # Uncomment the following lines if you are using the `hybrid/latest` or `redis` image.
218
+ # redis:
219
+ # image: redis:latest
220
+ # ports:
221
+ # - 6379:6379
222
+ ```
223
+
224
+ Then make sure to edit the `docker-compose.yml` file as required. After that create a directory `websurfx` in the directory you have placed the `docker-compose.yml` file, and then in the new directory create two new empty files named `allowlist.txt` and `blocklist.txt`. Finally, create a new config file `config.lua` with the default configuration, which looks something like this:
225
+
226
+ ```lua
227
+ -- ### General ###
228
+ logging = true -- an option to enable or disable logs.
229
+ debug = false -- an option to enable or disable debug mode.
230
+ threads = 8 -- the amount of threads that the app will use to run (the value should be greater than 0).
231
+
232
+ -- ### Server ###
233
+ port = "8080" -- port on which server should be launched
234
+ binding_ip = "0.0.0.0" --ip address on the which server should be launched.
235
+ production_use = false -- whether to use production mode or not (in other words this option should be used if it is to be used to host it on the server to provide a service to a large number of users (more than one))
236
+ -- if production_use is set to true
237
+ -- There will be a random delay before sending the request to the search engines, this is to prevent DDoSing the upstream search engines from a large number of simultaneous requests.
238
+ request_timeout = 30 -- timeout for the search requests sent to the upstream search engines to be fetched (value in seconds).
239
+ rate_limiter = {
240
+ number_of_requests = 20, -- The number of request that are allowed within a provided time limit.
241
+ time_limit = 3, -- The time limit in which the quantity of requests that should be accepted.
242
+ }
243
+
244
+ -- ### Search ###
245
+ -- Filter results based on different levels. The levels provided are:
246
+ -- {{
247
+ -- 0 - None
248
+ -- 1 - Low
249
+ -- 2 - Moderate
250
+ -- 3 - High
251
+ -- 4 - Aggressive
252
+ -- }}
253
+ safe_search = 2
254
+
255
+ -- ### Website ###
256
+ -- The different colorschemes provided are:
257
+ -- {{
258
+ -- catppuccin-mocha
259
+ -- dark-chocolate
260
+ -- dracula
261
+ -- gruvbox-dark
262
+ -- monokai
263
+ -- nord
264
+ -- oceanic-next
265
+ -- one-dark
266
+ -- solarized-dark
267
+ -- solarized-light
268
+ -- tokyo-night
269
+ -- tomorrow-night
270
+ -- }}
271
+ colorscheme = "catppuccin-mocha" -- the colorscheme name which should be used for the website theme
272
+ theme = "simple" -- the theme name which should be used for the website
273
+
274
+ -- ### Caching ###
275
+ redis_url = "redis://redis:6379" -- redis connection url address on which the client should connect on.
276
+
277
+ -- ### Search Engines ###
278
+ upstream_search_engines = {
279
+ DuckDuckGo = true,
280
+ Searx = false,
281
+ } -- select the upstream search engines from which the results should be fetched.
282
+ ```
283
+
284
+ Then run the following command to deploy the search engine:
285
+
286
+ ```shell
287
+ $ docker compose up -d
288
+ ```
289
+
290
+ > **Note**
291
+ > In the above command the dollar sign(**$**) refers to running the command in privilaged mode by using utilities `sudo`, `doas`, `pkgexec` or any other privilage access methods.
292
+
293
+ Then launch the browser of your choice and navigate to http://<ip_address_of_the_device>:<whatever_port_you_provided_in_the_config>.
294
+
295
+ > **Note**
296
+ > The official prebuild images only support `stable` versions of the app and will not support `rolling/edge/unstable` versions. But with support and contribution it could be made available for these versions as well πŸ™‚.
297
+
298
+ ## Manual Deployment
299
+
300
+ This section covers how to deploy the app with docker manually by manually building the image and deploying it.
301
+
302
+ > **Note**
303
+ > This section is provided for those who want to futher customize the docker image or for those who are extra cautious about security.
304
+
305
+ ### Unstable/Edge/Rolling
306
 
307
  First clone the the repository by running the following command:
308
 
 
371
  } -- select the upstream search engines from which the results should be fetched.
372
  ```
373
 
374
+ After this make sure to edit the `docker-compose.yml` and `Dockerfile` files as required and run the following command to deploy the app:
375
 
376
  ```bash
377
+ $ docker compose up -d --build
378
  ```
379
 
380
+ > **Note**
381
+ > In the above command the dollar sign(**$**) refers to running the command in privilaged mode by using utilities `sudo`, `doas`, `pkgexec` or any other privilage access methods.
382
+
383
  This will take around 5-10 mins for first deployment, afterwards the docker build stages will be cached so it will be faster to be build from next time onwards. After the above step finishes launch your preferred browser and then navigate to `http://<ip_address_of_the_device>:<whatever_port_you_provided_in_the_config>`.
384
 
385
+ ### Stable
386
 
387
  For the stable version, follow the same steps as above (as mentioned for the unstable/rolling/edge version) with an addition of one command which has to be performed after cloning and changing directory into the repository which makes the cloning step as follows:
388