Skip to content

web search done right

A bunch of frontend updates

Mikkel Denker9445548210a0
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..a7ef7647
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,36 @@
+# Contributing to Cuely
+There are many ways to contribute to Cuely.
+Code contribution are welcome of course, but also
+bug reports, feature request, and evangelizing are as valuable.
+
+# Submitting a PR
+Check if your issue is already listed [github](https://github.com/cuely/cuely/issues).
+If it is not, create your own issue.
+
+Please add the following phrase at the end of your commit. `Closes #<Issue Number>`.
+It will automatically link your PR in the issue page. Also, once your PR is merged, it will
+closes the issue. If your PR only partially addresses the issue and you would like to
+keep it open, just write `See #<Issue Number>`.
+
+Feel free to send your contribution in an unfinished state to get early feedback.
+In that case, simply mark the PR with the tag [WIP] (standing for work in progress).
+
+# Signing the CLA
+Cuely is an opensource project licensed a AGPLv3.
+
+Contributors are required to sign a Contributor License Agreement.
+The process is simple and fast. Upon your first pull request, you will be prompted to
+[sign our CLA by visiting this link](https://cla-assistant.io/cuely/cuely).
+
+# Development
+## Setup
+* Install rust by following the steps outlined [here](https://www.rust-lang.org/tools/install)
+* Install clang
+* Update ulimit. RocksDB tends to exceed the max number of allowed open files, so you will have to run `ulimit -n 10240` to increase the allowed max number of open files.
+* (Optional) Install cargo-watch by running `cargo install cargo-watch`. This makes frontend development easier.
+* (Optional) Install just by running `cargo install just`. This allows you to run the scripts in the Justfile. A Justfile is basically a simple Makefile, so this is just for convenience.
+* (Optional) Install git-lfs and download the data.
+ * `git lfs pull` downloads a compressed sample index.
+ * `just unpack-data` un-packs the data.
+
+After the non optional steps you can now run `cargo test` and should see all tests passing. If you have followed the optional steps, you should be able to run `just frontend` which will launch the frontend on `0.0.0.0:3000`.
\ No newline at end of file
diff --git a/Cargo.lock b/Cargo.lock
index 4a4fa2f3..05590657 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -49,6 +49,12 @@ version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704"
+[[package]]
+name = "arc-swap"
+version = "1.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "983cd8b9d4b02a6dc6ffa557262eb5858a27a0038ffffe21a0f133eaa819a164"
+
[[package]]
name = "askama"
version = "0.11.1"
@@ -722,9 +728,9 @@ checksum = "25c7df09945d65ea8d70b3321547ed414bbc540aad5bac6883d021b970f35b04"
[[package]]
name = "fastfield_codecs"
version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8dff2ee906bb242438742b5ecac909c0719cbd9db546f6c3d9ac86bd93f5b07e"
+source = "git+https://github.com/quickwit-oss/tantivy.git?rev=a451f6d60dc4cb751457d11a3cc9d038d9b63713#a451f6d60dc4cb751457d11a3cc9d038d9b63713"
dependencies = [
+ "ownedbytes",
"tantivy-bitpacker",
"tantivy-common",
]
@@ -1749,8 +1755,7 @@ dependencies = [
[[package]]
name = "ownedbytes"
version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2981bd7cfb2a70e6c50083c60561275a269fc7458f151c53b126ec1b15cc040"
+source = "git+https://github.com/quickwit-oss/tantivy.git?rev=a451f6d60dc4cb751457d11a3cc9d038d9b63713#a451f6d60dc4cb751457d11a3cc9d038d9b63713"
dependencies = [
"stable_deref_trait",
]
@@ -2488,9 +2493,9 @@ checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8"
[[package]]
name = "tantivy"
version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08d3da9d47a874779d5a97c5f01c2d0a85fc96e38ed6d51ad21a3cf6d6eb8c47"
+source = "git+https://github.com/quickwit-oss/tantivy.git?rev=a451f6d60dc4cb751457d11a3cc9d038d9b63713#a451f6d60dc4cb751457d11a3cc9d038d9b63713"
dependencies = [
+ "arc-swap",
"async-trait",
"base64",
"bitpacking",
@@ -2531,7 +2536,7 @@ dependencies = [
"tantivy-query-grammar",
"tempfile",
"thiserror",
- "time 0.3.9",
+ "time 0.3.14",
"uuid",
"winapi",
]
@@ -2539,14 +2544,12 @@ dependencies = [
[[package]]
name = "tantivy-bitpacker"
version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90f95c862d26a32e1fdb161ab139c5a3bba221f5fac512af40034e13e25f3131"
+source = "git+https://github.com/quickwit-oss/tantivy.git?rev=a451f6d60dc4cb751457d11a3cc9d038d9b63713#a451f6d60dc4cb751457d11a3cc9d038d9b63713"
[[package]]
name = "tantivy-common"
version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dec19155b3ed963ae1653bc4995ab8175281f68400c39081205ae25b53fd9750"
+source = "git+https://github.com/quickwit-oss/tantivy.git?rev=a451f6d60dc4cb751457d11a3cc9d038d9b63713#a451f6d60dc4cb751457d11a3cc9d038d9b63713"
dependencies = [
"byteorder",
"ownedbytes",
@@ -2566,8 +2569,7 @@ dependencies = [
[[package]]
name = "tantivy-query-grammar"
version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d6bbdce99f2b8dcbe24ee25acffb36a2b45b31344531374df1008f6a64bb583"
+source = "git+https://github.com/quickwit-oss/tantivy.git?rev=a451f6d60dc4cb751457d11a3cc9d038d9b63713#a451f6d60dc4cb751457d11a3cc9d038d9b63713"
dependencies = [
"combine",
"once_cell",
@@ -2692,9 +2694,9 @@ dependencies = [
[[package]]
name = "time"
-version = "0.3.9"
+version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd"
+checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b"
dependencies = [
"itoa 1.0.2",
"libc",
diff --git a/Cargo.toml b/Cargo.toml
index 5c421309..5c4080f2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,7 +22,7 @@ rayon = "1.5.3"
reqwest = { version = "0.11.10", features = ["blocking", "stream"] }
serde = "1.0.137"
serde_json = "1.0.81"
-tantivy = "0.18.0"
+tantivy = { git = "https://github.com/quickwit-oss/tantivy.git", rev = "a451f6d60dc4cb751457d11a3cc9d038d9b63713" }
thiserror = "1.0.31"
toml = "0.5.9"
tracing = "0.1.34"
diff --git a/README.md b/README.md
index e8356cd8..05a80ed4 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,44 @@
-# Cuely
-Work in progress.
+<br/>
-## License
+<br/>
+<br/>
+<p align="center">
+ <img src="git-assets/big-logo.svg" height="60" />
+</p>
+<br />
+
+Cuely is an open source web search engine hosted at [cuely.io](https://cuely.io/) targeted towards tinkerers and developers.
+
+<br />
+<p align="center">
+ <img src="git-assets/screenshot.png" width="80%" />
+</p>
+<br />
+<br />
+
+# πŸ’‘ Features
+* Keyword search that respects your search query.
+* Advanced query syntax (`site:`, `intitle:` etc.).
+* Rank webpages based on their [harmonic centrality](https://en.wikipedia.org/wiki/Centrality#Harmonic_centrality)
+* DDG-like [!bang syntax](https://duckduckgo.com/bang)
+* Entity sidebar
+* De-rank websites with third-party trackers
+* Prioritize fresh content
+* Regional search
+* (Coming soon) Customize how signals are combined during search for the final search result
+* (Coming soon) Use [goggles](https://brave.com/static-assets/files/goggles.pdf) to almost endlessly customize your search results.
+* (Coming soon) Prioritize links (centrality) from the sites you trust.
+
+# πŸ‘©β€πŸ’» Setup
+We recommend everyone to use the hosted version at [cuely.io](https://cuely.io/), but you can also follow the steps outlined in [CONTRIBUTING.md](CONTRIBUTING.md) to setup the engine locally.
+
+# β€πŸ’Ό License
Cuely is offered under the terms defined under the [LICENSE.md](LICENSE.md) file.
-## Contact
-You can contact us at [[email protected]](mailto:[email protected]) or in our [Discord server](https://discord.gg/BmzKHffWJM).
\ No newline at end of file
+# πŸ“¬ Contact
+You can contact us at [[email protected]](mailto:[email protected]) or in our [Discord server](https://discord.gg/BmzKHffWJM).
+
+# πŸ† Thank you!
+We truly stand on the shoulders of giants and this project would not have been even remotely feasible without them. An especially huge thank you to
+* The authors and contributors of Tantivy for providing the inverted index library on which Cuely is built.
+* The commoncrawl organization for crawling the web and making the dataset readily available.
\ No newline at end of file
diff --git a/data.tar.gz b/data.tar.gz
index 93ce0eb7..6cf1c47b 100644
--- a/data.tar.gz
+++ b/data.tar.gz
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:608f4a821d73fb19387c6eca5ffb150409ff1d40144b1757b4b40ae18a3ec0fb
-size 1008558697
+oid sha256:ca327c730cc3f628dd76399f17a820f40b001330dd96f750771fe126ce189b74
+size 1009211519
diff --git a/git-assets/big-logo.svg b/git-assets/big-logo.svg
new file mode 100644
index 00000000..bf10607f
--- /dev/null
+++ b/git-assets/big-logo.svg
@@ -0,0 +1,4 @@
+<svg width="216" height="80" viewBox="0 0 216 80" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M15.1762 63.072C14.5442 63.072 13.9602 62.968 13.4242 62.76C12.8882 62.544 12.4242 62.244 12.0322 61.86C11.6402 61.476 11.3322 61.024 11.1082 60.504C10.8922 59.984 10.7842 59.416 10.7842 58.8C10.7842 58.184 10.8922 57.616 11.1082 57.096C11.3322 56.576 11.6402 56.124 12.0322 55.74C12.4322 55.356 12.9002 55.06 13.4362 54.852C13.9722 54.636 14.5562 54.528 15.1882 54.528C15.7962 54.528 16.3682 54.632 16.9042 54.84C17.4402 55.04 17.8922 55.344 18.2602 55.752L17.6962 56.316C17.3522 55.964 16.9722 55.712 16.5562 55.56C16.1402 55.4 15.6922 55.32 15.2122 55.32C14.7082 55.32 14.2402 55.408 13.8082 55.584C13.3762 55.752 13.0002 55.996 12.6802 56.316C12.3602 56.628 12.1082 56.996 11.9242 57.42C11.7482 57.836 11.6602 58.296 11.6602 58.8C11.6602 59.304 11.7482 59.768 11.9242 60.192C12.1082 60.608 12.3602 60.976 12.6802 61.296C13.0002 61.608 13.3762 61.852 13.8082 62.028C14.2402 62.196 14.7082 62.28 15.2122 62.28C15.6922 62.28 16.1402 62.2 16.5562 62.04C16.9722 61.88 17.3522 61.624 17.6962 61.272L18.2602 61.836C17.8922 62.244 17.4402 62.552 16.9042 62.76C16.3682 62.968 15.7922 63.072 15.1762 63.072ZM22.2599 63.06C21.6519 63.06 21.1039 62.924 20.6159 62.652C20.1359 62.372 19.7559 61.992 19.4759 61.512C19.1959 61.024 19.0559 60.468 19.0559 59.844C19.0559 59.212 19.1959 58.656 19.4759 58.176C19.7559 57.696 20.1359 57.32 20.6159 57.048C21.0959 56.776 21.6439 56.64 22.2599 56.64C22.8839 56.64 23.4359 56.776 23.9159 57.048C24.4039 57.32 24.7839 57.696 25.0559 58.176C25.3359 58.656 25.4759 59.212 25.4759 59.844C25.4759 60.468 25.3359 61.024 25.0559 61.512C24.7839 61.992 24.4039 62.372 23.9159 62.652C23.4279 62.924 22.8759 63.06 22.2599 63.06ZM22.2599 62.304C22.7159 62.304 23.1199 62.204 23.4719 62.004C23.8239 61.796 24.0999 61.508 24.2999 61.14C24.5079 60.764 24.6119 60.332 24.6119 59.844C24.6119 59.348 24.5079 58.916 24.2999 58.548C24.0999 58.18 23.8239 57.896 23.4719 57.696C23.1199 57.488 22.7199 57.384 22.2719 57.384C21.8239 57.384 21.4239 57.488 21.0719 57.696C20.7199 57.896 20.4399 58.18 20.2319 58.548C20.0239 58.916 19.9199 59.348 19.9199 59.844C19.9199 60.332 20.0239 60.764 20.2319 61.14C20.4399 61.508 20.7199 61.796 21.0719 62.004C21.4239 62.204 21.8199 62.304 22.2599 62.304ZM35.0873 56.64C35.5993 56.64 36.0433 56.74 36.4193 56.94C36.8033 57.132 37.0993 57.428 37.3073 57.828C37.5233 58.228 37.6313 58.732 37.6313 59.34V63H36.7793V59.424C36.7793 58.76 36.6193 58.26 36.2993 57.924C35.9873 57.58 35.5433 57.408 34.9673 57.408C34.5353 57.408 34.1593 57.5 33.8393 57.684C33.5273 57.86 33.2833 58.12 33.1073 58.464C32.9393 58.8 32.8553 59.208 32.8553 59.688V63H32.0033V59.424C32.0033 58.76 31.8433 58.26 31.5233 57.924C31.2033 57.58 30.7553 57.408 30.1793 57.408C29.7553 57.408 29.3833 57.5 29.0633 57.684C28.7433 57.86 28.4953 58.12 28.3193 58.464C28.1513 58.8 28.0673 59.208 28.0673 59.688V63H27.2153V56.7H28.0313V58.404L27.8993 58.104C28.0913 57.648 28.3993 57.292 28.8233 57.036C29.2553 56.772 29.7633 56.64 30.3473 56.64C30.9633 56.64 31.4873 56.796 31.9193 57.108C32.3513 57.412 32.6313 57.872 32.7593 58.488L32.4233 58.356C32.6073 57.844 32.9313 57.432 33.3953 57.12C33.8673 56.8 34.4313 56.64 35.0873 56.64ZM43.1939 63.06C42.6499 63.06 42.1579 62.936 41.7179 62.688C41.2779 62.432 40.9259 62.068 40.6619 61.596C40.4059 61.116 40.2779 60.532 40.2779 59.844C40.2779 59.156 40.4059 58.576 40.6619 58.104C40.9179 57.624 41.2659 57.26 41.7059 57.012C42.1459 56.764 42.6419 56.64 43.1939 56.64C43.7939 56.64 44.3299 56.776 44.8019 57.048C45.2819 57.312 45.6579 57.688 45.9299 58.176C46.2019 58.656 46.3379 59.212 46.3379 59.844C46.3379 60.484 46.2019 61.044 45.9299 61.524C45.6579 62.004 45.2819 62.38 44.8019 62.652C44.3299 62.924 43.7939 63.06 43.1939 63.06ZM39.9419 65.328V56.7H40.7579V58.596L40.6739 59.856L40.7939 61.128V65.328H39.9419ZM43.1339 62.304C43.5819 62.304 43.9819 62.204 44.3339 62.004C44.6859 61.796 44.9659 61.508 45.1739 61.14C45.3819 60.764 45.4859 60.332 45.4859 59.844C45.4859 59.356 45.3819 58.928 45.1739 58.56C44.9659 58.192 44.6859 57.904 44.3339 57.696C43.9819 57.488 43.5819 57.384 43.1339 57.384C42.6859 57.384 42.2819 57.488 41.9219 57.696C41.5699 57.904 41.2899 58.192 41.0819 58.56C40.8819 58.928 40.7819 59.356 40.7819 59.844C40.7819 60.332 40.8819 60.764 41.0819 61.14C41.2899 61.508 41.5699 61.796 41.9219 62.004C42.2819 62.204 42.6859 62.304 43.1339 62.304ZM48.0747 63V54.096H48.9267V63H48.0747ZM53.9734 63.06C53.3174 63.06 52.7414 62.924 52.2454 62.652C51.7494 62.372 51.3614 61.992 51.0814 61.512C50.8014 61.024 50.6614 60.468 50.6614 59.844C50.6614 59.22 50.7934 58.668 51.0574 58.188C51.3294 57.708 51.6974 57.332 52.1614 57.06C52.6334 56.78 53.1614 56.64 53.7454 56.64C54.3374 56.64 54.8614 56.776 55.3174 57.048C55.7814 57.312 56.1454 57.688 56.4094 58.176C56.6734 58.656 56.8054 59.212 56.8054 59.844C56.8054 59.884 56.8014 59.928 56.7934 59.976C56.7934 60.016 56.7934 60.06 56.7934 60.108H51.3094V59.472H56.3374L56.0014 59.724C56.0014 59.268 55.9014 58.864 55.7014 58.512C55.5094 58.152 55.2454 57.872 54.9094 57.672C54.5734 57.472 54.1854 57.372 53.7454 57.372C53.3134 57.372 52.9254 57.472 52.5814 57.672C52.2374 57.872 51.9694 58.152 51.7774 58.512C51.5854 58.872 51.4894 59.284 51.4894 59.748V59.88C51.4894 60.36 51.5934 60.784 51.8014 61.152C52.0174 61.512 52.3134 61.796 52.6894 62.004C53.0734 62.204 53.5094 62.304 53.9974 62.304C54.3814 62.304 54.7374 62.236 55.0654 62.1C55.4014 61.964 55.6894 61.756 55.9294 61.476L56.4094 62.028C56.1294 62.364 55.7774 62.62 55.3534 62.796C54.9374 62.972 54.4774 63.06 53.9734 63.06ZM60.5316 63.06C59.9396 63.06 59.4836 62.9 59.1636 62.58C58.8436 62.26 58.6836 61.808 58.6836 61.224V55.308H59.5356V61.176C59.5356 61.544 59.6276 61.828 59.8116 62.028C60.0036 62.228 60.2756 62.328 60.6276 62.328C61.0036 62.328 61.3156 62.22 61.5636 62.004L61.8636 62.616C61.6956 62.768 61.4916 62.88 61.2516 62.952C61.0196 63.024 60.7796 63.06 60.5316 63.06ZM57.5556 57.408V56.7H61.4556V57.408H57.5556ZM65.8679 63.06C65.2119 63.06 64.6359 62.924 64.1399 62.652C63.6439 62.372 63.2559 61.992 62.9759 61.512C62.6959 61.024 62.5559 60.468 62.5559 59.844C62.5559 59.22 62.6879 58.668 62.9519 58.188C63.2239 57.708 63.5919 57.332 64.0559 57.06C64.5279 56.78 65.0559 56.64 65.6399 56.64C66.2319 56.64 66.7559 56.776 67.2119 57.048C67.6759 57.312 68.0399 57.688 68.3039 58.176C68.5679 58.656 68.6999 59.212 68.6999 59.844C68.6999 59.884 68.6959 59.928 68.6879 59.976C68.6879 60.016 68.6879 60.06 68.6879 60.108H63.2039V59.472H68.2319L67.8959 59.724C67.8959 59.268 67.7959 58.864 67.5959 58.512C67.4039 58.152 67.1399 57.872 66.8039 57.672C66.4679 57.472 66.0799 57.372 65.6399 57.372C65.2079 57.372 64.8199 57.472 64.4759 57.672C64.1319 57.872 63.8639 58.152 63.6719 58.512C63.4799 58.872 63.3839 59.284 63.3839 59.748V59.88C63.3839 60.36 63.4879 60.784 63.6959 61.152C63.9119 61.512 64.2079 61.796 64.5839 62.004C64.9679 62.204 65.4039 62.304 65.8919 62.304C66.2759 62.304 66.6319 62.236 66.9599 62.1C67.2959 61.964 67.5839 61.756 67.8239 61.476L68.3039 62.028C68.0239 62.364 67.6719 62.62 67.2479 62.796C66.8319 62.972 66.3719 63.06 65.8679 63.06ZM70.4341 63V54.096H71.2861V63H70.4341ZM73.7048 65.388C73.4088 65.388 73.1248 65.34 72.8528 65.244C72.5888 65.148 72.3607 65.004 72.1687 64.812L72.5648 64.176C72.7248 64.328 72.8968 64.444 73.0808 64.524C73.2728 64.612 73.4848 64.656 73.7168 64.656C73.9968 64.656 74.2368 64.576 74.4368 64.416C74.6448 64.264 74.8408 63.992 75.0248 63.6L75.4328 62.676L75.5288 62.544L78.1208 56.7H78.9608L75.8048 63.756C75.6288 64.164 75.4328 64.488 75.2168 64.728C75.0088 64.968 74.7808 65.136 74.5328 65.232C74.2848 65.336 74.0088 65.388 73.7048 65.388ZM75.3848 63.18L72.4808 56.7H73.3688L75.9368 62.484L75.3848 63.18ZM87.1533 63.072C86.5213 63.072 85.9333 62.968 85.3893 62.76C84.8533 62.544 84.3853 62.244 83.9853 61.86C83.5933 61.468 83.2853 61.016 83.0613 60.504C82.8453 59.984 82.7373 59.416 82.7373 58.8C82.7373 58.184 82.8453 57.62 83.0613 57.108C83.2853 56.588 83.5933 56.136 83.9853 55.752C84.3853 55.36 84.8533 55.06 85.3893 54.852C85.9253 54.636 86.5133 54.528 87.1533 54.528C87.7853 54.528 88.3693 54.636 88.9053 54.852C89.4413 55.06 89.9053 55.356 90.2973 55.74C90.6973 56.124 91.0053 56.576 91.2213 57.096C91.4453 57.616 91.5573 58.184 91.5573 58.8C91.5573 59.416 91.4453 59.984 91.2213 60.504C91.0053 61.024 90.6973 61.476 90.2973 61.86C89.9053 62.244 89.4413 62.544 88.9053 62.76C88.3693 62.968 87.7853 63.072 87.1533 63.072ZM87.1533 62.28C87.6573 62.28 88.1213 62.196 88.5453 62.028C88.9773 61.852 89.3493 61.608 89.6613 61.296C89.9813 60.976 90.2293 60.608 90.4053 60.192C90.5813 59.768 90.6693 59.304 90.6693 58.8C90.6693 58.296 90.5813 57.836 90.4053 57.42C90.2293 56.996 89.9813 56.628 89.6613 56.316C89.3493 55.996 88.9773 55.752 88.5453 55.584C88.1213 55.408 87.6573 55.32 87.1533 55.32C86.6493 55.32 86.1813 55.408 85.7493 55.584C85.3173 55.752 84.9413 55.996 84.6213 56.316C84.3093 56.628 84.0613 56.996 83.8773 57.42C83.7013 57.836 83.6133 58.296 83.6133 58.8C83.6133 59.296 83.7013 59.756 83.8773 60.18C84.0613 60.604 84.3093 60.976 84.6213 61.296C84.9413 61.608 85.3173 61.852 85.7493 62.028C86.1813 62.196 86.6493 62.28 87.1533 62.28ZM96.6197 63.06C96.0757 63.06 95.5837 62.936 95.1437 62.688C94.7037 62.432 94.3517 62.068 94.0877 61.596C93.8317 61.116 93.7037 60.532 93.7037 59.844C93.7037 59.156 93.8317 58.576 94.0877 58.104C94.3437 57.624 94.6917 57.26 95.1317 57.012C95.5717 56.764 96.0677 56.64 96.6197 56.64C97.2197 56.64 97.7557 56.776 98.2277 57.048C98.7077 57.312 99.0837 57.688 99.3557 58.176C99.6277 58.656 99.7637 59.212 99.7637 59.844C99.7637 60.484 99.6277 61.044 99.3557 61.524C99.0837 62.004 98.7077 62.38 98.2277 62.652C97.7557 62.924 97.2197 63.06 96.6197 63.06ZM93.3677 65.328V56.7H94.1837V58.596L94.0997 59.856L94.2197 61.128V65.328H93.3677ZM96.5597 62.304C97.0077 62.304 97.4077 62.204 97.7597 62.004C98.1117 61.796 98.3917 61.508 98.5997 61.14C98.8077 60.764 98.9117 60.332 98.9117 59.844C98.9117 59.356 98.8077 58.928 98.5997 58.56C98.3917 58.192 98.1117 57.904 97.7597 57.696C97.4077 57.488 97.0077 57.384 96.5597 57.384C96.1117 57.384 95.7077 57.488 95.3477 57.696C94.9957 57.904 94.7157 58.192 94.5077 58.56C94.3077 58.928 94.2077 59.356 94.2077 59.844C94.2077 60.332 94.3077 60.764 94.5077 61.14C94.7157 61.508 94.9957 61.796 95.3477 62.004C95.7077 62.204 96.1117 62.304 96.5597 62.304ZM104.177 63.06C103.521 63.06 102.945 62.924 102.449 62.652C101.953 62.372 101.565 61.992 101.285 61.512C101.005 61.024 100.865 60.468 100.865 59.844C100.865 59.22 100.997 58.668 101.261 58.188C101.533 57.708 101.901 57.332 102.365 57.06C102.837 56.78 103.365 56.64 103.949 56.64C104.541 56.64 105.065 56.776 105.521 57.048C105.985 57.312 106.349 57.688 106.613 58.176C106.877 58.656 107.009 59.212 107.009 59.844C107.009 59.884 107.005 59.928 106.997 59.976C106.997 60.016 106.997 60.06 106.997 60.108H101.513V59.472H106.541L106.205 59.724C106.205 59.268 106.105 58.864 105.905 58.512C105.713 58.152 105.449 57.872 105.113 57.672C104.777 57.472 104.389 57.372 103.949 57.372C103.517 57.372 103.129 57.472 102.785 57.672C102.441 57.872 102.173 58.152 101.981 58.512C101.789 58.872 101.693 59.284 101.693 59.748V59.88C101.693 60.36 101.797 60.784 102.005 61.152C102.221 61.512 102.517 61.796 102.893 62.004C103.277 62.204 103.713 62.304 104.201 62.304C104.585 62.304 104.941 62.236 105.269 62.1C105.605 61.964 105.893 61.756 106.133 61.476L106.613 62.028C106.333 62.364 105.981 62.62 105.557 62.796C105.141 62.972 104.681 63.06 104.177 63.06ZM111.959 56.64C112.471 56.64 112.919 56.74 113.303 56.94C113.695 57.132 113.999 57.428 114.215 57.828C114.439 58.228 114.551 58.732 114.551 59.34V63H113.699V59.424C113.699 58.76 113.531 58.26 113.195 57.924C112.867 57.58 112.403 57.408 111.803 57.408C111.355 57.408 110.963 57.5 110.627 57.684C110.299 57.86 110.043 58.12 109.859 58.464C109.683 58.8 109.595 59.208 109.595 59.688V63H108.743V56.7H109.559V58.428L109.427 58.104C109.627 57.648 109.947 57.292 110.387 57.036C110.827 56.772 111.351 56.64 111.959 56.64ZM122.489 63.072C121.865 63.072 121.265 62.972 120.689 62.772C120.121 62.564 119.681 62.3 119.369 61.98L119.717 61.296C120.013 61.584 120.409 61.828 120.905 62.028C121.409 62.22 121.937 62.316 122.489 62.316C123.017 62.316 123.445 62.252 123.773 62.124C124.109 61.988 124.353 61.808 124.505 61.584C124.665 61.36 124.745 61.112 124.745 60.84C124.745 60.512 124.649 60.248 124.457 60.048C124.273 59.848 124.029 59.692 123.725 59.58C123.421 59.46 123.085 59.356 122.717 59.268C122.349 59.18 121.981 59.088 121.613 58.992C121.245 58.888 120.905 58.752 120.593 58.584C120.289 58.416 120.041 58.196 119.849 57.924C119.665 57.644 119.573 57.28 119.573 56.832C119.573 56.416 119.681 56.036 119.897 55.692C120.121 55.34 120.461 55.06 120.917 54.852C121.373 54.636 121.957 54.528 122.669 54.528C123.141 54.528 123.609 54.596 124.073 54.732C124.537 54.86 124.937 55.04 125.273 55.272L124.973 55.98C124.613 55.74 124.229 55.564 123.821 55.452C123.421 55.34 123.033 55.284 122.657 55.284C122.153 55.284 121.737 55.352 121.409 55.488C121.081 55.624 120.837 55.808 120.677 56.04C120.525 56.264 120.449 56.52 120.449 56.808C120.449 57.136 120.541 57.4 120.725 57.6C120.917 57.8 121.165 57.956 121.469 58.068C121.781 58.18 122.121 58.28 122.489 58.368C122.857 58.456 123.221 58.552 123.581 58.656C123.949 58.76 124.285 58.896 124.589 59.064C124.901 59.224 125.149 59.44 125.333 59.712C125.525 59.984 125.621 60.34 125.621 60.78C125.621 61.188 125.509 61.568 125.285 61.92C125.061 62.264 124.717 62.544 124.253 62.76C123.797 62.968 123.209 63.072 122.489 63.072ZM130.052 63.06C129.396 63.06 128.82 62.924 128.324 62.652C127.828 62.372 127.44 61.992 127.16 61.512C126.88 61.024 126.74 60.468 126.74 59.844C126.74 59.22 126.872 58.668 127.136 58.188C127.408 57.708 127.776 57.332 128.24 57.06C128.712 56.78 129.24 56.64 129.824 56.64C130.416 56.64 130.94 56.776 131.396 57.048C131.86 57.312 132.224 57.688 132.488 58.176C132.752 58.656 132.884 59.212 132.884 59.844C132.884 59.884 132.88 59.928 132.872 59.976C132.872 60.016 132.872 60.06 132.872 60.108H127.388V59.472H132.416L132.08 59.724C132.08 59.268 131.98 58.864 131.78 58.512C131.588 58.152 131.324 57.872 130.988 57.672C130.652 57.472 130.264 57.372 129.824 57.372C129.392 57.372 129.004 57.472 128.66 57.672C128.316 57.872 128.048 58.152 127.856 58.512C127.664 58.872 127.568 59.284 127.568 59.748V59.88C127.568 60.36 127.672 60.784 127.88 61.152C128.096 61.512 128.392 61.796 128.768 62.004C129.152 62.204 129.588 62.304 130.076 62.304C130.46 62.304 130.816 62.236 131.144 62.1C131.48 61.964 131.768 61.756 132.008 61.476L132.488 62.028C132.208 62.364 131.856 62.62 131.432 62.796C131.016 62.972 130.556 63.06 130.052 63.06ZM138.39 63V61.608L138.354 61.38V59.052C138.354 58.516 138.202 58.104 137.898 57.816C137.602 57.528 137.158 57.384 136.566 57.384C136.158 57.384 135.77 57.452 135.402 57.588C135.034 57.724 134.722 57.904 134.466 58.128L134.082 57.492C134.402 57.22 134.786 57.012 135.234 56.868C135.682 56.716 136.154 56.64 136.65 56.64C137.466 56.64 138.094 56.844 138.534 57.252C138.982 57.652 139.206 58.264 139.206 59.088V63H138.39ZM136.218 63.06C135.746 63.06 135.334 62.984 134.982 62.832C134.638 62.672 134.374 62.456 134.19 62.184C134.006 61.904 133.914 61.584 133.914 61.224C133.914 60.896 133.99 60.6 134.142 60.336C134.302 60.064 134.558 59.848 134.91 59.688C135.27 59.52 135.75 59.436 136.35 59.436H138.522V60.072H136.374C135.766 60.072 135.342 60.18 135.102 60.396C134.87 60.612 134.754 60.88 134.754 61.2C134.754 61.56 134.894 61.848 135.174 62.064C135.454 62.28 135.846 62.388 136.35 62.388C136.83 62.388 137.242 62.28 137.586 62.064C137.938 61.84 138.194 61.52 138.354 61.104L138.546 61.692C138.386 62.108 138.106 62.44 137.706 62.688C137.314 62.936 136.818 63.06 136.218 63.06ZM141.52 63V56.7H142.336V58.416L142.252 58.116C142.428 57.636 142.724 57.272 143.14 57.024C143.556 56.768 144.072 56.64 144.688 56.64V57.468C144.656 57.468 144.624 57.468 144.592 57.468C144.56 57.46 144.528 57.456 144.496 57.456C143.832 57.456 143.312 57.66 142.936 58.068C142.56 58.468 142.372 59.04 142.372 59.784V63H141.52ZM148.8 63.06C148.176 63.06 147.616 62.924 147.12 62.652C146.632 62.372 146.248 61.992 145.968 61.512C145.688 61.024 145.548 60.468 145.548 59.844C145.548 59.212 145.688 58.656 145.968 58.176C146.248 57.696 146.632 57.32 147.12 57.048C147.616 56.776 148.176 56.64 148.8 56.64C149.336 56.64 149.82 56.744 150.252 56.952C150.684 57.16 151.024 57.472 151.272 57.888L150.636 58.32C150.42 58 150.152 57.764 149.832 57.612C149.512 57.46 149.164 57.384 148.788 57.384C148.34 57.384 147.936 57.488 147.576 57.696C147.216 57.896 146.932 58.18 146.724 58.548C146.516 58.916 146.412 59.348 146.412 59.844C146.412 60.34 146.516 60.772 146.724 61.14C146.932 61.508 147.216 61.796 147.576 62.004C147.936 62.204 148.34 62.304 148.788 62.304C149.164 62.304 149.512 62.228 149.832 62.076C150.152 61.924 150.42 61.692 150.636 61.38L151.272 61.812C151.024 62.22 150.684 62.532 150.252 62.748C149.82 62.956 149.336 63.06 148.8 63.06ZM156.068 56.64C156.58 56.64 157.028 56.74 157.412 56.94C157.804 57.132 158.108 57.428 158.324 57.828C158.548 58.228 158.66 58.732 158.66 59.34V63H157.808V59.424C157.808 58.76 157.64 58.26 157.304 57.924C156.976 57.58 156.512 57.408 155.912 57.408C155.464 57.408 155.072 57.5 154.736 57.684C154.408 57.86 154.152 58.12 153.968 58.464C153.792 58.8 153.704 59.208 153.704 59.688V63H152.852V54.096H153.704V58.428L153.536 58.104C153.736 57.648 154.056 57.292 154.496 57.036C154.936 56.772 155.46 56.64 156.068 56.64ZM165.074 58.356H169.514V59.112H165.074V58.356ZM165.17 62.232H170.222V63H164.282V54.6H170.042V55.368H165.17V62.232ZM175.345 56.64C175.857 56.64 176.305 56.74 176.689 56.94C177.081 57.132 177.385 57.428 177.601 57.828C177.825 58.228 177.937 58.732 177.937 59.34V63H177.085V59.424C177.085 58.76 176.917 58.26 176.581 57.924C176.253 57.58 175.789 57.408 175.189 57.408C174.741 57.408 174.349 57.5 174.013 57.684C173.685 57.86 173.429 58.12 173.245 58.464C173.069 58.8 172.981 59.208 172.981 59.688V63H172.129V56.7H172.945V58.428L172.813 58.104C173.013 57.648 173.333 57.292 173.773 57.036C174.213 56.772 174.737 56.64 175.345 56.64ZM182.927 65.388C182.351 65.388 181.799 65.304 181.271 65.136C180.743 64.968 180.315 64.728 179.987 64.416L180.419 63.768C180.715 64.032 181.079 64.24 181.511 64.392C181.951 64.552 182.415 64.632 182.903 64.632C183.703 64.632 184.291 64.444 184.667 64.068C185.043 63.7 185.231 63.124 185.231 62.34V60.768L185.351 59.688L185.267 58.608V56.7H186.083V62.232C186.083 63.32 185.815 64.116 185.279 64.62C184.751 65.132 183.967 65.388 182.927 65.388ZM182.771 62.76C182.171 62.76 181.631 62.632 181.151 62.376C180.671 62.112 180.291 61.748 180.011 61.284C179.739 60.82 179.603 60.288 179.603 59.688C179.603 59.088 179.739 58.56 180.011 58.104C180.291 57.64 180.671 57.28 181.151 57.024C181.631 56.768 182.171 56.64 182.771 56.64C183.331 56.64 183.835 56.756 184.283 56.988C184.731 57.22 185.087 57.564 185.351 58.02C185.615 58.476 185.747 59.032 185.747 59.688C185.747 60.344 185.615 60.9 185.351 61.356C185.087 61.812 184.731 62.16 184.283 62.4C183.835 62.64 183.331 62.76 182.771 62.76ZM182.855 62.004C183.319 62.004 183.731 61.908 184.091 61.716C184.451 61.516 184.735 61.244 184.943 60.9C185.151 60.548 185.255 60.144 185.255 59.688C185.255 59.232 185.151 58.832 184.943 58.488C184.735 58.144 184.451 57.876 184.091 57.684C183.731 57.484 183.319 57.384 182.855 57.384C182.399 57.384 181.987 57.484 181.619 57.684C181.259 57.876 180.975 58.144 180.767 58.488C180.567 58.832 180.467 59.232 180.467 59.688C180.467 60.144 180.567 60.548 180.767 60.9C180.975 61.244 181.259 61.516 181.619 61.716C181.987 61.908 182.399 62.004 182.855 62.004ZM188.454 63V56.7H189.306V63H188.454ZM188.886 55.308C188.71 55.308 188.562 55.248 188.442 55.128C188.322 55.008 188.262 54.864 188.262 54.696C188.262 54.528 188.322 54.388 188.442 54.276C188.562 54.156 188.71 54.096 188.886 54.096C189.062 54.096 189.21 54.152 189.33 54.264C189.45 54.376 189.51 54.516 189.51 54.684C189.51 54.86 189.45 55.008 189.33 55.128C189.218 55.248 189.07 55.308 188.886 55.308ZM194.892 56.64C195.404 56.64 195.852 56.74 196.236 56.94C196.628 57.132 196.932 57.428 197.148 57.828C197.372 58.228 197.484 58.732 197.484 59.34V63H196.632V59.424C196.632 58.76 196.464 58.26 196.128 57.924C195.8 57.58 195.336 57.408 194.736 57.408C194.288 57.408 193.896 57.5 193.56 57.684C193.232 57.86 192.976 58.12 192.792 58.464C192.616 58.8 192.528 59.208 192.528 59.688V63H191.676V56.7H192.492V58.428L192.36 58.104C192.56 57.648 192.88 57.292 193.32 57.036C193.76 56.772 194.284 56.64 194.892 56.64ZM202.462 63.06C201.806 63.06 201.23 62.924 200.734 62.652C200.238 62.372 199.85 61.992 199.57 61.512C199.29 61.024 199.15 60.468 199.15 59.844C199.15 59.22 199.282 58.668 199.546 58.188C199.818 57.708 200.186 57.332 200.65 57.06C201.122 56.78 201.65 56.64 202.234 56.64C202.826 56.64 203.35 56.776 203.806 57.048C204.27 57.312 204.634 57.688 204.898 58.176C205.162 58.656 205.294 59.212 205.294 59.844C205.294 59.884 205.29 59.928 205.282 59.976C205.282 60.016 205.282 60.06 205.282 60.108H199.798V59.472H204.826L204.49 59.724C204.49 59.268 204.39 58.864 204.19 58.512C203.998 58.152 203.734 57.872 203.398 57.672C203.062 57.472 202.674 57.372 202.234 57.372C201.802 57.372 201.414 57.472 201.07 57.672C200.726 57.872 200.458 58.152 200.266 58.512C200.074 58.872 199.978 59.284 199.978 59.748V59.88C199.978 60.36 200.082 60.784 200.29 61.152C200.506 61.512 200.802 61.796 201.178 62.004C201.562 62.204 201.998 62.304 202.486 62.304C202.87 62.304 203.226 62.236 203.554 62.1C203.89 61.964 204.178 61.756 204.418 61.476L204.898 62.028C204.618 62.364 204.266 62.62 203.842 62.796C203.426 62.972 202.966 63.06 202.462 63.06Z" fill="#B0B0B0"/>
+<path d="M61.1242 43.216C59.2282 43.216 57.4762 42.904 55.8682 42.28C54.2602 41.632 52.8682 40.732 51.6922 39.58C50.5162 38.428 49.5922 37.072 48.9202 35.512C48.2722 33.952 47.9482 32.248 47.9482 30.4C47.9482 28.552 48.2722 26.848 48.9202 25.288C49.5922 23.728 50.5162 22.372 51.6922 21.22C52.8922 20.068 54.2962 19.18 55.9042 18.556C57.5122 17.908 59.2642 17.584 61.1602 17.584C62.9842 17.584 64.7002 17.896 66.3082 18.52C67.9162 19.12 69.2722 20.032 70.3762 21.256L68.6842 22.948C67.6522 21.892 66.5122 21.136 65.2642 20.68C64.0162 20.2 62.6722 19.96 61.2322 19.96C59.7202 19.96 58.3162 20.224 57.0202 20.752C55.7242 21.256 54.5962 21.988 53.6362 22.948C52.6762 23.884 51.9202 24.988 51.3682 26.26C50.8402 27.508 50.5762 28.888 50.5762 30.4C50.5762 31.912 50.8402 33.304 51.3682 34.576C51.9202 35.824 52.6762 36.928 53.6362 37.888C54.5962 38.824 55.7242 39.556 57.0202 40.084C58.3162 40.588 59.7202 40.84 61.2322 40.84C62.6722 40.84 64.0162 40.6 65.2642 40.12C66.5122 39.64 67.6522 38.872 68.6842 37.816L70.3762 39.508C69.2722 40.732 67.9162 41.656 66.3082 42.28C64.7002 42.904 62.9722 43.216 61.1242 43.216ZM86.2072 43.216C82.9912 43.216 80.4592 42.292 78.6112 40.444C76.7632 38.596 75.8392 35.86 75.8392 32.236V17.8H78.5032V32.128C78.5032 35.104 79.1752 37.3 80.5192 38.716C81.8632 40.132 83.7592 40.84 86.2072 40.84C88.6792 40.84 90.5872 40.132 91.9312 38.716C93.2752 37.3 93.9472 35.104 93.9472 32.128V17.8H96.5392V32.236C96.5392 35.86 95.6152 38.596 93.7672 40.444C91.9432 42.292 89.4232 43.216 86.2072 43.216ZM106.943 29.068H120.263V31.336H106.943V29.068ZM107.231 40.696H122.387V43H104.567V17.8H121.847V20.104H107.231V40.696ZM128.649 43V17.8H131.313V40.696H145.425V43H128.649ZM153.188 43V33.64L153.8 35.296L143.108 17.8H145.952L155.348 33.172H153.836L163.232 17.8H165.896L155.204 35.296L155.816 33.64V43H153.188Z" fill="#0B7BFF"/>
+</svg>
diff --git a/git-assets/screenshot.png b/git-assets/screenshot.png
new file mode 100644
index 00000000..3a624ca3
Binary files /dev/null and b/git-assets/screenshot.png differ
diff --git a/justfile b/justfile
index 83e5f048..2590b869 100644
--- a/justfile
+++ b/justfile
@@ -20,7 +20,6 @@
cargo watch -x 'run -- frontend data/index data/queries_us.csv data/entity data/bangs.json'
@local:
- wget -nc -P data/warc_files https://data.commoncrawl.org/crawl-data/CC-MAIN-2022-05/segments/1642320299852.23/warc/CC-MAIN-20220116093137-20220116123137-00049.warc.gz
rm -rf data/index/
RUSTFLAGS="-C target-cpu=native" cargo run --release -- indexer local configs/indexer/local.toml
mv data/index/CC-MAIN-*/* data/index/
diff --git a/src/entity_index/mod.rs b/src/entity_index/mod.rs
index 12738a99..ac463634 100644
--- a/src/entity_index/mod.rs
+++ b/src/entity_index/mod.rs
@@ -27,7 +27,7 @@ use tantivy::{
query::{BooleanQuery, MoreLikeThisQuery, Occur, QueryClone, TermQuery},
schema::{BytesOptions, IndexRecordOption, Schema, TextFieldIndexing, TextOptions},
tokenizer::Tokenizer,
- DocAddress, IndexReader, IndexWriter, LeasedItem, Searcher, Term,
+ DocAddress, IndexReader, IndexWriter, Searcher, Term,
};
use tracing::info;
@@ -307,7 +307,7 @@ impl EntityIndex {
fn retrieve_stored_entity(
&self,
- searcher: &LeasedItem<Searcher>,
+ searcher: &Searcher,
doc_address: DocAddress,
get_related: bool,
decode_info: bool,
diff --git a/src/frontend/about.rs b/src/frontend/about.rs
new file mode 100644
index 00000000..3851d204
--- /dev/null
+++ b/src/frontend/about.rs
@@ -0,0 +1,29 @@
+// Cuely is an open source web search engine.
+// Copyright (C) 2022 Cuely ApS
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use super::HtmlTemplate;
+use askama::Template;
+use axum::response::IntoResponse;
+
+#[allow(clippy::unused_async)]
+pub async fn route() -> impl IntoResponse {
+ let template = AboutTemplate {};
+ HtmlTemplate(template)
+}
+
+#[derive(Template)]
+#[template(path = "about.html")]
+struct AboutTemplate {}
diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs
index 714e572a..bf55af17 100644
--- a/src/frontend/mod.rs
+++ b/src/frontend/mod.rs
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-use axum::{Extension, Router};
+use axum::{body::Body, Extension, Router};
use crate::{
autosuggest::Autosuggest, bangs::Bangs, entity_index::EntityIndex, index::Index,
@@ -31,11 +31,13 @@ use axum::{
};
use axum_extra::routing::SpaRouter;
+mod about;
mod autosuggest;
mod entity_image;
mod favicons;
mod index;
mod primary_image;
+mod privacy;
pub mod search;
pub struct HtmlTemplate<T>(T);
@@ -61,6 +63,16 @@ where
}
}
+#[allow(clippy::unused_async)]
+pub async fn favicon() -> impl IntoResponse {
+ Response::builder()
+ .status(StatusCode::OK)
+ .body(Body::from(
+ include_bytes!("../../static/images/favicon.ico").to_vec(),
+ ))
+ .unwrap()
+}
+
pub fn router(
index_path: &str,
queries_csv_path: &str,
@@ -85,6 +97,9 @@ pub fn router(
.route("/favicons/:site", get(favicons::route))
.route("/image/:uuid", get(primary_image::route))
.route("/entity/image/:entity", get(entity_image::route))
+ .route("/favicon.ico", get(favicon))
+ .route("/about", get(about::route))
+ .route("/privacy-and-happy-lawyers", get(privacy::route))
.merge(SpaRouter::new("/static", "static"))
.layer(Extension(state)))
}
diff --git a/src/frontend/privacy.rs b/src/frontend/privacy.rs
new file mode 100644
index 00000000..afa5a2c7
--- /dev/null
+++ b/src/frontend/privacy.rs
@@ -0,0 +1,29 @@
+// Cuely is an open source web search engine.
+// Copyright (C) 2022 Cuely ApS
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use super::HtmlTemplate;
+use askama::Template;
+use axum::response::IntoResponse;
+
+#[allow(clippy::unused_async)]
+pub async fn route() -> impl IntoResponse {
+ let template = PrivacyTemplate {};
+ HtmlTemplate(template)
+}
+
+#[derive(Template)]
+#[template(path = "privacy.html")]
+struct PrivacyTemplate {}
diff --git a/src/inverted_index.rs b/src/inverted_index.rs
index 4963d613..f7330b88 100644
--- a/src/inverted_index.rs
+++ b/src/inverted_index.rs
@@ -19,7 +19,7 @@ use tantivy::collector::{Collector, Count};
use tantivy::merge_policy::NoMergePolicy;
use tantivy::schema::Schema;
use tantivy::tokenizer::TokenizerManager;
-use tantivy::{DocAddress, Document, IndexReader, IndexWriter, LeasedItem};
+use tantivy::{DocAddress, Document, IndexReader, IndexWriter};
use crate::image_store::Image;
use crate::query::Query;
@@ -163,7 +163,7 @@ impl InvertedIndex {
fn retrieve_doc(
&self,
doc_address: DocAddress,
- searcher: &LeasedItem<tantivy::Searcher>,
+ searcher: &tantivy::Searcher,
) -> Result<RetrievedWebpage> {
let doc = searcher.doc(doc_address)?;
Ok(RetrievedWebpage::from(doc))
diff --git a/src/query/mod.rs b/src/query/mod.rs
index 7e2eaf38..3ab4d47d 100644
--- a/src/query/mod.rs
+++ b/src/query/mod.rs
@@ -15,10 +15,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::Result;
-use std::{
- collections::{BTreeMap, HashMap},
- sync::Arc,
-};
+use std::{collections::HashMap, sync::Arc};
use tantivy::{
query::{AllQuery, BooleanQuery, Occur},
schema::Schema,
@@ -107,8 +104,8 @@ impl tantivy::query::Query for Query {
self.tantivy_query.weight(searcher, scoring_enabled)
}
- fn query_terms(&self, terms: &mut BTreeMap<tantivy::Term, bool>) {
- self.tantivy_query.query_terms(terms)
+ fn query_terms<'a>(&'a self, visitor: &mut dyn FnMut(&'a tantivy::Term, bool)) {
+ self.tantivy_query.query_terms(visitor)
}
}
diff --git a/src/ranking/initial.rs b/src/ranking/initial.rs
index 36e1578e..fdeb88ed 100644
--- a/src/ranking/initial.rs
+++ b/src/ranking/initial.rs
@@ -20,7 +20,7 @@ use crate::schema::{Field, CENTRALITY_SCALING};
use crate::webpage::region::{Region, RegionCount};
use chrono::Utc;
use tantivy::collector::{ScoreSegmentTweaker, ScoreTweaker};
-use tantivy::fastfield::{DynamicFastFieldReader, FastFieldReader};
+use tantivy::fastfield::{Column, DynamicFastFieldReader};
use tantivy::{DocId, Score, SegmentReader};
pub(crate) struct InitialScoreTweaker {
@@ -143,13 +143,14 @@ fn region_score(
impl ScoreSegmentTweaker<f64> for InitialSegmentScoreTweaker {
fn score(&mut self, doc: DocId, score: Score) -> f64 {
let score = score as f64;
- let centrality: f64 = self.centrality_reader.get(doc) as f64 / CENTRALITY_SCALING as f64;
- let is_homepage = self.is_homepage_reader.get(doc) as f64;
- let fetch_time_ms = self.fetch_time_ms_reader.get(doc) as f64;
- let update_timestamp = self.update_timestamp_reader.get(doc) as f64;
+ let centrality: f64 =
+ self.centrality_reader.get_val(doc as u64) as f64 / CENTRALITY_SCALING as f64;
+ let is_homepage = self.is_homepage_reader.get_val(doc as u64) as f64;
+ let fetch_time_ms = self.fetch_time_ms_reader.get_val(doc as u64) as f64;
+ let update_timestamp = self.update_timestamp_reader.get_val(doc as u64) as f64;
let hours_since_update = (self.current_timestamp - update_timestamp).max(0.000001) / 3600.0;
- let num_trackers = self.num_trackers_reader.get(doc) as f64;
- let region = Region::from_id(self.region_reader.get(doc));
+ let num_trackers = self.num_trackers_reader.get_val(doc as u64) as f64;
+ let region = Region::from_id(self.region_reader.get_val(doc as u64));
(3.0 * score)
+ (3200.0 * centrality)
diff --git a/src/snippet.rs b/src/snippet.rs
index 289f2688..55896eef 100644
--- a/src/snippet.rs
+++ b/src/snippet.rs
@@ -17,7 +17,7 @@
use crate::frontend::search::html_escape;
use crate::tokenizer::Stemmed;
use std::cmp::Ordering;
-use std::collections::BTreeMap;
+use std::collections::{BTreeMap, BTreeSet};
use std::ops::Range;
use tantivy::tokenizer::{TextAnalyzer, Token};
@@ -201,29 +201,23 @@ impl SnippetGenerator {
field: tantivy::schema::Field,
tokenizer: tantivy::tokenizer::TextAnalyzer,
) -> crate::Result<SnippetGenerator> {
- let mut terms = BTreeMap::new();
- query.query_terms(&mut terms);
- let mut terms_text: BTreeMap<String, Score> = Default::default();
-
- for (mut term, _) in terms {
- if term.field() != field {
- continue;
+ let mut terms: BTreeSet<&tantivy::Term> = BTreeSet::new();
+ query.query_terms(&mut |term, _| {
+ if term.field() == field {
+ terms.insert(term);
}
+ });
+ let mut terms_text: BTreeMap<String, Score> = Default::default();
+ for term in terms {
let term_str = if let Some(term_str) = term.as_str() {
- tokenizer
- .token_stream(term_str)
- .next()
- .unwrap()
- .text
- .clone()
+ term_str
} else {
continue;
};
- term.set_text(&term_str);
- let doc_freq = searcher.doc_freq(&term)?;
+ let doc_freq = searcher.doc_freq(term)?;
if doc_freq > 0 {
let score = 1.0 / (1.0 + doc_freq as Score);
- terms_text.insert(term_str, score);
+ terms_text.insert(term_str.to_string(), score);
}
}
Ok(SnippetGenerator {
diff --git a/static/images/discord.svg b/static/images/discord.svg
new file mode 100644
index 00000000..9da6ee03
--- /dev/null
+++ b/static/images/discord.svg
@@ -0,0 +1,10 @@
+<svg width="71" height="55" viewBox="0 0 71 55" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0)">
+<path d="M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z" fill="#23272A"/>
+</g>
+<defs>
+<clipPath id="clip0">
+<rect width="71" height="55" fill="white"/>
+</clipPath>
+</defs>
+</svg>
diff --git a/static/images/favicon.ico b/static/images/favicon.ico
new file mode 100644
index 00000000..ac2bd633
Binary files /dev/null and b/static/images/favicon.ico differ
diff --git a/static/images/github.svg b/static/images/github.svg
new file mode 100644
index 00000000..aa05db9c
--- /dev/null
+++ b/static/images/github.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
\ No newline at end of file
diff --git a/static/images/logo.svg b/static/images/logo.svg
index 2309d56b..e81efc8d 100644
--- a/static/images/logo.svg
+++ b/static/images/logo.svg
@@ -1,16 +1,23 @@
-<svg width="52" height="52" viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g clip-path="url(#clip0_14_10)">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M51.6035 44.3857C47.791 47.671 43.0194 50.0184 37.7867 51.1829C35.3708 51.714 32.838 52 30.2293 52C25.9094 52.0028 21.6396 51.2087 17.7096 49.6715C13.7796 48.1344 10.2817 45.89 7.45338 43.0913C2.63621 38.3558 -0.0121917 32.2827 4.21958e-05 26C4.21958e-05 19.4573 2.81238 13.4791 7.45338 8.90872C10.2817 6.10993 13.7796 3.86572 17.7096 2.32852C21.6396 0.791321 25.9094 -0.00283138 30.2293 7.58482e-06C32.838 7.58482e-06 35.3708 0.286007 37.7867 0.81715C43.0194 1.9815 47.791 4.32896 51.6035 7.61429L40.9153 16.8071C39.5157 15.5992 37.8508 14.6409 36.0167 13.9874C34.1826 13.334 32.2155 12.9984 30.2293 13C21.8833 13 15.1147 18.8203 15.1147 26L15.119 26.3343C15.327 33.3617 22.0133 39 30.2293 39C34.4023 39 38.181 37.544 40.9153 35.1929L51.6035 44.3857Z" fill="#0B7BFF"/>
-<path fill-rule="evenodd" clip-rule="evenodd" d="M40.9154 16.8071C39.5157 15.5992 37.8508 14.6409 36.0167 13.9874C34.1826 13.334 32.2157 12.9984 30.2293 13C21.8833 13 15.1147 18.8203 15.1147 26C15.1084 22.5869 15.8872 19.2062 17.4067 16.0514C18.9262 12.8966 21.1564 10.0296 23.9698 7.61428C27.7823 4.32895 32.5542 1.98149 37.7867 0.817139L40.9154 16.8071Z" fill="url(#paint0_linear_14_10)"/>
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_402_3)">
+<mask id="path-1-inside-1_402_3" fill="white">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M23.817 20.4857C22.0574 22.002 19.8551 23.0854 17.44 23.6229C16.325 23.868 15.156 24 13.952 24C11.9582 24.0013 9.9875 23.6348 8.17366 22.9253C6.35982 22.2159 4.74538 21.18 3.44002 19.8883C1.21671 17.7027 -0.00562695 14.8997 1.9475e-05 12C1.9475e-05 8.98029 1.29802 6.22114 3.44002 4.11171C4.74538 2.81997 6.35982 1.78418 8.17366 1.0747C9.9875 0.365225 11.9582 -0.00130679 13.952 3.50069e-06C15.156 3.50069e-06 16.325 0.132003 17.44 0.377146C19.8551 0.914537 22.0574 1.99798 23.817 3.51429L18.884 7.75714C18.238 7.19964 17.4696 6.75733 16.6231 6.45574C15.7766 6.15415 14.8687 5.99925 13.952 6C10.1 6 6.97602 8.68629 6.97602 12L6.97802 12.1543C7.07402 15.3977 10.16 18 13.952 18C15.878 18 17.622 17.328 18.884 16.2429L23.817 20.4857Z"/>
+</mask>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M23.817 20.4857C22.0574 22.002 19.8551 23.0854 17.44 23.6229C16.325 23.868 15.156 24 13.952 24C11.9582 24.0013 9.9875 23.6348 8.17366 22.9253C6.35982 22.2159 4.74538 21.18 3.44002 19.8883C1.21671 17.7027 -0.00562695 14.8997 1.9475e-05 12C1.9475e-05 8.98029 1.29802 6.22114 3.44002 4.11171C4.74538 2.81997 6.35982 1.78418 8.17366 1.0747C9.9875 0.365225 11.9582 -0.00130679 13.952 3.50069e-06C15.156 3.50069e-06 16.325 0.132003 17.44 0.377146C19.8551 0.914537 22.0574 1.99798 23.817 3.51429L18.884 7.75714C18.238 7.19964 17.4696 6.75733 16.6231 6.45574C15.7766 6.15415 14.8687 5.99925 13.952 6C10.1 6 6.97602 8.68629 6.97602 12L6.97802 12.1543C7.07402 15.3977 10.16 18 13.952 18C15.878 18 17.622 17.328 18.884 16.2429L23.817 20.4857Z" fill="#0B7BFF" stroke="#1D1D1F" stroke-width="0.1" mask="url(#path-1-inside-1_402_3)"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M18.884 7.75713C18.238 7.19963 17.4696 6.75732 16.6231 6.45573C15.7766 6.15414 14.8688 5.99925 13.952 5.99999C10.1 5.99999 6.97603 8.68628 6.97603 12C6.9731 10.4247 7.33257 8.86439 8.03386 7.40835C8.73515 5.95228 9.7645 4.62903 11.063 3.51428C12.8226 1.99797 15.025 0.914529 17.44 0.377136L18.884 7.75713Z" fill="url(#paint0_linear_402_3)"/>
+<path d="M7.78497 20.837L8.63461 18.8274L9.43923 19.1676C9.58707 19.2301 9.70112 19.3042 9.78136 19.3898C9.86161 19.4754 9.91014 19.5676 9.92694 19.6665C9.94402 19.7647 9.93127 19.8641 9.88867 19.9649C9.85548 20.0434 9.81061 20.1058 9.75404 20.152C9.69775 20.1976 9.6341 20.2278 9.56311 20.2425C9.49305 20.2568 9.41971 20.257 9.34307 20.2431L9.33478 20.2628C9.40993 20.2984 9.47243 20.3503 9.52229 20.4184C9.5728 20.4868 9.60377 20.5658 9.61521 20.6555C9.62693 20.7445 9.61191 20.8383 9.57015 20.9371C9.52507 21.0438 9.45833 21.1277 9.36994 21.1891C9.28248 21.25 9.17717 21.283 9.054 21.288C8.93083 21.293 8.79402 21.2636 8.64356 21.2L7.78497 20.837ZM8.35671 20.6693L8.70309 20.8158C8.82149 20.8658 8.91739 20.8798 8.99076 20.8576C9.06442 20.8347 9.11729 20.7854 9.14937 20.7095C9.17288 20.6539 9.18021 20.5992 9.17137 20.5453C9.16253 20.4914 9.13836 20.4419 9.09888 20.3967C9.06005 20.3517 9.00662 20.3149 8.93859 20.2861L8.5824 20.1355L8.35671 20.6693ZM8.70395 19.848L9.01893 19.9812C9.07715 20.0058 9.13312 20.0175 9.18683 20.0163C9.24147 20.0147 9.28989 20.0005 9.3321 19.9736C9.37496 19.947 9.4076 19.9072 9.43 19.8542C9.4607 19.7816 9.45961 19.7122 9.42674 19.6458C9.39452 19.5798 9.33132 19.5268 9.23712 19.487L8.91429 19.3505L8.70395 19.848Z" fill="white"/>
+<path d="M11.0422 21.8422L11.3433 19.6813L12.7994 19.8842L12.7469 20.2609L11.7477 20.1217L11.676 20.6366L12.6003 20.7654L12.5478 21.1421L11.6235 21.0133L11.5516 21.5292L12.555 21.6691L12.5025 22.0457L11.0422 21.8422Z" fill="white"/>
+<path d="M13.8144 20.1909L13.7678 19.8134L15.5461 19.5935L15.5928 19.9709L14.9299 20.0529L15.151 21.8408L14.6985 21.8968L14.4774 20.1089L13.8144 20.1909Z" fill="white"/>
+<path d="M17.8133 21.062L17.358 21.2545L17.2021 18.9516L17.7497 18.7201L19.2921 20.4368L18.8368 20.6293L17.6779 19.2918L17.6622 19.2984L17.8133 21.062ZM17.4509 20.2841L18.5263 19.8294L18.6666 20.1611L17.5911 20.6158L17.4509 20.2841Z" fill="white"/>
</g>
<defs>
-<linearGradient id="paint0_linear_14_10" x1="40.0833" y1="7.58333" x2="15.1667" y2="13" gradientUnits="userSpaceOnUse">
+<linearGradient id="paint0_linear_402_3" x1="18.5" y1="3.49999" x2="7" y2="5.99999" gradientUnits="userSpaceOnUse">
<stop stop-color="#0E7DFF" stop-opacity="0.911017"/>
<stop offset="0.0001" stop-color="#0074FC" stop-opacity="0.65"/>
<stop offset="0.734375" stop-color="white"/>
</linearGradient>
-<clipPath id="clip0_14_10">
-<rect width="52" height="52" fill="white"/>
+<clipPath id="clip0_402_3">
+<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>
diff --git a/templates/about.html b/templates/about.html
new file mode 100644
index 00000000..2f65a38d
--- /dev/null
+++ b/templates/about.html
@@ -0,0 +1,70 @@
+{% extends "base.html" %}
+{% import "navbar.html" as navbar %}
+{% import "footer.html" as footer %}
+
+{% block content %}
+<div class="flex flex-col h-full w-full">
+ <header class="flex items-center h-24">
+ <div class="ml-14 mr-14 w-12 h-12">
+ <a href="/">
+ <img src="/static/images/logo.svg" class="w-full h-full" />
+ </a>
+ </div>
+ {% call navbar::navbar() %}
+ </header>
+
+ <div class="flex flex-col w-full items-center">
+ <div class="flex items-center flex-col max-w-4xl mr-10 ml-10" style="flex-grow: 2;">
+ <div class="flex flex-col items-center">
+ <h1 class="text-2xl mb-3">About Us</h1>
+ <div>
+ <p>Cuely is an open source search engine where the user has the ability to see exactly what is
+ going
+ on and customize almost everything about their search results. It's a search engine made for
+ hackers just like us. No more searches where some of the terms in the query arent used, and
+ the engine tries to guess what you <i>really</i> meant. You get what you search for.</p>
+ </div>
+ </div>
+
+ <div class="flex flex-col items-center mt-16">
+ <h1 class="text-lg mb-3">Our Values</h1>
+ <div>
+ <ul class="list-disc pl-5">
+ <li class="mb-1"><span class="italic">Complete transparency</span> – You can view our code and
+ follow the
+ development directly on <a href="https://github.com/cuely/cuely">Github</a></li>
+ <li class="mb-1"><span class="italic">Privacy focussed</span> – We will never track you. Period.
+ And you can
+ always verify this in our <a href="https://github.com/cuely/cuely">code.</a></li>
+ <li class="mb-1"><span class="italic">Immensely customizable</span> – We aim to give you the
+ ability to
+ customize everything about the search. e.g. block sites, boost sites, prioritize links from
+ specific sites etc.</li>
+ </ul>
+ <p class="mt-3">Oh, and if we ever become evil (e.g. by changing our motto) please take our code
+ and start a
+ competitor. The fact that you have this ability will make sure that our values will always
+ be aligned with our users.</p>
+ </div>
+
+ </div>
+
+ <div class="flex flex-col items-center mt-16 w-full">
+ <h1 class="text-lg mb-3">How do you make money?</h1>
+ <div class="w-full">
+ <p>Well, currently we don't. We are bootstraped and trying to keep costs low. In the future we will
+ have contextual ads based on your current search
+ query. Just to re-iterate; we will only use your current search to match ads and will never
+ track
+ you across searches.</p>
+ <p class="mt-3">We will also have a paid api for developers.</p>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ <div class="flex flex-grow"></div>
+ {% call footer::footer() %}
+</div>
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/base.html b/templates/base.html
index 618e6de4..76d65ef0 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -7,6 +7,7 @@
<title>Cuely</title>
{% block meta %}{% endblock %}
<link rel="stylesheet" type="text/css" href="/static/css/main.css" />
+ <link rel="icon" type="image/x-icon" href="/favicon.ico">
<style>
@font-face {
font-family: Montserrat;
diff --git a/templates/footer.html b/templates/footer.html
new file mode 100644
index 00000000..0c50e814
--- /dev/null
+++ b/templates/footer.html
@@ -0,0 +1,5 @@
+{% macro footer() %}
+<div class="flex w-full justify-center items-center h-10">
+ <a href="/privacy-and-happy-lawyers">Terms & Privacy</a>
+</div>
+{% endmacro %}
\ No newline at end of file
diff --git a/templates/index.html b/templates/index.html
index 0112fccd..9f815321 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,11 +1,19 @@
{% extends "base.html" %}
{% import "searchbar.html" as scope %}
+{% import "navbar.html" as navbar %}
+{% import "footer.html" as footer %}
{% block content %}
<div class="flex flex-col h-full w-full">
+ <header class="flex items-center h-24">
+ {% call navbar::navbar() %}
+ </header>
- <div class="flex justify-center items-center flex-col" style="flex-grow: 2;">
- <h1 class="text-5xl uppercase mb-1" style="color: #0b7bff">cuely</h1>
+ <div class="flex justify-center items-center flex-col" style="flex-grow: 3;">
+ <div class="flex">
+ <h1 class="text-5xl uppercase mb-1" style="color: #0b7bff">cuely</h1>
+ <span style="color: #828282">BETA</span>
+ </div>
<h3 class="mb-8" style="color: #828282">Completely Open Search Engine</h3>
@@ -13,8 +21,10 @@
</div>
- <div class="flex grow flex-col" style="flex-grow: 1;">
+ <div class="flex grow flex-col" style="flex-grow: 2;">
</div>
+
+ {% call footer::footer() %}
</div>
{% endblock %}
\ No newline at end of file
diff --git a/templates/navbar.html b/templates/navbar.html
new file mode 100644
index 00000000..637a021a
--- /dev/null
+++ b/templates/navbar.html
@@ -0,0 +1,39 @@
+{% macro navbar() %}
+<navbar class="flex-grow flex justify-end pr-10 space-x-10">
+ <a href="/about">About</a>
+ <a href="https://discord.gg/BmzKHffWJM">
+ <div class="discord-logo"></div>
+ </a>
+ <a href="https://github.com/cuely/cuely">
+ <div class="github-logo"></div>
+ </a>
+</navbar>
+
+<style>
+ .github-logo {
+ background-color: gray;
+ width: 22px;
+ height: 22px;
+ -webkit-mask: url(/static/images/github.svg) no-repeat center;
+ mask: url(/static/images/github.svg) no-repeat center;
+ mask-size: contain;
+ }
+
+ .github-logo:hover {
+ background-color: black;
+ }
+
+ .discord-logo {
+ background-color: gray;
+ width: 22px;
+ height: 22px;
+ -webkit-mask: url(/static/images/discord.svg) no-repeat center;
+ mask: url(/static/images/discord.svg) no-repeat center;
+ mask-size: contain;
+ }
+
+ .discord-logo:hover {
+ background-color: black;
+ }
+</style>
+{% endmacro %}
\ No newline at end of file
diff --git a/templates/privacy.html b/templates/privacy.html
new file mode 100644
index 00000000..f8acda4c
--- /dev/null
+++ b/templates/privacy.html
@@ -0,0 +1,179 @@
+{% extends "base.html" %}
+{% import "navbar.html" as navbar %}
+{% import "footer.html" as footer %}
+
+{% block content %}
+<div class="flex flex-col h-full w-full">
+ <div class="min-h-max w-full">
+ <header class="flex items-center w-full h-24">
+ <div class="ml-14 mr-14 w-12 h-12">
+ <a href="/">
+ <img src="/static/images/logo.svg" class="w-full h-full" />
+ </a>
+ </div>
+ {% call navbar::navbar() %}
+ </header>
+ </div>
+
+ <div class="flex flex-col w-full h-fit items-center pt-10">
+ <div class="flex flex-col w-full items-center max-w-4xl mr-10 ml-10 space-y-16">
+ <div class="space-y-3">
+ <h1 class="text-2xl font-medium pb-2">We will always respect your privacy.</h1>
+
+ <p>We will be good stewards of any personal information you share with us and we promise not to share
+ your
+ data
+ with anyone else in any way, shape or form.</p>
+
+ <p>When using Cuely, you can have peace of mind knowing that we do whatever is possible to keep
+ your
+ private information - private. We mostly do this by simply not storing any of your private
+ information at all. This keeps things simple, both for you and for us.</p>
+
+ <p>Here is a brief overview of your privacy:</p>
+
+ <ul class="list-disc pl-7">
+ <li>Searches are anonymous and private to you.</li>
+ <li>We don't log or store your IP address.</li>
+ <li>We do not use any web browser analytics or other frontend telemetry.</li>
+ <li>We do not share any user data with any third parties.</li>
+ <li>We collect only the data needed to provide and protect the service.</li>
+ <li>We serve all images and other static content directly from our servers to prevent tracking from
+ third parties.</li>
+ <li>We use HTTPS encryption everywhere.</li>
+ </ul>
+
+ <p>You don't have to take our word for these claims as our <a
+ href="https://github.com/cuely/cuely">source code is available to everyone.</a></p>
+ </div>
+ <div class="space-y-3">
+ <h1 class="text-xl">Terms of Service</h1>
+
+ <p>Keep in mind that all services provided in Cuely are provided β€œas is” and there are no warranties. By
+ using our services you agree with the following terms.
+ </p>
+
+ <p><span class="font-medium">Introduction</span> These Terms of Service ("Terms") govern your use of
+ Cuely (the "Services").</p>
+
+ <p><span class="font-medium">Privacy Policy</span> We use the information we receive through the
+ Services as described in our Privacy Policy.</p>
+
+ <p><span class="font-medium">Source code </span> The source code for Cuely is distributed under the
+ license described in the <a href="https://github.com/Cuely/Cuely/blob/main/LICENSE.md">git
+ repository.</a></p>
+
+ <p><span class="font-medium">Proprietary Rights</span> Cuely does not grant you any intellectual
+ property
+ rights in the Services that are
+ not
+ specifically stated in these Terms. For example, these Terms do not provide the right to use any of
+ Cuely's
+ copyrights, trade names, trademarks, service marks, logos, domain names, or other distinctive brand
+ features.</p>
+
+ <p><span class="font-medium">Indemnification</span> You agree to defend, indemnify and hold harmless
+ Cuely, its contractors, contributors,
+ licensors,
+ and partners, and their respective directors, officers, employees and agents ("Indemnified Parties")
+ from
+ and
+ against any and all third party claims and expenses, including attorneys' fees, arising out of or
+ related to
+ your use of the Services.</p>
+
+ <p><span class="font-medium">Limitation of Liability</span> THE SERVICES ARE PROVIDED "AS IS"
+ WITH ALL FAULTS. TO THE EXTENT
+ PERMITTED
+ BY LAW, CUELY AND THE INDEMNIFIED PARTIES HEREBY DISCLAIM ALL WARRANTIES, WHETHER EXPRESS OR
+ IMPLIED,
+ INCLUDING
+ WITHOUT LIMITATION WARRANTIES THAT THE SERVICES ARE FREE OF DEFECTS, MERCHANTABLE, FIT FOR A
+ PARTICULAR
+ PURPOSE,
+ AND NON-INFRINGING. YOU BEAR THE ENTIRE RISK AS TO SELECTING THE SERVICES FOR YOUR PURPOSES AND AS
+ TO
+ THE
+ QUALITY AND PERFORMANCE OF THE SERVICES, INCLUDING WITHOUT LIMITATION THE RISK THAT YOUR CONTENT IS
+ DELETED
+ OR
+ CORRUPTED OR THAT SOMEONE ELSE ACCESSES YOUR ONLINE ACCOUNTS. THIS LIMITATION WILL APPLY
+ NOTWITHSTANDING
+ THE
+ FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR
+ LIMITATION
+ OF
+ IMPLIED WARRANTIES, SO THIS DISCLAIMER MAY NOT APPLY TO YOU. EXCEPT AS REQUIRED BY LAW, CUELY AND
+ THE
+ INDEMNIFIED
+ PARTIES WILL NOT BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR EXEMPLARY
+ DAMAGES
+ ARISING
+ OUT OF OR IN ANY WAY RELATING TO THESE TERMS OR THE USE OF OR INABILITY TO USE THE SERVICES,
+ INCLUDING
+ WITHOUT
+ LIMITATION DIRECT AND INDIRECT DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOST PROFITS, LOSS OF
+ DATA,
+ AND
+ COMPUTER FAILURE OR MALFUNCTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS
+ OF
+ THE
+ THEORY
+ (CONTRACT, TORT, OR OTHERWISE) UPON WHICH SUCH CLAIM IS BASED. THE COLLECTIVE LIABILITY OF CUELY AND
+ THE
+ INDEMNIFIED PARTIES UNDER THIS AGREEMENT WILL NOT EXCEED $500 (FIVE HUNDRED DOLLARS). SOME
+ JURISDICTIONS
+ DO
+ NOT
+ ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL, CONSEQUENTIAL, OR SPECIAL DAMAGES, SO THIS
+ EXCLUSION
+ AND
+ LIMITATION MAY NOT APPLY TO YOU.</p>
+
+ <p><span class="font-medium">Modifications to these Terms</span> Cuely may update these Terms from time
+ to time to address a new feature
+ of
+ the
+ Services or to clarify a provision. The updated Terms will be posted online. If the changes are
+ substantive,
+ we
+ will announce the update through Cuely's usual channels for such announcements such as Discord.
+ Your continued use of the Services after the effective date of such changes constitutes your
+ acceptance
+ of
+ such
+ changes.
+ </p>
+
+ <p><span class="font-medium">Miscellaneous</span> These Terms constitute the entire agreement between
+ you and Cuely concerning the
+ Services
+ and
+ are
+ governed by the laws of Denmark, excluding its conflict of law provisions. If any
+ portion
+ of these Terms is held to be invalid or unenforceable, the remaining portions will remain in full
+ force
+ and
+ effect. In the event of a conflict between a translated version of these terms and the English
+ language
+ version,
+ the English language version shall control.</p>
+
+ </div>
+ <div class="w-full pb-10">
+ <h1>Changelog</h1>
+ <div>
+ <div class="flex space-x-1">
+ <h3 class="font-medium">31-08-2022:</h3>
+ <p>Initial commit</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="flex flex-grow"></div>
+ {% call footer::footer() %}
+</div>
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/search.html b/templates/search.html
index 12d6ebf6..68f375d1 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -1,17 +1,20 @@
{% extends "base.html" %}
{% import "searchbar.html" as scope %}
{% import "entity.html" as entity_scope %}
+{% import "navbar.html" as navbar %}
+{% import "footer.html" as footer %}
{% block content %}
<div class="flex flex-col w-full">
<div class="flex items-center h-24 border bg-neutral-50">
- <div class="ml-14 mr-14">
+ <div class="ml-14 mr-14 w-12 h-12">
<a href="/">
- <img src="/static/images/logo.svg" />
+ <img src="/static/images/logo.svg" class="w-full h-full" />
</a>
</div>
{% call scope::searchbar("", query) %}
+ {% call navbar::navbar() %}
</div>
<div class="flex">
@@ -99,6 +102,8 @@
</div>
</div>
+{% call footer::footer() %}
+
<style>
.title-link {
color: #1a0dab;
diff --git a/templates/searchbar.html b/templates/searchbar.html
index 5a88ced1..af45b306 100644
--- a/templates/searchbar.html
+++ b/templates/searchbar.html
@@ -121,7 +121,7 @@
sepBar.classList.remove("sep-bar-margin-bottom");
}
- currentSuggestions = suggestionsData;
+ currentSuggestions = suggestionsData.map(item => item.raw);
currentHighlighted = -1;
suggestionsData.forEach(item => {