diff --git a/Cargo.lock b/Cargo.lock index 48c29bb..040ece7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -601,6 +601,32 @@ dependencies = [ "libc", ] +[[package]] +name = "crabbysearch" +version = "1.12.1" +dependencies = [ + "actix-cors", + "actix-files", + "actix-web", + "async-compression", + "async-trait", + "cfg-if 1.0.0", + "env_logger", + "error-stack", + "fake-useragent", + "figment", + "futures 0.3.30", + "log", + "maud", + "mini-moka", + "regex", + "reqwest 0.12.5", + "scraper", + "serde", + "serde_json", + "tokio 1.39.2", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -3651,32 +3677,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "websurfx" -version = "1.12.1" -dependencies = [ - "actix-cors", - "actix-files", - "actix-web", - "async-compression", - "async-trait", - "cfg-if 1.0.0", - "env_logger", - "error-stack", - "fake-useragent", - "figment", - "futures 0.3.30", - "log", - "maud", - "mini-moka", - "regex", - "reqwest 0.12.5", - "scraper", - "serde", - "serde_json", - "tokio 1.39.2", -] - [[package]] name = "winapi" version = "0.2.8" diff --git a/Cargo.toml b/Cargo.toml index 747539a..e1284a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "websurfx" +name = "crabbysearch" version = "1.12.1" edition = "2021" -description = "An open-source alternative to Searx that provides clean, ad-free, and organic results with incredible speed while keeping privacy and security in mind." -repository = "https://github.com/neon-mmd/websurfx" +description = "crabbysearch: a simple meta search engine written in rust." +repository = "https://github.com/MilimTheTrueOne/crabbysearch" license = "AGPL-3.0" [dependencies] diff --git a/Dockerfile b/Dockerfile index d8724f4..3b10ccd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,12 +32,12 @@ RUN export ARCH=$(uname -m) && \ else if [ "$CACHE" = "no-cache" ] ; then cargo build --release --target=$ARCH-unknown-linux-musl --no-default-features ; fi ; fi ; fi ; fi # Optimise binary size with UPX RUN export ARCH=$(uname -m) \ - && upx --lzma --best /app/target/$ARCH-unknown-linux-musl/release/websurfx \ - && cp /app/target/$ARCH-unknown-linux-musl/release/websurfx /usr/local/bin/websurfx + && upx --lzma --best /app/target/$ARCH-unknown-linux-musl/release/crabbysearch \ + && cp /app/target/$ARCH-unknown-linux-musl/release/crabbysearch /usr/local/bin/crabbysearch FROM --platform=$BUILDPLATFORM scratch -COPY --from=builder /app/public/ /opt/websurfx/public/ -VOLUME ["/etc/xdg/websurfx/"] -COPY --from=builder /usr/local/bin/websurfx /usr/local/bin/websurfx -CMD ["websurfx"] +COPY --from=builder /app/public/ /opt/crabbysearch/public/ +VOLUME ["/etc/xdg/crabbysearch/"] +COPY --from=builder /usr/local/bin/crabbysearch /usr/local/bin/crabbysearch +CMD ["crabbysearch"] diff --git a/README.md b/README.md index f6353de..aa96251 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ -# Oxisearch +# crabbysearch -A modern, fast, simple meta search engine written in rust. \ No newline at end of file +A modern, fast, simple meta search engine written in rust. + +# Origin +This project is a hard fork of [Websurfx](https://github.com/neon-mmd/websurfx). +I deemed this fork necessary due to the severe incompetence displayed by websurfx's leadership, as well as its stalled development. \ No newline at end of file diff --git a/src/handler/mod.rs b/src/handler/mod.rs index f6cf2d7..5973f54 100644 --- a/src/handler/mod.rs +++ b/src/handler/mod.rs @@ -10,7 +10,7 @@ use std::sync::OnceLock; /// The constant holding the name of the theme folder. const PUBLIC_DIRECTORY_NAME: &str = "public"; /// The constant holding the name of the common folder. -const COMMON_DIRECTORY_NAME: &str = "websurfx"; +const COMMON_DIRECTORY_NAME: &str = "crabbysearch"; /// The constant holding the name of the config file. const CONFIG_FILE_NAME: &str = "config.lua"; /// The constant holding the name of the AllowList text file. @@ -47,7 +47,7 @@ static FILE_PATHS_FOR_DIFF_FILE_TYPES: OnceLock>> /// If this function is give the file_type of Theme variant then the theme folder is checked by the /// following steps: /// -/// 1. `/opt/websurfx` if it not present here then it fallbacks to the next one (2) +/// 1. `/opt/crabbysearch` if it not present here then it fallbacks to the next one (2) /// 2. Under project folder ( or codebase in other words) if it is not present /// here then it returns an error as mentioned above. pub fn file_path(file_type: FileType) -> Result<&'static str, Error> { @@ -70,7 +70,7 @@ pub fn file_path(file_type: FileType) -> Result<&'static str, Error> { ( FileType::Theme, vec![ - format!("/opt/websurfx/{}/", PUBLIC_DIRECTORY_NAME), + format!("/opt/crabbysearch/{}/", PUBLIC_DIRECTORY_NAME), format!("./{}/", PUBLIC_DIRECTORY_NAME), ], ), diff --git a/src/main.rs b/src/main.rs index e333a5f..0763538 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ //! This main library module provides the functionality to provide and handle the Tcp server -//! and register all the routes for the `websurfx` meta search engine website. +//! and register all the routes for the `crabbysearch` meta search engine website. #![forbid(unsafe_code, clippy::panic)] #![deny(missing_docs, clippy::missing_docs_in_private_items, clippy::perf)] diff --git a/src/server/mod.rs b/src/server/mod.rs index 7f4274f..e2721b0 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -1,5 +1,5 @@ //! This module provides modules that handle the functionality of handling different routes/paths -//! for the `websurfx` search engine website. Also it handles the parsing of search parameters in +//! for the `crabbysearch` search engine website. Also it handles the parsing of search parameters in //! the search route. Also, caches the next, current and previous search results in the search //! routes with the help of the redis server. diff --git a/src/server/router.rs b/src/server/router.rs index b42816c..94c974d 100644 --- a/src/server/router.rs +++ b/src/server/router.rs @@ -1,4 +1,4 @@ -//! This module provides the functionality to handle different routes of the `websurfx` +//! This module provides the functionality to handle different routes of the `crabbysearch` //! meta search engine website and provide appropriate response to each route/page //! when requested. @@ -9,7 +9,7 @@ use crate::{ use actix_web::{get, http::header::ContentType, web, HttpRequest, HttpResponse}; use tokio::fs::read_to_string; -/// Handles the route of index page or main page of the `websurfx` meta search engine website. +/// Handles the route of index page or main page of the `crabbysearch` meta search engine website. #[get("/")] pub async fn index(config: web::Data) -> Result> { Ok(HttpResponse::Ok().content_type(ContentType::html()).body( @@ -37,7 +37,7 @@ pub async fn not_found( )) } -/// Handles the route of robots.txt page of the `websurfx` meta search engine website. +/// Handles the route of robots.txt page of the `crabbysearch` meta search engine website. #[get("/robots.txt")] pub async fn robots_data(_req: HttpRequest) -> Result> { let page_content: String = @@ -47,7 +47,7 @@ pub async fn robots_data(_req: HttpRequest) -> Result) -> Result> { Ok(HttpResponse::Ok().content_type(ContentType::html()).body( @@ -60,7 +60,7 @@ pub async fn about(config: web::Data) -> Result, diff --git a/src/server/routes/search.rs b/src/server/routes/search.rs index 9c30f2a..95013ab 100644 --- a/src/server/routes/search.rs +++ b/src/server/routes/search.rs @@ -14,7 +14,7 @@ use actix_web::{get, http::header::ContentType, web, HttpRequest, HttpResponse}; use std::borrow::Cow; use tokio::join; -/// Handles the route of search page of the `websurfx` meta search engine website and it takes +/// Handles the route of search page of the `crabbysearch` meta search engine website and it takes /// two search url parameters `q` and `page` where `page` parameter is optional. /// /// # Example diff --git a/src/templates/mod.rs b/src/templates/mod.rs index bc39dce..22b5b17 100644 --- a/src/templates/mod.rs +++ b/src/templates/mod.rs @@ -1,4 +1,4 @@ -//! This module provides other modules to handle both the view and its partials for the `websurfx` +//! This module provides other modules to handle both the view and its partials for the `crabbysearch` //! search engine frontend. mod partials; diff --git a/src/templates/partials/bar.rs b/src/templates/partials/bar.rs index ebf89fe..a7cd39a 100644 --- a/src/templates/partials/bar.rs +++ b/src/templates/partials/bar.rs @@ -1,4 +1,4 @@ -//! A module that handles `bar` partial for the `search_bar` partial and the home/index/main page in the `websurfx` frontend. +//! A module that handles `bar` partial for the `search_bar` partial and the home/index/main page in the `crabbysearch` frontend. use maud::{html, Markup, PreEscaped}; diff --git a/src/templates/partials/footer.rs b/src/templates/partials/footer.rs index 2ced457..9e5d5d4 100644 --- a/src/templates/partials/footer.rs +++ b/src/templates/partials/footer.rs @@ -1,4 +1,4 @@ -//! A module that handles the footer for all the pages in the `websurfx` frontend. +//! A module that handles the footer for all the pages in the `crabbysearch` frontend. use maud::{html, Markup, PreEscaped}; @@ -12,13 +12,13 @@ pub fn footer() -> Markup { html!( footer{ div{ - span{"Powered By "b{"Websurfx"}}span{"-"}span{"a lightning-fast, privacy respecting, secure meta + span{"Powered By "b{"Crabbysearch"}}span{"-"}span{"a lightning-fast, privacy respecting, secure meta search engine"} } div{ ul{ - li{a href="https://github.com/neon-mmd/websurfx"{"Source Code"}} - li{a href="https://github.com/neon-mmd/websurfx/issues"{"Issues/Bugs"}} + li{a href="https://github.com/MilimTheTrueOne/crabbysearch"{"Source Code"}} + li{a href="https://github.com/MilimTheTrueOne/crabbysearch/issues"{"Issues/Bugs"}} } } } diff --git a/src/templates/partials/header.rs b/src/templates/partials/header.rs index e248248..b88e5cb 100644 --- a/src/templates/partials/header.rs +++ b/src/templates/partials/header.rs @@ -1,4 +1,4 @@ -//! A module that handles the header for all the pages in the `websurfx` frontend. +//! A module that handles the header for all the pages in the `crabbysearch` frontend. use crate::templates::partials::navbar::navbar; use maud::{html, Markup, PreEscaped, DOCTYPE}; @@ -19,7 +19,7 @@ pub fn header(colorscheme: &str, theme: &str, animation: &Option) -> Mar html lang="en" head{ - title{"Websurfx"} + title{"crabbysearch"} meta charset="UTF-8"; meta name="viewport" content="width=device-width, initial-scale=1"; link href=(format!("static/colorschemes/{colorscheme}.css")) rel="stylesheet" type="text/css"; @@ -31,7 +31,7 @@ pub fn header(colorscheme: &str, theme: &str, animation: &Option) -> Mar (PreEscaped("")) header{ - h1{a href="/"{"Websurfx"}} + h1{a href="/"{"crabbysearch"}} (navbar()) } ) diff --git a/src/templates/partials/mod.rs b/src/templates/partials/mod.rs index 0e6b803..815909c 100644 --- a/src/templates/partials/mod.rs +++ b/src/templates/partials/mod.rs @@ -1,4 +1,4 @@ -//! This module provides other modules to handle the partials for the views in the `websurfx` frontend. +//! This module provides other modules to handle the partials for the views in the `crabbysearch` frontend. pub mod bar; pub mod footer; diff --git a/src/templates/partials/navbar.rs b/src/templates/partials/navbar.rs index f1f86fd..92d6450 100644 --- a/src/templates/partials/navbar.rs +++ b/src/templates/partials/navbar.rs @@ -1,4 +1,4 @@ -//! A module that handles `navbar` partial for the header partial in the `websurfx` frontend. +//! A module that handles `navbar` partial for the header partial in the `crabbysearch` frontend. use maud::{html, Markup}; diff --git a/src/templates/partials/search_bar.rs b/src/templates/partials/search_bar.rs index 249f75a..2e7b046 100644 --- a/src/templates/partials/search_bar.rs +++ b/src/templates/partials/search_bar.rs @@ -1,4 +1,4 @@ -//! A module that handles `search bar` partial for the search page in the `websurfx` frontend. +//! A module that handles `search bar` partial for the search page in the `crabbysearch` frontend. use maud::{html, Markup, PreEscaped}; diff --git a/src/templates/partials/settings_tabs/cookies.rs b/src/templates/partials/settings_tabs/cookies.rs index c8bc8e6..f17185b 100644 --- a/src/templates/partials/settings_tabs/cookies.rs +++ b/src/templates/partials/settings_tabs/cookies.rs @@ -1,4 +1,4 @@ -//! A module that handles the engines tab for setting page view in the `websurfx` frontend. +//! A module that handles the engines tab for setting page view in the `crabbysearch` frontend. use maud::{html, Markup}; diff --git a/src/templates/partials/settings_tabs/engines.rs b/src/templates/partials/settings_tabs/engines.rs index 03ec7fa..a37f9dd 100644 --- a/src/templates/partials/settings_tabs/engines.rs +++ b/src/templates/partials/settings_tabs/engines.rs @@ -1,4 +1,4 @@ -//! A module that handles the engines tab for setting page view in the `websurfx` frontend. +//! A module that handles the engines tab for setting page view in the `crabbysearch` frontend. use std::collections::HashMap; diff --git a/src/templates/partials/settings_tabs/mod.rs b/src/templates/partials/settings_tabs/mod.rs index ad2717a..b8f42dc 100644 --- a/src/templates/partials/settings_tabs/mod.rs +++ b/src/templates/partials/settings_tabs/mod.rs @@ -1,5 +1,5 @@ //! This module provides other modules to handle the partials for the tabs for the settings page -//! view in the `websurfx` frontend. +//! view in the `crabbysearch` frontend. pub mod cookies; pub mod engines; diff --git a/src/templates/partials/settings_tabs/user_interface.rs b/src/templates/partials/settings_tabs/user_interface.rs index 974d031..b191a55 100644 --- a/src/templates/partials/settings_tabs/user_interface.rs +++ b/src/templates/partials/settings_tabs/user_interface.rs @@ -1,4 +1,4 @@ -//! A module that handles the user interface tab for setting page view in the `websurfx` frontend. +//! A module that handles the user interface tab for setting page view in the `crabbysearch` frontend. use crate::handler::{file_path, FileType}; use maud::{html, Markup}; diff --git a/src/templates/views/about.rs b/src/templates/views/about.rs index 2b4de53..ccc4c4d 100644 --- a/src/templates/views/about.rs +++ b/src/templates/views/about.rs @@ -1,4 +1,4 @@ -//! A module that handles the view for the about page in the `websurfx` frontend. +//! A module that handles the view for the about page in the `crabbysearch` frontend. use maud::{html, Markup, PreEscaped}; @@ -51,9 +51,9 @@ pub fn about(colorscheme: &str, theme: &str, animation: &Option) -> Mark } div class="text-block" { - h3 class="text-block-title" {"Why Websurfx?"} + h3 class="text-block-title" {"Why crabbysearch?"} div class="hero-text-container" { - p class="hero-text" {"Websurfx aggregates results from multiple search engines and presents them in an unbiased manner, filtering out trackers and ads."} + p class="hero-text" {"crabbysearch aggregates results from multiple search engines and presents them in an unbiased manner, filtering out trackers and ads."} } } @@ -112,7 +112,7 @@ pub fn about(colorscheme: &str, theme: &str, animation: &Option) -> Mark } div class="feature-card-body" { p { - "Websurfx does not track, store or sell your search data. Your privacy is our priority." + "crabbysearch does not track, store or sell your search data. Your privacy is our priority." } } } @@ -126,7 +126,7 @@ pub fn about(colorscheme: &str, theme: &str, animation: &Option) -> Mark } div class="feature-card-body" { p { - "The entire project's code is open source and available for free on "{a href="https://github.com/neon-mmd/websurfx"{"GitHub"}}"." + "The entire project's code is open source and available for free on "{a href="https://github.com/MilimTheTrueOne/crabbysearch"{"GitHub"}}"." } } } @@ -140,7 +140,7 @@ pub fn about(colorscheme: &str, theme: &str, animation: &Option) -> Mark } div class="feature-card-body" { p { - "Websurfx comes with 9 built-in color themes and supports creating custom themes effortlessly." + "crabbysearch comes with 9 built-in color themes and supports creating custom themes effortlessly." } } } @@ -149,7 +149,7 @@ pub fn about(colorscheme: &str, theme: &str, animation: &Option) -> Mark } - h3 class="about-footnote" {"Developed by the "{a href="https://github.com/neon-mmd/websurfx"{"Websurfx team"}}} + h3 class="about-footnote" {"Developed by the "{a href="https://github.com/MilimTheTrueOne/crabbysearch"{"crabbysearch team"}}} } (footer()) ) diff --git a/src/templates/views/index.rs b/src/templates/views/index.rs index 9d3742e..bb8a9f0 100644 --- a/src/templates/views/index.rs +++ b/src/templates/views/index.rs @@ -1,4 +1,4 @@ -//! A module that handles the view for the index/home/main page in the `websurfx` frontend. +//! A module that handles the view for the index/home/main page in the `crabbysearch` frontend. use maud::{html, Markup, PreEscaped}; @@ -15,20 +15,9 @@ use crate::templates::partials::{bar::bar, footer::footer, header::header}; /// /// It returns the compiled html markup code as a result. pub fn index(colorscheme: &str, theme: &str, animation: &Option) -> Markup { - let logo_svg = r#" - - - - - - - - "#; - html!( (header(colorscheme, theme, animation)) main class="search-container"{ - (PreEscaped(logo_svg)) (bar(&String::default())) (PreEscaped("")) } diff --git a/src/templates/views/mod.rs b/src/templates/views/mod.rs index bbfe189..a68e9bc 100644 --- a/src/templates/views/mod.rs +++ b/src/templates/views/mod.rs @@ -1,5 +1,5 @@ //! This module provides other modules to handle view for each individual page in the -//! `websurfx` frontend. +//! `crabbysearch` frontend. pub mod about; pub mod index; diff --git a/src/templates/views/not_found.rs b/src/templates/views/not_found.rs index 853f260..f893cc9 100644 --- a/src/templates/views/not_found.rs +++ b/src/templates/views/not_found.rs @@ -1,4 +1,4 @@ -//! A module that handles the view for the 404 page in the `websurfx` frontend. +//! A module that handles the view for the 404 page in the `crabbysearch` frontend. use crate::templates::partials::{footer::footer, header::header}; use maud::{html, Markup}; diff --git a/src/templates/views/search.rs b/src/templates/views/search.rs index c5ab456..d38217d 100644 --- a/src/templates/views/search.rs +++ b/src/templates/views/search.rs @@ -1,4 +1,4 @@ -//! A module that handles the view for the search page in the `websurfx` frontend. +//! A module that handles the view for the search page in the `crabbysearch` frontend. use maud::{html, Markup, PreEscaped}; diff --git a/src/templates/views/settings.rs b/src/templates/views/settings.rs index 8af91b0..b293e84 100644 --- a/src/templates/views/settings.rs +++ b/src/templates/views/settings.rs @@ -1,4 +1,4 @@ -//! A module that handles the view for the settings page in the `websurfx` frontend. +//! A module that handles the view for the settings page in the `crabbysearch` frontend. use std::collections::HashMap;