whoogle-search/app
Ben Busby 30d929f36d
Rewrite session behavior for public instances
This introduces a new approach to handling user sessions.

Previously, when a user with cookies disabled would update their config,
this would modify the app's default config file, which would in turn
cause new users to inherit these settings when visiting the app for the
first time. There was also some janky logic for determining on the
backend whether or not a user had cookies disabled, which lead to some
issues with out of control session creation by Flask.

Now, when a user visits the site, their initial request is forwarded to
a `session/<session id>` endpoint, and during that subsequent request
their current session id is matched against the one found in the url. If
the ids match, the user has cookies enabled. If not, their original
request is modified with a 'cookies_disabled' query param that tells
Flask not to bother trying to set up a new session for that user, and
instead just use the app's fallback Fernet key for encryption and the
default config.

Sessions are also now (semi)permanent and have a lifetime of 1 year.
2021-10-23 11:41:49 -06:00
..
models Rewrite session behavior for public instances 2021-10-23 11:41:49 -06:00
static Show client IP for "my ip" searches (#469) 2021-10-21 10:42:31 -06:00
templates Block by result title or url using regex (#473) 2021-10-20 20:01:04 -06:00
utils Rewrite session behavior for public instances 2021-10-23 11:41:49 -06:00
__init__.py Rewrite session behavior for public instances 2021-10-23 11:41:49 -06:00
__main__.py Swap out Flask's default web server for Waitress (#32) 2020-05-12 17:14:55 -06:00
filter.py Block by result title or url using regex (#473) 2021-10-20 20:01:04 -06:00
request.py Skip parsing user agent if absent from request 2021-06-16 10:37:33 -04:00
routes.py Rewrite session behavior for public instances 2021-10-23 11:41:49 -06:00