Commit graph

477 commits

Author SHA1 Message Date
Ben Busby
e70bbabd63 Bump version to 0.9.1 2024-10-31 17:36:37 -06:00
Dave Fatkin
a8205c3043
Use alternate USPS link for package tracking [skip ci] (#1191)
The previous tracking link would sometimes lead to a blank page
2024-10-31 17:11:36 -06:00
Roman Štefko
1b9f7990b6
Allow setting fallback search engine (#1184)
Allow setting a fallback Search Engine URL when there is internal server error
or instance is rate-limited. Search query is appended to the end of the URL
(eg. https://duckduckgo.com/?k1=-1&q=).
2024-10-31 17:06:47 -06:00
Tarek
c54f4a79a6
Add ability to set custom dotenv path (#1183)
* add ability to set custom dotenv path

* add `WHOOGLE_DOTENV_PATH` to environment variables table
2024-10-31 16:52:18 -06:00
Ben Busby
223f00c3c0 Switch from pickle->json for config encoding
`pickle.loads` is insecure (and unnecessary in this context). The
simpler data types of the config model can easily be serialized to json
instead.
2024-10-31 16:43:29 -06:00
Ben Busby
466cb63d0e
Bump version to 0.9.0 2024-09-30 12:18:09 -06:00
Ben Busby
c056322037
Use .lower() when accessing the cache busting map
Cache busted resources will always have a lowercase name. For some
reason, a user encountered a capitalized css file name in #1142. This
isn't present anywhere in the Whoogle repo, but could be a byproduct of
some self-hosting configuration. Either way, the key used should always
be lowercase.

Fixes #1142
2024-09-30 12:00:52 -06:00
Ben Busby
5eb609d0b2
Hide line below search bar in dark themes
The results return an empty div with a background color set (not sure
why, not generated on Whoogle's side). This unsets the background color
so that at least it isn't visible.
2024-09-30 11:57:12 -06:00
Ben Busby
a016a1bcf4
Use raw string for matching regex in results.py
Fixes #1144
2024-09-30 11:41:13 -06:00
Ben Busby
6924f5ce0d
Update ad filter keyword for Dutch language
Fixes #1172
2024-09-30 11:33:50 -06:00
Ben Busby
6abe5511f4
Update ad filter keyword for Korean language
Fixes #1162
2024-09-30 11:32:29 -06:00
Andrew
58d54c6384
Update ad filter for Czech language (#1141) 2024-09-30 11:12:37 -06:00
Akopov
91112f1b7b
Refactor utils/misc.py (#1165)
* Improving readability, removing unnecessary elements, etc.

* Minor changes to comment style and favicon response code

---------

Co-authored-by: Ben Busby <contact@benbusby.com>
2024-09-30 10:42:12 -06:00
Matt Burns
a509169110
Add SO as a default site alternative (#1168)
SO -> farside.link/anonymousoverflow
2024-09-30 10:34:54 -06:00
Vinfall
95f872ccde
fix: description in opensearch template (#1175) 2024-09-30 10:32:46 -06:00
Ben Busby
9bfdd88a5e
Fix input cursor position bug on mobile
Refactors how search suggestions are added to the view

Fixes #1133
2024-04-19 14:00:12 -06:00
Ben Busby
37ff61dfac
Fall back to random secret key on permission exception
Fixes #1136
2024-04-19 12:49:52 -06:00
David Shen
80e41e6b44
Attempt to query on error condition and print trace (#1131) 2024-04-19 12:47:07 -06:00
David Shen
f18bf07ac3
Fix feeling lucky (#1130)
* Fix feeling lucky, fall through to display results if doesn't work

* Allow lucky bang anywhere

* Update feeling lucky test
2024-04-19 12:40:06 -06:00
David Shen
fd20135af0
Add support for custom bangs (#1132)
Add the possibility for user-defined bangs, stored in app/static/bangs. 

These are parsed in alphabetical order, with the DDG bangs parsed first.
2024-04-19 12:26:42 -06:00
Ben Busby
c389c26220
Add favicon.ico endpoint
Closes #1121
2024-03-06 10:37:48 -07:00
Ben Busby
ef54f00212
Only show redirects on error page if query is available
The redirects portion of the error page is only needed in scenarios
where the instance is rate limited, in which case the user's query is
provided to the error template. If this isn't provided, it should just
display the error and allow the user to redirect to the home page.

Fixes #1122
2024-03-06 10:14:52 -07:00
Ben Busby
2395bb7a6a
Remove version from DDG bangs url
Including the version portion of the URL now redirects to search results
for the name of the bang file, rather than returning the bang file
itself. Removing the version from the URL returns the correct bang file.
2024-03-06 09:35:48 -07:00
Ben Busby
7313edff46
Include more options for continuing search in error tmpl
The error template previously only included the option to continue a
user's search via Farside (whoogle or searxng), and would only appear
when an instance was ratelimited. This has been updated to display
anytime an exception has occurred, and now includes other options for
continuing a search, such as Kagi, DDG, Brave, Ecosia, etc.

Closes #1099
2023-12-20 12:14:34 -07:00
Ben Busby
cdbe550737
Add env vars for hiding favicons and removing daily update check
- WHOOGLE_SHOW_FAVICONS: Default on, can be set to 0 to hide favicons
  and skip the request for fetching them
- WHOOGLE_UPDATE_CHECK: Default on, can be set to 0 to disable the
  daily check for new versions released on github

Closes #1098
Closes #1059
2023-12-20 11:28:00 -07:00
Vivek
70dc750c7a
Add arg for configuring unix socket perms (#1103)
The default unix socket permissions of 600 is too restrictive for many use
cases.

Added a new argument --unix-socket-perms which is passed to waitress to allow
for user configurable socket permissions
2023-12-20 11:05:38 -07:00
Ben Busby
b97f3dd4c0
Bump version to 0.8.4 2023-11-01 14:45:42 -06:00
Ben Busby
9f68c843d6
Specify links that should trigger div removal from results
There are certain links (such as the age verification link mentioned in
issue #1083) that should trigger removal of the entire container div on
the results page, rather than just hiding the link itself.

This introduces a new `unsupported_g_divs` list that holds links that
will trigger a removal of the result div on the result page.

Fixes #1083
2023-11-01 14:30:23 -06:00
Gautam Korlam
9cc1004fb8
fix: correctly handle skip_prefix logic for site_alts (#1092)
Fixes #1091
2023-11-01 14:07:45 -06:00
Ben Busby
2950aa869b
Redirect POST search -> enc GET request
This should fix the annoyance with browsers like Firefox not caching
POST request responses. By redirecting a POST search to be a GET request
instead (with an encrypted query string), the page can be cached and
successfully navigated back to after visiting a result.
2023-10-16 16:28:36 -06:00
Ben Busby
7bda165ca3
Fetch fallback site icons from DDG
DDG provides favicons using the url format
icons.duckduckgo.com/ip2/{site}.ico

This can be used to fetch favicons in the event that the default
"/favicon.ico" path does not work.
2023-10-11 17:26:12 -06:00
Ben Busby
81b7fd1876
Encrypt site icon requests
Paths to favicons are now encrypted with the user's Fernet key, the same
as any other external result page element
2023-10-11 17:18:25 -06:00
Ben Busby
a7e937f7c6
Skip scrollers when applying site icons to results
Scroller results (like the "latest from ___" or "top stories" results)
shouldn't have a site icon associated with them. This extracts the class
that those types of results have and skips over the process of inserting
an icon.
2023-10-11 15:58:52 -06:00
Ben Busby
c2873190c9
Display audio controls, refactor site icon placement
Audio controls are now always shown by default (mostly found in searches
that contain word pronunciation guides).

Site icons were moved to the left side of the results.
2023-10-11 15:41:48 -06:00
Ben Busby
330ae964f3
Only sanitize result content on main result page
The other result tabs (images/maps/videos/news) don't have text content
that needs sanitizing.

Fixes #1080
2023-10-11 11:09:09 -06:00
Ben Busby
67b6110087
Display an empty img if a site icon can't be found
This improves the search result icon feature by "hiding" the site's icon
if one was not found. This happens in scenarios where a site doesn't
have a /favicon.ico due to having a unique path or using javascript to
load the icon.
2023-10-11 11:05:53 -06:00
Ben Busby
4292ec7f63
Add icons for each search result
This appends an icon element to each search result, using the result
domain's "/favicon.ico" path.

Note that some sites do not have a standard /favicon.ico, but have a
unique path to a specifically sized favicon instead. Worse still, some
sites use javascript to load their favicon, which would make it even
more difficult for Whoogle to figure out.

For now this approach is fine, but can be expanded upon in the future
if desired.
2023-10-11 11:05:53 -06:00
Ben Busby
c36396e9cb
Sanitize valid html in result text content
This inspects the text content of each individual result div and strips
out valid 'script' or 'iframe' tags from the result.

Closes #1076
2023-10-10 16:38:13 -06:00
Ben Busby
3a2e0b262e
Validate urls in element and window endpoints
Domains were previously not validated before being handled, leading to a
potential scenario where someone could pass something like
"element_url=127.0.0.1:<port>/<resource>" to access other resources on a
machine running Whoogle. This change ensures that the resource used in
both endpoints is a valid domain.

This also includes validation of config names to prevent names from
including path values such as "../../(etc)".
2023-09-13 15:50:04 -06:00
MoistCat
693ca3a9a8
Fix invalid calculator widget path (#1064)
When starting whoogle from another directory, the path to the calculator
widget was previously invalid. It now specifies the path relative to the widget
loader file.
2023-09-13 14:13:21 -06:00
Ben Busby
a35b1dabbc
Use filtered query for map tab
The map tab should only ever pass the raw query (i.e. no "-site:..."
strings), otherwise the maps page will return an error.

Fixes #1048
2023-09-08 16:44:04 -06:00
Ben Busby
a623210244
Match exact words to trigger calculator widget
The calculator was previously triggered for partial matches with words
like "calc", which meant searches containing the word "calcium" would
cause the calculator widget to appear.
2023-09-08 16:19:39 -06:00
Ben Busby
92e8ede24e
Bump version to 0.8.3 2023-08-21 15:06:17 -06:00
Ahmad Alkadri
4a0089686e
Fix: keep_blank_values = True to handle blank q input (#1052) 2023-08-21 14:53:10 -06:00
Fabian Wunsch
a40b98341b
Change the consent cookies (#1054)
* Changed the consent cookies

* Shorter cookie thanks to @Imaskiller
2023-08-21 14:50:38 -06:00
Ben Busby
4962659acb
Serve basic robots.txt to avoid indexing
Closes #1015
2023-06-26 16:16:45 -06:00
Cx
8a2a6f3265
Update translations.json [skip ci] (#1025) 2023-06-26 15:49:19 -06:00
Andiru
29992985bc
Fix incorrect link replacements (#1016)
Fix link/result description getting replaced when alternative is disabled
(set to empty string)

Replace medium.com links with value from constant
2023-06-26 15:47:43 -06:00
Ben Busby
f65529f328
Allow defining custom redirects with WHOOGLE_REDIRECTS
Redirects to alternative frontends can now be defined using the
WHOOGLE_REDIRECTS environment variable. Usage is documented in the
readme, but is basically defined as <parent>:<new>.

Closes #988
2023-05-19 12:15:15 -06:00
Ben Busby
f213a2a64a
Ensure b64 prefs always have min padding
This relates to an issue with an unknown cause (unable to reproduce on
my end) where the preferences string does not contain the correct amount
of padding on a base64 encoded value. This is mediated by appending
padding to the end of the encoded value, since any extra padding is
removed anyways.

Fixes #987
2023-05-19 11:39:51 -06:00