Commit Graph

335 Commits (904091f44032961c6d494eb667862c49b5a695f7)
 

Author SHA1 Message Date
Ben Busby 904091f440
Bump version to 0.5.4 3 years ago
Ben Busby 44b0fe519c
Revert changes to default language config
A recent issue brought up a good point about how the latest changes to
setting default language to english break functionality for bilingual
users. The change was likely not the best solution for users who were
being affected by IP geolocation on their instances -- the right
solution for that would be to configure the interface/search language to
their preference instead.
3 years ago
Ben Busby e7a604d428
Fix handling of http (vs https) proxy creation
The requests library requires both 'http' and 'https' values in any
included proxy dict, and whoogle was previously copying the http proxy
to https for simplicity. The assumption was that if the underlying
request wasn't able to connect via https, it would default to http
(otherwise why have the requirement to specify both?)

This led to connectivity issues for users with http only proxies as of
the latest urllib and requests package versions, which are a lot more
strict with connections over https. With the latest versions, if an
https connection cannot be made, the library returns an error.

As a result, the new proxy dict must look something like this for plain
http proxies:

{'http': 'http://domain.tld:port', 'https': 'http://domain.tld:port'}

where both http and https are identical, but both are still required.
3 years ago
Ben Busby a64a86efb6
Bump version to 0.5.3 3 years ago
Ricardo 9d024cffce
Add Portuguese translation (#345)
* Add Portuguese translation

* Update translations.json
3 years ago
Ben Busby 614dceeb70
Add fallback interface/search lang + cleanup
Since the interface language defaults to IP geolocation by google, the
default language is now set to english. Still not sure if this is the
best solution, but at least temporarily should clear up some confusion
for users with instances deployed in countries outside of their own.

Also performed some minor cleanup:
  - Updated name of strip_blocked_sites to clean_query
  - Added clean_query to list of jinja template functions
  - Ensured site block list doesn't contain duplicate filters
3 years ago
bruvv 3892355199
Add Dutch translation (#343) 3 years ago
Ben Busby e1a9ec03f0
Update requests version to 2.25.1
Resolves conflict between prior version of requests and the new patched
version of urllib3
3 years ago
dependabot[bot] fbbe658320
Bump urllib3 from 1.25.9 to 1.26.5 (#341)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.25.9 to 1.26.5.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.25.9...1.26.5)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years ago
Ben Busby 59479228bf
Add clarification note for Whoogle CSP headers
Fixes #336
3 years ago
Myzel394 7103d9eccb
Add German translation (#339)
* Added german language

* Fixed translations.json path

* Fixed German name
3 years ago
Ben Busby cbe32a081e
Hotfix: extract only 'q' element from query string
Occasionally the search results will contain links with arguments such
as 'dq', which was being erroneously used in attempts to extract the 'q'
element from query strings. This enforces that only links with '?q=' or
'&q=' (elements with a standalone 'q' arg) will have the element
extracted.

I also refactored the naming of this element once extracted to be just
'q'. Although this seems counterintuitive, it makes a little more sense
since this element is the one we're extracting. It's a vague url arg
name, but it is what it is.

Bump version to 0.5.2 for hotfix release
3 years ago
Jerome Gravel-Niquet e1e6e84649
Add instructions to deploy to Fly.io (#330)
* Add instructions to deploy to Fly.io

* Put Fly.io as #3 in the installation options
3 years ago
Ben Busby 43faaee77f
Hotfix: remove site filter for maps links
The new site filter breaks links to Maps results, so filter.py needed
to be updated to handle these links as a unique case. A new method was
introduced to easily remove any "-site:..." filters from the query,
which is now also used to format queries in the header template rather
than manually removing the blocked site list within the template itself.

Bumps version to 0.5.1 for releasing the bugfix

Fixes #329
3 years ago
Federico Torrielli cf55765933
Add italian localization (#327) 3 years ago
Ben Busby 4649d96dda
Support basic localization (#325)
* Replace hardcoded strings using translation json file

This introduces a new "translations.json" file under app/static/settings
that is loaded on app init and uses the user config value for interface
language to determine the appropriate strings to use in Whoogle-specific
elements of the UI (primarily only on the home page).

* Verify interface lang can be used for localization

Check the configured interface language against the available
localization dict before attempting to use, otherwise fall back to
english.

Also expanded language names in the languages json file.

* Add test for validating translation language keys

Also adds Spanish translation to json (the only non-English language I
can add and reasonably validate on my own).

* Validate all translations against original keyset, update readme

Readme has been updated to include basic contributing guidelines for
both code and translations.
3 years ago
Justin Goette 7c221b7f7f
Remove duplicate docker-compose restart (#324) 3 years ago
Oscar c2a76bd73a
Add new public instance to readme (#323)
https://whoogle.silkky.cloud
3 years ago
Ben Busby 75e7410981
Add WHOOGLE_CONFIG_DISABLE doc to readme 3 years ago
Joao A. Candido Ramos 448efb8f2a
Add "view image" functionality (#268)
* add view image option

* prevent whoogle links from opening in a new tab.

* remove view image template on mobile requests

* change loop values to be more robust to the number of images

* Update app/templates/imageresults.html

* fix "Basically the .cvifge class needs width: 100%; in order to expand the search input to fit the form width."

* Update app/templates/imageresults.html

* remove hardcoded string from template

* Add view image config var to app.json

* Add view image config var to whoogle.env

Co-authored-by: jacr13 <ramos.joao@protonmail.com>
Co-authored-by: Ben Busby <benbusby@protonmail.com>
3 years ago
Ben Busby fcfa3783e3
Bump version to 0.5.0 3 years ago
Ben Busby d5eebe9fe5
Add iframe-able search page for insertion into other sites
Introduces a new html template, search.html, which provides a very basic
form for submitting search queries.

Closes #319
3 years ago
Ben Busby 3f1096b05d
Remove search.whoogle.tech public instance
The instance is no longer maintained.
3 years ago
Ben Busby 373a466cb5
Use relative paths in readme toc
This change was needed to allow mirrored readmes to still link to the
correct section without redirecting to github.
3 years ago
Ben Busby 65d948368c
Add read-only mirrors to readme 3 years ago
Ben Busby 2bd17bef47
Expand readme toc, add chromium instructions 3 years ago
Exonip 45f7522e65
Add public instance "search.exonip.de" (#321) 3 years ago
Ben Busby 1fdf226802
Use curl-based healthcheck w/ new non-auth route
The wget method seemed to have a possible issue with creating endless
index.html copies (despite being specified to output to console only),
so this has been updated to use curl instead.

Also uses new non-authenticated "healthz" route to perform the
healthcheck.

Fix #316

Fix #313
3 years ago
bruvv 27b6d05b6a
Fix EU consent bug (#320)
* Update request.py

* Use current date to format EU consent cookie

Co-authored-by: Ben Busby <benbusby@protonmail.com>
3 years ago
Harsh Barsaiyan 4466bbc8f4
Add divider to user-defined CSS (#310) 3 years ago
Ben Busby 05995649f3
Hotfix: check for site filters before modifying query
The previous method of removing all site filters from the search query
removed the last letter of the search. This only applies the substring
filter if any site filters are present in the query.

Fixes #306
3 years ago
Ben Busby c8da53d4b0
Block websites from search results via user config (#304)
* Block websites in search results via user config

Adds a new config field "Block" to specify a comma separated list of
websites to block in search results. This is applied for all searches.

* Add test for blocking sites from search results

* Document WHOOGLE_CONFIG_BLOCK usage

* Strip '-site:' filters from query in header template

The 'behind the scenes' site filter applied for blocked sites was
appearing in the query field when navigating between search categories
(all -> images -> news, etc). This prevents the filter from appearing in
all except "images", since the image category uses a separate header.
This should eventually be addressed when the image page can begin using
the standard whoogle header, but until then, the filter will still
appear for image searches.
3 years ago
Ben Busby a7bf9728e3
Allow 'data:' for img src in app CSP
Disallowing base64 images in the app resulted in broken image
placeholders for things like pronunciation guides, business reviews,
etc.
3 years ago
Ben Busby 35aa02167c
Clarify how to enable whoogle.env for docker/docker-compose
The readme section on enabling whoogle.env needed to be updated to clarify
how it should work for "docker-compose" and "docker build" runs.
3 years ago
Ben Busby 3b7b9d2738
Add env_file option to docker-compose, refactor whoogle.env
The env_file option is a better way of loading environment variables
from whoogle.env, and has been added to docker-compose.yml.

The whoogle.env file had comments after each example setting, and it was
not clear that these comments needed to be removed when setting new
values. The comments for each variable have been moved above the
appropriate variable to reduce confusion.

See #303 for initial discussion
3 years ago
Angel Mario d6d7110e22
Add option to disable changing config from client (#295)
* Add option to disable changing of configuration

Introduces a test to ensure the correct response code is found when
attempting to update the config when disabled, and ensure default config
is unchanged when posting a new config dict.

Attempting to update the config using the API when disabled now returns
a 403 code + redirect.

Co-authored-by: Ben Busby <benbusby@protonmail.com>
3 years ago
Ben Busby 8ae7b5947e
Separate interface language from search language in env vars
The search language is now set using the WHOOGLE_CONFIG_SEARCH_LANGUAGE
environment variable. Interface language is still set using
WHOOGLE_CONFIG_LANGUAGE.

Fixes #260
3 years ago
Ben Busby f56e913521
Remove gap between input and result types
Enforces 0 margin for the search input form on the result page, which
removes the weird gap that is seen by default.

Also made minor changes to the border styling. Desktop searches now have
a single bottom border in dark mode rather than an all around border,
and the border around the mobile search result input was removed
entirely.
3 years ago
Ben Busby 5b963b441c
Focus search input after clearing w/ reset btn
See #291
3 years ago
Ben Busby 01fe0c02a5
Add button to clear search input on mobile
This was unfortunately a bit more complex than just adding an HTML reset
button, since reset buttons only "reset" input content to its original
value rather than clearing it. This doesn't work for Whoogle's needs,
since inputs on search result pages are auto populated with the search
content as their default value.

A reset button was introduced anyways, but is controlled by a few lines
of javascript to allow completely clearing the search input. The button
will only appear on mobile searches.

At the moment, it isn't particularly pretty, but is functional. It uses
just a plain "x" character and is always visible on mobile search result
pages. This leaves plenty of room for improvement moving forward.

Fixes #291
3 years ago
Ben Busby 7136197e5d
Fix missing text style for active search suggestions 3 years ago
Ben Busby 2eb33007f7
Disable autocorrect on mobile search inputs
Fixes #292
3 years ago
dependabot[bot] 8fa0e7f093
Bump py from 1.8.1 to 1.10.0 (#293)
Bumps [py](https://github.com/pytest-dev/py) from 1.8.1 to 1.10.0.
- [Release notes](https://github.com/pytest-dev/py/releases)
- [Changelog](https://github.com/pytest-dev/py/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/py/compare/1.8.1...1.10.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years ago
Ben Busby d2fac809ca
Fix mishandling of empty config environment variables
The recent change to cast bool config vars as ints to handle a '0' or
'1' value was shortsighted, since it doesn't allow for instances where
the variable is set to an empty value (or '' or any invalid/non-int
value).

This introduces a read_config_bool method for reading values that should
be a '0' or '1', but will default to False if not a digit (otherwise the
value will be cast as bool(int(value)) if "value" is a digit str).

Fixes #288
3 years ago
FlawCra e40a071b6b
Add onBoot in .replit (#286)
onBoot: Command that is executed once when the repl first starts up

Example: Instance has not been visited for a longer time
3 years ago
Ben Busby baa7a87efb
Fix incorrect config bool env var casting
Config boolean environment variables need to be cast to ints, since
they are set or unset using 0 and 1. Previously they were interpreted as
(pseudocode) read_var(name, default=False), which meant that setting
CONFIG_VAR=0 would enable that variable since Python reads environment
variables as strings, and '0' is truthy. This updates the previous logic
to (still pseudocode) int(read_var(name, default='0')).

Fixes #279
3 years ago
Ben Busby b7e48a9597
Replace remaining hardcoded theme values
Both light and dark themes have been updated to remove the leftover
hardcoded values (mostly related to the search suggestion styling).

See discussion in #247.
3 years ago
FlawCra 18af72c182
Add public instance to readme (#273)
https://search.flawcra.cc
3 years ago
Ben Busby cb80c181a6
Direct wget output in Docker healthcheck to stdout
wget's default behavior to download contents to a file is not always a
valid method to use as a Docker healthcheck, due to permission issues.
This circumvents any issues there by redirecting the healthcheck output
to stdout, which shouldn't cause any issues regardless of context.

Fixes #272
3 years ago
Ben Busby 1030118d0b
Expand custom css theming support
Also adds new default dark theme designed by @gripped.
3 years ago