Commit Graph

269 Commits

Author SHA1 Message Date
Shimul
9a5b095305
Allow setting environment variables in whoogle.env (#237)
This allows the user to enable their preferred settings in a variety of
ways, depending on their deployment preference. Values added to
whoogle.env can be enabled using WHOOGLE_DOTENV=1, in which case all
values in the env var file will overwrite defaults or user provided
settings.

Co-authored-by: Ben Busby <benbusby@protonmail.com>
2021-03-28 13:27:08 -04:00
Nico
271782bead
Add Garuda Linux public instance (#241)
Co-authored-by: Ben Busby <benbusby@protonmail.com>
2021-03-28 12:29:17 -04:00
Ben Busby
9a097d79d4
Add custom builder image to buildx action
Also added debug to list architectures for buildx. Needless to say,
the buildx action is super flakey (as evidenced by a change to the
README breaking the entire build somehow).
2021-03-25 10:43:05 -04:00
Ben Busby
fba8e3d9f8
Remove public instance from readme
I've received multiple reports that the Whoogle instance hosted at 
whoogle.tormentasolar.win is spam, so it has been removed from the
readme.
2021-03-25 10:04:41 -04:00
Ben Busby
f4a087303d
Improve static typing throughout repo
Eventually this should be part of a separate mypy ci build, but right
now it's just a general guideline. Future commits and PRs should be
validated for static typing wherever possible.

For reference, the testing commands used for this commit were:

mypy --ignore-missing-imports --pretty --disallow-untyped-calls app/
mypy --ignore-missing-imports --pretty --disallow-untyped-calls test/
2021-03-24 15:13:52 -04:00
Shimul
c893f5d7a2
Configure PWA for mobile browsers (#234)
Fix PWA issue for mobile phones
Fix icon loading issue
Update app/static/img/favicon/manifest.json

Co-authored-by: Ben Busby <benbusby@pm.me>
2021-03-22 13:04:29 -04:00
Ben Busby
d81b232248
Re-add search css to results page
The results page search css was removed during the refactor to allow for
user defined css. This adds that back.
2021-03-22 10:59:32 -04:00
fredster33
bba3c32313
Reformat public instance links in readme (#224)
Co-authored-by: Ben Busby <benbusby@protonmail.com>
2021-03-22 10:19:58 -04:00
Shimul
dc20de6fed
Fixing typo in Dockerfile (#235) 2021-03-22 10:16:24 -04:00
Ben Busby
56258a16b0
Return 503 if response is blocked by captcha
Also added in a slight modification to the dark theme style, which
should only apply the border radius in the header.

Closes #226
2021-03-20 21:51:24 -04:00
Ben Busby
c0f4ba99cf
Allow user-defined CSS/theming (#227)
* Add custom CSS field to config

This allows users to set/customize an instance's theme and appearance to
their liking. The config CSS field is prepopulated with all default CSS
variable values to allow quick editing.

Note that this can be somewhat of a "footgun" if someone updates the
CSS to hide all fields/search/etc. Should probably add some sort of
bandaid "admin" feature for public instances to employ until the whole
cookie/session issue is investigated further.

* Symlink all app static files to test dir

* Refactor app/misc/*.json -> app/static/settings/*.json

The country/language json files are used for user config settings, so
the "misc" name didn't really make sense. Also moved these to the static
folder to make testing easier.

* Fix light theme variables in dark theme css

* Minor style tweaking
2021-03-20 21:21:41 -04:00
Shimul
e4299f7a72
Handle manifest-src in CSP (#231) 2021-03-20 19:52:06 -04:00
dependabot[bot]
d9dcbfccb9
Bump jinja2 from 2.10.3 to 2.11.3 (#229)
Bumps [jinja2](https://github.com/pallets/jinja) from 2.10.3 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.10.3...2.11.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 23:47:29 -04:00
FireMasterK
5da53fb50f
Add new public instances (#223) 2021-03-18 09:59:59 -04:00
Ben Busby
8e0fffc181
Use bash for heroku-regen 2021-03-17 12:44:30 -04:00
Ben Busby
fea76c927d
Add heroku-regen script, rename config/ -> misc/
Introduces a new script for quickly regenerating a Heroku instance
(typically with a new IP) to handle the rare circumstances where an
instance is flagged by Google and prompted for a captcha.

The config/ dir was renamed to misc/ to avoid confusion with the Docker
mounted config volume, and to more closely match its intended purpose
(which is to contain all miscellaneous features/scripts/etc that add
functionality to Whoogle, but are not critical for general use).
2021-03-17 12:27:08 -04:00
Ben Busby
f4b8b7bc2d
Add UI requests note to feature template
The feature request template should not be used for requesting updates to the UI.

There's already a pinned issue for UI customization, and all requests should go there.
2021-03-09 10:12:35 -05:00
Ben Busby
e2080f0592
Update heroku quick deploy branch, env vars in readme
The Heroku quick deploy branch has been changed from heroku-app to
heroku-app-beta, since a lot of users want to use features from develop
in their heroku instances.

The environment variables in the readme were updated to include the
reddit redirect var.
2021-03-08 17:08:55 -05:00
Ben Busby
ba7493a846
Add healthcheck to Dockerfile
See #184
2021-03-08 12:38:40 -05:00
Ben Busby
d447e5009f
Improve naming of *_utils files, update fn/class doc
The app/utils/*_utils weren't named very well, and all have been updated
to have more accurate names.

Function and class documention for the utils have been updated as well,
as part of the effort to improve overall documentation for the project.
2021-03-08 12:22:04 -05:00
Nico
855b4e8502
Add Arch Linux installation instructions to readme (#217) 2021-03-07 16:50:23 -05:00
Ben Busby
a1134e7633
Send CSP header in all responses
Introduces a new content security policy header for responses to all
requests to reduce the possibility of ip leaks to outside connections.
By default blocks all inline scripts, and only allows content loaded
from Whoogle.

Refactors a few small inline scripting cases in the project to their own
individual scripts.
2021-03-07 14:04:05 -05:00
Ben Busby
e912b8f5e0
Move ssl install to Dockerfile build stage 2021-02-26 12:04:06 -05:00
Ben Busby
08379efa26
Remove auth req for accessing opensearch
Requiring authentication for accessing the opensearch template prevents
the browser from accessing the file when adding as a default search
engine. This removes the authentication requirement from the opensearch
route, which should never provide any sensitive information anyways.
2021-02-26 11:42:42 -05:00
Basti
b3ae0b7594
Use multi-stage container build (#210)
This only adds necessary packages and files from the repo to reduce the image size.

Co-authored-by: pred2k <does@not.exists>
2021-02-26 10:49:40 -05:00
Basti
2e599c0a7e
Update docker-compose security features (#208)
Co-authored-by: Sebastian Forst <sebastian.forst@posteo.de>
2021-02-26 10:33:11 -05:00
Ben Busby
6c85468cd6
Allow bang operator anywhere in query
Bang operator can now be placed anywhere in the query, to allow for peak
efficiency in stream of consciousness querying (i.e. `big !reddit
chungus` will search reddit for big chungus`).

Fixes #196
2021-02-20 15:31:15 -05:00
Ben Busby
e066a19411
Ensure G logo doesn't appear in mobile img results
Adds a separate check to remove all images sourced from www.gstatic.com,
which is where the mobile logo in particular is coming from.
2021-02-20 15:04:32 -05:00
Ben Busby
38f160142e
Add basic keyboard support #202
This adds basic keyboard support on the search results page:

    ArrowUp or k - focus previous result
    ArrowDown or j - focus next result
    / focus search box

Because this just focuses links in the search result items hitting Enter
(or ctrl/cmd + Enter) when an item is focused - will open the search 
result (because the link is already focused and this is browser's default
behaviour).
2021-02-20 14:47:18 -05:00
Tomasz Borychowski
4bbfc8c8f7 fix 'j' and 'k' inside search input 2021-02-19 22:49:32 +00:00
Ben Busby
3958e607de
Merge branch 'develop' into develop 2021-02-19 12:30:27 -05:00
Roman Štefko
c5fdf84635
Do not autocapitalize on index page search bar (#200) 2021-02-19 12:30:05 -05:00
Tomasz Borychowski
04718099f4 add basic keyboard support 2021-02-14 15:50:53 +00:00
Ben Busby
16b3d0f543
List public instances in readme
Note: future public instances should be added with a PR
2021-02-12 10:37:39 -05:00
dependabot[bot]
5689285816
Bump cryptography from 3.2 to 3.3.2 (#193)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.2 to 3.3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.2...3.3.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-12 10:28:34 -05:00
Ben Busby
35b555273c
Merge remote-tracking branch 'origin/main' into develop 2021-02-07 18:56:22 -05:00
Ben Busby
0a6575d219
Hotfix: Move language/country json to app dir
Pip installs of whoogle search were missing access to the misc/ folder,
which previously contained the language and country json files. These
have been moved to app/misc, and the previous root level misc/ was
renamed to config/ (since it now only contains the tor config files).

Bump to 0.3.1.
2021-02-07 18:55:27 -05:00
Ben Busby
01b810b130
Add ability to redirect reddit.com to libredd.it (#180)
* Adds the ability to redirect reddit.com to libredd.it using the existing
 "site alts" config setting.

This adds the WHOOGLE_ALT_RD environment variable for optionally
redirecting reddit links to libreddit
(https://github.com/spikecodes/libreddit).

* Include libreddit in home page site alt note
2021-01-23 17:43:53 -05:00
Ben Busby
329c38efb0
Hotfix: Enforce https in heroku opensearch template
Heroku instances were using the base http url when formatting the
opensearch.xml template. This adds a new routing utility, "needs_https",
which can be used for determining if the url in question needs
upgrading.
2021-01-23 14:50:30 -05:00
Ben Busby
5c69283e80
Hotfix: Add hidden submit btn for nojs searches
With javascript disabled, searches could not be submitted on the results
page using the "Enter" key. Adding a hidden submit button to the header
template resolves this issue.
2021-01-19 11:11:13 -05:00
Ben Busby
406e236666
Bump version to 0.3.0 2021-01-17 23:07:43 -05:00
Ben Busby
7e39b4e7a0
Fix default site alts in Dockerfile
The Dockerfile was incorrectly assigning an empty string to the site alt
values, which caused the filter to update relevant sites with an empty
host. This replaces the empty string with the correct domain for each
site alternative.
2021-01-11 14:00:15 -05:00
Ben Busby
fad937fe08
Update ARM instructions for docker 2021-01-05 18:09:00 -05:00
Ben Busby
934749e0b8
Add docker buildx gh action
This automatically builds and pushes a cross platform image to Docker
Hub.
2021-01-05 17:53:58 -05:00
Ben Busby
440c4e9c50
Remove lxml dependency
The lxml dependency in the project was fairly unnecessary, and made the
initial build time for the project considerably slower. This replaces
all instances of lxml with either the default html parser (for bs4
constructors) or the built in xml.etree package (for search suggestion
parsing).
2020-12-29 18:43:42 -05:00
Ben Busby
2bbc649903
Add support for UPS/USPS/FedEx tracking queries
Introduces a new javascript "utils" file, which includes a check for
matching the query against a set of tracking number regexes on page
load. If a match is found, the script prepends a link to the
(presumably) appropriate tracking page.

Referenced in #98
2020-12-27 18:00:35 -05:00
Ben Busby
6e7ec9918a
Move language/country settings to app config
Moves the language and country dicts from the config model to json files
that are loaded during app init and stored in the app config dict. This
substantially improves the readability of the config model and allows
for much more sensible loading of the language/country options.
2020-12-17 16:42:05 -05:00
Ben Busby
d4a4a03de1
Add pep8 workflow badge to readme 2020-12-17 16:08:32 -05:00
Ben Busby
375f4ee9fd
PEP-8: Fix formatting issues, add CI workflow (#161)
Enforces PEP-8 formatting for all python code

Adds a github action build for checking pep8 formatting using pycodestyle
2020-12-17 16:06:47 -05:00
Ziga Zajc
b55aad3fdf
Use #222 for dark mode bg (#159) 2020-12-17 16:03:05 -05:00