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
2021-12-09 03:27:33 +03:00
|
|
|
{% if config.theme %}
|
|
|
|
{% if config.theme == 'system' %}
|
|
|
|
<style>
|
|
|
|
@import "{{ cb_url('light-theme.css') }}" screen;
|
|
|
|
@import "{{ cb_url('dark-theme.css') }}" screen and (prefers-color-scheme: dark);
|
|
|
|
</style>
|
|
|
|
{% else %}
|
|
|
|
<link rel="stylesheet" href="{{ cb_url(config.theme + '-theme.css') }}"/>
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
<link rel="stylesheet" href="{{ cb_url(('dark' if config.dark else 'light') + '-theme.css') }}"/>
|
|
|
|
{% endif %}
|
|
|
|
<link rel="stylesheet" href="{{ cb_url('main.css') }}">
|
|
|
|
<link rel="stylesheet" href="{{ cb_url('error.css') }}">
|
|
|
|
<style>{{ config.style }}</style>
|
|
|
|
<div>
|
|
|
|
<h1>Error</h1>
|
|
|
|
<p>
|
|
|
|
{{ error_message|safe }}
|
|
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
<p>
|
|
|
|
{% if blocked is defined %}
|
|
|
|
<h4>{{ translation['continue-search'] }} <a class="link" href="https://github.com/benbusby/farside">Farside</a>!</h4>
|
|
|
|
Whoogle:
|
|
|
|
<br>
|
|
|
|
<a class="link-color" href="{{farside}}/whoogle/search?q={{query}}{{params}}">
|
|
|
|
{{farside}}/whoogle/search?q={{query}}{{params}}
|
|
|
|
</a>
|
|
|
|
<br><br>
|
|
|
|
Searx:
|
|
|
|
<br>
|
|
|
|
<a class="link-color" href="{{farside}}/searx/search?q={{query}}">
|
|
|
|
{{farside}}/searx/search?q={{query}}
|
|
|
|
</a>
|
|
|
|
<hr>
|
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
<a class="link" href="home">Return Home</a>
|
|
|
|
</div>
|