alamin655 commited on
Commit
5fa5495
2 Parent(s): 564662b 1893e85

Merge branch 'rolling' into xss-fix

Browse files
.gitpod.yml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ image: ubuntu:latest
3
+ # Commands that will run on workspace start
4
+ tasks:
5
+ - name: Setup, Install & Build
6
+ - before: apt install cargo redis-server nodejs npm && cargo test
7
+ - init: cargo install cargo-watch
8
+ - command: redis-server --port 8080 & cargo watch -q -w "." -x "run"
9
+ # Ports to expose on workspace startup
10
+ ports:
11
+ - port: 8080
12
+ - onOpen: open-preview
13
+ - name: Website
14
+ - description: Website Preview
15
+ # vscode IDE setup
16
+ vscode:
17
+ extensions:
18
+ - vadimcn.vscode-lldb
19
+ - rust-lang.rust-analyzer
20
+ - bungcip.better-toml
21
+ - serayuzgur.crates
22
+ - usernamehw.errorlens
23
+ - DavidAnson.vscode-markdownlint
24
+ - esbenp.prettier-vscode
25
+ - stylelint.vscode-stylelint
26
+ - dbaeumer.vscode-eslint
27
+ - evgeniypeshkov.syntax-highlighter
28
+ - redhat.vscode-yaml
29
+ - ms-azuretools.vscode-docker
30
+ - GitHub.vscode-github-actions
31
+ - Catppuccin.catppuccin-vsc
32
+ - PKief.material-icon-theme
33
+ - tal7aouy.rainbow-bracket
34
+ - oderwat.indent-rainbow
35
+ - formulahendry.auto-rename-tag
36
+ - eamodio.gitlens
37
+ github:
38
+ prebuilds:
39
+ - master: true
40
+ - branches: true
41
+ - pullRequests: true
42
+ - pullRequestsFromForks: true
43
+ - addCheck: true
44
+ - addComment: false
45
+ - addBadge: true
CONTRIBUTING.md CHANGED
@@ -14,7 +14,7 @@ Know how to fix or improve a github action?. Consider Submitting a Pull request
14
 
15
  ## Source Code
16
 
17
- You should know atleast one of the things below to start contributing:
18
 
19
  - Rust basics
20
  - Actix-web crate basics
 
14
 
15
  ## Source Code
16
 
17
+ You should know at least one of the things below to start contributing:
18
 
19
  - Rust basics
20
  - Actix-web crate basics
Cargo.lock CHANGED
@@ -201,7 +201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
201
  checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9"
202
  dependencies = [
203
  "actix-router",
204
- "proc-macro2 1.0.60",
205
  "quote 1.0.28",
206
  "syn 1.0.109",
207
  ]
