Minor styling refactor, updated app name

main
Ben Busby 2020-05-04 18:00:43 -06:00
parent 0300eab6df
commit 708769f682
16 changed files with 47 additions and 51 deletions

View File

@ -1,6 +1,6 @@
--- ---
name: Bug report name: Bug report
about: Create a bug report to help improve Shoogle about: Create a bug report to help improve Whoogle
title: "[BUG] " title: "[BUG] "
labels: bug labels: bug
assignees: benbusby assignees: benbusby

View File

@ -1,8 +1,9 @@
![Shoogle Banner](app/static/img/docs/shoogle-logo.png) <p align="left">
<img src="./app/static/img/logo.png" width="400" alt="whoogle-banner"/>
</p>
___ ___
[![Latest Release](https://img.shields.io/github/v/release/benbusby/shoogle)](https://github.com/benbusby/shoogle/releases) [![Latest Release](https://img.shields.io/github/v/release/benbusby/whoogle-search)](https://github.com/benbusby/shoogle/releases)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.com/benbusby/shoogle.svg?token=JgVbn8LSCz5Mmr9h5qq7&branch=master)](https://travis-ci.com/benbusby/shoogle) [![Build Status](https://travis-ci.com/benbusby/shoogle.svg?token=JgVbn8LSCz5Mmr9h5qq7&branch=master)](https://travis-ci.com/benbusby/shoogle)
[![codebeat badge](https://codebeat.co/badges/e96cada2-fb6f-4528-8285-7d72abd74e8d)](https://codebeat.co/projects/github-com-benbusby-shoogle-master) [![codebeat badge](https://codebeat.co/badges/e96cada2-fb6f-4528-8285-7d72abd74e8d)](https://codebeat.co/projects/github-com-benbusby-shoogle-master)
@ -25,6 +26,7 @@ Contents
- No tracking/linking of your personal IP address - No tracking/linking of your personal IP address
- No AMP links - No AMP links
- No URL tracking tags (i.e. utm=%s) - No URL tracking tags (i.e. utm=%s)
- POST request search queries (when possible)
- View images at full res with one click - View images at full res with one click
- Dark mode - Dark mode
- Randomly generated User Agent - Randomly generated User Agent
@ -53,14 +55,14 @@ If deploying manually:
There are a few different ways to begin using the app, depending on your preferences: There are a few different ways to begin using the app, depending on your preferences:
### A) Heroku Quick Deploy (Free) ### A) Heroku Quick Deploy (Free)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/benbusby/shoogle) [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/benbusby/whoogle-search)
### B) Manual Setup (non-Docker) ### B) Manual Setup (non-Docker)
Clone the repo and run the following commands to start the app in a local-only environment: Clone the repo and run the following commands to start the app in a local-only environment:
```bash ```bash
git clone https://github.com/benbusby/shoogle.git git clone https://github.com/benbusby/whoogle-search.git
cd shoogle cd whoogle-search
python3 -m venv venv python3 -m venv venv
source venv/bin/activate source venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
@ -77,15 +79,15 @@ pip install -r requirements.txt
```bash ```bash
heroku login heroku login
heroku container:login heroku container:login
git clone https://github.com/benbusby/shoogle.git git clone https://github.com/benbusby/whoogle-search.git
cd shoogle cd whoogle-search
heroku create heroku create
heroku container:push web heroku container:push web
heroku container:release web heroku container:release web
heroku open heroku open
``` ```
This series of commands can take a while, but once you run it once, you shouldn't have to run it again. The final command, `heroku open` will launch a tab in your web browser, where you can test out Shoogle and even [set it as your primary search engine](https://github.com/benbusby/shoogle#set-shoogle-as-your-primary-search-engine). This series of commands can take a while, but once you run it once, you shouldn't have to run it again. The final command, `heroku open` will launch a tab in your web browser, where you can test out Whoogle and even [set it as your primary search engine](https://github.com/benbusby/whoogle#set-whoogle-as-your-primary-search-engine).
#### Using your own server, or alternative container deployment #### Using your own server, or alternative container deployment
There are other methods for deploying docker containers that are well outlined in [this article](https://rollout.io/blog/the-shortlist-of-docker-hosting/), but there are too many to describe set up for each here. Generally it should be about the same amount of effort as the Heroku deployment. There are other methods for deploying docker containers that are well outlined in [this article](https://rollout.io/blog/the-shortlist-of-docker-hosting/), but there are too many to describe set up for each here. Generally it should be about the same amount of effort as the Heroku deployment.
@ -102,18 +104,18 @@ Same as most search engines, with the exception of filtering by time range.
To filter by a range of time, append ":past <time>" to the end of your search, where <time> can be `hour`, `day`, `month`, or `year`. Example: `coronavirus updates :past hour` To filter by a range of time, append ":past <time>" to the end of your search, where <time> can be `hour`, `day`, `month`, or `year`. Example: `coronavirus updates :past hour`
## Extra Steps ## Extra Steps
### Set Shoogle as your primary search engine ### Set Whoogle as your primary search engine
Update browser settings: Update browser settings:
- Firefox (Desktop) - Firefox (Desktop)
- Navigate to your app's url, and click the 3 dot menu in the address bar. At the bottom, there should be an option to "Add Search Engine". Once you've clicked this, open your Firefox Preferences menu, click "Search" in the left menu, and use the available dropdown to select "Shoogle" from the list. - Navigate to your app's url, and click the 3 dot menu in the address bar. At the bottom, there should be an option to "Add Search Engine". Once you've clicked this, open your Firefox Preferences menu, click "Search" in the left menu, and use the available dropdown to select "Whoogle" from the list.
- Firefox (iOS) - Firefox (iOS)
- In the mobile app Settings page, tap "Search" within the "General" section. There should be an option titled "Add Search Engine" to select. It should prompt you to enter a title and search query url - use the following elements to fill out the form: - In the mobile app Settings page, tap "Search" within the "General" section. There should be an option titled "Add Search Engine" to select. It should prompt you to enter a title and search query url - use the following elements to fill out the form:
- Title: "Shoogle" - Title: "Whoogle"
- URL: "https://\<your shoogle url\>/search?q=%s" - URL: "https://\<your whoogle url\>/search?q=%s"
- Others (TODO) - Others (TODO)
### Customizing and Configuration ### Customizing and Configuration
Shoogle currently allows a few minor configuration settings, accessible from the home page: Whoogle currently allows a few minor configuration settings, accessible from the home page:
- "Near" - "Near"
- Set to a city name to narrow your results to a general geographic region. This can be useful if you rely on being able to search for things like "pizza places" and see results in your city, rather than results from wherever the server is located. - Set to a city name to narrow your results to a general geographic region. This can be useful if you rely on being able to search for things like "pizza places" and see results in your city, rather than results from wherever the server is located.
- Dark Mode - Dark Mode
@ -122,28 +124,28 @@ Shoogle currently allows a few minor configuration settings, accessible from the
- Adds a separate link for each search result that will open the webpage without any javascript content served. Can be useful if you're seeking a no-javascript experience on mobile, but otherwise could just be accomplished with a browser plugin. - Adds a separate link for each search result that will open the webpage without any javascript content served. Can be useful if you're seeking a no-javascript experience on mobile, but otherwise could just be accomplished with a browser plugin.
### Prevent Downtime (Heroku only) ### Prevent Downtime (Heroku only)
Part of the deal with Heroku's free tier is that you're allocated 550 hours/month (meaning it can't stay active 24/7), and the app is temporarily shut down after 30 minutes of inactivity. Once it becomes inactive, any Shoogle searches will still work, but it'll take an extra 10-15 seconds for the app to come back online before displaying the result, which can be frustrating if you're in a hurry. Part of the deal with Heroku's free tier is that you're allocated 550 hours/month (meaning it can't stay active 24/7), and the app is temporarily shut down after 30 minutes of inactivity. Once it becomes inactive, any Whoogle searches will still work, but it'll take an extra 10-15 seconds for the app to come back online before displaying the result, which can be frustrating if you're in a hurry.
A good solution for this is to set up a simple cronjob on any device at your home that is consistently powered on and connected to the internet (in my case, a PiHole worked perfectly). All the device needs to do is fetch app content on a consistent basis to keep the app alive in whatever ~17 hour window you want it on (17 hrs * 31 days = 527, meaning you'd still have 23 leftover hours each month if you searched outside of your target window). A good solution for this is to set up a simple cronjob on any device at your home that is consistently powered on and connected to the internet (in my case, a PiHole worked perfectly). All the device needs to do is fetch app content on a consistent basis to keep the app alive in whatever ~17 hour window you want it on (17 hrs * 31 days = 527, meaning you'd still have 23 leftover hours each month if you searched outside of your target window).
For instance: `*/20 7-23 * * * curl https://<your heroku app name>.herokuapp.com > /home/<username>/shoogle-refresh` will fetch the home page of the app every 20 minutes between 7am and midnight, allowing for downtime from midnight to 7am. And again, this wouldn't be a hard limit - you'd still have plenty of remaining hours of uptime each month in case you were searching after this window has closed. For instance: `*/20 7-23 * * * curl https://<your heroku app name>.herokuapp.com > /home/<username>/whoogle-refresh` will fetch the home page of the app every 20 minutes between 7am and midnight, allowing for downtime from midnight to 7am. And again, this wouldn't be a hard limit - you'd still have plenty of remaining hours of uptime each month in case you were searching after this window has closed.
## FAQ ## FAQ
**What's the difference between this and Searx?** **What's the difference between this and [Searx](https://github.com/asciimoo/searx)?**
*There are quite a few similarities and differences between Shoogle and Searx. Both are built to respect user privacy as much as possible, and both are capable of being individually deployed. Additionally, a lot of privacy features are shared between the two services, but since Shoogle is still in its infancy, a lot of features are missing, but will gradually be added in over time.* Whoogle is intended to only ever be deployed to private instances by individuals of any background, with as little effort as possible. Prior knowledge of/experience with the command line or deploying applications is not necessary to deploy Whoogle, which isn't the case with Searx. As a result, Whoole is missing some features of Searx in order to be as easy to deploy as possible.
*The core feature of Shoogle that sets it apart and will be supported through all added features is the extremely simplified deployment of the app for individuals at any experience level, not just the technically inclined.* Whoogle also only uses Google search results, not Bing/Quant/etc, and uses the existing Google search UI to make the transition away from Google search as unnoticeable as possible.
*It is strictly intended to be self-hosted only, and as such, needs to be (and is) excruciatingly easy to host yourself.* I'm a huge fan of Searx though and encourage anyone to use that instead if they want access to other search engines/a different UI/more configuration.
**Why does the image results page look so bad on mobile?** **Why does the image results page look different?**
*A lot of the app currently piggybacks on Google's existing support for fetching results pages with Javascript disabled. To their credit, they've done an excellent job with styling pages, but it seems that the image results page - particularly on mobile - is a little rough. Moving forward, with enough interest, I'd like to transition to fetching the results and parsing them into a unique Shoogle-fied interface that I can style myself.* A lot of the app currently piggybacks on Google's existing support for fetching results pages with Javascript disabled. To their credit, they've done an excellent job with styling pages, but it seems that the image results page - particularly on mobile - is a little rough. Moving forward, with enough interest, I'd like to transition to fetching the results and parsing them into a unique Whoogle-fied interface that I can style myself.
## Screenshots ## Screenshots
#### Desktop #### Desktop
![Shoogle Desktop](app/static/img/docs/screenshot_desktop.jpg) ![Whoogle Desktop](app/static/img/docs/screenshot_desktop.jpg)
#### Mobile #### Mobile
![Shoogle Mobile](app/static/img/docs/screenshot_mobile.jpg) ![Whoogle Mobile](app/static/img/docs/screenshot_mobile.jpg)

View File

@ -1,8 +1,8 @@
{ {
"name": "Shoogle Search", "name": "Whoogle Search",
"description": "A lightweight, privacy-oriented, containerized Google search proxy for desktop/mobile that removes Javascript, AMP links, and ads/sponsored content", "description": "A lightweight, privacy-oriented, containerized Google search proxy for desktop/mobile that removes Javascript, AMP links, tracking, and ads/sponsored content",
"repository": "https://github.com/benbusby/shoogle", "repository": "https://github.com/benbusby/whoogle",
"logo": "https://raw.githubusercontent.com/benbusby/shoogle/master/app/static/img/favicon/ms-icon-150x150.png", "logo": "https://raw.githubusercontent.com/benbusby/whoogle/master/app/static/img/favicon/ms-icon-150x150.png",
"keywords": ["search", "metasearch", "flask", "docker", "heroku", "adblock", "degoogle", "privacy"], "keywords": ["search", "metasearch", "flask", "docker", "heroku", "adblock", "degoogle", "privacy"],
"stack": "container" "stack": "container"
} }

View File

@ -30,7 +30,7 @@ class Filter:
def reskin(self, page): def reskin(self, page):
# Aesthetic only re-skinning # Aesthetic only re-skinning
page = page.replace('>G<', '>Sh<') page = page.replace('>G<', '>Wh<')
pattern = re.compile('4285f4|ea4335|fbcc05|34a853|fbbc05', re.IGNORECASE) pattern = re.compile('4285f4|ea4335|fbcc05|34a853|fbbc05', re.IGNORECASE)
page = pattern.sub('685e79', page) page = pattern.sub('685e79', page)
if self.dark: if self.dark:

View File

@ -32,7 +32,7 @@ def opensearch():
if url_root.endswith('/'): if url_root.endswith('/'):
url_root = url_root[:-1] url_root = url_root[:-1]
template = render_template('opensearch.xml', shoogle_url=url_root) template = render_template('opensearch.xml', whoogle_url=url_root)
response = make_response(template) response = make_response(template)
response.headers['Content-Type'] = 'application/xml' response.headers['Content-Type'] = 'application/xml'
return response return response
@ -61,8 +61,8 @@ def search():
full_query = gen_query(q, request.args, content_filter.near) full_query = gen_query(q, request.args, content_filter.near)
get_body = g.user_request.send(query=full_query) get_body = g.user_request.send(query=full_query)
shoogle_results = content_filter.reskin(get_body) results = content_filter.reskin(get_body)
formatted_results = content_filter.clean(BeautifulSoup(shoogle_results, 'html.parser')) formatted_results = content_filter.clean(BeautifulSoup(results, 'html.parser'))
return render_template('display.html', query=urlparse.unquote(q), response=formatted_results) return render_template('display.html', query=urlparse.unquote(q), response=formatted_results)

View File

@ -1,9 +1,3 @@
@import url(https://fonts.googleapis.com/css?family=Open+Sans);
body {
font-family: 'Open Sans', sans-serif;
}
.logo { .logo {
width: 80%; width: 80%;
display: block; display: block;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -21,7 +21,7 @@ const fillConfigValues = (near, nojs, dark) => {
xhrGET.open("GET", "/config"); xhrGET.open("GET", "/config");
xhrGET.onload = function() { xhrGET.onload = function() {
if (xhrGET.readyState === 4 && xhrGET.status !== 200) { if (xhrGET.readyState === 4 && xhrGET.status !== 200) {
alert("Error loading Shoogle config"); alert("Error loading Whoogle config");
return; return;
} }
@ -48,7 +48,7 @@ const fillConfigValues = (near, nojs, dark) => {
} }
const setupConfigLayout = () => { const setupConfigLayout = () => {
// Setup shoogle config // Setup whoogle config
const collapsible = document.getElementById("config-collapsible"); const collapsible = document.getElementById("config-collapsible");
collapsible.addEventListener("click", function() { collapsible.addEventListener("click", function() {
this.classList.toggle("active"); this.classList.toggle("active");

View File

@ -2,9 +2,9 @@
<head> <head>
<link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="/static/img/favicon.ico" type="image/x-icon"> <link rel="icon" href="/static/img/favicon.ico" type="image/x-icon">
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Shoogle Search"> <link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Whoogle Search">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ query }} - Shoogle Search</title> <title>{{ query }} - Whoogle Search</title>
</head> </head>
<body> <body>
{{ response|safe }} {{ response|safe }}

View File

@ -17,10 +17,10 @@
<meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/static/img/favicon/ms-icon-144x144.png"> <meta name="msapplication-TileImage" content="/static/img/favicon/ms-icon-144x144.png">
<script type="text/javascript" src="/static/js/controller.js"></script> <script type="text/javascript" src="/static/js/controller.js"></script>
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Shoogle Search"> <link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Whoogle Search">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/css/main.css"> <link rel="stylesheet" href="/static/css/main.css">
<title>Shoogle Search</title> <title>Whoogle Search</title>
</head> </head>
<body id="main" style="display: none; background-color: {{ bg }}"> <body id="main" style="display: none; background-color: {{ bg }}">
<div class="search-container"> <div class="search-container">

View File

@ -1,13 +1,13 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/"> xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Shoogle</ShortName> <ShortName>Whoogle</ShortName>
<Description>Shoogle: A lightweight, deployable Google search proxy for desktop/mobile that removes Javascript, AMP links, and ads</Description> <Description>Whoogle: A lightweight, deployable Google search proxy for desktop/mobile that removes Javascript, AMP links, and ads</Description>
<InputEncoding>UTF-8</InputEncoding> <InputEncoding>UTF-8</InputEncoding>
<Image width="32" height="32" type="image/x-icon">/static/img/favicon/favicon-32x32.png</Image> <Image width="32" height="32" type="image/x-icon">/static/img/favicon/favicon-32x32.png</Image>
<Url type="text/html" method="post" template="{{ shoogle_url }}/search"> <Url type="text/html" method="post" template="{{ whoogle_url }}/search">
<Param name="q" value="{searchTerms}"/> <Param name="q" value="{searchTerms}"/>
</Url> </Url>
<Url type="application/x-suggestions+json" template="{{ shoogle_url }}/search"/> <Url type="application/x-suggestions+json" template="{{ whoogle_url }}/search"/>
<moz:SearchForm>{{ shoogle_url }}/search</moz:SearchForm> <moz:SearchForm>{{ whoogle_url }}/search</moz:SearchForm>
</OpenSearchDescription> </OpenSearchDescription>

View File

@ -33,4 +33,4 @@ def test_config(client):
def test_opensearch(client): def test_opensearch(client):
rv = client.get('/opensearch.xml') rv = client.get('/opensearch.xml')
assert rv._status_code == 200 assert rv._status_code == 200
assert 'Shoogle' in str(rv.data) assert 'Whoogle' in str(rv.data)