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

Merge branch 'rolling' into optimize-and-make-code-idiomatic-3

This commit is contained in:
neon_arch 2023-09-10 17:58:28 +03:00 committed by GitHub
commit 8dfe2e1b2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 26 deletions

View File

@ -21,9 +21,10 @@ jobs:
- stable - stable
steps: steps:
- uses: leafo/gh-actions-lua@v10 - name: Install LuaJIT and Lua
with: run: |
luaVersion: 'luajit' sudo apt-get update
sudo apt-get install -y --no-install-recommends liblua5.4-dev liblua5.3-dev liblua5.2-dev liblua5.1-0-dev libluajit-5.1-dev
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: rustup toolchain install stable --profile minimal - run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2

View File

@ -13,9 +13,10 @@ jobs:
name: Rust project name: Rust project
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: leafo/gh-actions-lua@v10 - name: Install LuaJIT and Lua
with: run: |
luaVersion: 'luajit' sudo apt-get update
sudo apt-get install -y --no-install-recommends liblua5.4-dev liblua5.3-dev liblua5.2-dev liblua5.1-0-dev libluajit-5.1-dev
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install minimal stable with clippy and rustfmt - name: Install minimal stable with clippy and rustfmt
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1

24
Cargo.lock generated
View File

@ -1707,9 +1707,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771"
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.6.1" version = "2.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f478948fd84d9f8e86967bf432640e46adfb5a4bd4f14ef7e864ab38220534ae" checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e"
[[package]] [[package]]
name = "memoffset" name = "memoffset"
@ -2015,19 +2015,20 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
[[package]] [[package]]
name = "pest" name = "pest"
version = "2.7.2" version = "2.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33"
dependencies = [ dependencies = [
"memchr",
"thiserror", "thiserror",
"ucd-trie", "ucd-trie",
] ]
[[package]] [[package]]
name = "pest_derive" name = "pest_derive"
version = "2.7.2" version = "2.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a"
dependencies = [ dependencies = [
"pest", "pest",
"pest_generator", "pest_generator",
@ -2035,9 +2036,9 @@ dependencies = [
[[package]] [[package]]
name = "pest_generator" name = "pest_generator"
version = "2.7.2" version = "2.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141"
dependencies = [ dependencies = [
"pest", "pest",
"pest_meta", "pest_meta",
@ -2048,9 +2049,9 @@ dependencies = [
[[package]] [[package]]
name = "pest_meta" name = "pest_meta"
version = "2.7.2" version = "2.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f"
dependencies = [ dependencies = [
"once_cell", "once_cell",
"pest", "pest",
@ -3671,7 +3672,7 @@ dependencies = [
[[package]] [[package]]
name = "websurfx" name = "websurfx"
version = "0.18.5" version = "0.18.6"
dependencies = [ dependencies = [
"actix-cors", "actix-cors",
"actix-files", "actix-files",
@ -3687,6 +3688,7 @@ dependencies = [
"log", "log",
"md5", "md5",
"mlua", "mlua",
"once_cell",
"rand 0.8.5", "rand 0.8.5",
"redis", "redis",
"regex", "regex",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "websurfx" name = "websurfx"
version = "0.18.5" version = "0.18.6"
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"
@ -19,16 +19,17 @@ serde_json = {version="1.0.105"}
fake-useragent = {version="0.1.3"} fake-useragent = {version="0.1.3"}
env_logger = {version="0.10.0"} env_logger = {version="0.10.0"}
log = {version="0.4.20"} log = {version="0.4.20"}
mlua = {version="0.8.10", features=["luajit"]} mlua = {version="0.8.10",features=["luajit"]}
redis = {version="0.23.2", features=["tokio-comp", "connection-manager"]} redis = {version="0.23.2",features=["tokio-comp","connection-manager"]}
md5 = {version="0.7.0"} md5 = {version="0.7.0"}
rand={version="0.8.5"} rand={version="0.8.5"}
once_cell = {version="1.18.0"}
error-stack = {version="0.4.0"} error-stack = {version="0.4.0"}
async-trait = {version="0.1.73"} async-trait = {version="0.1.73"}
regex = {version="1.9.3", features=["perf"]} regex = {version="1.9.4", features=["perf"]}
smallvec = {version="1.11.0", features=["union", "serde"]} futures = {version="0.3.28"}dhat = {version="0.3.2", optional = true}
futures = {version="0.3.28"}
dhat = {version="0.3.2", optional = true} dhat = {version="0.3.2", optional = true}
smallvec = {version="1.11.0", features=["union", "serde"]}
[dev-dependencies] [dev-dependencies]
rusty-hook = "^0.11.2" rusty-hook = "^0.11.2"

View File

@ -19,7 +19,7 @@ COPY . .
RUN cargo install --path . RUN cargo install --path .
# We do not need the Rust toolchain to run the binary! # We do not need the Rust toolchain to run the binary!
FROM gcr.io/distroless/cc-debian11 FROM gcr.io/distroless/cc-debian12
COPY --from=builder /app/public/ /opt/websurfx/public/ COPY --from=builder /app/public/ /opt/websurfx/public/
COPY --from=builder /app/websurfx/config.lua /etc/xdg/websurfx/config.lua COPY --from=builder /app/websurfx/config.lua /etc/xdg/websurfx/config.lua
COPY --from=builder /usr/local/cargo/bin/* /usr/local/bin/ COPY --from=builder /usr/local/cargo/bin/* /usr/local/bin/

View File

@ -5,7 +5,7 @@
<b align="center"><a href="README.md">Readme</a></b> | <b align="center"><a href="README.md">Readme</a></b> |
<b><a href="https://discord.gg/SWnda7Mw5u">Discord</a></b> | <b><a href="https://discord.gg/SWnda7Mw5u">Discord</a></b> |
<b><a href="https://github.com/neon-mmd/websurfx">GitHub</a></b> | <b><a href="https://github.com/neon-mmd/websurfx">GitHub</a></b> |
<b><a href="./docs/README.md">Documentation</a></b> <b><a href="../../tree/HEAD/docs/">Documentation</a></b>
<br /><br /> <br /><br />
<a href="#"> <a href="#">
<img <img

View File

@ -109,7 +109,7 @@ colorscheme = "catppuccin-mocha" -- the colorscheme name which should be used fo
theme = "simple" -- the theme name which should be used for the website theme = "simple" -- the theme name which should be used for the website
-- ### Caching ### -- ### Caching ###
redis_connection_url = "redis://redis:6379" -- redis connection url address on which the client should connect on. redis_url = "redis://redis:6379" -- redis connection url address on which the client should connect on.
-- ### Search Engines ### -- ### Search Engines ###
upstream_search_engines = { DuckDuckGo = true, Searx = false } -- select the upstream search engines from which the results should be fetched. upstream_search_engines = { DuckDuckGo = true, Searx = false } -- select the upstream search engines from which the results should be fetched.

View File

@ -203,6 +203,7 @@ async fn results(
.await? .await?
} }
}; };
results.add_style(&config.style); results.add_style(&config.style);
redis_cache redis_cache
.cache_results(&serde_json::to_string(&results)?, &url) .cache_results(&serde_json::to_string(&results)?, &url)