@@ -620,7 +620,7 @@ dependencies = [
620
  "itoa 1.0.6",
621
  "matches",
622
  "phf 0.10.1",
623
- "proc-macro2 1.0.60",
624
  "quote 1.0.28",
625
  "smallvec 1.10.0",
626
  "syn 1.0.109",
@@ -633,7 +633,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
633
  checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
634
  dependencies = [
635
  "quote 1.0.28",
636
- "syn 2.0.18",
637
  ]
638
 
639
  [[package]]
@@ -643,7 +643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
643
  checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
644
  dependencies = [
645
  "convert_case",
646
- "proc-macro2 1.0.60",
647
  "quote 1.0.28",
648
  "rustc_version 0.4.0",
649
  "syn 1.0.109",
@@ -771,7 +771,7 @@ version = "0.1.8"
771
  source = "registry+https://github.com/rust-lang/crates.io-index"
772
  checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
773
  dependencies = [
774
- "proc-macro2 1.0.60",
775
  "quote 1.0.28",
776
  "syn 1.0.109",
777
  "synstructure",
@@ -1082,7 +1082,7 @@ dependencies = [
1082
  "log",
1083
  "mac",
1084
  "markup5ever 0.11.0",
1085
- "proc-macro2 1.0.60",
1086
  "quote 1.0.28",
1087
  "syn 1.0.109",
1088
  ]
@@ -1662,9 +1662,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
1662
 
1663
  [[package]]
1664
  name = "openssl"
1665
- version = "0.10.54"
1666
  source = "registry+https://github.com/rust-lang/crates.io-index"
1667
- checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019"
1668
  dependencies = [
1669
  "bitflags",
1670
  "cfg-if 1.0.0",
@@ -1681,9 +1681,9 @@ version = "0.1.1"
1681
  source = "registry+https://github.com/rust-lang/crates.io-index"
1682
  checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
1683
  dependencies = [
1684
- "proc-macro2 1.0.60",
1685
  "quote 1.0.28",
1686
- "syn 2.0.18",
1687
  ]
1688
 
1689
  [[package]]
@@ -1694,9 +1694,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
1694
 
1695
  [[package]]
1696
  name = "openssl-sys"
1697
- version = "0.9.88"
1698
  source = "registry+https://github.com/rust-lang/crates.io-index"
1699
- checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617"
1700
  dependencies = [
1701
  "cc",
1702
  "libc",
@@ -1773,9 +1773,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
1773
 
1774
  [[package]]
1775
  name = "pest"
1776
- version = "2.6.1"
1777
  source = "registry+https://github.com/rust-lang/crates.io-index"
1778
- checksum = "16833386b02953ca926d19f64af613b9bf742c48dcd5e09b32fbfc9740bf84e2"
1779
  dependencies = [
1780
  "thiserror",
1781
  "ucd-trie",
@@ -1783,9 +1783,9 @@ dependencies = [
1783
 
1784
  [[package]]
1785
  name = "pest_derive"
1786
- version = "2.6.1"
1787
  source = "registry+https://github.com/rust-lang/crates.io-index"
1788
- checksum = "7763190f9406839f99e5197afee8c9e759969f7dbfa40ad3b8dbee8757b745b5"
1789
  dependencies = [
1790
  "pest",
1791
  "pest_generator",
@@ -1793,22 +1793,22 @@ dependencies = [
1793
 
1794
  [[package]]
1795
  name = "pest_generator"
1796
- version = "2.6.1"
1797
  source = "registry+https://github.com/rust-lang/crates.io-index"
1798
- checksum = "249061b22e99973da1f5f5f1410284419e283bb60b79255bf5f42a94b66a2e00"
1799
  dependencies = [
1800
  "pest",
1801
  "pest_meta",
1802
- "proc-macro2 1.0.60",
1803
  "quote 1.0.28",
1804
- "syn 2.0.18",
1805
  ]
1806
 
1807
  [[package]]
1808
  name = "pest_meta"
1809
- version = "2.6.1"
1810
  source = "registry+https://github.com/rust-lang/crates.io-index"
1811
- checksum = "457c310cfc9cf3f22bc58901cc7f0d3410ac5d6298e432a4f9a6138565cb6df6"
1812
  dependencies = [
1813
  "once_cell",
1814
  "pest",
@@ -1913,7 +1913,7 @@ dependencies = [
1913
  "phf_generator 0.10.0",
1914
  "phf_shared 0.10.0",
1915
  "proc-macro-hack",
1916
- "proc-macro2 1.0.60",
1917
  "quote 1.0.28",
1918
  "syn 1.0.109",
1919
  ]
@@ -1992,9 +1992,9 @@ dependencies = [
1992
 
1993
  [[package]]
1994
  name = "proc-macro2"
1995
- version = "1.0.60"
1996
  source = "registry+https://github.com/rust-lang/crates.io-index"
1997
- checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406"
1998
  dependencies = [
1999
  "unicode-ident",
2000
  ]
@@ -2024,7 +2024,7 @@ version = "1.0.28"
2024
  source = "registry+https://github.com/rust-lang/crates.io-index"
2025
  checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488"
2026
  dependencies = [
2027
- "proc-macro2 1.0.60",
2028
  ]
2029
 
2030
  [[package]]
@@ -2548,16 +2548,16 @@ version = "1.0.164"
2548
  source = "registry+https://github.com/rust-lang/crates.io-index"
2549
  checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
2550
  dependencies = [
2551
- "proc-macro2 1.0.60",
2552
  "quote 1.0.28",
2553
- "syn 2.0.18",
2554
  ]
2555
 
2556
  [[package]]
2557
  name = "serde_json"
2558
- version = "1.0.97"
2559
  source = "registry+https://github.com/rust-lang/crates.io-index"
2560
- checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a"
2561
  dependencies = [
2562
  "itoa 1.0.6",
2563
  "ryu",
@@ -2733,7 +2733,7 @@ checksum = "f0f45ed1b65bf9a4bf2f7b7dc59212d1926e9eaf00fa998988e420fd124467c6"
2733
  dependencies = [
2734
  "phf_generator 0.7.24",
2735
  "phf_shared 0.7.24",
2736
- "proc-macro2 1.0.60",
2737
  "quote 1.0.28",
2738
  "string_cache_shared",
2739
  ]
@@ -2746,7 +2746,7 @@ checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988"
2746
  dependencies = [
2747
  "phf_generator 0.10.0",
2748
  "phf_shared 0.10.0",
2749
- "proc-macro2 1.0.60",
2750
  "quote 1.0.28",
2751
  ]
2752
 
@@ -2773,18 +2773,18 @@ version = "1.0.109"
2773
  source = "registry+https://github.com/rust-lang/crates.io-index"
2774
  checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
2775
  dependencies = [
2776
- "proc-macro2 1.0.60",
2777
  "quote 1.0.28",
2778
  "unicode-ident",
2779
  ]
2780
 
2781
  [[package]]
2782
  name = "syn"
2783
- version = "2.0.18"
2784
  source = "registry+https://github.com/rust-lang/crates.io-index"
2785
- checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e"
2786
  dependencies = [
2787
- "proc-macro2 1.0.60",
2788
  "quote 1.0.28",
2789
  "unicode-ident",
2790
  ]
@@ -2795,7 +2795,7 @@ version = "0.12.6"
2795
  source = "registry+https://github.com/rust-lang/crates.io-index"
2796
  checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
2797
  dependencies = [
2798
- "proc-macro2 1.0.60",
2799
  "quote 1.0.28",
2800
  "syn 1.0.109",
2801
  "unicode-xid 0.2.4",
@@ -2850,9 +2850,9 @@ version = "1.0.40"
2850
  source = "registry+https://github.com/rust-lang/crates.io-index"
2851
  checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
2852
  dependencies = [
2853
- "proc-macro2 1.0.60",
2854
  "quote 1.0.28",
2855
- "syn 2.0.18",
2856
  ]
2857
 
2858
  [[package]]
@@ -2994,9 +2994,9 @@ version = "2.1.0"
2994
  source = "registry+https://github.com/rust-lang/crates.io-index"
2995
  checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
2996
  dependencies = [
2997
- "proc-macro2 1.0.60",
2998
  "quote 1.0.28",
2999
- "syn 2.0.18",
3000
  ]
3001
 
3002
  [[package]]
@@ -3322,9 +3322,9 @@ dependencies = [
3322
  "bumpalo",
3323
  "log",
3324
  "once_cell",
3325
- "proc-macro2 1.0.60",
3326
  "quote 1.0.28",
3327
- "syn 2.0.18",
3328
  "wasm-bindgen-shared",
3329
  ]
3330
 
@@ -3356,9 +3356,9 @@ version = "0.2.87"
3356
  source = "registry+https://github.com/rust-lang/crates.io-index"
3357
  checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
3358
  dependencies = [
3359
- "proc-macro2 1.0.60",
3360
  "quote 1.0.28",
3361
- "syn 2.0.18",
3362
  "wasm-bindgen-backend",
3363
  "wasm-bindgen-shared",
3364
  ]
@@ -3381,7 +3381,7 @@ dependencies = [
3381
 
3382
  [[package]]
3383
  name = "websurfx"
3384
- version = "0.13.0"
3385
  dependencies = [
3386
  "actix-files",
3387
  "actix-web",
 
201
  checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9"
202
  dependencies = [
203
  "actix-router",
204
+ "proc-macro2 1.0.63",
205
  "quote 1.0.28",
206
  "syn 1.0.109",
207
  ]
 
620
  "itoa 1.0.6",
621
  "matches",
622
  "phf 0.10.1",
623
+ "proc-macro2 1.0.63",
624
  "quote 1.0.28",
625
  "smallvec 1.10.0",
626
  "syn 1.0.109",
 
633
  checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
634
  dependencies = [
635
  "quote 1.0.28",
636
+ "syn 2.0.22",
637
  ]
638
 
639
  [[package]]
 
643
  checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
644
  dependencies = [
645
  "convert_case",
646
+ "proc-macro2 1.0.63",
647
  "quote 1.0.28",
648
  "rustc_version 0.4.0",
649
  "syn 1.0.109",
 
771
  source = "registry+https://github.com/rust-lang/crates.io-index"
772
  checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
773
  dependencies = [
774
+ "proc-macro2 1.0.63",
775
  "quote 1.0.28",
776
  "syn 1.0.109",
777
  "synstructure",
 
1082
  "log",
1083
  "mac",
1084
  "markup5ever 0.11.0",
1085
+ "proc-macro2 1.0.63",
1086
  "quote 1.0.28",
1087
  "syn 1.0.109",
1088
  ]
 
1662
 
1663
  [[package]]
1664
  name = "openssl"
1665
+ version = "0.10.55"
1666
  source = "registry+https://github.com/rust-lang/crates.io-index"
1667
+ checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d"
1668
  dependencies = [
1669
  "bitflags",
1670
  "cfg-if 1.0.0",
 
1681
  source = "registry+https://github.com/rust-lang/crates.io-index"
1682
  checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
1683
  dependencies = [
1684
+ "proc-macro2 1.0.63",
1685
  "quote 1.0.28",
1686
+ "syn 2.0.22",
1687
  ]
1688
 
1689
  [[package]]
 
1694
 
1695
  [[package]]
1696
  name = "openssl-sys"
1697
+ version = "0.9.90"
1698
  source = "registry+https://github.com/rust-lang/crates.io-index"
1699
+ checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6"
1700
  dependencies = [
1701
  "cc",
1702
  "libc",
 
1773
 
1774
  [[package]]
1775
  name = "pest"
1776
+ version = "2.7.0"
1777
  source = "registry+https://github.com/rust-lang/crates.io-index"
1778
+ checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9"
1779
  dependencies = [
1780
  "thiserror",
1781
  "ucd-trie",
 
1783
 
1784
  [[package]]
1785
  name = "pest_derive"
1786
+ version = "2.7.0"
1787
  source = "registry+https://github.com/rust-lang/crates.io-index"
1788
+ checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b"
1789
  dependencies = [
1790
  "pest",
1791
  "pest_generator",
 
1793
 
1794
  [[package]]
1795
  name = "pest_generator"
1796
+ version = "2.7.0"
1797
  source = "registry+https://github.com/rust-lang/crates.io-index"
1798
+ checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190"
1799
  dependencies = [
1800
  "pest",
1801
  "pest_meta",
1802
+ "proc-macro2 1.0.63",
1803
  "quote 1.0.28",
1804
+ "syn 2.0.22",
1805
  ]
1806
 
1807
  [[package]]
1808
  name = "pest_meta"
1809
+ version = "2.7.0"
1810
  source = "registry+https://github.com/rust-lang/crates.io-index"
1811
+ checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0"
1812
  dependencies = [
1813
  "once_cell",
1814
  "pest",
 
1913
  "phf_generator 0.10.0",
1914
  "phf_shared 0.10.0",
1915
  "proc-macro-hack",
1916
+ "proc-macro2 1.0.63",
1917
  "quote 1.0.28",
1918
  "syn 1.0.109",
1919
  ]
 
1992
 
1993
  [[package]]
1994
  name = "proc-macro2"
1995
+ version = "1.0.63"
1996
  source = "registry+https://github.com/rust-lang/crates.io-index"
1997
+ checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb"
1998
  dependencies = [
1999
  "unicode-ident",
2000
  ]
 
2024
  source = "registry+https://github.com/rust-lang/crates.io-index"
2025
  checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488"
2026
  dependencies = [
2027
+ "proc-macro2 1.0.63",
2028
  ]
2029
 
2030
  [[package]]
 
2548
  source = "registry+https://github.com/rust-lang/crates.io-index"
2549
  checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
2550
  dependencies = [
2551
+ "proc-macro2 1.0.63",
2552
  "quote 1.0.28",
2553
+ "syn 2.0.22",
2554
  ]
2555
 
2556
  [[package]]
2557
  name = "serde_json"
2558
+ version = "1.0.99"
2559
  source = "registry+https://github.com/rust-lang/crates.io-index"
2560
+ checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3"
2561
  dependencies = [
2562
  "itoa 1.0.6",
2563
  "ryu",
 
2733
  dependencies = [
2734
  "phf_generator 0.7.24",
2735
  "phf_shared 0.7.24",
2736
+ "proc-macro2 1.0.63",
2737
  "quote 1.0.28",
2738
  "string_cache_shared",
2739
  ]
 
2746
  dependencies = [
2747
  "phf_generator 0.10.0",
2748
  "phf_shared 0.10.0",
2749
+ "proc-macro2 1.0.63",
2750
  "quote 1.0.28",
2751
  ]
2752
 
 
2773
  source = "registry+https://github.com/rust-lang/crates.io-index"
2774
  checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
2775
  dependencies = [
2776
+ "proc-macro2 1.0.63",
2777
  "quote 1.0.28",
2778
  "unicode-ident",
2779
  ]
2780
 
2781
  [[package]]
2782
  name = "syn"
2783
+ version = "2.0.22"
2784
  source = "registry+https://github.com/rust-lang/crates.io-index"
2785
+ checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616"
2786
  dependencies = [
2787
+ "proc-macro2 1.0.63",
2788
  "quote 1.0.28",
2789
  "unicode-ident",
2790
  ]
 
2795
  source = "registry+https://github.com/rust-lang/crates.io-index"
2796
  checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
2797
  dependencies = [
2798
+ "proc-macro2 1.0.63",
2799
  "quote 1.0.28",
2800
  "syn 1.0.109",
2801
  "unicode-xid 0.2.4",
 
2850
  source = "registry+https://github.com/rust-lang/crates.io-index"
2851
  checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
2852
  dependencies = [
2853
+ "proc-macro2 1.0.63",
2854
  "quote 1.0.28",
2855
+ "syn 2.0.22",
2856
  ]
2857
 
2858
  [[package]]
 
2994
  source = "registry+https://github.com/rust-lang/crates.io-index"
2995
  checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
2996
  dependencies = [
2997
+ "proc-macro2 1.0.63",
2998
  "quote 1.0.28",
2999
+ "syn 2.0.22",
3000
  ]
3001
 
3002
  [[package]]
 
3322
  "bumpalo",
3323
  "log",
3324
  "once_cell",
3325
+ "proc-macro2 1.0.63",
3326
  "quote 1.0.28",
3327
+ "syn 2.0.22",
3328
  "wasm-bindgen-shared",
3329
  ]
3330
 
 
3356
  source = "registry+https://github.com/rust-lang/crates.io-index"
3357
  checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
3358
  dependencies = [
3359
+ "proc-macro2 1.0.63",
3360
  "quote 1.0.28",
3361
+ "syn 2.0.22",
3362
  "wasm-bindgen-backend",
3363
  "wasm-bindgen-shared",
3364
  ]
 
3381
 
3382
  [[package]]
3383
  name = "websurfx"
3384
+ version = "0.13.5"
3385
  dependencies = [
3386
  "actix-files",
3387
  "actix-web",
Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
  [package]
2
  name = "websurfx"
3
- version = "0.13.0"
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"
 
1
  [package]
2
  name = "websurfx"
3
+ version = "0.13.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"
PULL_REQUEST_TEMPLATE.md CHANGED
@@ -16,7 +16,7 @@
16
 
17
  ## Author's checklist
18
 
19
- <!-- additional notes for reviewiers -->
20
 
21
  ## Related issues
22
 
 
16
 
17
  ## Author's checklist
18
 
19
+ <!-- additional notes for reviewers -->
20
 
21
  ## Related issues
22
 
README.md CHANGED
@@ -59,7 +59,7 @@
59
  - **Community**
60
  - [📊 System Requirements](#system-requirements-)
61
  - [🗨️ FAQ (Frequently Asked Questions)](#faq-frequently-asked-questions-)
62
- - [📣 More Contributers Wanted](#more-contributers-wanted-)
63
  - [💖 Supporting Websurfx](#supporting-websurfx-)
64
  - [📘 Documentation](#documentation-)
65
  - [🛣️ Roadmap](#roadmap-)
@@ -165,7 +165,7 @@ Websurfx is based on Rust due to its memory safety features, which prevents vuln
165
 
166
  **[⬆️ Back to Top](#--)**
167
 
168
- # More Contributers Wanted 📣
169
 
170
  We are looking for more willing contributors to help grow this project. For more information on how you can contribute, check out the [project board](https://github.com/neon-mmd/websurfx/projects?query=is%3Aopen) and the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines and rules for making contributions.
171
 
 
59
  - **Community**
60
  - [📊 System Requirements](#system-requirements-)
61
  - [🗨️ FAQ (Frequently Asked Questions)](#faq-frequently-asked-questions-)
62
+ - [📣 More Contributors Wanted](#more-contributors-wanted-)
63
  - [💖 Supporting Websurfx](#supporting-websurfx-)
64
  - [📘 Documentation](#documentation-)
65
  - [🛣️ Roadmap](#roadmap-)
 
165
 
166
  **[⬆️ Back to Top](#--)**
167
 
168
+ # More Contributors Wanted 📣
169
 
170
  We are looking for more willing contributors to help grow this project. For more information on how you can contribute, check out the [project board](https://github.com/neon-mmd/websurfx/projects?query=is%3Aopen) and the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines and rules for making contributions.
171
 
public/static/pagination.js CHANGED
@@ -30,8 +30,8 @@ function navigate_backward() {
30
  let page = parseInt(searchParams.get('page'));
31
 
32
  if (isNaN(page)) {
33
- page = 1;
34
- } else if (page > 1) {
35
  page--;
36
  }
37
 
 
30
  let page = parseInt(searchParams.get('page'));
31
 
32
  if (isNaN(page)) {
33
+ page = 0;
34
+ } else if (page > 0) {
35
  page--;
36
  }
37
 
src/config_parser/parser.rs CHANGED
@@ -24,46 +24,35 @@ pub struct Config {
24
  pub binding_ip_addr: String,
25
  pub style: Style,
26
  pub redis_connection_url: String,
27
- pub aggregator: AggreatorConfig,
28
  pub logging: bool,
29
  pub debug: bool,
30
  }
31
 
32
  /// Configuration options for the aggregator.
33
  #[derive(Clone)]
34
- pub struct AggreatorConfig {
35
  /// Whether to introduce a random delay before sending the request to the search engine.
36
  pub random_delay: bool,
37
  }
38
 
39
  impl Config {
40
  /// A function which parses the config.lua file and puts all the parsed options in the newly
41
- /// contructed Config struct and returns it.
42
  ///
43
  /// # Error
44
  ///
45
  /// Returns a lua parse error if parsing of the config.lua file fails or has a syntax error
46
- /// or io error if the config.lua file doesn't exists otherwise it returns a newly contructed
47
  /// Config struct with all the parsed config options from the parsed config file.
48
  pub fn parse() -> Result<Self, Box<dyn std::error::Error>> {
49
  Lua::new().context(|context| -> Result<Self, Box<dyn std::error::Error>> {
50
  let globals = context.globals();
51
 
52
  context
53
- .load(&fs::read_to_string(
54
- Config::handle_different_config_file_path()?,
55
- )?)
56
  .exec()?;
57
 
58
- let production_use = globals.get::<_, bool>("production_use")?;
59
- let aggregator_config = if production_use {
60
- AggreatorConfig { random_delay: true }
61
- } else {
62
- AggreatorConfig {
63
- random_delay: false,
64
- }
65
- };
66
-
67
  Ok(Config {
68
  port: globals.get::<_, u16>("port")?,
69
  binding_ip_addr: globals.get::<_, String>("binding_ip_addr")?,
@@ -72,7 +61,9 @@ impl Config {
72
  globals.get::<_, String>("colorscheme")?,
73
  ),
74
  redis_connection_url: globals.get::<_, String>("redis_connection_url")?,
75
- aggregator: aggregator_config,
 
 
76
  logging: globals.get::<_, bool>("logging")?,
77
  debug: globals.get::<_, bool>("debug")?,
78
  })
@@ -90,35 +81,37 @@ impl Config {
90
  /// one (3).
91
  /// 3. `websurfx/` (under project folder ( or codebase in other words)) if it is not present
92
  /// here then it returns an error as mentioned above.
93
- fn handle_different_config_file_path() -> Result<String, Box<dyn std::error::Error>> {
94
- if Path::new(
95
- format!(
96
- "{}/.config/{}/config.lua",
97
- std::env::var("HOME").unwrap(),
98
- COMMON_DIRECTORY_NAME
99
- )
100
- .as_str(),
101
- )
102
- .exists()
103
- {
104
- Ok(format!(
105
  "{}/.config/{}/{}",
106
  std::env::var("HOME").unwrap(),
107
  COMMON_DIRECTORY_NAME,
108
  CONFIG_FILE_NAME
109
- ))
110
- } else if Path::new(
111
- format!("/etc/xdg/{}/{}", COMMON_DIRECTORY_NAME, CONFIG_FILE_NAME).as_str(),
112
- )
113
- .exists()
114
- {
115
- Ok("/etc/xdg/websurfx/config.lua".to_string())
116
- } else if Path::new(format!("./{}/{}", COMMON_DIRECTORY_NAME, CONFIG_FILE_NAME).as_str())
117
  .exists()
118
  {
119
- Ok("./websurfx/config.lua".to_string())
120
- } else {
121
- Err("Config file not found!!".to_string().into())
122
  }
 
 
 
 
 
 
 
 
 
123
  }
124
  }
 
24
  pub binding_ip_addr: String,
25
  pub style: Style,
26
  pub redis_connection_url: String,
27
+ pub aggregator: AggregatorConfig,
28
  pub logging: bool,
29
  pub debug: bool,
30
  }
31
 
32
  /// Configuration options for the aggregator.
33
  #[derive(Clone)]
34
+ pub struct AggregatorConfig {
35
  /// Whether to introduce a random delay before sending the request to the search engine.
36
  pub random_delay: bool,
37
  }
38
 
39
  impl Config {
40
  /// A function which parses the config.lua file and puts all the parsed options in the newly
41
+ /// constructed Config struct and returns it.
42
  ///
43
  /// # Error
44
  ///
45
  /// Returns a lua parse error if parsing of the config.lua file fails or has a syntax error
46
+ /// or io error if the config.lua file doesn't exists otherwise it returns a newly constructed
47
  /// Config struct with all the parsed config options from the parsed config file.
48
  pub fn parse() -> Result<Self, Box<dyn std::error::Error>> {
49
  Lua::new().context(|context| -> Result<Self, Box<dyn std::error::Error>> {
50
  let globals = context.globals();
51
 
52
  context
53
+ .load(&fs::read_to_string(Config::get_config_path()?)?)
 
 
54
  .exec()?;
55
 
 
 
 
 
 
 
 
 
 
56
  Ok(Config {
57
  port: globals.get::<_, u16>("port")?,
58
  binding_ip_addr: globals.get::<_, String>("binding_ip_addr")?,
 
61
  globals.get::<_, String>("colorscheme")?,
62
  ),
63
  redis_connection_url: globals.get::<_, String>("redis_connection_url")?,
64
+ aggregator: AggregatorConfig {
65
+ random_delay: globals.get::<_, bool>("production_use")?,
66
+ },
67
  logging: globals.get::<_, bool>("logging")?,
68
  debug: globals.get::<_, bool>("debug")?,
69
  })
 
81
  /// one (3).
82
  /// 3. `websurfx/` (under project folder ( or codebase in other words)) if it is not present
83
  /// here then it returns an error as mentioned above.
84
+ fn get_config_path() -> Result<String, Box<dyn std::error::Error>> {
85
+ // check user config
86
+
87
+ let path = format!(
88
+ "{}/.config/{}/config.lua",
89
+ std::env::var("HOME").unwrap(),
90
+ COMMON_DIRECTORY_NAME
91
+ );
92
+ if Path::new(path.as_str()).exists() {
93
+ return Ok(format!(
 
 
94
  "{}/.config/{}/{}",
95
  std::env::var("HOME").unwrap(),
96
  COMMON_DIRECTORY_NAME,
97
  CONFIG_FILE_NAME
98
+ ));
99
+ }
100
+
101
+ // look for config in /etc/xdg
102
+ if Path::new(format!("/etc/xdg/{}/{}", COMMON_DIRECTORY_NAME, CONFIG_FILE_NAME).as_str())
 
 
 
103
  .exists()
104
  {
105
+ return Ok("/etc/xdg/websurfx/config.lua".to_string());
 
 
106
  }
107
+
108
+ // use dev config
109
+ if Path::new(format!("./{}/{}", COMMON_DIRECTORY_NAME, CONFIG_FILE_NAME).as_str()).exists()
110
+ {
111
+ return Ok("./websurfx/config.lua".to_string());
112
+ }
113
+
114
+ // if no of the configs above exist, return error
115
+ Err("Config file not found!!".to_string().into())
116
  }
117
  }
src/config_parser/parser_models.rs CHANGED
@@ -1,5 +1,5 @@
1
  //! This module provides public models for handling, storing and serializing parsed config file
2
- //! options from config.lua by grouping them togather.
3
 
4
  use serde::{Deserialize, Serialize};
5
 
 
1
  //! This module provides public models for handling, storing and serializing parsed config file
2
+ //! options from config.lua by grouping them together.
3
 
4
  use serde::{Deserialize, Serialize};
5
 
src/engines/duckduckgo.rs CHANGED
@@ -36,7 +36,7 @@ pub async fn results(
36
  user_agent: &str,
37
  ) -> Result<HashMap<String, RawSearchResult>, EngineError> {
38
  // Page number can be missing or empty string and so appropriate handling is required
39
- // so that upstream server recieves valid page number.
40
  let url: String = match page {
41
  1 => {
42
  format!("https://html.duckduckgo.com/html/?q={query}&s=&dc=&v=1&o=json&api=/d.js")
@@ -86,7 +86,7 @@ pub async fn results(
86
  let results: String = reqwest::Client::new()
87
  .get(url)
88
  .timeout(Duration::from_secs(5))
89
- .headers(header_map) // add spoofed headers to emulate human behaviour
90
  .send()
91
  .await
92
  .into_report()
 
36
  user_agent: &str,
37
  ) -> Result<HashMap<String, RawSearchResult>, EngineError> {
38
  // Page number can be missing or empty string and so appropriate handling is required
39
+ // so that upstream server receives valid page number.
40
  let url: String = match page {
41
  1 => {
42
  format!("https://html.duckduckgo.com/html/?q={query}&s=&dc=&v=1&o=json&api=/d.js")
 
86
  let results: String = reqwest::Client::new()
87
  .get(url)
88
  .timeout(Duration::from_secs(5))
89
+ .headers(header_map) // add spoofed headers to emulate human behavior
90
  .send()
91
  .await
92
  .into_report()
src/engines/engine_models.rs CHANGED
@@ -13,7 +13,7 @@ use std::fmt;
13
  /// search engines.
14
  /// * `UnexpectedError` - This variant handles all the errors which are unexpected or occur rarely
15
  /// and are errors mostly related to failure in initialization of HeaderMap, Selector errors and
16
- /// all other errors occuring within the code handling the `upstream search engines`.
17
  #[derive(Debug)]
18
  pub enum EngineError {
19
  EmptyResultSet,
 
13
  /// search engines.
14
  /// * `UnexpectedError` - This variant handles all the errors which are unexpected or occur rarely
15
  /// and are errors mostly related to failure in initialization of HeaderMap, Selector errors and
16
+ /// all other errors occurring within the code handling the `upstream search engines`.
17
  #[derive(Debug)]
18
  pub enum EngineError {
19
  EmptyResultSet,
src/search_results_handler/aggregator.rs CHANGED
@@ -17,7 +17,7 @@ use crate::engines::{duckduckgo, searx};
17
  /// then removes duplicate results and if two results are found to be from two or more engines
18
  /// then puts their names together to show the results are fetched from these upstream engines
19
  /// and then removes all data from the HashMap and puts into a struct of all results aggregated
20
- /// into a vector and also adds the query used into the struct this is neccessory because
21
  /// otherwise the search bar in search remains empty if searched from the query url
22
  ///
23
  /// # Example:
 
17
  /// then removes duplicate results and if two results are found to be from two or more engines
18
  /// then puts their names together to show the results are fetched from these upstream engines
19
  /// and then removes all data from the HashMap and puts into a struct of all results aggregated
20
+ /// into a vector and also adds the query used into the struct this is necessary because
21
  /// otherwise the search bar in search remains empty if searched from the query url
22
  ///
23
  /// # Example:
src/server/routes.rs CHANGED
@@ -1,5 +1,5 @@
1
  //! This module provides the functionality to handle different routes of the `websurfx`
2
- //! meta search engine website and provide approriate response to each route/page
3
  //! when requested.
4
 
5
  use std::fs::read_to_string;
@@ -82,40 +82,16 @@ pub async fn search(
82
  .insert_header(("location", "/"))
83
  .finish())
84
  } else {
85
- let page_url: String; // Declare the page_url variable without initializing it
86
-
87
- // ...
88
-
89
- let page = match params.page {
90
- Some(page_number) => {
91
- if page_number <= 1 {
92
- page_url = format!(
93
- "http://{}:{}/search?q={}&page={}",
94
- config.binding_ip_addr, config.port, query, 1
95
- );
96
- 1
97
- } else {
98
- page_url = format!(
99
- "http://{}:{}/search?q={}&page={}",
100
- config.binding_ip_addr, config.port, query, page_number
101
- );
102
-
103
- page_number
104
- }
105
- }
106
- None => {
107
- page_url = format!(
108
- "http://{}:{}{}&page={}",
109
- config.binding_ip_addr,
110
- config.port,
111
- req.uri(),
112
- 1
113
- );
114
-
115
- 1
116
- }
117
  };
118
 
 
 
 
 
 
119
  // fetch the cached results json.
120
  let cached_results_json = redis_cache.cached_results_json(&page_url);
121
  // check if fetched results was indeed fetched or it was an error and if so
 
1
  //! This module provides the functionality to handle different routes of the `websurfx`
2
+ //! meta search engine website and provide appropriate response to each route/page
3
  //! when requested.
4
 
5
  use std::fs::read_to_string;
 
82
  .insert_header(("location", "/"))
83
  .finish())
84
  } else {
85
+ let page = match &params.page {
86
+ Some(page) => *page,
87
+ None => 0,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  };
89
 
90
+ let page_url = format!(
91
+ "http://{}:{}/search?q={}&page={}",
92
+ config.binding_ip_addr, config.port, query, page
93
+ );
94
+
95
  // fetch the cached results json.
96
  let cached_results_json = redis_cache.cached_results_json(&page_url);
97
  // check if fetched results was indeed fetched or it was an error and if so