neon_arch commited on
Commit
e8f9ad2
β€’
1 Parent(s): fb46d2c

πŸ“ docs: provide a note on the `pkg_env` environment variable & update the example config file (#439)

Browse files
Files changed (1) hide show
  1. docs/installation.md +33 -20
docs/installation.md CHANGED
@@ -44,7 +44,7 @@ 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 Privileged mode by using utilities `sudo`, `doas`, `pkgexec`, or any other privileged access methods.
49
 
50
  Once you have run the above set of commands, open your preferred web browser and navigate to http://127.0.0.1:8080/ to start using Websurfx.
@@ -89,7 +89,7 @@ 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 privileged mode by using utilities `sudo`, `doas`, `pkgexec`, or any other privileged access methods.
94
 
95
  ## Other Distros
@@ -128,6 +128,16 @@ cd websurfx
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)
@@ -285,22 +295,22 @@ Then run the following command to deploy the search engine:
285
  $ docker compose up -d
286
  ```
287
 
288
- > **Note**
289
  > In the above command the dollar sign(**$**) refers to running the command in privileged mode by using utilities `sudo`, `doas`, `pkgexec` or any other privileged access methods.
290
 
291
  Then launch the browser of your choice and navigate to http://<ip_address_of_the_device>:<whatever_port_you_provided_in_the_config>.
292
 
293
- > **Note**
294
  > 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 πŸ™‚.
295
 
296
  ## Manual Deployment
297
 
298
  This section covers how to deploy the app with docker manually by manually building the image and deploying it.
299
 
300
- > **Note**
301
  > This section is provided for those who want to further customize the docker image or for those who are extra cautious about security.
302
 
303
- > **Warning**
304
  > A note of caution the project currently only supports **x86-64** architecture and as such we do not recommend deploying the project on devices with other architectures. Though if you still want to do it then **do it at your own risk**.
305
 
306
  ### Unstable/Edge/Rolling
@@ -317,19 +327,19 @@ After that edit the config.lua file located under `websurfx` directory. In the c
317
  ```lua
318
  -- ### General ###
319
  logging = true -- an option to enable or disable logs.
320
- debug = false -- an option to enable or disable debug mode.
321
- threads = 8 -- the amount of threads that the app will use to run (the value should be greater than 0).
322
 
323
  -- ### Server ###
324
- port = "8080" -- port on which server should be launched
325
- binding_ip = "0.0.0.0" --ip address on the server should be launched.
326
- 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))
327
  -- if production_use is set to true
328
  -- 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.
329
- request_timeout = 30 -- timeout for the search requests sent to the upstream search engines to be fetched (value in seconds).
330
  rate_limiter = {
331
- number_of_requests = 20, -- The number of requests that are allowed within a provided time limit.
332
- time_limit = 3, -- The time limit in which the number of requests that should be accepted.
333
  }
334
 
335
  -- ### Search ###
@@ -360,15 +370,18 @@ safe_search = 2
360
  -- tomorrow-night
361
  -- }}
362
  colorscheme = "catppuccin-mocha" -- the colorscheme name which should be used for the website theme
363
- theme = "simple" -- the theme name which should be used for the website
364
 
365
  -- ### Caching ###
366
- redis_url = "redis://redis:6379" -- redis connection url address on which the client should connect on.
367
-
368
  -- ### Search Engines ###
369
  upstream_search_engines = {
370
- DuckDuckGo = true,
371
- Searx = false,
 
 
 
372
  } -- select the upstream search engines from which the results should be fetched.
373
  ```
374
 
@@ -378,7 +391,7 @@ After this make sure to edit the `docker-compose.yml` and `Dockerfile` files as
378
  $ docker compose up -d --build
379
  ```
380
 
381
- > **Note**
382
  > In the above command the dollar sign(**$**) refers to running the command in privileged mode by using utilities `sudo`, `doas`, `pkgexec`, or any other privileged access methods.
383
 
384
  This will take around 5-10 mins for the first deployment, afterwards, the docker build stages will be cached so it will be faster to 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>`.
 
44
  nix run .#websurfx
45
  ```
46
 
47
+ > [!Note]
48
  > In the above command the dollar sign(**$**) refers to running the command in Privileged mode by using utilities `sudo`, `doas`, `pkgexec`, or any other privileged access methods.
49
 
