0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-11-24 23:18:22 -05:00

Compare commits

...

28 Commits

Author SHA1 Message Date
neon_arch
4d5e7bddda
Merge branch 'rolling' into 532 2024-09-03 13:10:37 +05:30
alamin655
4847a6eed2
Merge pull request #567 from neon-mmd/FEAT/566_initial-support-for-low-powered-devices-with-other-architectures
 Initial support for low powered devices with other architectures
2024-09-02 18:36:23 +05:30
neon_arch
951060dc45
Merge branch 'rolling' into FEAT/566_initial-support-for-low-powered-devices-with-other-architectures 2024-09-02 18:00:20 +05:30
dependabot[bot]
2693cd18d2
build(deps): bump scraper from 0.18.1 to 0.20.0 (#597) 2024-09-02 07:51:28 +00:00
dependabot[bot]
838d1b6958
build(deps): bump async-compression from 0.4.11 to 0.4.12 (#596) 2024-09-02 05:13:22 +00:00
dependabot[bot]
c527897a4d
build(deps): bump actix-web from 4.8.0 to 4.9.0 (#595) 2024-09-02 05:08:37 +00:00
dependabot[bot]
2141b88c35
build(deps): bump blake3 from 1.5.1 to 1.5.4 (#594) 2024-09-02 02:19:10 +00:00
dependabot[bot]
b0c99f25e5
build(deps): bump serde from 1.0.203 to 1.0.209 (#593) 2024-09-02 02:13:42 +00:00
dependabot[bot]
d5c4206afe
⬆️ Bump actix-web from 4.6.0 to 4.8.0 (#582) 2024-08-16 09:46:54 +00:00
dependabot[bot]
4950106871
⬆️ Bump mlua from 0.9.8 to 0.9.9 (#583) 2024-08-16 09:39:54 +00:00
dependabot[bot]
0b48f671cb
⬆️ Bump mimalloc from 0.1.42 to 0.1.43 (#585) 2024-08-16 08:22:03 +00:00
dependabot[bot]
16717bc27d
⬆️ Bump reqwest from 0.12.4 to 0.12.5 (#586) 2024-08-16 08:17:12 +00:00
dependabot[bot]
f51d2e6881
⬆️ Bump openssl from 0.10.64 to 0.10.66 (#587) 2024-08-16 08:00:09 +00:00
dependabot[bot]
ad5b754741
⬆️ Bump serde_json from 1.0.117 to 1.0.122 (#588) 2024-08-16 07:54:54 +00:00
dependabot[bot]
d5524d7eae
⬆️ build(deps): bump reqwest from 0.11.25 to 0.12.4 (#575) 2024-06-08 19:05:09 +00:00
dependabot[bot]
3c2533f69a
build(deps): bump async-compression from 0.4.6 to 0.4.11 (#579) 2024-06-08 18:28:42 +00:00
dependabot[bot]
8225d34a9c
build(deps): bump lightningcss from 1.0.0-alpha.55 to 1.0.0-alpha.57 (#578) 2024-06-08 18:23:44 +00:00
dependabot[bot]
d2954862ea
build(deps): bump mlua from 0.9.6 to 0.9.8 (#577) 2024-06-08 18:19:00 +00:00
dependabot[bot]
f55abf934d
build(deps): bump redis from 0.24.0 to 0.25.4 (#576) 2024-06-07 19:08:26 +00:00
dependabot[bot]
052d9fd167
build(deps): bump rust from 1.77.2-alpine3.18 to 1.78.0-alpine3.18 (#574) 2024-06-07 19:01:29 +00:00
Alex Curtis-Slep
bf7e73f9ff
📝 docs(readme): list three new features provided by the search engine (#570) 2024-05-15 20:47:17 +00:00
alamin655
2f4e4038b1
Merge branch 'rolling' into FEAT/566_initial-support-for-low-powered-devices-with-other-architectures 2024-05-11 21:14:41 +05:30
ddotthomas
5d06cce220
feat(config): option to keep the websurfx server connection alive for a certain period for subsequent requests (#568) 2024-05-09 17:24:12 +00:00
neon_arch
33363a83ef
Merge branch 'rolling' into FEAT/566_initial-support-for-low-powered-devices-with-other-architectures 2024-05-06 20:35:17 +00:00
neon_arch
6200c5d53c 🚨 chore: make clippy checks happy (#566) 2024-05-06 23:19:25 +03:00
neon_arch
bbc49cbf42 🔖 chore(release): bump the app version (#566) 2024-05-04 20:29:43 +03:00
ddotthomas
408858a91e
:bandage: fix: temporary fix for minifying js files (#565) 2024-05-04 19:57:40 +03:00
neon_arch
4993da4d89 feat: multiple profiles to support various devices with other architectures (#566)
- Add 2 profiles with binary size reduction feature to allow devices
  with low storage to compile/build the app with smaller size.
- Add 3 profiles to allow devices with low powered cpus or other
  architectures like arm to compile apps using less cpu usage.
- Add 6 profiles with hybrid of both for both low powered cpu and low
  storage devices.
2024-05-04 18:54:37 +03:00
9 changed files with 773 additions and 510 deletions

1179
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package] [package]
name = "websurfx" name = "websurfx"
version = "1.12.1" version = "1.17.0"
edition = "2021" edition = "2021"
description = "An open-source alternative to Searx that provides clean, ad-free, and organic results with incredible speed while keeping privacy and security in mind." description = "An open-source alternative to Searx that provides clean, ad-free, and organic results with incredible speed while keeping privacy and security in mind."
repository = "https://github.com/neon-mmd/websurfx" repository = "https://github.com/neon-mmd/websurfx"
@ -13,10 +13,11 @@ bench = false
path = "src/bin/websurfx.rs" path = "src/bin/websurfx.rs"
[dependencies] [dependencies]
reqwest = { version = "0.11.24", default-features = false, features = [ reqwest = { version = "0.12.5", default-features = false, features = [
"rustls-tls", "rustls-tls",
"brotli", "brotli",
"gzip", "gzip",
"http2"
] } ] }
tokio = { version = "1.32.0", features = [ tokio = { version = "1.32.0", features = [
"rt-multi-thread", "rt-multi-thread",
@ -24,13 +25,13 @@ tokio = { version = "1.32.0", features = [
"fs", "fs",
"io-util", "io-util",
], default-features = false } ], default-features = false }
serde = { version = "1.0.196", default-features = false, features = ["derive"] } serde = { version = "1.0.209", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.116", default-features = false } serde_json = { version = "1.0.122", default-features = false }
maud = { version = "0.26.0", default-features = false, features = [ maud = { version = "0.26.0", default-features = false, features = [
"actix-web", "actix-web",
] } ] }
scraper = { version = "0.18.1", default-features = false } scraper = { version = "0.20.0", default-features = false }
actix-web = { version = "4.4.0", features = [ actix-web = { version = "4.9.0", features = [
"cookies", "cookies",
"macros", "macros",
"compress-brotli", "compress-brotli",
@ -40,15 +41,15 @@ actix-cors = { version = "0.7.0", default-features = false }
fake-useragent = { version = "0.1.3", default-features = false } fake-useragent = { version = "0.1.3", default-features = false }
env_logger = { version = "0.11.1", default-features = false } env_logger = { version = "0.11.1", default-features = false }
log = { version = "0.4.21", default-features = false } log = { version = "0.4.21", default-features = false }
mlua = { version = "0.9.1", features = [ mlua = { version = "0.9.9", features = [
"luajit", "luajit",
"vendored", "vendored",
], default-features = false } ], default-features = false }
redis = { version = "0.24.0", features = [ redis = { version = "0.25.4", features = [
"tokio-comp", "tokio-comp",
"connection-manager", "connection-manager",
], default-features = false, optional = true } ], default-features = false, optional = true }
blake3 = { version = "1.5.0", default-features = false } blake3 = { version = "1.5.4", default-features = false }
error-stack = { version = "0.4.0", default-features = false, features = [ error-stack = { version = "0.4.0", default-features = false, features = [
"std", "std",
] } ] }
@ -60,13 +61,13 @@ smallvec = { version = "1.13.1", features = [
], default-features = false } ], default-features = false }
futures = { version = "0.3.30", default-features = false, features = ["alloc"] } futures = { version = "0.3.30", default-features = false, features = ["alloc"] }
dhat = { version = "0.3.2", optional = true, default-features = false } dhat = { version = "0.3.2", optional = true, default-features = false }
mimalloc = { version = "0.1.38", default-features = false } mimalloc = { version = "0.1.43", default-features = false }
async-once-cell = { version = "0.5.3", default-features = false } async-once-cell = { version = "0.5.3", default-features = false }
actix-governor = { version = "0.5.0", default-features = false } actix-governor = { version = "0.5.0", default-features = false }
mini-moka = { version = "0.10", optional = true, default-features = false, features = [ mini-moka = { version = "0.10", optional = true, default-features = false, features = [
"sync", "sync",
] } ] }
async-compression = { version = "0.4.6", default-features = false, features = [ async-compression = { version = "0.4.12", default-features = false, features = [
"brotli", "brotli",
"tokio", "tokio",
], optional = true } ], optional = true }
@ -96,10 +97,15 @@ criterion = { version = "0.5.1", default-features = false }
tempfile = { version = "3.10.1", default-features = false } tempfile = { version = "3.10.1", default-features = false }
[build-dependencies] [build-dependencies]
lightningcss = { version = "1.0.0-alpha.55", default-features = false, features = [ lightningcss = { version = "1.0.0-alpha.57", default-features = false, features = [
"grid", "grid",
] } ] }
minify-js = { version = "0.6.0", default-features = false } # Disabled until bug fixing update
# minify-js = { version = "0.6.0", default-features = false }
# Temporary fork with fix
minify-js = { git = "https://github.com/RuairidhWilliamson/minify-js", branch = "master", version = "0.6.0", default-features = false}
[profile.dev] [profile.dev]
opt-level = 0 opt-level = 0
@ -127,6 +133,50 @@ codegen-units = 1
rpath = false rpath = false
strip = "symbols" strip = "symbols"
[profile.bsr1]
inherits = "release"
opt-level = "s"
[profile.bsr2]
inherits = "bsr1"
opt-level = "z"
[profile.lpcb1]
inherits = "release"
codegen-units = 16
[profile.lpcb2]
inherits = "lpcb1"
lto = "off"
[profile.lpcb3]
inherits = "lpcb2"
opt-level = 2
[profile.bsr_and_lpcb1]
inherits = "lpcb1"
opt-level = "s"
[profile.bsr_and_lpcb2]
inherits = "lpcb2"
opt-level = "s"
[profile.bsr_and_lpcb3]
inherits = "lpcb3"
opt-level = "s"
[profile.bsr_and_lpcb4]
inherits = "lpcb1"
opt-level = "z"
[profile.bsr_and_lpcb5]
inherits = "lpcb1"
opt-level = "z"
[profile.bsr_and_lpcb6]
inherits = "lpcb1"
opt-level = "z"
[features] [features]
use-synonyms-search = ["thesaurus/static"] use-synonyms-search = ["thesaurus/static"]
default = ["memory-cache"] default = ["memory-cache"]

View File

@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM rust:1.77.2-alpine3.18 AS chef FROM --platform=$BUILDPLATFORM rust:1.78.0-alpine3.18 AS chef
# We only pay the installation cost once, # We only pay the installation cost once,
# it will be cached from the second build onwards # it will be cached from the second build onwards
RUN apk add --no-cache alpine-sdk musl-dev g++ make libcrypto3 libressl-dev upx perl build-base RUN apk add --no-cache alpine-sdk musl-dev g++ make libcrypto3 libressl-dev upx perl build-base

View File

@ -115,6 +115,9 @@
- 🚀 Easy to setup with Docker or on bare metal with various installation and deployment options. - 🚀 Easy to setup with Docker or on bare metal with various installation and deployment options.
- ⛔ Search filtering to filter search results based on four different levels. - ⛔ Search filtering to filter search results based on four different levels.
- 💾 Different caching levels focusing on reliability, speed and resiliancy. - 💾 Different caching levels focusing on reliability, speed and resiliancy.
- ⬆️ Organic Search results (with ranking algorithm builtin to rerank the search results according to user's search query.).
- 🔒 Different compression and encryption levels focusing on speed and privacy.
- 🧪 Experimental IO-uring feature for Linux operating systems focused on performance of the engine.
- 🔐 Fast, private, and secure - 🔐 Fast, private, and secure
- 🆓 100% free and open source - 🆓 100% free and open source
- 💨 Ad-free and clean results - 💨 Ad-free and clean results

View File

@ -1,5 +1,5 @@
# Create Builder image # Create Builder image
FROM --platform=$BUILDPLATFORM rust:1.77.2-alpine3.18 FROM --platform=$BUILDPLATFORM rust:1.78.0-alpine3.18
# Install required dependencies # Install required dependencies
RUN apk add --no-cache alpine-sdk musl-dev g++ make libcrypto3 libressl-dev perl build-base RUN apk add --no-cache alpine-sdk musl-dev g++ make libcrypto3 libressl-dev perl build-base

View File

@ -37,13 +37,15 @@ pub struct Config {
pub request_timeout: u8, pub request_timeout: u8,
/// It stores the number of threads which controls the app will use to run. /// It stores the number of threads which controls the app will use to run.
pub threads: u8, pub threads: u8,
/// Set the keep-alive time for client connections to the HTTP server
pub client_connection_keep_alive: u8,
/// It stores configuration options for the ratelimiting middleware. /// It stores configuration options for the ratelimiting middleware.
pub rate_limiter: RateLimiter, pub rate_limiter: RateLimiter,
/// It stores the level of safe search to be used for restricting content in the /// It stores the level of safe search to be used for restricting content in the
/// search results. /// search results.
pub safe_search: u8, pub safe_search: u8,
/// It stores the TCP connection keepalive duration in seconds. /// It stores the TCP connection keepalive duration in seconds.
pub tcp_connection_keepalive: u8, pub tcp_connection_keep_alive: u8,
/// It stores the pool idle connection timeout in seconds. /// It stores the pool idle connection timeout in seconds.
pub pool_idle_connection_timeout: u8, pub pool_idle_connection_timeout: u8,
} }
@ -135,9 +137,10 @@ impl Config {
upstream_search_engines: globals upstream_search_engines: globals
.get::<_, HashMap<String, bool>>("upstream_search_engines")?, .get::<_, HashMap<String, bool>>("upstream_search_engines")?,
request_timeout: globals.get::<_, u8>("request_timeout")?, request_timeout: globals.get::<_, u8>("request_timeout")?,
tcp_connection_keepalive: globals.get::<_, u8>("tcp_connection_keepalive")?, tcp_connection_keep_alive: globals.get::<_, u8>("tcp_connection_keep_alive")?,
pool_idle_connection_timeout: globals.get::<_, u8>("pool_idle_connection_timeout")?, pool_idle_connection_timeout: globals.get::<_, u8>("pool_idle_connection_timeout")?,
threads, threads,
client_connection_keep_alive: globals.get::<_, u8>("client_connection_keep_alive")?,
rate_limiter: RateLimiter { rate_limiter: RateLimiter {
number_of_requests: rate_limiter["number_of_requests"], number_of_requests: rate_limiter["number_of_requests"],
time_limit: rate_limiter["time_limit"], time_limit: rate_limiter["time_limit"],

View File

@ -14,7 +14,7 @@ pub mod results;
pub mod server; pub mod server;
pub mod templates; pub mod templates;
use std::{net::TcpListener, sync::OnceLock}; use std::{net::TcpListener, sync::OnceLock, time::Duration};
use crate::server::router; use crate::server::router;
@ -113,6 +113,10 @@ pub fn run(
.default_service(web::route().to(router::not_found)) // error page .default_service(web::route().to(router::not_found)) // error page
}) })
.workers(config.threads as usize) .workers(config.threads as usize)
// Set the keep-alive timer for client connections
.keep_alive(Duration::from_secs(
config.client_connection_keep_alive as u64,
))
// Start server on 127.0.0.1 with the user provided port number. for example 127.0.0.1:8080. // Start server on 127.0.0.1 with the user provided port number. for example 127.0.0.1:8080.
.listen(listener)? .listen(listener)?
.run(); .run();

View File

@ -81,7 +81,7 @@ pub async fn aggregate(
.pool_idle_timeout(Duration::from_secs( .pool_idle_timeout(Duration::from_secs(
config.pool_idle_connection_timeout as u64, config.pool_idle_connection_timeout as u64,
)) ))
.tcp_keepalive(Duration::from_secs(config.tcp_connection_keepalive as u64)) .tcp_keepalive(Duration::from_secs(config.tcp_connection_keep_alive as u64))
.connect_timeout(Duration::from_secs(config.request_timeout as u64)) // Add timeout to request to avoid DDOSing the server .connect_timeout(Duration::from_secs(config.request_timeout as u64)) // Add timeout to request to avoid DDOSing the server
.https_only(true) .https_only(true)
.gzip(true) .gzip(true)

View File

@ -10,14 +10,18 @@ production_use = false -- whether to use production mode or not (in other words
-- if production_use is set to true -- if production_use is set to true
-- 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. -- 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.
request_timeout = 30 -- timeout for the search requests sent to the upstream search engines to be fetched (value in seconds). request_timeout = 30 -- timeout for the search requests sent to the upstream search engines to be fetched (value in seconds).
tcp_connection_keepalive = 30 -- the amount of time the tcp connection should remain alive (or connected to the server). (value in seconds). tcp_connection_keep_alive = 30 -- the amount of time the tcp connection should remain alive to the upstream search engines (or connected to the server). (value in seconds).
pool_idle_connection_timeout = 30 -- timeout for the idle connections in the reqwest HTTP connection pool (value in seconds). pool_idle_connection_timeout = 30 -- timeout for the idle connections in the reqwest HTTP connection pool (value in seconds).
rate_limiter = { rate_limiter = {
number_of_requests = 20, -- The number of request that are allowed within a provided time limit. number_of_requests = 20, -- The number of request that are allowed within a provided time limit.
time_limit = 3, -- The time limit in which the quantity of requests that should be accepted. time_limit = 3, -- The time limit in which the quantity of requests that should be accepted.
} }
https_adaptive_window_size = false https_adaptive_window_size = false
number_of_https_connections = 10 -- the number of https connections that should be available in the connection pool. number_of_https_connections = 10 -- the number of https connections that should be available in the connection pool.
-- Set keep-alive timer in seconds; keeps clients connected to the HTTP server, different from the connection to upstream search engines
client_connection_keep_alive = 120
-- ### Search ### -- ### Search ###
-- Filter results based on different levels. The levels provided are: -- Filter results based on different levels. The levels provided are:
-- {{ -- {{