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

Compare commits

...

11 Commits

Author SHA1 Message Date
Łukasz Mariański
6144eb15f6
Merge 9615f0d9e6 into 913ca1b075 2024-10-04 06:32:28 +00:00
Łukasz Mariański
9615f0d9e6
Merge branch 'rolling' into proxy 2024-10-04 06:32:25 +00:00
m00nwtchr
d20c5c4dab
fix 2024-10-04 08:28:44 +02:00
Łukasz Mariański
808707c43b
Update Cargo.toml
Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>
2024-10-04 06:21:41 +00:00
Łukasz Mariański
aa18ce3a67
Update websurfx/config.lua
Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>
2024-10-04 06:21:26 +00:00
Łukasz Mariański
6464827834
Update src/config/parser.rs
Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>
2024-10-04 06:21:11 +00:00
dependabot[bot]
913ca1b075
build(deps): bump tempfile from 3.12.0 to 3.13.0 (#612) 2024-10-02 08:24:27 +00:00
dependabot[bot]
5d59a2c7be
build(deps): bump error-stack from 0.4.1 to 0.5.0 (#611) 2024-10-02 04:50:58 +00:00
dependabot[bot]
ecc6875a21
build(deps): bump actix-governor from 0.5.0 to 0.6.0 (#609) 2024-10-02 04:45:58 +00:00
dependabot[bot]
d75693ce4e
build(deps): bump regex from 1.10.6 to 1.11.0 (#610) 2024-10-02 02:09:30 +00:00
dependabot[bot]
e7efca4a4e
build(deps): bump redis from 0.25.4 to 0.27.2 (#613) 2024-10-02 02:04:26 +00:00
4 changed files with 48 additions and 43 deletions

65
Cargo.lock generated
View File

@ -59,9 +59,9 @@ dependencies = [
[[package]] [[package]]
name = "actix-governor" name = "actix-governor"
version = "0.5.0" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2e7b88f3804e01bd4191fdb08650430bbfcb43d3d9b2890064df3551ec7d25b" checksum = "0954b0f27aabd8f56bb03f2a77b412ddf3f8c034a3c27b2086c1fc75415760df"
dependencies = [ dependencies = [
"actix-http", "actix-http",
"actix-web", "actix-web",
@ -1180,9 +1180,9 @@ dependencies = [
[[package]] [[package]]
name = "error-stack" name = "error-stack"
version = "0.4.1" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27a72baa257b5e0e2de241967bc5ee8f855d6072351042688621081d66b2a76b" checksum = "fe413319145d1063f080f27556fd30b1d70b01e2ba10c2a6e40d4be982ffc5d1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"rustc_version 0.4.1", "rustc_version 0.4.1",
@ -2411,12 +2411,31 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21"
[[package]]
name = "num-bigint"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
dependencies = [
"num-integer",
"num-traits",
]
[[package]] [[package]]
name = "num-conv" name = "num-conv"
version = "0.1.0" version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]]
name = "num-integer"
version = "0.1.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
dependencies = [
"num-traits",
]
[[package]] [[package]]
name = "num-traits" name = "num-traits"
version = "0.2.19" version = "0.2.19"
@ -3127,9 +3146,9 @@ dependencies = [
[[package]] [[package]]
name = "redis" name = "redis"
version = "0.25.4" version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0d7a6955c7511f60f3ba9e86c6d02b3c3f144f8c24b288d1f4e18074ab8bbec" checksum = "a7e86f5670bd8b028edfb240f0616cad620705b31ec389d55e4f3da2c38dcd48"
dependencies = [ dependencies = [
"arc-swap", "arc-swap",
"async-trait", "async-trait",
@ -3138,6 +3157,7 @@ dependencies = [
"futures 0.3.30", "futures 0.3.30",
"futures-util", "futures-util",
"itoa 1.0.11", "itoa 1.0.11",
"num-bigint",
"percent-encoding 2.3.1", "percent-encoding 2.3.1",
"pin-project-lite", "pin-project-lite",
"ryu", "ryu",
@ -3164,9 +3184,9 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.10.6" version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8"
dependencies = [ dependencies = [
"aho-corasick 1.1.3", "aho-corasick 1.1.3",
"memchr", "memchr",
@ -3176,9 +3196,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-automata" name = "regex-automata"
version = "0.4.7" version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3"
dependencies = [ dependencies = [
"aho-corasick 1.1.3", "aho-corasick 1.1.3",
"memchr", "memchr",
@ -3193,9 +3213,9 @@ checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a"
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.8.4" version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]] [[package]]
name = "reqwest" name = "reqwest"
@ -3266,7 +3286,6 @@ dependencies = [
"sync_wrapper", "sync_wrapper",
"tokio 1.40.0", "tokio 1.40.0",
"tokio-rustls", "tokio-rustls",
"tokio-socks",
"tokio-util", "tokio-util",
"tower-service", "tower-service",
"url 2.5.2", "url 2.5.2",
@ -3336,9 +3355,9 @@ dependencies = [
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.38.36" version = "0.38.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"errno", "errno",
@ -3832,9 +3851,9 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.12.0" version = "3.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"fastrand", "fastrand",
@ -4097,18 +4116,6 @@ dependencies = [
"tokio 1.40.0", "tokio 1.40.0",
] ]
[[package]]
name = "tokio-socks"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f"
dependencies = [
"either",
"futures-util",
"thiserror",
"tokio 1.38.0",
]
[[package]] [[package]]
name = "tokio-sync" name = "tokio-sync"
version = "0.1.8" version = "0.1.8"

View File

@ -46,22 +46,22 @@ mlua = { version = "0.9.9", features = [
"luajit", "luajit",
"vendored", "vendored",
], default-features = false } ], default-features = false }
redis = { version = "0.25.4", features = [ redis = { version = "0.27.2", features = [
"tokio-comp", "tokio-comp",
"connection-manager", "connection-manager",
"tcp_nodelay" "tcp_nodelay"
], default-features = false, optional = true } ], default-features = false, optional = true }
blake3 = { version = "1.5.4", 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.5.0", default-features = false, features = [
"std", "std",
] } ] }
async-trait = { version = "0.1.80", default-features = false } async-trait = { version = "0.1.80", default-features = false }
regex = { version = "1.9.4", features = ["perf"], default-features = false } regex = { version = "1.11.0", features = ["perf"], 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.43", 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.6.0", default-features = false }
moka = { version = "0.12.8", optional = true, default-features = false, features = [ moka = { version = "0.12.8", optional = true, default-features = false, features = [
"future", "future",
] } ] }
@ -91,7 +91,7 @@ itertools = {version = "0.13.0", default-features = false}
[dev-dependencies] [dev-dependencies]
rusty-hook = { version = "^0.11.2", default-features = false } rusty-hook = { version = "^0.11.2", default-features = false }
criterion = { version = "0.5.1", default-features = false } criterion = { version = "0.5.1", default-features = false }
tempfile = { version = "3.10.1", default-features = false } tempfile = { version = "3.13.0", default-features = false }
[build-dependencies] [build-dependencies]
lightningcss = { version = "1.0.0-alpha.57", default-features = false, features = [ lightningcss = { version = "1.0.0-alpha.57", default-features = false, features = [
@ -174,7 +174,7 @@ opt-level = "z"
[features] [features]
use-synonyms-search = ["thesaurus/static"] use-synonyms-search = ["thesaurus/static"]
default = ["memory-cache", "socks"] default = ["memory-cache"]
dhat-heap = ["dep:dhat"] dhat-heap = ["dep:dhat"]
memory-cache = ["dep:moka"] memory-cache = ["dep:moka"]
redis-cache = ["dep:redis", "dep:base64"] redis-cache = ["dep:redis", "dep:base64"]
@ -183,4 +183,3 @@ encrypt-cache-results = ["dep:chacha20poly1305", "dep:chacha20"]
cec-cache-results = ["compress-cache-results", "encrypt-cache-results"] cec-cache-results = ["compress-cache-results", "encrypt-cache-results"]
experimental-io-uring = ["actix-web/experimental-io-uring"] experimental-io-uring = ["actix-web/experimental-io-uring"]
use-non-static-synonyms-search = ["thesaurus"] use-non-static-synonyms-search = ["thesaurus"]
socks = ["reqwest/socks"]

View File

@ -123,14 +123,13 @@ impl Config {
_ => parsed_cet, _ => parsed_cet,
}; };
let proxy_str = globals.get::<_, String>("proxy")?; let proxy_opt = globals.get::<_, Option<String>>("proxy")?;
let proxy = match Proxy::all(proxy_str) { let proxy = proxy_opt.and_then(|proxy_str| {
Ok(proxy) => Some(proxy), Proxy::all(proxy_str).ok().and_then(|_| {
Err(_) => {
log::error!("Invalid proxy url, defaulting to no proxy."); log::error!("Invalid proxy url, defaulting to no proxy.");
None None
} })
}; });
Ok(Config { Ok(Config {
port: globals.get::<_, u16>("port")?, port: globals.get::<_, u16>("port")?,

View File

@ -76,4 +76,4 @@ upstream_search_engines = {
Bing = false, Bing = false,
} -- select the upstream search engines from which the results should be fetched. } -- select the upstream search engines from which the results should be fetched.
proxy = "" -- Proxy to send outgoing requests through. Set to empty string to disable. proxy = nil -- Proxy to send outgoing requests through. Set to nil to disable.