neon_arch commited on
Commit
8dfe2e1
·
unverified ·
2 Parent(s): 4a3dac6 9cded97

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

Browse files
.github/workflows/rust.yml CHANGED
@@ -21,9 +21,10 @@ jobs:
21
  - stable
22
 
23
  steps:
24
- - uses: leafo/gh-actions-lua@v10
25
- with:
26
- luaVersion: 'luajit'
 
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
- - uses: leafo/gh-actions-lua@v10
17
- with:
18
- luaVersion: 'luajit'
 
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
@@ -1707,9 +1707,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771"
1707
 
1708
  [[package]]
1709
  name = "memchr"
1710
- version = "2.6.1"
1711
  source = "registry+https://github.com/rust-lang/crates.io-index"
1712
- checksum = "f478948fd84d9f8e86967bf432640e46adfb5a4bd4f14ef7e864ab38220534ae"
1713
 
1714
  [[package]]
1715
  name = "memoffset"
@@ -2015,19 +2015,20 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
2015
 
2016
  [[package]]
2017
  name = "pest"
2018
- version = "2.7.2"
2019
  source = "registry+https://github.com/rust-lang/crates.io-index"
2020
- checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a"
2021
  dependencies = [
 
2022
  "thiserror",
2023
  "ucd-trie",
2024
  ]
2025
 
2026
  [[package]]
2027
  name = "pest_derive"
2028
- version = "2.7.2"
2029
  source = "registry+https://github.com/rust-lang/crates.io-index"
2030
- checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853"
2031
  dependencies = [
2032
  "pest",
2033
  "pest_generator",
@@ -2035,9 +2036,9 @@ dependencies = [
2035
 
2036
  [[package]]
2037
  name = "pest_generator"
2038
- version = "2.7.2"
2039
  source = "registry+https://github.com/rust-lang/crates.io-index"
2040
- checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929"
2041
  dependencies = [
2042
  "pest",
2043
  "pest_meta",
@@ -2048,9 +2049,9 @@ dependencies = [
2048
 
2049
  [[package]]
2050
  name = "pest_meta"
2051
- version = "2.7.2"
2052
  source = "registry+https://github.com/rust-lang/crates.io-index"
2053
- checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48"
2054
  dependencies = [
2055
  "once_cell",
2056
  "pest",
@@ -3671,7 +3672,7 @@ dependencies = [
3671
 
3672
  [[package]]
3673
  name = "websurfx"
3674
- version = "0.18.5"
3675
  dependencies = [
3676
  "actix-cors",
3677
  "actix-files",
@@ -3687,6 +3688,7 @@ dependencies = [
3687
  "log",
3688
  "md5",
3689
  "mlua",
 
3690
  "rand 0.8.5",
3691
  "redis",
3692
  "regex",
 
1707
 
1708
  [[package]]
1709
  name = "memchr"
1710
+ version = "2.6.2"
1711
  source = "registry+https://github.com/rust-lang/crates.io-index"
1712
+ checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e"
1713
 
1714
  [[package]]
1715
  name = "memoffset"
 
2015
 
2016
  [[package]]
2017
  name = "pest"
2018
+ version = "2.7.3"
2019
  source = "registry+https://github.com/rust-lang/crates.io-index"
2020
+ checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33"
2021
  dependencies = [
2022
+ "memchr",
2023
  "thiserror",
2024
  "ucd-trie",
2025
  ]
2026
 
2027
  [[package]]
2028
  name = "pest_derive"
2029
+ version = "2.7.3"
2030
  source = "registry+https://github.com/rust-lang/crates.io-index"
2031
+ checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a"
2032
  dependencies = [
2033
  "pest",
2034
  "pest_generator",
 
2036
 
2037
  [[package]]
2038
  name = "pest_generator"
2039
+ version = "2.7.3"
2040
  source = "registry+https://github.com/rust-lang/crates.io-index"
2041
+ checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141"
2042
  dependencies = [
2043
  "pest",
2044
  "pest_meta",
 
2049
 
2050
  [[package]]
2051
  name = "pest_meta"
2052
+ version = "2.7.3"
2053
  source = "registry+https://github.com/rust-lang/crates.io-index"
2054
+ checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f"
2055
  dependencies = [
2056
  "once_cell",
2057
  "pest",
 
3672
 
3673
  [[package]]
3674
  name = "websurfx"
3675
+ version = "0.18.6"
3676
  dependencies = [
3677
  "actix-cors",
3678
  "actix-files",
 
3688
  "log",
3689
  "md5",
3690
  "mlua",
3691
+ "once_cell",
3692
  "rand 0.8.5",
3693
  "redis",
3694
  "regex",
Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
  [package]
2
  name = "websurfx"
3
- version = "0.18.5"
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,16 +19,17 @@ 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", 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
  error-stack = {version="0.4.0"}
27
  async-trait = {version="0.1.73"}
28
- regex = {version="1.9.3", features=["perf"]}
29
- smallvec = {version="1.11.0", features=["union", "serde"]}
30
- futures = {version="0.3.28"}
31
  dhat = {version="0.3.2", optional = true}
 
32
 
33
  [dev-dependencies]
34
  rusty-hook = "^0.11.2"
 
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"]}
30
+ futures = {version="0.3.28"}dhat = {version="0.3.2", optional = true}
 
31
  dhat = {version="0.3.2", optional = true}
32
+ smallvec = {version="1.11.0", features=["union", "serde"]}
33
 
34
  [dev-dependencies]
35
  rusty-hook = "^0.11.2"
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-debian11
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="./docs/README.md">Documentation</a></b>
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
- redis_connection_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.
 
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
@@ -203,6 +203,7 @@ async fn results(
203
  .await?
204
  }
205
  };
 
206
  results.add_style(&config.style);
207
  redis_cache
208
  .cache_results(&serde_json::to_string(&results)?, &url)
 
203
  .await?
204
  }
205
  };
206
+
207
  results.add_style(&config.style);
208
  redis_cache
209
  .cache_results(&serde_json::to_string(&results)?, &url)