Commit Graph

506 Commits (1af4566991f5248fd0d3576ca4fbcc0a84293004)
 

Author SHA1 Message Date
Ben Busby 1af4566991
Bump version to 0.7.1 2 years ago
Ben Busby 4dd2c581ac
Add nightly container vuln scan
Introduces a new 'scan' workflow for scanning the main branch container for
vulnerabilities nightly. By default, this will fail for any 'medium' or higher
vulnerability. 

Fixes #613
2 years ago
Ben Busby 9cbd7bd9d3
Remove bash dependency
Depending on bash wasn't strictly necessary, as the two minimal scripts
in the repo were both nearly POSIX anyways.

Aside from simplifying the repo's dependencies a little bit, this also
helps reduce the overall Docker image size as an added bonus.
2 years ago
Ben Busby 2e3c647591
Use `test` image tag for docker-compose tests
Also adds the ability to overwrite the image in docker-compose.yml,
which allows the CI build to use the same image for all docker tests.
The default is still 'benbusby/whoogle-search' though.
2 years ago
Ben Busby 863cbb2b8d
Remove trailing whitespace 2 years ago
Ben Busby 72e5a227c8
Move bangs init to bg thread
Initializing the DDG bangs when running whoogle for the first time
creates an indeterminate amount of delay before the app becomes usable,
which makes usability tests (particularly w/ Docker) unreliable. This
moves the bang json init to a background thread and writes a temporary
empty dict to the bangs json file until the full bangs json can be used.
2 years ago
Ben Busby 6d178342ee
Refactor Docker CI workflows
Split previous docker test CI into one for PRs and one for triggering
the main buildx workflow that deploys new images to Docker Hub.

