0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-11-25 15:38:21 -05:00
Commit Graph

46 Commits

Author SHA1 Message Date
Kekma
b1df4f1154
feat(config): config option to timeout idle connections within the reqwest pool (#551) 2024-03-30 16:05:44 +03:00
Kekma
c584a7d601
feat(config): config option to keep tcp connection alive for a certain period for subsequent requests (#548)
* Added new HTTP connection setting to the reqwest::ClientBuilder to timeout requests for fetching the search results from the upstream search engines.

* Provided a config option under the server section of the config to allow users to keep tcp connections alive for each request for a certain period of time

* Update src/results/aggregator.rs

Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>

* Update src/results/aggregator.rs

Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>

* Fixed import issue in `tcp_connection_keepalive`

* updated size to u8

Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>

* Fixed sizer eror in `parser.rs`

---------

Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>
Co-authored-by: alamin655 <129589283+alamin655@users.noreply.github.com>
2024-03-25 12:11:56 +03:00
neon_arch
991f3f59de
perf: several optimizations for improving the performance of the engine (#540)
* ♻️ refactor: initialize & store the config & cache structs as a constant (#486)
- initializes & stores the config & cache structs as a static constant.
- Pass the config & cache structs as a static reference to all the
  functions handling their respective route.

*  perf: replace hashmaps with vectors for fetching & aggregating results (#486)
- replace hashmaps with vectors for fetching, collecting & aggregating results as it tends to be contigous & cache efficient data structure.
- refactor & redesign algorithms for fetching & aggregating results
  centered around vectors in aggregate function.

*  build: add the future crate (#486)

*  perf: use `futureunordered` for collecting results fetched from the tokio spawn tasks (#486)
- using the `futureunordered` instead of vector for collecting results
  reduces the time it takes to fetch the results as the results do not
  need to come in specific order so any result that gets fetched first
  gets collected in the `futureunordered` type.

Co-authored-by: Spencerjibz <spencernajib2@gmail.com>

*  perf: initialize new async connections parallely using tokio spawn tasks (#486)

*  perf: initialize redis pipeline struct once with the default size of 3 (#486)

*  perf: reduce branch predictions by reducing conditional code branches (#486)

*  test(unit): provide unit test for the `get_safesearch_level` function (#486)

*  perf: reduce clones & use index based loop to improve search results filtering performance (#486)

* 🚨 fix(clippy): make clippy/format checks happy (#486)

* 🚨 fix(build): make the cargo build check happy (#486)

*  perf: reduce the amount of clones, to_owneds & to_strings (#486)

*  perf: use async crates & methods & make functions async (#486)

* 🔖 chore(release): bump the app version (#486)

---------

Co-authored-by: Spencerjibz <spencernajib2@gmail.com>
2024-03-11 12:01:30 +03:00
ddotthomas
41ab8a2a76
config option to configure the https adaptive window size for requests (#529)
* Added config option to enable the reqwest client adaptive window

* Change adaptive window config name

Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>

* Modified documentation

* Trimmed down aggregate parameters

---------

Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>
2024-02-28 15:08:29 +03:00
abdulahad5112
851ea314a7
🐛 parsed_cet not found in scope error when building the app with the no-cache feature #498 (#502)
Co-authored-by: alamin655 <129589283+alamin655@users.noreply.github.com>
2024-01-30 07:14:31 +00:00
neon_arch
76419a7353 feat: provide code to parse the new config option (#424) 2023-12-11 21:10:28 +03:00
Ashwin Vinod
5a8d61f231
Config option to customize the cache invalidation/expiry time (#403) 2023-11-30 15:09:17 +03:00
víctor
5e2669b6de
♻️ Clean some code, fix bug (#396)
* ♻️ Improve src/handler

Removes unnecessary submoduling & adjusts some weird code

* ♻️ Cleaner code

* 🐛 Fixed issue where code would overflow if page=0
2023-11-27 09:45:28 +03:00
neon_arch
c39d9ff0b0 ♻️ refactor: rewrite the parsing of the upstream search engines option (#302) 2023-11-18 21:46:36 +03:00
Zsombor Gegesy
8ed4c9e206 Propagate errors upward, if an engine can't be initialized 2023-10-07 10:31:58 +02:00
Zsombor Gegesy
75a77d25f0 Create separate search_result_parser 2023-10-07 00:33:44 +02:00
neon_arch
8c239e2313 🛠️ fix: make the redis_url option only available on redis-cache feature (#244) 2023-09-17 12:50:25 +03:00
Zsombor Gegesy
e69126c5ea Fix git rebase problems, and the failing doctest 2023-09-15 23:25:17 +02:00
Zsombor Gegesy
76795c43cc Make the cache types compile time feature flags too, and make it more configurable! 2023-09-15 23:21:19 +02:00
Zsombor Gegesy
996ff84c5b Cache refactor - add an in-memory cache, so redis is not needed 2023-09-15 23:21:19 +02:00
neon_arch
ca4447fcdf Merge branch 'rolling' into reorganize-code-and-restructure-the-codebase 2023-09-13 18:31:37 +03:00
neon_arch
c60fdb8366 🧹 chore: make github actions happy (#205) 2023-09-12 18:53:32 +03:00
neon_arch
fb231de416
Merge branch 'rolling' into change-document-style-with-linter-warnings 2023-09-12 17:49:46 +03:00
neon_arch
b9d651c378 🧹 chore: make github actions happy (#203) 2023-09-11 20:16:42 +03:00
alamin655
8e56ac8ba2
Update parser.rs 2023-09-11 12:05:13 +05:30
alamin655
0132a63e6f
Apply suggestions from code review 2023-09-11 11:58:31 +05:30
alamin655
3c1aaf63f8
Update src/config/parser.rs 2023-09-11 11:56:12 +05:30
alamin655
531611f077
Update src/config/parser.rs 2023-09-11 11:54:21 +05:30
alamin655
70a5a2463b
Update src/config/parser.rs 2023-09-11 11:46:56 +05:30
alamin655
86991a2f9a
Merge branch 'rolling' into feat-rate-limiter-for-websurfx 2023-09-10 20:56:21 +05:30
neon_arch
493c56bd02 ⚙️ refactor: reorganize code & restructure codebase for better maintainability (#207) 2023-09-03 20:50:50 +03:00
neon_arch
049b1c1ddd ⚙️ refactor: change & add documentation to the code based on the lints (#205) 2023-09-03 19:23:34 +03:00
neon_arch
8cba040d80 feat: add code to parse the new config option (#203) 2023-09-02 20:21:48 +03:00
neon_arch
4eb75a8cb1 feat: add code to parse the new config option (#203) 2023-09-02 20:19:43 +03:00
neon_arch
7b33744c9d ⚙️ refactor: implement default trait for Style struct (#180)(#178) 2023-08-27 20:56:29 +03:00
neon_arch
e4476aae28 ⚙️ refactor: replace rlua with mlua code implementation (#180)(#178) 2023-08-27 20:55:34 +03:00
neon_arch
09227d8c93 feat: move implementation of config file path to reduce duplication (#163) 2023-08-22 19:20:29 +03:00
Milim
87e230d731 fix debug level not being set properly 2023-08-19 09:09:09 +02:00
Milim
21403d0a48 fix dumb rustfmt version and bump dependency versions 2023-08-18 22:04:34 +02:00
Milim
5aca5c0d0d Improve aggregation
Adds the EngineHandler struct
Removes vulnerability where an attacker could send requests cookies with fake engine names and crash the server.
Merged RawSearchResult and SearchResult, as they were functionally identical.
2023-08-18 10:43:53 +02:00
Milim
15dfda6ea9 Improve Aggregation function & config parser
Refactor aggregation function
Rename visiting_url to url, as they are always the same (see upstream engine scalping).
Refactor parsing function to be more readable.
2023-08-17 22:48:20 +02:00
neon_arch
653d08c801 🔧 chore: fix link in the logs & add logs for engine error (#170) 2023-08-05 19:16:27 +03:00
neon_arch
8b0f2f50f0 🔧 chore: improve logging based on levels & config options (#173) 2023-08-03 23:09:08 +03:00
neon_arch
4b4dc28cd2 feat: add control check to avoid reinitializing logging & fix tests 2023-08-03 00:12:09 +03:00
neon_arch
11bcf9c98a feat: remove space from the end of the line 2023-08-02 20:07:29 +03:00
neon_arch
d8bd2feb6e feat: add new config option to manage threads and improve logging 2023-08-02 20:05:39 +03:00
neon_arch
9cb582a10d feat: improve code documentation 2023-07-30 17:08:47 +03:00
neon_arch
6d3396b6f9 feat: provide functionality to parse the new config option 2023-07-30 10:52:03 +03:00
neon_arch
74e4fc6169 Merge branch 'rolling' into improve-async-multithreading 2023-07-15 19:50:31 +03:00
Trickshotblaster
99936bcb1a Rename getter functions 2023-07-04 15:11:30 -07:00
Milim
440216871d Rename Things, refactor some code
BREAKING: renames `binding_ip_addr` to `binding_ip` and `redis_connection_url` to `redis_url`.

Renames a lot of internals as well, but they are to many to mention.
2023-07-03 19:30:25 +02:00