Commit Graph

568 Commits (8a0b872337247e1fa5514b67768122a1121a159c)
 

Author SHA1 Message Date
Ben Busby c298b8447c
Split PyPI action into separate jobs 3 years ago
Ben Busby 5d86326ae6
Append timestamp to TestPyPI build versions
This should allow the same "version" to be uploaded for each commit.
3 years ago
Ben Busby 118c9da813
Remove ARM specific Docker tag note from readme
ARM devices can now use the `latest` tag, so the `buildx-experimental`
tag is no longer necessary.
3 years ago
Ben Busby 4ad4ed5ff7
Publish to PyPI using GitHub Actions
Regular commits are all built and publish to TestPyPI, tagged commits
are published to PyPI.

This should finish the process of moving away from Travis CI, now that
both testing and PyPI deployments are handled in github actions.
3 years ago
Ben Busby 9f84a8ad83
Remove form action from csp
Restricting form-action to 'self' in the content security policy
prevented Chrome (and likely other browsers) from using !bangs on the
home page.

Fixes #408
3 years ago
Ben Busby ad2b2554c1
Use UTF-8 encoding when loading languages json
Fixes #371
3 years ago
Ben Busby 9320d8e230
Remove travis yml, update readme test badge 3 years ago
Ben Busby 648a540126
Move all testing to github actions
The Travis CI folks are updating stuff and broke my tests, so I'm moving
over to github actions instead since that is (hopefully) less likely to
change moving forward.

Will need to move PyPi deployment to github actions as well.
3 years ago
alefvanoon 981c7d28f8
Add persian (farsi) translation (#400) 3 years ago
davidfrickert 71070ee921
Fix portuguese translations (#405) 3 years ago
alefvanoon be3714f074
Fix rtl lang problem in search box (#399)
Adds auto dir to index, search and header input html
3 years ago
alefvanoon 388f51cfb7
Add table for public instances (#398)
Includes new "Country" and "Cloudflare" columns
3 years ago
Trottel f34490d4f1
Add Czech translation (#397) 3 years ago
Ben Busby b44762d157
Split buildx action into main and dev builds
Since Docker Hub no longer allows automated builds for free tier users,
the build process for new images needs to be moved to GitHub Actions.
The existing buildx workflow has worked pretty well for the most part,
but was only enabled for the develop branch and only pushed the
buildx-experimental tag. This addition allows pushes to the main branch
to build updates for the "latest" tag as well, which is more commonly
used I think.
3 years ago
Darkempire 4f5ed37c0a
Add French translation (#391) 3 years ago
alefvanoon 14a5e63ad9
Remove dead instance, add new public instance (#387)
https://s.alefvanboon.xyz
3 years ago
gripped 8d24f8abdd
Fix white background on dropdown for result selectors, time etc (#384) 3 years ago
Laurent le Beau-Martin 1a3790c7b1
Only open external links in a new tab (#380) 3 years ago
සයුරි | Sayuri 8e91564600
Update translations (#373) 3 years ago
KokoTheBest a69ec74cfd
Make replit install all requirements first (#378)
* Make replit install all requirements first

This should install all requirements from requirements.txt. It makes this a one click experience, without the user having to run `pip install -r requirements.txt` and then tap the run button. I myself had to first run that command in my repl, so I have made this change so others don't have to do the same.

repl.it also runs on linux based systems, so `&&` is the correct bash syntax.

* Running in Bash

I applied the same change I made on onBoot to the run variable, and made the language bash as the syntax `./` and `&&` belong to bash.
3 years ago
Ben Busby 694642ccb3
Set bg color for "top stories" elements 3 years ago
Ben Busby 38c38a772f
Find valid parent element when collapsing result content
Previously if a result element marked for collapsing didn't have a valid
"parent" element, the collapsing was skipped altogether. This loops
through child elements until a valid parent is found (or if one isn't
found, the element will not be collapsed).
3 years ago
Ben Busby 958faed1b6
Set user ownership of static build dir 3 years ago
Ben Busby 13202cc6b1
Ensure existence of static build dir 3 years ago
Ben Busby 68fdd55482
Use cache busting for css/js files
On app init, short hashes are generated from file checksums to use for
cache busting. These hashes are added into the full file name and used
to symlink to the actual file contents. These symlinks are loaded in the
jinja templates for each page, and can tell the browser to load a new
file if the hash changes.

This is only in place for css and js files, but can be extended in the
future for other file types if needed.
3 years ago
Ben Busby c41e0fc239
Allow theme to mirror user system settings
Introduces a new config element and environment variable
(WHOOGLE_CONFIG_THEME) for setting the theme of the app. Rather than
just having either light or dark, this allows a user to have their
instance use their current system light/dark preference to determine the
theme to use.

As a result, the dark mode setting (and WHOOGLE_CONFIG_DARK) have been
deprecated, but will still work as expected until a system theme has
been chosen.
3 years ago
Ben Busby afd01820bb
Collapse long result sections into details/summary elements
Sections such as "People also asked" and "related searches" typically
take up a lot of room on the results page, and don't always have the
most useful information. This checks for result elements with more than
7 child divs, extracts the section title, and wraps all elements in a
"details" element that can be expanded/collapsed by the user.

Note that this functionality existed previously (albeit not implemented
as well), but due to changes in how Google returns searches (switching
from using <h2> elements for section headers to <span> or <div>
elements), the approach to collapsing these sections needed to be
updated.
3 years ago
Ben Busby d894bd347d
Handle error when parsing image result url 3 years ago
Ben Busby b21b4f4f57
Skip parsing user agent if absent from request 3 years ago
Ben Busby bcb1d8ecc9
Add lingva translation support in search (#360)
* Add support for Lingva translations in results

Searches that contain the word "translate" and are normal search queries
(i.e. not news/images/video/etc) now create an iframe to a Lingva url to
translate the user's search using their configured search language.

The Lingva url can be configured using the WHOOGLE_ALT_TL env var, or
will fall back to the official Lingva instance url (lingva.ml).

For more info, visit https://github.com/TheDavidDelta/lingva-translate

* Add basic test for lingva results

* Allow user specified lingva instances through csp frame-src

* Fix pep8 issue
3 years ago
deluxghost 82ccace647
Add zh-CN translation (#355) 3 years ago
Aikatsui a6b4252210
Add Sinhala translation (#353) 3 years ago
Ben Busby 83d19d7644
Update instructions for Firefox 89+
Also adds steps to take for allowing searches using Firefox Containers

Closes #352
3 years ago
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