Note that this needs to be further refactored soon to use reusable
workflows. The main portion of docker/docker-compose tests is duplicated
between the new main + test workflows.
2 years ago
nakoo 0b70962e0c
Fix docker-compose.yml permission errors (#623) 2 years ago
ras07 ecb4277e69
Run container as non-root `whoogle` user (#617)
Creates a non-root user ("whoogle"), and runs the container as that user.
2 years ago
ras07 09a0039a38
Make `/config` directory writable by all (#616)
The `/config` directory needs to be writable by all in order to run the container
as a non-root user.
2 years ago
Nitish Yadav fc50359752
Improve formatting of collapsible infobox (#612) 2 years ago
DUO Labs 257e3f33ef
Skip loading autocomplete.js if `WHOOGLE_AUTOCOMPLETE=0` (#611)
Bypasses autocomplete.js if `WHOOGLE_AUTOCOMPLETE` is set to 0
2 years ago
Ben Busby 4dd01cdfda
Fix Dockerfile syntax errors 2 years ago
DUO Labs 74cb48086c
Introduce site alts for imgur and wikipedia (#609)
* Add `WHOOGLE_ALT_IMG` for a replacement for imgur.

* Add `WHOOGLE_ALT_WIKI` for Wikipedia
2 years ago
Ben Busby ded787547a
Exclude opensearch route from session validation
Fixes #588
2 years ago
domokosdcs0 31f4c00aee
Add new instance [skip ci] (#604)
https://whoogle.dcs0.hu
2 years ago
Ben Busby f4b65be876
Catch invalid XML in suggestion response
As reported in #593, the XML response body returned for search
suggestions can apparently contain invalid XML elements. This catches
the error and returns an empty suggestion list instead of erroring.

Fixes #593
2 years ago
Ben Busby 362b6a75c8
Include plaintext instance list in repo [skip ci]
Including a list of instances that are easily machine-readable allows
services such as Farside (https://github.com/benbusby/farside) to read
these and have an up to date list of valid instances.
2 years ago
Ben Busby 8c92b381a2
Remove default country param
The country URL param ('gl') is no longer set to 'US' by default, and is
omitted from the search entirely unless explicitly set by the user. This
change was made in an attempt to cut back on the number of captchas
experienced by certain users self-hosting who experienced a decreased
amount of captchas when this configuration setting was removed.

Fixes #558
2 years ago
Ben Busby 95be59eaab
Roll back crypto library version
This is a temporary reversion to 3.3.2 for the cryptography library.
There's an issue with buildx failing for the arm/v7 build, which is
directly related to cryptography versions > 3.3.2 (after the switch to
rust).

It might be acceptable to include the rust toolchain for armv7 builds,
but that adds a comical amount of time to the full cross platform build.
2 years ago
Ben Busby a2d5a23c43
docker: Upgrade pip before installing requirements
Outdated pip versions require a rust compiler to install the
cryptography package. Ensuring that pip is up to date should eliminate
the recent buildx errors where a prebuilt cryptography wheel is not
available.
2 years ago
Ben Busby d02a7d90b9
Use UTF-8 encoding when loading json files
Fixes #581
2 years ago
Ben Busby 6d9df65d02
Catch `FileNotFound` when clearing invalid sessions
The server now consumes the FNF error if an invalid session is found but
is deleted in an earlier thread.

Fixes #577
2 years ago
Ben Busby b745460a87
Bump cryptography version 2 years ago
Albony Cal fd802aac06
Update screenshots in readme [skip ci] (#583)
Add new screenshots to reflect recent layout and theme changes
2 years ago
Roy Zuo dec6d80dda
Use alpine docker image (#573) 2 years ago
Nuño Sempere f6c0843183
Update systemd instructions [skip ci] (#571) 2 years ago
glitsj16 c637eb28dd
Add missing env vars to readme [skip ci] (#584) 2 years ago
Ben Busby 119437a07c
Fix test for blocking site from results
Previously the logic for testing site blocking was essentially "assert
blocked_site not part of result_site". This caused test failures, since
site blocking does not extend to subdomains for the blocked site. The
reversed logic makes more sense with what the test was trying to
accomplish.
2 years ago
Albony Cal 84b5987ac5
Remove `lsof` dependency in replit deploy (#569)
Use `killall -q python3` instead
2 years ago
Ben Busby 3d8da1db58
Bump version to 0.7.0 2 years ago
Ben Busby 634d179568
Use farside.link for frontend alternatives in results (#560)
* Integrate Farside into Whoogle

When instances are ratelimited (when a captcha is returned instead of
the user's search results) the user can now hop to a new instance via
Farside, a new backend service that redirects users to working instances
of a particular frontend. In this case, it presents a user with a
Farside link to a new Whoogle (or Searx) instance instead, so that the
user can resume their search.

For the generated Farside->Whoogle link, the generated link includes the
user's current Whoogle configuration settings as URL params, to ensure a
more seamless transition between instances. This doesn't translate to
the Farside->Searx link, but potentially could with some changes.

* Expand conversion of config<->url params

Config settings can now be translated to and from URL params using a
predetermined set of "safe" keys (i.e. config settings that easily
translate to URL params).

* Allow jumping instances via Farside when ratelimited

When instances are ratelimited (when a captcha is returned instead of
the user's search results) the user can now hop to a new instance via
Farside, a new backend service that redirects users to working instances
of a particular frontend. In this case, it presents a user with a
Farside link to a new Whoogle (or Searx) instance instead, so that the
user can resume their search.

For the generated Farside->Whoogle link, the generated link includes the
user's current Whoogle configuration settings as URL params, to ensure a
more seamless transition between instances. This doesn't translate to
the Farside->Searx link, but potentially could with some changes.

Closes #554

Closes #559
2 years ago
Vansh Comar 7bea6349a0
Add tools for currency conversion in search results (#536)
This implements a method for converting between various currencies. When a user
searches "<currency A> to <currency B>" (including when prefixed by a specific
amount), they are now presented with a table for quickly converting between the
two. This makes use of the currency ratio returned as the first "card" in
currency related searches, and the table is inserted into this same card.
2 years ago
Ben Busby 10a15e06e1
Fix incorrect request type for image searches
Previously had hardcoded POST requests for all requests that didn't use
the header template (which currently is only the image tab).

Also refactored how the Filter class works. It now requires a valid
Config model to be provided, which is then set up as a class var that
the filtering functions can use as needed, rather than setting specific
values from the config as individual values (which was confusing and
sloppy).

Fixes #561
2 years ago
Ming Di Leom 1867e7ad01
docs(instance): search.sethforprivacy.com (#562)
- https://blog.sethforprivacy.com/about/#privacy-preserving-front-ends-and-tools
2 years ago
Ben Busby e16038bf28
Make country var value compatible with `gl` param 2 years ago
Ben Busby b75ff0782d
pep8: fix CSP header line length 3 years ago
Ben Busby 3e20788857
Disable in-app CSP unless enabled via WHOOGLE_CSP
The default CSP is only helpful for some, and can break instances for
others. Since these aren't always necessary and are occasionally set by
the user's preferred reverse proxy, it is being disabled unless
explicitly enabled by setting `WHOOGLE_CSP`.

Fixes #493
3 years ago
Ben Busby f73e4b9239
Fix height for homepage logo 3 years ago
Ben Busby 27051363ff
Adjust logo css for mobile devices
Fixes #557
3 years ago
alefvanoon 15391379be
Remove dead instances & add onion instance (#555) 3 years ago
Ben Busby 9c96f0fd57
Improve default response headers
Reponse headers now include the following:
- X-Content-Type-Options: nosniff
- X-Frame-Options: DENY
- Strict-Transport-Security: max-age=63072000
  - Only when HTTPS_ONLY is set

https://infosec.mozilla.org/guidelines/web_security#http-strict-transport-security
https://infosec.mozilla.org/guidelines/web_security#x-content-type-options
https://infosec.mozilla.org/guidelines/web_security#x-frame-options
3 years ago
Ben Busby 30d4337783
Add new public instance
https://whoogle.fossho.st is now an "official" public instance of
Whoogle, since it is the only instance maintained and validated by
the developer(s) of Whoogle (currently only me).

Closes #533
3 years ago
Ben Busby 73f631b1f9
Import logo stylesheet before applying custom css
This fixes #551, and allows custom css to be applied to the Whoogle
logo.
3 years ago
Ben Busby 3c06519130
Use 'gl' search param to set country
This switches the param used for the "country" config setting from "cr"
(which only filters results by the country the result is hosted in) to
"gl" (which overrides server/hosting location and produces results that
are more accurate for the user's current country).

Before this change, the country config setting was (imo) pretty useless.
Allowing a user to override an instance's hosting location with their
preferred country though is way more useful, especially for public
instances that are hosted in a different country than the user.

Closes #544
3 years ago
Ben Busby 1d3e7c0255
Pin config buttons to bottom of config menu
Previously the load/save/apply buttons in the config menu were hidden
below all available config options and required the user to scroll to
the bottom to save changes. This made for bad ux, since for new users,
it isn't immediately apparent that selecting a new dropdown value, for
instance, doesn't instantly save the new setting. The new layout should
make it more clear that hitting "Apply" is required to save config
changes.
3 years ago
Ben Busby a8afd49f84
Move docker tests after api/unit testing
It makes more sense to structure the order of tests to go from api and
unit testing -> validate docker image works as expected -> build and
deploy docker image.
3 years ago
Ilya Prokopenko 79a4a17311
Add Russian translation (#552) 3 years ago
Ben Busby baffb5fc81
Simplify docker tests
Only the healthcheck is really necessary for the workflow's purpose.
Running the full test suite is redundant.
3 years ago
Ben Busby 5a27d748d1
Create separate test workflow for docker
This expands on the current testing suite a bit by introducing a new
workflow for testing functionality within the docker container. It runs
the same test suite as the regular "test" workflow, but also performs a
health check after running the app for 10 seconds to ensure
functionality.

The buildx workflow now waits for the docker test script to finish
successfully, rather than the regular test workflow. This will hopefully
avoid situations where new images are pushed with issues that aren't
detected in regular testing of the app.
3 years ago