Commit Graph

800 Commits (main)
 

Author SHA1 Message Date
Ben Busby 7a61220aa5 Update Dockerfile tor service init, refactor rc/ -> misc/
The tor service is now started by calling a script which runs tor
according to the current container user. If the user is root, the script
will begin the tor service as normal. Otherwise, it runs tor as the
current user. This primarily is meant to address the issue with Heroku
builds (which don't have a root user) not being able to start tor as a
service.

Also refactored the rc/ dir to misc/ (with a tor/ subdir) since that
makes more sense.
4 years ago
Ben Busby 0ef098069e
Add tor and http/socks proxy support (#137)
* Add tor and http/socks proxy support

Allows users to enable/disable tor from the config menu, which will
forward all requests through Tor.

Also adds support for setting environment variables for alternative
proxy support. Setting the following variables will forward requests
through the proxy:
    - WHOOGLE_PROXY_USER (optional)
    - WHOOGLE_PROXY_PASS (optional)
    - WHOOGLE_PROXY_TYPE (required)
      - Can be "http", "socks4", or "socks5"
    - WHOOGLE_PROXY_LOC  (required)
      - Format: "<ip address>:<port>"

See #30

* Refactor acquire_tor_conn -> acquire_tor_identity

Also updated travis CI to set up tor

* Add check for Tor socket on init, improve Tor error handling

Initializing the app sends a heartbeat request to Tor to check for
availability, and updates the home page config options accordingly. This
heartbeat is sent on every request, to ensure Tor support can be
reconfigured without restarting the entire app.

If Tor support is enabled, and a subsequent request fails, then a new
TorError exception is raised, and the Tor feature is disabled until a
valid connection is restored.

The max attempts has been updated to 10, since 5 seemed a bit too low
for how quickly the attempts go by.

* Change send_tor_signal arg type, update function doc

send_tor_signal now accepts a stem.Signal arg (a bit cleaner tbh). Also
added the doc string for the "disable" attribute in TorError.

* Fix tor identity logic in Request.send

* Update proxy init, change proxyloc var name

Proxy is now only initialized if both type and location are specified,
as neither have a default fallback and both are required. I suppose the
type could fall back to http, but seems safer this way.

Also refactored proxyurl -> proxyloc for the runtime args in order to
match the Dockerfile args.

* Add tor/proxy support for Docker builds, fix opensearch/init

The Dockerfile is now updated to include support for Tor configuration,
with a working torrc file included in the repo.

An issue with opensearch was fixed as well, which was uncovered during
testing and was simple enough to fix here. Likewise, DDG bang gen was
updated to only ever happen if the file didn't exist previously, as
testing with the file being regenerated every time was tedious.

* Add missing "@" for socks proxy requests
4 years ago
dependabot[bot] 83433432ec
Bump cryptography from 2.8 to 3.2 (#138)
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.8 to 3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.8...3.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4 years ago
Ben Busby f3bb1e22b4 Fix improper header styling, remove shopping tab links
The header template was using Google's classes for the "Whoogle" logo,
which meant keeping up with their list of colors used in the logo. The
template was updated to only ever use the Whoogle logo color.
Accordingly, the logo specific styling in filter.py was removed, since
it is no longer needed.

Also removes all links to the shopping tab, as it seems that the
majority of the links to items are Google specific links (usually
google.com/aclk links without any discernible param for determining the
true location for the link). The shopping page should be addressed
separately with unique filtering/formatting. Further tracking of this
task will be followed in #136.
4 years ago
Ben Busby 58a7868d25
Update README.md
Added DDG-style bang searches to feature list in the readme, removed Gitter chat badge
4 years ago
Ben Busby 57ca6e99ba
Added ddg-style !bang-operators #96
Adds support for ~12K ddg-style !bang-operators -- for example "!gh <query>" to search GitHub, "!w <query>" to search Wikipedia, etc.

Bang operators are loosely supported in the search suggestion API, but should be improved upon eventually to prioritize more popular bangs. At the moment, most bang suggestions are obscure results that likely aren't being used by the vast majority of users. This is simply due to the fact that no intelligent filtering occurs between matching the input text and the results, it's simply a string comparison against the available bang operator keys.

The full list of bang operators is generated on initialization of the app, under a new and separate directory (`app/static/bangs/`).

Authored by: @marvinborner 
Co-authored by: @benbusby
4 years ago
Ben Busby ae05e8ff8b Finished basic implementation of DDG bang feature
Initialization of the app now includes generation of a ddg-bang json
file, which is used for all bang style searches afterwards.

Also added search suggestion handling for bang json lookup. Queries
beginning with "!" now reference the bang json file to pull all keys
that match.

Updated test suite to include basic tests for bang functionality.

Updated gitignore to exclude bang subdir.
4 years ago
Ben Busby 2126742b76
Merge branch 'develop' into develop 4 years ago
Ben Busby b01b6d8c69 Minor change to wording of language config 4 years ago
curlpipe 558e3e1514
Fixed annoying browser autocomplete (#128) 4 years ago
Ben Busby dfb1e81fa1 Added search input auto focus, updated README
The javascript controller has been updated to include a call to focus
the cursor on the search field. This previously had only been seen on
Firefox, and was assumed to be a weird FF-specific bug. Adding in a
timeout to allow elements to finish loading allows the field to be
focused as expected.

Also updated the README to include clarification for IP address
tracking.
4 years ago
Ben Busby 1f07e4e235 Update issue template
Removed the section concerning which parts of the project would need modification, since it's not always fair to expect someone to know that beforehand.
4 years ago
Ben Busby 9a03b4111d Clarified country filter, updated invidious result URL (closes #123)
Improves clarity of the meaning behind the "Country" filter -- Google
seemingly uses this value to only return results that are hosted in a
particular country, as evidenced in the search differences highlighted
in #123. It now mentions that the results are filtered by website
hosting location.

Also, now that invidio.us is shut down, the fallback URL (invidiou.site)
is now used instead.
4 years ago
Ben Busby 9afe5f81bd
Updated dark theme (#121)
* Implemented new dark theme

Now uses a dedicated css file for all dark theme color changes, rather
than replacing color codes directly.

Color theme is from discussion in #60.

* Minor link color update
4 years ago
Ben Busby a1894975af Merge remote-tracking branch 'origin/master' into develop 4 years ago
Dee-Jay Logozzo 481c5d1798
Added instructions for Android Firefox >=79.0.0 (#119)
* Added instructions for Android Firefox >=79.0.0

Long pressing on the search bar and selecting "Add search engine" no longer works as of Android Firefox 79.0.0

* Update README.md

* Corrected search strings to use backticks
4 years ago
Chad Smith 6ba5e8f165
fix pipx run command (#118)
Add the required `--spec` argument
4 years ago
Ben Busby e471b012a0 Updated opensearch template
Reconfigured template to only use method parameter if set to search via
POST request (which is the default).

Apparently Chrome/Chromium based browsers don't like non-GET request
searches, and specifying a method caused Chrome to reject the template
altogether.
4 years ago
Ben Busby 0c0a01b83f Minor opensearch route and description updates
Bumped version to 0.2.1 for next release

Updated image in opensearch template to use base64 image

Updated opensearch route to serve file as attachment
4 years ago
Ben Busby b2ecd8dc78 Updated search suggestion behavior (closes #115)
Arrow key navigation through search suggestions now populates the input
field with text content from the active selection. Navigating "down"
past the end of the suggestions list returns the active cursor to position 0,
while navigating "up" before the list of suggestions restores the
original search query and removes the active highlight from element 0.
4 years ago
Spike f4eca3711b
Allow for free deployment to Repl.it (#114)
* Update README.md with instructions for deploying via Repl.it

* Create .replit
4 years ago
Ben Busby 975ece8cd0
Privacy respecting alternatives in results view (#106)
Full implementation of social media alt redirects (twitter/youtube/instagram -> nitter/invidious/bibliogram) depending on configuration.

Verbatim search and option to ignore search autocorrect are now supported as well.

Also cleaned up the javascript side of whoogle config so that it now
uses arrays of available fields for parsing config values instead of manually assigning each
one to a variable.

This doesn't include support for Google Maps -> Open Street Maps, that
seems a bit more involved than the social media redirects were, so it
should likely be a separate effort.
4 years ago
Ben Busby 3d7456f37b
Added gitter badge 4 years ago
Ben Busby 4577c11d4c Merge branch 'develop' of github.com:benbusby/whoogle-search into develop 4 years ago
Ben Busby 6ef7ab663a Small update to results time period test
Updated to ensure a child span element is available before running a
test to verify the correct time range for the result. Need to come up
with a better way of ensuring uniform results across multiple tests,
since otherwise periodic changes in the returned results can cause tests
to fail.
4 years ago
Marvin Borner 348301f201
Added bang operator list generator
This is, again, just a proof of concept.
4 years ago
Marvin Borner 5575bcd0af
Merge branch 'develop' into develop 4 years ago
Joao A. Candido Ramos bf4bf1ff2c
Split interface and results language config (#89)
Adding support to choose separately the language of search and the one for the interface (allowing a default givent by google).

Co-authored-by: Joao <ramos.joao@protonmail.com>
4 years ago
Marvin Borner dd9d87d25b
Added ddg-style !bang-operators
This is a proof of concept! The code works, but uses hardcoded operators
and may be placed in the wrong file/class.
The best-case scenario would be the possibility to use the 13.000+ ddg
operators, but I don't know if that's possible without having to
redirect to duckduckgo first.
4 years ago
Ben Busby 4e970a4796 Merge remote-tracking branch 'origin/master' into develop 4 years ago
Ben Busby ebfa87f561
Fixed dark mode footer text color
Updated to use config accessor rather than boolean value
4 years ago
Ben Busby b2133edaa3
Session refactoring and improved filter (#86)
* Project refactor (#85)

* Major refactor of requests and session management

- Switches from pycurl to requests library
  - Allows for less janky decoding, especially with non-latin character
  sets
- Adds session level management of user configs
  - Allows for each session to set its own config -- users with blocked cookies fall back to the "default" profile (same usage as before)
- Updates key gen/regen to more aggressively swap out keys after each
request

* Added ability to save/load configs by name

- New PUT method for config allows changing config with specified name
- New methods in js controller to handle loading/saving of configs

* Result formatting and removal of unused elements

- Fixed question section formatting from results page (added appropriate
padding and made questions styled as italic)
- Removed user agent display from main config settings

* Minor change to save config button label (now "Save As...")

* Fixed issue with "de-pickling" of flask session

Having a gitignore-everything ("*") file within a flask session folder seems to cause a
weird bug where the state of the app becomes unusable from continuously
trying to prune files listed in the gitignore (and it can't prune '*').

* Switched to pickling saved configs

* Updated ad/sponsored content filter and conf naming

Configs are now named with a .conf extension to allow for easier manual
cleanup/modification of named config files

Sponsored content now removed by basic string matching of span content

* Version bump to 0.2.0

* Fixed request.send return style

* Moved custom conf files to their own directory

* Refactored whoogle session mgmt

Now allows a fallback "default" session to be used if a user's browser
is blocking cookies

* Reworked pytest client fixture to support new session mgmt

* Added better multilingual support, updated filter

Results page now includes method for switching to "All Languages" from
whichever language is specified as the primary in the config (see #74).

Also removes the non-Whoogle links from the page footer, leaving only
the page navigation controls

Added support for the date range filter on the results page, though I'd
still recommend using the ":past <unit>" query instead.

* Removed no-cache enforcement, minor styling/formatting improvements

* Improving ad filtering for non-English languages

* Added footer to results page
4 years ago
Ben Busby 5f8309d2f0 Added footer to results page 4 years ago
Ben Busby f7380ae15d Improving ad filtering for non-English languages 4 years ago
Ben Busby f86a44b637 Removed no-cache enforcement, minor styling/formatting improvements 4 years ago
Ben Busby d859e46a6c
Update README.md
Added clarification for enforcing https
4 years ago
Ben Busby 4324fcd8f8 Added better multilingual support, updated filter
Results page now includes method for switching to "All Languages" from
whichever language is specified as the primary in the config (see #74).

Also removes the non-Whoogle links from the page footer, leaving only
the page navigation controls

Added support for the date range filter on the results page, though I'd
still recommend using the ":past <unit>" query instead.
4 years ago
Ben Busby 6ec65f8754 Reworked pytest client fixture to support new session mgmt 4 years ago
Ben Busby 32e837a5e0 Refactored whoogle session mgmt
Now allows a fallback "default" session to be used if a user's browser
is blocking cookies
4 years ago
Ben Busby 64af72abb5 Moved custom conf files to their own directory 4 years ago
Ben Busby b6fb4723f9
Project refactor (#85)
* Major refactor of requests and session management

- Switches from pycurl to requests library
  - Allows for less janky decoding, especially with non-latin character
  sets
- Adds session level management of user configs
  - Allows for each session to set its own config (people are probably
  going to complain about this, though not sure if it'll be the same
  number of people who are upset that their friends/family have to share
  their config)
- Updates key gen/regen to more aggressively swap out keys after each
request

* Added ability to save/load configs by name

- New PUT method for config allows changing config with specified name
- New methods in js controller to handle loading/saving of configs

* Result formatting and removal of unused elements

- Fixed question section formatting from results page (added appropriate
padding and made questions styled as italic)
- Removed user agent display from main config settings

* Minor change to button label

* Fixed issue with "de-pickling" of flask session

Having a gitignore-everything ("*") file within a flask session folder seems to cause a
weird bug where the state of the app becomes unusable from continuously
trying to prune files listed in the gitignore (and it can't prune '*').

* Switched to pickling saved configs

* Updated ad/sponsored content filter and conf naming

Configs are now named with a .conf extension to allow for easier manual
cleanup/modification of named config files

Sponsored content now removed by basic string matching of span content

* Version bump to 0.2.0

* Fixed request.send return style
4 years ago
Ben Busby 71ba00785f Quick improvement to ad removal 4 years ago
Ben Busby cb18bc6ccc Updated autocomplete styling
Added dark theme specific stylesheet to use if dark mode is active
4 years ago
Ben Busby 78939e7fb4 Reworked google url routing 4 years ago
Ben Busby 98d639883c Fixing styling/url/safe mode inconsistencies 4 years ago
Ben Busby 77c4920e83
Update README.md 4 years ago
Ben Busby 9212f9921a Fixed #76
Added enter key submit on results page

Added results type carryover for subsequent searches on results page

Removed redundant header on image search results
4 years ago
Ben Busby d1f38cf924 Fixed styling of footer in dark mode 4 years ago
Ben Busby 21012f5265
Feature: autocomplete/search suggestions (#72)
Basic autocomplete/search suggestion functionality added

* Adds new GET and POST routes for '/autocomplete' that accept a string query and returns an array of suggestions

* Adds new autoscript.js file for handling queries on the main page and results view

* Updated requests class to include autocomplete method

* Updated opensearch template to handle search suggestions

* Added header template to allow for autocomplete on results view

* Updated readme to mention autocomplete feature
4 years ago
Ben Busby 3dbe51e9e7 Removing google's filter card from results 4 years ago