50
  Once you have run the above set of commands, open your preferred web browser and navigate to http://127.0.0.1:8080/ to start using Websurfx.
 
89
  nix run .#websurfx
90
  ```
91
 
92
+ > [!Note]
93
  > In the above command the dollar sign(**$**) refers to running the command in privileged mode by using utilities `sudo`, `doas`, `pkgexec`, or any other privileged access methods.
94
 
95
  ## Other Distros
 
128
 
129
  Once you have changed the directory to the `websurfx` directory then follow the build options listed below:
130
 
131
+ > [!Note]
132
+ > Before you start building the search engine using one of the below listed command. We would strongly recommend setting the `PKG_ENV` enviroment variable as this applies some special optimization to code to reduce the file and improve the page load speed of the website.
133
+ > To set the `PKG_ENV` enviroment variable in the `bash` shell run the following command:
134
+ >
135
+ > ```bash
136
+ > export PKG_ENV="prod"
137
+ > ```
138
+ >
139
+ > For how to set the environment variables in other shells. You can follow the instructions on how to do so by visiting the documentation of the specific shell you are using.
140
+
141
  ### Hybrid Cache
142
 
143
  > For more information on the features and their pros and cons. see: [**Features**](./features.md)
 
295
  $ docker compose up -d
296
  ```
297
 
298
+ > [!Note]
299
  > In the above command the dollar sign(**$**) refers to running the command in privileged mode by using utilities `sudo`, `doas`, `pkgexec` or any other privileged access methods.
300
 
301
  Then launch the browser of your choice and navigate to http://<ip_address_of_the_device>:<whatever_port_you_provided_in_the_config>.
302
 
303
+ > [!Note]
304
  > 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 πŸ™‚.
305
 
306
  ## Manual Deployment
307
 
308
  This section covers how to deploy the app with docker manually by manually building the image and deploying it.
309
 
310
+ > [!Note]
311
  > This section is provided for those who want to further customize the docker image or for those who are extra cautious about security.
312
 
313
+ > [!Warning]
314
  > A note of caution the project currently only supports **x86-64** architecture and as such we do not recommend deploying the project on devices with other architectures. Though if you still want to do it then **do it at your own risk**.
315
 
316
  ### Unstable/Edge/Rolling
 
327
  ```lua
328
  -- ### General ###
329
  logging = true -- an option to enable or disable logs.
330
+ debug = false -- an option to enable or disable debug mode.
331
+ threads = 10 -- the amount of threads that the app will use to run (the value should be greater than 0).
332
 
333
  -- ### Server ###
334
+ port = "8080" -- port on which server should be launched
335
+ binding_ip = "127.0.0.1" --ip address on the which server should be launched.
336
+ 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))
337
  -- if production_use is set to true
338
  -- 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.
339
+ request_timeout = 30 -- timeout for the search requests sent to the upstream search engines to be fetched (value in seconds).
340
  rate_limiter = {
341
+ number_of_requests = 20, -- The number of request that are allowed within a provided time limit.
342
+ time_limit = 3, -- The time limit in which the quantity of requests that should be accepted.
343
  }
344
 
345
  -- ### Search ###
 
370
  -- tomorrow-night
371
  -- }}
372
  colorscheme = "catppuccin-mocha" -- the colorscheme name which should be used for the website theme
373
+ theme = "simple" -- the theme name which should be used for the website
374
 
375
  -- ### Caching ###
376
+ redis_url = "redis://127.0.0.1:8082" -- redis connection url address on which the client should connect on.
377
+ cache_expiry_time = 600 -- This option takes the expiry time of the search results (value in seconds and the value should be greater than or equal to 60 seconds).
378
  -- ### Search Engines ###
379
  upstream_search_engines = {
380
+ DuckDuckGo = true,
381
+ Searx = false,
382
+ Brave = false,
383
+ Startpage = false,
384
+ LibreX = false,
385
  } -- select the upstream search engines from which the results should be fetched.
386
  ```
387
 
 
391
  $ docker compose up -d --build
392
  ```
393
 
394
+ > [!Note]
395
  > In the above command the dollar sign(**$**) refers to running the command in privileged mode by using utilities `sudo`, `doas`, `pkgexec`, or any other privileged access methods.
396
 
397
  This will take around 5-10 mins for the first deployment, afterwards, the docker build stages will be cached so it will be faster to 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>`.