Commit Graph

643 Commits

Author SHA1 Message Date
Ben Busby
70df88b825
Add sourcehut to readme [skip ci] 2022-10-13 15:52:05 -06:00
Arya K
4d7254e74d
Add ~vern instances (clearnet, onion, i2p) [skip ci] (#858)
Co-authored-by: Ben Busby <contact@benbusby.com>
2022-10-03 11:30:26 -06:00
watchakorn-18k
4b2b0bf3c9
Include thai keyword in ads blacklist (#857) 2022-10-03 11:21:17 -06:00
watchakorn-18k
3943b2bc2c
Add thai translations (#856) 2022-10-03 11:20:40 -06:00
João
219fc58401
Fix handling of bangs (#851)
Changed the implementation to work if the bang is at anyplace in the query.

Added a check to not spend time looking for an operator if a "!" is not present
in the query.

No longer allowed to have the bang at the "!" char at the end, since this may
cause some conflicts like the issue cited before, where the ! is after a word
in the query, which is natural in most languages.
2022-09-30 14:39:13 -06:00
João
74503d542e
Encode config params in URL (#842)
Adds support for encoding (and optionally encrypting) user config values as
a single string that can be passed to any endpoint with the "preferences" url
param.

Co-authored-by: Ben Busby <contact@benbusby.com>
2022-09-22 14:14:56 -06:00
Biên
11275a7796
Add filter for ads in Vietnamese (#847) 2022-09-20 11:11:58 -06:00
João
c42640e21c
Use read_config_bool for vars in app init (#848) 2022-09-20 11:11:27 -06:00
João
1aad47f2af
Fix bad internal redirection for google links (#850) 2022-09-20 11:10:27 -06:00
Cx
6bb9c8448b
Add Kurdish translation (#837) 2022-09-07 13:00:43 -06:00
João
8f59b7c340
Allow different true values for config vars (#841)
* Fixes read_config_bool to allow several true params

* add upper case comment
2022-09-07 12:54:43 -06:00
Ben Busby
32ad39d0e1
Refactor session behavior, remove Flask-Session dep
Sessions are no longer validated using the "/session/..." route. This
created a lot of problems due to buggy/unexpected behavior coming from
the Flask-Session dependency, which is (more or less) no longer
maintained.

Sessions are also no longer strictly server-side-only. The majority of
information that was being stored in user sessions was aesthetic only,
aside from the session specific key used to encrypt URLs. This key is
still unique per user, but is not (or shouldn't be) in anyone's threat
model to keep absolutely 100% private from everyone. Especially paranoid
users of Whoogle can easily modify the code to use a randomly generated
encryption key that is reset on session invalidation (and set
invalidation time to a short enough period for their liking).

Ultimately, this should result in much more stable sessions per client.
There shouldn't be decryption issues with element URLs or queries
during result page navigation.
2022-08-29 13:36:40 -06:00
Ben Busby
77f617e984
Simplify Tor logging restriction
Can use the "Log min-max <location>" syntax instead of declaring a
separate value for each logging level.
2022-08-11 10:20:27 -06:00
Ben Busby
81a802e3fc
Only allow warn+err lvl logging for Tor service
The Tor service logs often confuse Whoogle users, since they're a lot
more verbose than anything Whoogle ever reports. The bulk of these logs
use "notice" level logging and are not helpful for the average user, so
everything between debug and notice is now directed to /dev/null.

Fixes #825
2022-08-11 10:17:41 -06:00
Ben Busby
a6a97aa9c7
Catch failure to restore adv search state
Shouldn't throw any errors if this fails to be restored from local
storage for any reason. It's purely a nice-to-have feature.
2022-08-03 17:59:08 -06:00
Ben Busby
cab1105169
Add an "advanced search" toggle in result tabs
Adds a new advanced search icon alongside the result tabs for switching
to a different country from the result page.

This will obviously get populated with other methods of filtering
results, but for now it's just the country selector.
2022-08-03 17:55:26 -06:00
Ben Busby
2eee0b87d5
Include full path when determining proxy host url
Session validation includes a method for determining the proxy host url,
but previously did not include the path for the initial request. This
caused a situation where users with a new session would not be able to
complete their first search, since the session validation follow-through
url did not include the actual path for their search query.

The method now includes a flag for only extracting the root url, which
is needed for creating full urls in the content filter.

Fixes #708
2022-08-02 10:57:59 -06:00
Ben Busby
aa198ed562
Include leading slash in path replacement for result config changes 2022-08-01 14:35:43 -06:00
Ben Busby
3f363b0175
Allow temp region selection from result view
This adds a new "temporary" config section of the results view, where a
user can now change the country that their results come from without
changing their default config settings.

Closes #322
2022-08-01 14:32:24 -06:00
Ben Busby
8e867a5ace
Remove pep8 workflow from ci
PEP-8 enforcements in the project are more of an annoyance than
anything. It doesn't really seem to add much value, and adds a lot of
friction to pull requests from developers who aren't familiar with the
style guide. Stylistic enforcements should just be done during PRs if
necessary (or a different style guide should be enforced).
2022-08-01 13:50:27 -06:00
Ben Busby
73dd5b80b5
Remove google prefs link for mismatched language queries
Queries performed in a different language than what is configured
contain a result div that prompts the user to configure their language
preferences using google's preferences page.

Since we want all language configuration to occur on Whoogle only, we
can safely remove this result div.

Fixes #444
Fixes #386
2022-08-01 13:46:06 -06:00
Ben Busby
839683b4e1
Allow result navigation w/ Tab and Shift+Tab
Closes #457
2022-08-01 13:01:12 -06:00
Ben Busby
78614877f2
Fix redirect for misspelled queries starting with /
Fixes #818
2022-08-01 12:12:55 -06:00
Ben Busby
bf92944b95
Support quora and imdb alts through Farside
Farside can now redirect quora links to querte instances and imdb links
to libremdb instances. This updates Whoogle to perform link replacements
for both services when site alts are configured.
2022-08-01 11:49:09 -06:00
Ben Busby
fde2c4db1e
Only select default country in config if none are selected 2022-08-01 11:33:38 -06:00
Ben Busby
96b9cce70c
Use WHOOGLE_TOR_SERVICE to enable/disable bg Tor service
Allows skipping the Tor startup script if WHOOGLE_TOR_SERVICE is set to
0. This is separate from WHOOGLE_CONFIG_TOR, which only allows
enabling/disabling user configuration of passing searches through
Tor.

Closes #631
2022-08-01 10:54:20 -06:00
Ben Busby
75a57ede07
Update instructions for fly.io [skip ci]
Closes #772
2022-07-18 10:20:37 -06:00
Ben Busby
a1adf60b30
PEP-8 fix 2022-07-13 10:31:55 -06:00
Ben Busby
5db72a9552
Use scheme in alt replacement if defined
For users running local instances of service alternatives such as
invidious, the alt replacement procedure broke if the scheme of the
original service (almost always https) didn't match the scheme of their
defined local service (likely http).

This adds a small check to see if the alt has a defined scheme, and if
so, removes the original scheme for that result.

Fixes #806
2022-07-13 10:25:51 -06:00
Kian-Meng Ang
2a8519be30
Fix typos [skip ci] (#813) 2022-07-13 10:08:44 -06:00
MadcowOG
03eeb3fad1
Strip newlines when parsing tor password (#801)
When parsing control.conf or password file, a newline character could cause
Authentication Errors.
2022-07-06 09:52:02 -06:00
Ben Busby
f688b88bd8
Preserve wikipedia language setting for wikiless redirects
Wikipedia -> Wikiless redirects always result in an english language
result, even if the Wikipedia result would've been in a non-english
language. This is due to Wikipedia using language specific subdomains
(i.e. de.wikipedia.org, en.wikipedia.org, etc) whereas Wikiless uses a
"lang" url param.

This has been fixed by inspecting the subdomain of the wikipedia link
and passing that value to Wikiless as the lang param if it's determined
to be a language specific value (currently just looking for a 2-char
subdomain).

See #805
2022-07-06 09:49:43 -06:00
J2D9
7164d066c3
Add instance to instances.txt [skip ci] (#808) 2022-07-06 09:30:24 -06:00
J2D9
4473f8ee1d
Add new instance [skip ci] (#807)
https://search.wef.lol
2022-07-06 09:29:56 -06:00
MadcowOG
6a24a785ee
Add Tor Documentation [skip ci] (#800) 2022-07-05 10:02:33 -06:00
Marcell Fülöp
ee2d3726af
Use X-Forwarded-Host as url_root when present (#799)
If Whoogle is accessed on a non-standard port _and_ proxied,
this port is lost to the application and `element['src']`s are
incorrectly formed (omitting port).

HTTP x-Forwarded-Host will contain this front port number in
a typical Nginx reverse proxy configuration.
2022-07-05 10:01:47 -06:00
Ben Busby
c1d9373d55
Include X-Forwarded-Proto in nginx sample [skip ci] 2022-06-27 12:54:00 -06:00
Ben Busby
a51fbb1b0e
Add sample Nginx config headers to readme [skip ci]
Closes #774
2022-06-27 12:47:51 -06:00
Ben Busby
cada4efe1d
Fix missing os import in routes 2022-06-27 12:36:45 -06:00
Joao A. Candido Ramos
0d2d5fff5d
Fixes handling of maps (#792)
* fixes map url, e.g. when no q parameter is given

* move maps_args from results to filter where it is used
2022-06-27 12:33:08 -06:00
jan Anja
90e160094d
Add more OpenSearch definitions (for images etc.) (#786) 2022-06-27 12:30:41 -06:00
CAB233
877785c3ca
Update Simplified Chinese translation (#794) 2022-06-24 10:52:27 -06:00
Joao A. Candido Ramos
d05ec08abf
Remove wildcard imports (#791) 2022-06-24 10:51:15 -06:00
Joao A. Candido Ramos
ddb8931e68
Fix image links not being opened in new tab (#790)
The majority of image links and links that are not handle by whoogle are not
opening in new tabs, this allow links that are not related to the application
to open in new tabs.
2022-06-24 10:50:14 -06:00
jan Anja
194b2eae74
Fix a crash with protected Tor control port (#785) 2022-06-22 10:23:58 -06:00
Ben Busby
966644baa0
Broaden session validation exception handling
Due to how instances installed with pip seem to have issues storing
unrelated files in the same directory as sessions, exception handling
during session validation has been expanded to blindly ignore all
exceptions. This portion of the code is more for maintainers of large
public instances with a bunch of users who block cookies anyways, so
having basic app functionality break down as a result shouldn't be the
default.
2022-06-16 15:46:18 -06:00
Ben Busby
ddc73a53fe
Flip country config check in template
Country config value should be checked against the valid value when
updating the home page config, not the other way around. This can lead
to a state where a user sets up an invalid country value, but can still
be matched against a correct value that is part of the invalid value
(i.e. "countryUK" is invalid, but would match against the correct value,
"UK")

Also minor refactor of where the session file size validation occurs.
2022-06-16 12:11:23 -06:00
Ben Busby
cb5557cc2e
Check file sizes in session dir before validation
For pip installed instances of Whoogle, there seems to be an issue where
files other than sessions are being stored in the same directory as the
sessions. From a brief investigation, this does not seem to be caused by
Whoogle, since Flask-Session objects are the only files stored in that
directory. It could be an issue with the library that is being used for
sessions, however.

Regardless, the app shouldn't crash when trying to validate and remove
invalid sessions, so a file size limit of 4KB was imposed during
validation. Any file found in the session directory that exceeds this
size limit will be ignored.

Fixes #777
Fixes #793
2022-06-16 11:50:13 -06:00
MadcowOG
c9ee9dcc8b
Tor password authentication (#746)
Added password authentication for tor control port.

For user configuration of access to tor control port. This file should be
heavily restricted in file system.

Co-authored-by: MadcowOG <madcowog@Arch-Main.localdomain>
2022-06-16 11:05:41 -06:00
Ben Busby
dc03022e27
Remove parked public instance
(whooglesearch.net is no longer an active instance)
2022-06-16 10:42:31 -06:00