Merge pull request #16 from neon-mmd/rolling
Browse files- .dockerignore +9 -0
- Cargo.lock +65 -65
- Cargo.toml +1 -1
- Dockerfile +26 -0
- docker-compose.yml +15 -0
- src/engines/duckduckgo.rs +4 -9
- src/engines/searx.rs +3 -8
- src/search_results_handler/aggregator.rs +20 -8
.dockerignore
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
target/
|
2 |
+
.git/
|
3 |
+
.github/
|
4 |
+
.dockerignore
|
5 |
+
Dockerfile
|
6 |
+
docker-compose.yml
|
7 |
+
images
|
8 |
+
*.md
|
9 |
+
LICENSE
|
Cargo.lock
CHANGED
@@ -87,7 +87,7 @@ version = "0.2.3"
|
|
87 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
88 |
checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6"
|
89 |
dependencies = [
|
90 |
-
"quote 1.0.
|
91 |
"syn 1.0.109",
|
92 |
]
|
93 |
|
@@ -190,7 +190,7 @@ dependencies = [
|
|
190 |
"serde_urlencoded 0.7.1",
|
191 |
"smallvec 1.10.0",
|
192 |
"socket2",
|
193 |
-
"time 0.3.
|
194 |
"url 2.3.1",
|
195 |
]
|
196 |
|
@@ -202,7 +202,7 @@ checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9"
|
|
202 |
dependencies = [
|
203 |
"actix-router",
|
204 |
"proc-macro2 1.0.56",
|
205 |
-
"quote 1.0.
|
206 |
"syn 1.0.109",
|
207 |
]
|
208 |
|
@@ -480,7 +480,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
480 |
checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
|
481 |
dependencies = [
|
482 |
"percent-encoding 2.2.0",
|
483 |
-
"time 0.3.
|
484 |
"version_check",
|
485 |
]
|
486 |
|
@@ -606,7 +606,7 @@ dependencies = [
|
|
606 |
"matches",
|
607 |
"phf 0.10.1",
|
608 |
"proc-macro2 1.0.56",
|
609 |
-
"quote 1.0.
|
610 |
"smallvec 1.10.0",
|
611 |
"syn 1.0.109",
|
612 |
]
|
@@ -617,7 +617,7 @@ version = "0.6.0"
|
|
617 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
618 |
checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e"
|
619 |
dependencies = [
|
620 |
-
"quote 1.0.
|
621 |
"syn 1.0.109",
|
622 |
]
|
623 |
|
@@ -629,7 +629,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
|
|
629 |
dependencies = [
|
630 |
"convert_case",
|
631 |
"proc-macro2 1.0.56",
|
632 |
-
"quote 1.0.
|
633 |
"rustc_version 0.4.0",
|
634 |
"syn 1.0.109",
|
635 |
]
|
@@ -731,7 +731,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
731 |
checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
|
732 |
dependencies = [
|
733 |
"proc-macro2 1.0.56",
|
734 |
-
"quote 1.0.
|
735 |
"syn 1.0.109",
|
736 |
"synstructure",
|
737 |
]
|
@@ -1036,7 +1036,7 @@ dependencies = [
|
|
1036 |
"mac",
|
1037 |
"markup5ever 0.11.0",
|
1038 |
"proc-macro2 1.0.56",
|
1039 |
-
"quote 1.0.
|
1040 |
"syn 1.0.109",
|
1041 |
]
|
1042 |
|
@@ -1301,9 +1301,9 @@ dependencies = [
|
|
1301 |
|
1302 |
[[package]]
|
1303 |
name = "js-sys"
|
1304 |
-
version = "0.3.
|
1305 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1306 |
-
checksum = "
|
1307 |
dependencies = [
|
1308 |
"wasm-bindgen",
|
1309 |
]
|
@@ -1332,15 +1332,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|
1332 |
|
1333 |
[[package]]
|
1334 |
name = "libc"
|
1335 |
-
version = "0.2.
|
1336 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1337 |
-
checksum = "
|
1338 |
|
1339 |
[[package]]
|
1340 |
name = "linux-raw-sys"
|
1341 |
-
version = "0.3.
|
1342 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1343 |
-
checksum = "
|
1344 |
|
1345 |
[[package]]
|
1346 |
name = "local-channel"
|
@@ -1632,7 +1632,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1632 |
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
|
1633 |
dependencies = [
|
1634 |
"proc-macro2 1.0.56",
|
1635 |
-
"quote 1.0.
|
1636 |
"syn 2.0.15",
|
1637 |
]
|
1638 |
|
@@ -1750,7 +1750,7 @@ dependencies = [
|
|
1750 |
"pest",
|
1751 |
"pest_meta",
|
1752 |
"proc-macro2 1.0.56",
|
1753 |
-
"quote 1.0.
|
1754 |
"syn 2.0.15",
|
1755 |
]
|
1756 |
|
@@ -1864,7 +1864,7 @@ dependencies = [
|
|
1864 |
"phf_shared 0.10.0",
|
1865 |
"proc-macro-hack",
|
1866 |
"proc-macro2 1.0.56",
|
1867 |
-
"quote 1.0.
|
1868 |
"syn 1.0.109",
|
1869 |
]
|
1870 |
|
@@ -1909,9 +1909,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
|
1909 |
|
1910 |
[[package]]
|
1911 |
name = "pkg-config"
|
1912 |
-
version = "0.3.
|
1913 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1914 |
-
checksum = "
|
1915 |
|
1916 |
[[package]]
|
1917 |
name = "ppv-lite86"
|
@@ -1970,9 +1970,9 @@ dependencies = [
|
|
1970 |
|
1971 |
[[package]]
|
1972 |
name = "quote"
|
1973 |
-
version = "1.0.
|
1974 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1975 |
-
checksum = "
|
1976 |
dependencies = [
|
1977 |
"proc-macro2 1.0.56",
|
1978 |
]
|
@@ -2314,9 +2314,9 @@ dependencies = [
|
|
2314 |
|
2315 |
[[package]]
|
2316 |
name = "rlua-lua54-sys"
|
2317 |
-
version = "0.1.
|
2318 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2319 |
-
checksum = "
|
2320 |
dependencies = [
|
2321 |
"cc",
|
2322 |
"libc",
|
@@ -2349,9 +2349,9 @@ dependencies = [
|
|
2349 |
|
2350 |
[[package]]
|
2351 |
name = "rustix"
|
2352 |
-
version = "0.37.
|
2353 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2354 |
-
checksum = "
|
2355 |
dependencies = [
|
2356 |
"bitflags",
|
2357 |
"errno",
|
@@ -2482,21 +2482,21 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
|
2482 |
|
2483 |
[[package]]
|
2484 |
name = "serde"
|
2485 |
-
version = "1.0.
|
2486 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2487 |
-
checksum = "
|
2488 |
dependencies = [
|
2489 |
"serde_derive",
|
2490 |
]
|
2491 |
|
2492 |
[[package]]
|
2493 |
name = "serde_derive"
|
2494 |
-
version = "1.0.
|
2495 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2496 |
-
checksum = "
|
2497 |
dependencies = [
|
2498 |
"proc-macro2 1.0.56",
|
2499 |
-
"quote 1.0.
|
2500 |
"syn 2.0.15",
|
2501 |
]
|
2502 |
|
@@ -2681,7 +2681,7 @@ dependencies = [
|
|
2681 |
"phf_generator 0.7.24",
|
2682 |
"phf_shared 0.7.24",
|
2683 |
"proc-macro2 1.0.56",
|
2684 |
-
"quote 1.0.
|
2685 |
"string_cache_shared",
|
2686 |
]
|
2687 |
|
@@ -2694,7 +2694,7 @@ dependencies = [
|
|
2694 |
"phf_generator 0.10.0",
|
2695 |
"phf_shared 0.10.0",
|
2696 |
"proc-macro2 1.0.56",
|
2697 |
-
"quote 1.0.
|
2698 |
]
|
2699 |
|
2700 |
[[package]]
|
@@ -2721,7 +2721,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2721 |
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
2722 |
dependencies = [
|
2723 |
"proc-macro2 1.0.56",
|
2724 |
-
"quote 1.0.
|
2725 |
"unicode-ident",
|
2726 |
]
|
2727 |
|
@@ -2732,7 +2732,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2732 |
checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822"
|
2733 |
dependencies = [
|
2734 |
"proc-macro2 1.0.56",
|
2735 |
-
"quote 1.0.
|
2736 |
"unicode-ident",
|
2737 |
]
|
2738 |
|
@@ -2743,7 +2743,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2743 |
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
|
2744 |
dependencies = [
|
2745 |
"proc-macro2 1.0.56",
|
2746 |
-
"quote 1.0.
|
2747 |
"syn 1.0.109",
|
2748 |
"unicode-xid 0.2.4",
|
2749 |
]
|
@@ -2797,7 +2797,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2797 |
checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
|
2798 |
dependencies = [
|
2799 |
"proc-macro2 1.0.56",
|
2800 |
-
"quote 1.0.
|
2801 |
"syn 2.0.15",
|
2802 |
]
|
2803 |
|
@@ -2814,9 +2814,9 @@ dependencies = [
|
|
2814 |
|
2815 |
[[package]]
|
2816 |
name = "time"
|
2817 |
-
version = "0.3.
|
2818 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2819 |
-
checksum = "
|
2820 |
dependencies = [
|
2821 |
"itoa 1.0.6",
|
2822 |
"serde",
|
@@ -2826,15 +2826,15 @@ dependencies = [
|
|
2826 |
|
2827 |
[[package]]
|
2828 |
name = "time-core"
|
2829 |
-
version = "0.1.
|
2830 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2831 |
-
checksum = "
|
2832 |
|
2833 |
[[package]]
|
2834 |
name = "time-macros"
|
2835 |
-
version = "0.2.
|
2836 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2837 |
-
checksum = "
|
2838 |
dependencies = [
|
2839 |
"time-core",
|
2840 |
]
|
@@ -2941,7 +2941,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2941 |
checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
|
2942 |
dependencies = [
|
2943 |
"proc-macro2 1.0.56",
|
2944 |
-
"quote 1.0.
|
2945 |
"syn 2.0.15",
|
2946 |
]
|
2947 |
|
@@ -3243,9 +3243,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
|
3243 |
|
3244 |
[[package]]
|
3245 |
name = "wasm-bindgen"
|
3246 |
-
version = "0.2.
|
3247 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3248 |
-
checksum = "
|
3249 |
dependencies = [
|
3250 |
"cfg-if 1.0.0",
|
3251 |
"wasm-bindgen-macro",
|
@@ -3253,24 +3253,24 @@ dependencies = [
|
|
3253 |
|
3254 |
[[package]]
|
3255 |
name = "wasm-bindgen-backend"
|
3256 |
-
version = "0.2.
|
3257 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3258 |
-
checksum = "
|
3259 |
dependencies = [
|
3260 |
"bumpalo",
|
3261 |
"log",
|
3262 |
"once_cell",
|
3263 |
"proc-macro2 1.0.56",
|
3264 |
-
"quote 1.0.
|
3265 |
-
"syn
|
3266 |
"wasm-bindgen-shared",
|
3267 |
]
|
3268 |
|
3269 |
[[package]]
|
3270 |
name = "wasm-bindgen-futures"
|
3271 |
-
version = "0.4.
|
3272 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3273 |
-
checksum = "
|
3274 |
dependencies = [
|
3275 |
"cfg-if 1.0.0",
|
3276 |
"js-sys",
|
@@ -3280,38 +3280,38 @@ dependencies = [
|
|
3280 |
|
3281 |
[[package]]
|
3282 |
name = "wasm-bindgen-macro"
|
3283 |
-
version = "0.2.
|
3284 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3285 |
-
checksum = "
|
3286 |
dependencies = [
|
3287 |
-
"quote 1.0.
|
3288 |
"wasm-bindgen-macro-support",
|
3289 |
]
|
3290 |
|
3291 |
[[package]]
|
3292 |
name = "wasm-bindgen-macro-support"
|
3293 |
-
version = "0.2.
|
3294 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3295 |
-
checksum = "
|
3296 |
dependencies = [
|
3297 |
"proc-macro2 1.0.56",
|
3298 |
-
"quote 1.0.
|
3299 |
-
"syn
|
3300 |
"wasm-bindgen-backend",
|
3301 |
"wasm-bindgen-shared",
|
3302 |
]
|
3303 |
|
3304 |
[[package]]
|
3305 |
name = "wasm-bindgen-shared"
|
3306 |
-
version = "0.2.
|
3307 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3308 |
-
checksum = "
|
3309 |
|
3310 |
[[package]]
|
3311 |
name = "web-sys"
|
3312 |
-
version = "0.3.
|
3313 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3314 |
-
checksum = "
|
3315 |
dependencies = [
|
3316 |
"js-sys",
|
3317 |
"wasm-bindgen",
|
@@ -3319,7 +3319,7 @@ dependencies = [
|
|
3319 |
|
3320 |
[[package]]
|
3321 |
name = "websurfx"
|
3322 |
-
version = "0.
|
3323 |
dependencies = [
|
3324 |
"actix-files",
|
3325 |
"actix-web",
|
@@ -3328,7 +3328,7 @@ dependencies = [
|
|
3328 |
"handlebars",
|
3329 |
"log",
|
3330 |
"md5",
|
3331 |
-
"rand 0.
|
3332 |
"redis",
|
3333 |
"reqwest 0.11.17",
|
3334 |
"rlua",
|
|
|
87 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
88 |
checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6"
|
89 |
dependencies = [
|
90 |
+
"quote 1.0.27",
|
91 |
"syn 1.0.109",
|
92 |
]
|
93 |
|
|
|
190 |
"serde_urlencoded 0.7.1",
|
191 |
"smallvec 1.10.0",
|
192 |
"socket2",
|
193 |
+
"time 0.3.21",
|
194 |
"url 2.3.1",
|
195 |
]
|
196 |
|
|
|
202 |
dependencies = [
|
203 |
"actix-router",
|
204 |
"proc-macro2 1.0.56",
|
205 |
+
"quote 1.0.27",
|
206 |
"syn 1.0.109",
|
207 |
]
|
208 |
|
|
|
480 |
checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
|
481 |
dependencies = [
|
482 |
"percent-encoding 2.2.0",
|
483 |
+
"time 0.3.21",
|
484 |
"version_check",
|
485 |
]
|
486 |
|
|
|
606 |
"matches",
|
607 |
"phf 0.10.1",
|
608 |
"proc-macro2 1.0.56",
|
609 |
+
"quote 1.0.27",
|
610 |
"smallvec 1.10.0",
|
611 |
"syn 1.0.109",
|
612 |
]
|
|
|
617 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
618 |
checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e"
|
619 |
dependencies = [
|
620 |
+
"quote 1.0.27",
|
621 |
"syn 1.0.109",
|
622 |
]
|
623 |
|
|
|
629 |
dependencies = [
|
630 |
"convert_case",
|
631 |
"proc-macro2 1.0.56",
|
632 |
+
"quote 1.0.27",
|
633 |
"rustc_version 0.4.0",
|
634 |
"syn 1.0.109",
|
635 |
]
|
|
|
731 |
checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
|
732 |
dependencies = [
|
733 |
"proc-macro2 1.0.56",
|
734 |
+
"quote 1.0.27",
|
735 |
"syn 1.0.109",
|
736 |
"synstructure",
|
737 |
]
|
|
|
1036 |
"mac",
|
1037 |
"markup5ever 0.11.0",
|
1038 |
"proc-macro2 1.0.56",
|
1039 |
+
"quote 1.0.27",
|
1040 |
"syn 1.0.109",
|
1041 |
]
|
1042 |
|
|
|
1301 |
|
1302 |
[[package]]
|
1303 |
name = "js-sys"
|
1304 |
+
version = "0.3.62"
|
1305 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1306 |
+
checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5"
|
1307 |
dependencies = [
|
1308 |
"wasm-bindgen",
|
1309 |
]
|
|
|
1332 |
|
1333 |
[[package]]
|
1334 |
name = "libc"
|
1335 |
+
version = "0.2.144"
|
1336 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1337 |
+
checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1"
|
1338 |
|
1339 |
[[package]]
|
1340 |
name = "linux-raw-sys"
|
1341 |
+
version = "0.3.7"
|
1342 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1343 |
+
checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f"
|
1344 |
|
1345 |
[[package]]
|
1346 |
name = "local-channel"
|
|
|
1632 |
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
|
1633 |
dependencies = [
|
1634 |
"proc-macro2 1.0.56",
|
1635 |
+
"quote 1.0.27",
|
1636 |
"syn 2.0.15",
|
1637 |
]
|
1638 |
|
|
|
1750 |
"pest",
|
1751 |
"pest_meta",
|
1752 |
"proc-macro2 1.0.56",
|
1753 |
+
"quote 1.0.27",
|
1754 |
"syn 2.0.15",
|
1755 |
]
|
1756 |
|
|
|
1864 |
"phf_shared 0.10.0",
|
1865 |
"proc-macro-hack",
|
1866 |
"proc-macro2 1.0.56",
|
1867 |
+
"quote 1.0.27",
|
1868 |
"syn 1.0.109",
|
1869 |
]
|
1870 |
|
|
|
1909 |
|
1910 |
[[package]]
|
1911 |
name = "pkg-config"
|
1912 |
+
version = "0.3.27"
|
1913 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1914 |
+
checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
|
1915 |
|
1916 |
[[package]]
|
1917 |
name = "ppv-lite86"
|
|
|
1970 |
|
1971 |
[[package]]
|
1972 |
name = "quote"
|
1973 |
+
version = "1.0.27"
|
1974 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1975 |
+
checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500"
|
1976 |
dependencies = [
|
1977 |
"proc-macro2 1.0.56",
|
1978 |
]
|
|
|
2314 |
|
2315 |
[[package]]
|
2316 |
name = "rlua-lua54-sys"
|
2317 |
+
version = "0.1.4"
|
2318 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2319 |
+
checksum = "93f42202b5aeb0bcc5df28436f8d963f8cbcbb898033a9e28c7ba4f299707934"
|
2320 |
dependencies = [
|
2321 |
"cc",
|
2322 |
"libc",
|
|
|
2349 |
|
2350 |
[[package]]
|
2351 |
name = "rustix"
|
2352 |
+
version = "0.37.19"
|
2353 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2354 |
+
checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d"
|
2355 |
dependencies = [
|
2356 |
"bitflags",
|
2357 |
"errno",
|
|
|
2482 |
|
2483 |
[[package]]
|
2484 |
name = "serde"
|
2485 |
+
version = "1.0.162"
|
2486 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2487 |
+
checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6"
|
2488 |
dependencies = [
|
2489 |
"serde_derive",
|
2490 |
]
|
2491 |
|
2492 |
[[package]]
|
2493 |
name = "serde_derive"
|
2494 |
+
version = "1.0.162"
|
2495 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2496 |
+
checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6"
|
2497 |
dependencies = [
|
2498 |
"proc-macro2 1.0.56",
|
2499 |
+
"quote 1.0.27",
|
2500 |
"syn 2.0.15",
|
2501 |
]
|
2502 |
|
|
|
2681 |
"phf_generator 0.7.24",
|
2682 |
"phf_shared 0.7.24",
|
2683 |
"proc-macro2 1.0.56",
|
2684 |
+
"quote 1.0.27",
|
2685 |
"string_cache_shared",
|
2686 |
]
|
2687 |
|
|
|
2694 |
"phf_generator 0.10.0",
|
2695 |
"phf_shared 0.10.0",
|
2696 |
"proc-macro2 1.0.56",
|
2697 |
+
"quote 1.0.27",
|
2698 |
]
|
2699 |
|
2700 |
[[package]]
|
|
|
2721 |
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
2722 |
dependencies = [
|
2723 |
"proc-macro2 1.0.56",
|
2724 |
+
"quote 1.0.27",
|
2725 |
"unicode-ident",
|
2726 |
]
|
2727 |
|
|
|
2732 |
checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822"
|
2733 |
dependencies = [
|
2734 |
"proc-macro2 1.0.56",
|
2735 |
+
"quote 1.0.27",
|
2736 |
"unicode-ident",
|
2737 |
]
|
2738 |
|
|
|
2743 |
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
|
2744 |
dependencies = [
|
2745 |
"proc-macro2 1.0.56",
|
2746 |
+
"quote 1.0.27",
|
2747 |
"syn 1.0.109",
|
2748 |
"unicode-xid 0.2.4",
|
2749 |
]
|
|
|
2797 |
checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
|
2798 |
dependencies = [
|
2799 |
"proc-macro2 1.0.56",
|
2800 |
+
"quote 1.0.27",
|
2801 |
"syn 2.0.15",
|
2802 |
]
|
2803 |
|
|
|
2814 |
|
2815 |
[[package]]
|
2816 |
name = "time"
|
2817 |
+
version = "0.3.21"
|
2818 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2819 |
+
checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc"
|
2820 |
dependencies = [
|
2821 |
"itoa 1.0.6",
|
2822 |
"serde",
|
|
|
2826 |
|
2827 |
[[package]]
|
2828 |
name = "time-core"
|
2829 |
+
version = "0.1.1"
|
2830 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2831 |
+
checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
|
2832 |
|
2833 |
[[package]]
|
2834 |
name = "time-macros"
|
2835 |
+
version = "0.2.9"
|
2836 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2837 |
+
checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b"
|
2838 |
dependencies = [
|
2839 |
"time-core",
|
2840 |
]
|
|
|
2941 |
checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
|
2942 |
dependencies = [
|
2943 |
"proc-macro2 1.0.56",
|
2944 |
+
"quote 1.0.27",
|
2945 |
"syn 2.0.15",
|
2946 |
]
|
2947 |
|
|
|
3243 |
|
3244 |
[[package]]
|
3245 |
name = "wasm-bindgen"
|
3246 |
+
version = "0.2.85"
|
3247 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3248 |
+
checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4"
|
3249 |
dependencies = [
|
3250 |
"cfg-if 1.0.0",
|
3251 |
"wasm-bindgen-macro",
|
|
|
3253 |
|
3254 |
[[package]]
|
3255 |
name = "wasm-bindgen-backend"
|
3256 |
+
version = "0.2.85"
|
3257 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3258 |
+
checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822"
|
3259 |
dependencies = [
|
3260 |
"bumpalo",
|
3261 |
"log",
|
3262 |
"once_cell",
|
3263 |
"proc-macro2 1.0.56",
|
3264 |
+
"quote 1.0.27",
|
3265 |
+
"syn 2.0.15",
|
3266 |
"wasm-bindgen-shared",
|
3267 |
]
|
3268 |
|
3269 |
[[package]]
|
3270 |
name = "wasm-bindgen-futures"
|
3271 |
+
version = "0.4.35"
|
3272 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3273 |
+
checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163"
|
3274 |
dependencies = [
|
3275 |
"cfg-if 1.0.0",
|
3276 |
"js-sys",
|
|
|
3280 |
|
3281 |
[[package]]
|
3282 |
name = "wasm-bindgen-macro"
|
3283 |
+
version = "0.2.85"
|
3284 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3285 |
+
checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434"
|
3286 |
dependencies = [
|
3287 |
+
"quote 1.0.27",
|
3288 |
"wasm-bindgen-macro-support",
|
3289 |
]
|
3290 |
|
3291 |
[[package]]
|
3292 |
name = "wasm-bindgen-macro-support"
|
3293 |
+
version = "0.2.85"
|
3294 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3295 |
+
checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869"
|
3296 |
dependencies = [
|
3297 |
"proc-macro2 1.0.56",
|
3298 |
+
"quote 1.0.27",
|
3299 |
+
"syn 2.0.15",
|
3300 |
"wasm-bindgen-backend",
|
3301 |
"wasm-bindgen-shared",
|
3302 |
]
|
3303 |
|
3304 |
[[package]]
|
3305 |
name = "wasm-bindgen-shared"
|
3306 |
+
version = "0.2.85"
|
3307 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3308 |
+
checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb"
|
3309 |
|
3310 |
[[package]]
|
3311 |
name = "web-sys"
|
3312 |
+
version = "0.3.62"
|
3313 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
3314 |
+
checksum = "16b5f940c7edfdc6d12126d98c9ef4d1b3d470011c47c76a6581df47ad9ba721"
|
3315 |
dependencies = [
|
3316 |
"js-sys",
|
3317 |
"wasm-bindgen",
|
|
|
3319 |
|
3320 |
[[package]]
|
3321 |
name = "websurfx"
|
3322 |
+
version = "0.6.0"
|
3323 |
dependencies = [
|
3324 |
"actix-files",
|
3325 |
"actix-web",
|
|
|
3328 |
"handlebars",
|
3329 |
"log",
|
3330 |
"md5",
|
3331 |
+
"rand 0.8.5",
|
3332 |
"redis",
|
3333 |
"reqwest 0.11.17",
|
3334 |
"rlua",
|
Cargo.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
[package]
|
2 |
name = "websurfx"
|
3 |
-
version = "0.
|
4 |
edition = "2021"
|
5 |
|
6 |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
1 |
[package]
|
2 |
name = "websurfx"
|
3 |
+
version = "0.6.0"
|
4 |
edition = "2021"
|
5 |
|
6 |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
Dockerfile
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM rust:latest AS chef
|
2 |
+
# We only pay the installation cost once,
|
3 |
+
# it will be cached from the second build onwards
|
4 |
+
RUN cargo install cargo-chef
|
5 |
+
|
6 |
+
WORKDIR app
|
7 |
+
|
8 |
+
FROM chef AS planner
|
9 |
+
COPY . .
|
10 |
+
RUN cargo chef prepare --recipe-path recipe.json
|
11 |
+
|
12 |
+
FROM chef AS builder
|
13 |
+
COPY --from=planner /app/recipe.json recipe.json
|
14 |
+
# Build dependencies - this is the caching Docker layer!
|
15 |
+
RUN cargo chef cook --release --recipe-path recipe.json
|
16 |
+
|
17 |
+
# Build application
|
18 |
+
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 ./public/ ./public/
|
24 |
+
COPY --from=builder ./websurfx/ ./websurfx/
|
25 |
+
COPY --from=builder /usr/local/cargo/bin/* /usr/local/bin/
|
26 |
+
CMD ["websurfx"]
|
docker-compose.yml
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: "3.9"
|
2 |
+
services:
|
3 |
+
app:
|
4 |
+
image: websurfx:latest
|
5 |
+
build: .
|
6 |
+
ports:
|
7 |
+
- 8080:8080
|
8 |
+
depends_on:
|
9 |
+
- redis
|
10 |
+
links:
|
11 |
+
- redis
|
12 |
+
redis:
|
13 |
+
image: redis:latest
|
14 |
+
ports:
|
15 |
+
- 6379:6379
|
src/engines/duckduckgo.rs
CHANGED
@@ -2,10 +2,9 @@
|
|
2 |
//! by querying the upstream duckduckgo search engine with user provided query and with a page
|
3 |
//! number if provided.
|
4 |
|
5 |
-
use std::
|
6 |
|
7 |
-
use
|
8 |
-
use reqwest::header::{HeaderMap, CONTENT_TYPE, REFERER, USER_AGENT};
|
9 |
use scraper::{Html, Selector};
|
10 |
|
11 |
use crate::search_results_handler::aggregation_models::RawSearchResult;
|
@@ -47,16 +46,12 @@ pub async fn results(
|
|
47 |
}
|
48 |
};
|
49 |
|
50 |
-
// Add a random delay before making the request.
|
51 |
-
let mut rng = rand::thread_rng();
|
52 |
-
let delay_secs = rng.gen_range(1, 10);
|
53 |
-
std::thread::sleep(Duration::from_secs(delay_secs));
|
54 |
-
|
55 |
// initializing HeaderMap and adding appropriate headers.
|
56 |
let mut header_map = HeaderMap::new();
|
57 |
header_map.insert(USER_AGENT, user_agent.parse()?);
|
58 |
header_map.insert(REFERER, "https://google.com/".parse()?);
|
59 |
-
header_map.insert(CONTENT_TYPE, "
|
|
|
60 |
|
61 |
// fetch the html from upstream duckduckgo engine
|
62 |
// TODO: Write better error handling code to handle no results case.
|
|
|
2 |
//! by querying the upstream duckduckgo search engine with user provided query and with a page
|
3 |
//! number if provided.
|
4 |
|
5 |
+
use std::collections::HashMap;
|
6 |
|
7 |
+
use reqwest::header::{HeaderMap, CONTENT_TYPE, COOKIE, REFERER, USER_AGENT};
|
|
|
8 |
use scraper::{Html, Selector};
|
9 |
|
10 |
use crate::search_results_handler::aggregation_models::RawSearchResult;
|
|
|
46 |
}
|
47 |
};
|
48 |
|
|
|
|
|
|
|
|
|
|
|
49 |
// initializing HeaderMap and adding appropriate headers.
|
50 |
let mut header_map = HeaderMap::new();
|
51 |
header_map.insert(USER_AGENT, user_agent.parse()?);
|
52 |
header_map.insert(REFERER, "https://google.com/".parse()?);
|
53 |
+
header_map.insert(CONTENT_TYPE, "application/x-www-form-urlencoded".parse()?);
|
54 |
+
header_map.insert(COOKIE, "kl=wt-wt".parse()?);
|
55 |
|
56 |
// fetch the html from upstream duckduckgo engine
|
57 |
// TODO: Write better error handling code to handle no results case.
|
src/engines/searx.rs
CHANGED
@@ -2,10 +2,9 @@
|
|
2 |
//! by querying the upstream searx search engine instance with user provided query and with a page
|
3 |
//! number if provided.
|
4 |
|
5 |
-
use
|
6 |
-
use reqwest::header::{HeaderMap, CONTENT_TYPE, REFERER, USER_AGENT};
|
7 |
use scraper::{Html, Selector};
|
8 |
-
use std::
|
9 |
|
10 |
use crate::search_results_handler::aggregation_models::RawSearchResult;
|
11 |
|
@@ -34,16 +33,12 @@ pub async fn results(
|
|
34 |
// so that upstream server recieves valid page number.
|
35 |
let url: String = format!("https://searx.work/search?q={query}&pageno={page}");
|
36 |
|
37 |
-
// Add random delay before making the request.
|
38 |
-
let mut rng = rand::thread_rng();
|
39 |
-
let delay_secs = rng.gen_range(1, 10);
|
40 |
-
std::thread::sleep(Duration::from_secs(delay_secs));
|
41 |
-
|
42 |
// initializing headers and adding appropriate headers.
|
43 |
let mut header_map = HeaderMap::new();
|
44 |
header_map.insert(USER_AGENT, user_agent.parse()?);
|
45 |
header_map.insert(REFERER, "https://google.com/".parse()?);
|
46 |
header_map.insert(CONTENT_TYPE, "application/x-www-form-urlencoded".parse()?);
|
|
|
47 |
|
48 |
// fetch the html from upstream searx instance engine
|
49 |
// TODO: Write better error handling code to handle no results case.
|
|
|
2 |
//! by querying the upstream searx search engine instance with user provided query and with a page
|
3 |
//! number if provided.
|
4 |
|
5 |
+
use reqwest::header::{HeaderMap, CONTENT_TYPE, COOKIE, REFERER, USER_AGENT};
|
|
|
6 |
use scraper::{Html, Selector};
|
7 |
+
use std::collections::HashMap;
|
8 |
|
9 |
use crate::search_results_handler::aggregation_models::RawSearchResult;
|
10 |
|
|
|
33 |
// so that upstream server recieves valid page number.
|
34 |
let url: String = format!("https://searx.work/search?q={query}&pageno={page}");
|
35 |
|
|
|
|
|
|
|
|
|
|
|
36 |
// initializing headers and adding appropriate headers.
|
37 |
let mut header_map = HeaderMap::new();
|
38 |
header_map.insert(USER_AGENT, user_agent.parse()?);
|
39 |
header_map.insert(REFERER, "https://google.com/".parse()?);
|
40 |
header_map.insert(CONTENT_TYPE, "application/x-www-form-urlencoded".parse()?);
|
41 |
+
header_map.insert(COOKIE, "categories=general; language=auto; locale=en; autocomplete=duckduckgo; image_proxy=1; method=POST; safesearch=2; theme=simple; results_on_new_tab=1; doi_resolver=oadoi.org; simple_style=auto; center_alignment=1; query_in_title=1; infinite_scroll=0; disabled_engines=; enabled_engines=\"archive is__general\\054yep__general\\054curlie__general\\054currency__general\\054ddg definitions__general\\054wikidata__general\\054duckduckgo__general\\054tineye__general\\054lingva__general\\054startpage__general\\054yahoo__general\\054wiby__general\\054marginalia__general\\054alexandria__general\\054wikibooks__general\\054wikiquote__general\\054wikisource__general\\054wikiversity__general\\054wikivoyage__general\\054dictzone__general\\054seznam__general\\054mojeek__general\\054naver__general\\054wikimini__general\\054brave__general\\054petalsearch__general\\054goo__general\"; disabled_plugins=; enabled_plugins=\"searx.plugins.hostname_replace\\054searx.plugins.oa_doi_rewrite\\054searx.plugins.vim_hotkeys\"; tokens=; maintab=on; enginetab=on".parse()?);
|
42 |
|
43 |
// fetch the html from upstream searx instance engine
|
44 |
// TODO: Write better error handling code to handle no results case.
|
src/search_results_handler/aggregator.rs
CHANGED
@@ -1,7 +1,10 @@
|
|
1 |
//! This module provides the functionality to scrape and gathers all the results from the upstream
|
2 |
//! search engines and then removes duplicate results.
|
3 |
|
4 |
-
use std::collections::HashMap;
|
|
|
|
|
|
|
5 |
|
6 |
use super::{
|
7 |
aggregation_models::{RawSearchResult, SearchResult, SearchResults},
|
@@ -14,14 +17,14 @@ use crate::engines::{duckduckgo, searx};
|
|
14 |
/// then removes duplicate results and if two results are found to be from two or more engines
|
15 |
/// then puts their names together to show the results are fetched from these upstream engines
|
16 |
/// and then removes all data from the HashMap and puts into a struct of all results aggregated
|
17 |
-
/// into a vector and also adds the query used into the struct this is neccessory because
|
18 |
/// otherwise the search bar in search remains empty if searched from the query url
|
19 |
///
|
20 |
/// # Example:
|
21 |
///
|
22 |
/// If you search from the url like `https://127.0.0.1/search?q=huston` then the search bar should
|
23 |
/// contain the word huston and not remain empty.
|
24 |
-
///
|
25 |
/// # Arguments
|
26 |
///
|
27 |
/// * `query` - Accepts a string to query with the above upstream search engines.
|
@@ -29,7 +32,7 @@ use crate::engines::{duckduckgo, searx};
|
|
29 |
///
|
30 |
/// # Error
|
31 |
///
|
32 |
-
/// Returns an error a reqwest and scraping selector errors if any error occurs in the results
|
33 |
/// function in either `searx` or `duckduckgo` or both otherwise returns a `SearchResults struct`
|
34 |
/// containing appropriate values.
|
35 |
pub async fn aggregate(
|
@@ -39,10 +42,19 @@ pub async fn aggregate(
|
|
39 |
let user_agent: String = random_user_agent();
|
40 |
let mut result_map: HashMap<String, RawSearchResult> = HashMap::new();
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
let
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
result_map.extend(ddg_map_results);
|
48 |
|
|
|
1 |
//! This module provides the functionality to scrape and gathers all the results from the upstream
|
2 |
//! search engines and then removes duplicate results.
|
3 |
|
4 |
+
use std::{collections::HashMap, time::Duration};
|
5 |
+
|
6 |
+
use rand::Rng;
|
7 |
+
use tokio::join;
|
8 |
|
9 |
use super::{
|
10 |
aggregation_models::{RawSearchResult, SearchResult, SearchResults},
|
|
|
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:
|
24 |
///
|
25 |
/// If you search from the url like `https://127.0.0.1/search?q=huston` then the search bar should
|
26 |
/// contain the word huston and not remain empty.
|
27 |
+
///
|
28 |
/// # Arguments
|
29 |
///
|
30 |
/// * `query` - Accepts a string to query with the above upstream search engines.
|
|
|
32 |
///
|
33 |
/// # Error
|
34 |
///
|
35 |
+
/// Returns an error a reqwest and scraping selector errors if any error occurs in the results
|
36 |
/// function in either `searx` or `duckduckgo` or both otherwise returns a `SearchResults struct`
|
37 |
/// containing appropriate values.
|
38 |
pub async fn aggregate(
|
|
|
42 |
let user_agent: String = random_user_agent();
|
43 |
let mut result_map: HashMap<String, RawSearchResult> = HashMap::new();
|
44 |
|
45 |
+
// Add a random delay before making the request.
|
46 |
+
let mut rng = rand::thread_rng();
|
47 |
+
let delay_secs = rng.gen_range(1..10);
|
48 |
+
std::thread::sleep(Duration::from_secs(delay_secs));
|
49 |
+
|
50 |
+
// fetch results from upstream search engines simultaneously/concurrently.
|
51 |
+
let (ddg_map_results, searx_map_results) = join!(
|
52 |
+
duckduckgo::results(query, page, &user_agent),
|
53 |
+
searx::results(query, page, &user_agent)
|
54 |
+
);
|
55 |
+
|
56 |
+
let ddg_map_results: HashMap<String, RawSearchResult> = ddg_map_results?;
|
57 |
+
let searx_map_results: HashMap<String, RawSearchResult> = searx_map_results?;
|
58 |
|
59 |
result_map.extend(ddg_map_results);
|
60 |
|