Merge branch 'rolling' into optimize-and-make-code-idiomatic
Browse files- .github/workflows/rust.yml +4 -3
- .github/workflows/rust_format.yml +4 -3
- Cargo.lock +17 -15
- Cargo.toml +4 -3
- Dockerfile +1 -1
- README.md +1 -1
- docs/installation.md +1 -1
- src/server/routes.rs +1 -0
.github/workflows/rust.yml
CHANGED
@@ -21,9 +21,10 @@ jobs:
|
|
21 |
- stable
|
22 |
|
23 |
steps:
|
24 |
-
-
|
25 |
-
|
26 |
-
|
|
|
27 |
- uses: actions/checkout@v3
|
28 |
- run: rustup toolchain install stable --profile minimal
|
29 |
- uses: Swatinem/rust-cache@v2
|
|
|
21 |
- stable
|
22 |
|
23 |
steps:
|
24 |
+
- name: Install LuaJIT and Lua
|
25 |
+
run: |
|
26 |
+
sudo apt-get update
|
27 |
+
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
|
28 |
- uses: actions/checkout@v3
|
29 |
- run: rustup toolchain install stable --profile minimal
|
30 |
- uses: Swatinem/rust-cache@v2
|
.github/workflows/rust_format.yml
CHANGED
@@ -13,9 +13,10 @@ jobs:
|
|
13 |
name: Rust project
|
14 |
runs-on: ubuntu-latest
|
15 |
steps:
|
16 |
-
-
|
17 |
-
|
18 |
-
|
|
|
19 |
- uses: actions/checkout@v2
|
20 |
- name: Install minimal stable with clippy and rustfmt
|
21 |
uses: actions-rs/toolchain@v1
|
|
|
13 |
name: Rust project
|
14 |
runs-on: ubuntu-latest
|
15 |
steps:
|
16 |
+
- name: Install LuaJIT and Lua
|
17 |
+
run: |
|
18 |
+
sudo apt-get update
|
19 |
+
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
|
20 |
- uses: actions/checkout@v2
|
21 |
- name: Install minimal stable with clippy and rustfmt
|
22 |
uses: actions-rs/toolchain@v1
|
Cargo.lock
CHANGED
@@ -209,9 +209,9 @@ dependencies = [
|
|
209 |
|
210 |
[[package]]
|
211 |
name = "actix-web-codegen"
|
212 |
-
version = "4.2.
|
213 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
214 |
-
checksum = "
|
215 |
dependencies = [
|
216 |
"actix-router",
|
217 |
"proc-macro2 1.0.66",
|
@@ -248,9 +248,9 @@ dependencies = [
|
|
248 |
|
249 |
[[package]]
|
250 |
name = "aho-corasick"
|
251 |
-
version = "1.0.
|
252 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
253 |
-
checksum = "
|
254 |
dependencies = [
|
255 |
"memchr",
|
256 |
]
|
@@ -1723,9 +1723,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771"
|
|
1723 |
|
1724 |
[[package]]
|
1725 |
name = "memchr"
|
1726 |
-
version = "2.6.
|
1727 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1728 |
-
checksum = "
|
1729 |
|
1730 |
[[package]]
|
1731 |
name = "memoffset"
|
@@ -2040,19 +2040,20 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
|
|
2040 |
|
2041 |
[[package]]
|
2042 |
name = "pest"
|
2043 |
-
version = "2.7.
|
2044 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2045 |
-
checksum = "
|
2046 |
dependencies = [
|
|
|
2047 |
"thiserror",
|
2048 |
"ucd-trie",
|
2049 |
]
|
2050 |
|
2051 |
[[package]]
|
2052 |
name = "pest_derive"
|
2053 |
-
version = "2.7.
|
2054 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2055 |
-
checksum = "
|
2056 |
dependencies = [
|
2057 |
"pest",
|
2058 |
"pest_generator",
|
@@ -2060,9 +2061,9 @@ dependencies = [
|
|
2060 |
|
2061 |
[[package]]
|
2062 |
name = "pest_generator"
|
2063 |
-
version = "2.7.
|
2064 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2065 |
-
checksum = "
|
2066 |
dependencies = [
|
2067 |
"pest",
|
2068 |
"pest_meta",
|
@@ -2073,9 +2074,9 @@ dependencies = [
|
|
2073 |
|
2074 |
[[package]]
|
2075 |
name = "pest_meta"
|
2076 |
-
version = "2.7.
|
2077 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2078 |
-
checksum = "
|
2079 |
dependencies = [
|
2080 |
"once_cell",
|
2081 |
"pest",
|
@@ -3696,7 +3697,7 @@ dependencies = [
|
|
3696 |
|
3697 |
[[package]]
|
3698 |
name = "websurfx"
|
3699 |
-
version = "0.18.
|
3700 |
dependencies = [
|
3701 |
"actix-cors",
|
3702 |
"actix-files",
|
@@ -3714,6 +3715,7 @@ dependencies = [
|
|
3714 |
"md5",
|
3715 |
"mimalloc",
|
3716 |
"mlua",
|
|
|
3717 |
"rand 0.8.5",
|
3718 |
"redis",
|
3719 |
"regex",
|
|
|
209 |
|
210 |
[[package]]
|
211 |
name = "actix-web-codegen"
|
212 |
+
version = "4.2.2"
|
213 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
214 |
+
checksum = "eb1f50ebbb30eca122b188319a4398b3f7bb4a8cdf50ecfb73bfc6a3c3ce54f5"
|
215 |
dependencies = [
|
216 |
"actix-router",
|
217 |
"proc-macro2 1.0.66",
|
|
|
248 |
|
249 |
[[package]]
|
250 |
name = "aho-corasick"
|
251 |
+
version = "1.0.5"
|
252 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
253 |
+
checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783"
|
254 |
dependencies = [
|
255 |
"memchr",
|
256 |
]
|
|
|
1723 |
|
1724 |
[[package]]
|
1725 |
name = "memchr"
|
1726 |
+
version = "2.6.2"
|
1727 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1728 |
+
checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e"
|
1729 |
|
1730 |
[[package]]
|
1731 |
name = "memoffset"
|
|
|
2040 |
|
2041 |
[[package]]
|
2042 |
name = "pest"
|
2043 |
+
version = "2.7.3"
|
2044 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2045 |
+
checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33"
|
2046 |
dependencies = [
|
2047 |
+
"memchr",
|
2048 |
"thiserror",
|
2049 |
"ucd-trie",
|
2050 |
]
|
2051 |
|
2052 |
[[package]]
|
2053 |
name = "pest_derive"
|
2054 |
+
version = "2.7.3"
|
2055 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2056 |
+
checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a"
|
2057 |
dependencies = [
|
2058 |
"pest",
|
2059 |
"pest_generator",
|
|
|
2061 |
|
2062 |
[[package]]
|
2063 |
name = "pest_generator"
|
2064 |
+
version = "2.7.3"
|
2065 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2066 |
+
checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141"
|
2067 |
dependencies = [
|
2068 |
"pest",
|
2069 |
"pest_meta",
|
|
|
2074 |
|
2075 |
[[package]]
|
2076 |
name = "pest_meta"
|
2077 |
+
version = "2.7.3"
|
2078 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2079 |
+
checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f"
|
2080 |
dependencies = [
|
2081 |
"once_cell",
|
2082 |
"pest",
|
|
|
3697 |
|
3698 |
[[package]]
|
3699 |
name = "websurfx"
|
3700 |
+
version = "0.18.6"
|
3701 |
dependencies = [
|
3702 |
"actix-cors",
|
3703 |
"actix-files",
|
|
|
3715 |
"md5",
|
3716 |
"mimalloc",
|
3717 |
"mlua",
|
3718 |
+
"once_cell",
|
3719 |
"rand 0.8.5",
|
3720 |
"redis",
|
3721 |
"regex",
|
Cargo.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
[package]
|
2 |
name = "websurfx"
|
3 |
-
version = "0.18.
|
4 |
edition = "2021"
|
5 |
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."
|
6 |
repository = "https://github.com/neon-mmd/websurfx"
|
@@ -19,10 +19,11 @@ serde_json = {version="1.0.105"}
|
|
19 |
fake-useragent = {version="0.1.3"}
|
20 |
env_logger = {version="0.10.0"}
|
21 |
log = {version="0.4.20"}
|
22 |
-
mlua = {version="0.8.10",
|
23 |
-
redis = {version="0.23.2",
|
24 |
md5 = {version="0.7.0"}
|
25 |
rand={version="0.8.5"}
|
|
|
26 |
error-stack = {version="0.4.0"}
|
27 |
async-trait = {version="0.1.73"}
|
28 |
regex = {version="1.9.4", features=["perf"]}
|
|
|
1 |
[package]
|
2 |
name = "websurfx"
|
3 |
+
version = "0.18.6"
|
4 |
edition = "2021"
|
5 |
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."
|
6 |
repository = "https://github.com/neon-mmd/websurfx"
|
|
|
19 |
fake-useragent = {version="0.1.3"}
|
20 |
env_logger = {version="0.10.0"}
|
21 |
log = {version="0.4.20"}
|
22 |
+
mlua = {version="0.8.10",features=["luajit"]}
|
23 |
+
redis = {version="0.23.2",features=["tokio-comp","connection-manager"]}
|
24 |
md5 = {version="0.7.0"}
|
25 |
rand={version="0.8.5"}
|
26 |
+
once_cell = {version="1.18.0"}
|
27 |
error-stack = {version="0.4.0"}
|
28 |
async-trait = {version="0.1.73"}
|
29 |
regex = {version="1.9.4", features=["perf"]}
|
Dockerfile
CHANGED
@@ -19,7 +19,7 @@ COPY . .
|
|
19 |
RUN cargo install --path .
|
20 |
|
21 |
# We do not need the Rust toolchain to run the binary!
|
22 |
-
FROM gcr.io/distroless/cc-
|
23 |
COPY --from=builder /app/public/ /opt/websurfx/public/
|
24 |
COPY --from=builder /app/websurfx/config.lua /etc/xdg/websurfx/config.lua
|
25 |
COPY --from=builder /usr/local/cargo/bin/* /usr/local/bin/
|
|
|
19 |
RUN cargo install --path .
|
20 |
|
21 |
# We do not need the Rust toolchain to run the binary!
|
22 |
+
FROM gcr.io/distroless/cc-debian12
|
23 |
COPY --from=builder /app/public/ /opt/websurfx/public/
|
24 |
COPY --from=builder /app/websurfx/config.lua /etc/xdg/websurfx/config.lua
|
25 |
COPY --from=builder /usr/local/cargo/bin/* /usr/local/bin/
|
README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
<b align="center"><a href="README.md">Readme</a></b> |
|
6 |
<b><a href="https://discord.gg/SWnda7Mw5u">Discord</a></b> |
|
7 |
<b><a href="https://github.com/neon-mmd/websurfx">GitHub</a></b> |
|
8 |
-
<b><a href="
|
9 |
<br /><br />
|
10 |
<a href="#">
|
11 |
<img
|
|
|
5 |
<b align="center"><a href="README.md">Readme</a></b> |
|
6 |
<b><a href="https://discord.gg/SWnda7Mw5u">Discord</a></b> |
|
7 |
<b><a href="https://github.com/neon-mmd/websurfx">GitHub</a></b> |
|
8 |
+
<b><a href="../../tree/HEAD/docs/">Documentation</a></b>
|
9 |
<br /><br />
|
10 |
<a href="#">
|
11 |
<img
|
docs/installation.md
CHANGED
@@ -109,7 +109,7 @@ colorscheme = "catppuccin-mocha" -- the colorscheme name which should be used fo
|
|
109 |
theme = "simple" -- the theme name which should be used for the website
|
110 |
|
111 |
-- ### Caching ###
|
112 |
-
|
113 |
|
114 |
-- ### Search Engines ###
|
115 |
upstream_search_engines = { DuckDuckGo = true, Searx = false } -- select the upstream search engines from which the results should be fetched.
|
|
|
109 |
theme = "simple" -- the theme name which should be used for the website
|
110 |
|
111 |
-- ### Caching ###
|
112 |
+
redis_url = "redis://redis:6379" -- redis connection url address on which the client should connect on.
|
113 |
|
114 |
-- ### Search Engines ###
|
115 |
upstream_search_engines = { DuckDuckGo = true, Searx = false } -- select the upstream search engines from which the results should be fetched.
|
src/server/routes.rs
CHANGED
@@ -214,6 +214,7 @@ async fn results(
|
|
214 |
.await?
|
215 |
}
|
216 |
};
|
|
|
217 |
results.add_style(&config.style);
|
218 |
redis_cache
|
219 |
.clone()
|
|
|
214 |
.await?
|
215 |
}
|
216 |
};
|
217 |
+
|
218 |
results.add_style(&config.style);
|
219 |
redis_cache
|
220 |
.clone()
|