2020-04-07 23:12:16 +03:00
|
|
|
<html>
|
|
|
|
<head>
|
2020-04-12 23:26:32 +03:00
|
|
|
<link rel="apple-touch-icon" sizes="57x57" href="/static/img/favicon/apple-icon-57x57.png">
|
|
|
|
<link rel="apple-touch-icon" sizes="60x60" href="/static/img/favicon/apple-icon-60x60.png">
|
|
|
|
<link rel="apple-touch-icon" sizes="72x72" href="/static/img/favicon/apple-icon-72x72.png">
|
|
|
|
<link rel="apple-touch-icon" sizes="76x76" href="/static/img/favicon/apple-icon-76x76.png">
|
|
|
|
<link rel="apple-touch-icon" sizes="114x114" href="/static/img/favicon/apple-icon-114x114.png">
|
|
|
|
<link rel="apple-touch-icon" sizes="120x120" href="/static/img/favicon/apple-icon-120x120.png">
|
|
|
|
<link rel="apple-touch-icon" sizes="144x144" href="/static/img/favicon/apple-icon-144x144.png">
|
|
|
|
<link rel="apple-touch-icon" sizes="152x152" href="/static/img/favicon/apple-icon-152x152.png">
|
|
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/static/img/favicon/apple-icon-180x180.png">
|
|
|
|
<link rel="icon" type="image/png" sizes="192x192" href="/static/img/favicon/android-icon-192x192.png">
|
|
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/static/img/favicon/favicon-32x32.png">
|
|
|
|
<link rel="icon" type="image/png" sizes="96x96" href="/static/img/favicon/favicon-96x96.png">
|
|
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/static/img/favicon/favicon-16x16.png">
|
|
|
|
<link rel="manifest" href="/static/img/favicon/manifest.json">
|
2020-05-06 03:28:43 +03:00
|
|
|
<meta name="referrer" content="no-referrer">
|
2020-04-12 23:26:32 +03:00
|
|
|
<meta name="msapplication-TileColor" content="#ffffff">
|
|
|
|
<meta name="msapplication-TileImage" content="/static/img/favicon/ms-icon-144x144.png">
|
2020-05-24 23:03:11 +03:00
|
|
|
<script type="text/javascript" src="/static/js/autocomplete.js"></script>
|
2020-04-07 23:12:16 +03:00
|
|
|
<script type="text/javascript" src="/static/js/controller.js"></script>
|
2020-05-05 03:00:43 +03:00
|
|
|
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Whoogle Search">
|
2020-04-07 23:12:16 +03:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2020-06-11 22:38:51 +03:00
|
|
|
<link rel="stylesheet" href="/static/css/{{ 'search-dark' if config.dark else 'search' }}.css">
|
2020-04-07 23:12:16 +03:00
|
|
|
<link rel="stylesheet" href="/static/css/main.css">
|
2020-09-14 22:29:58 +03:00
|
|
|
{% if config.dark %}
|
|
|
|
<link rel="stylesheet" href="/static/css/dark-theme.css"/>
|
|
|
|
{% endif %}
|
2020-05-05 03:00:43 +03:00
|
|
|
<title>Whoogle Search</title>
|
2020-04-07 23:12:16 +03:00
|
|
|
</head>
|
2020-06-11 22:38:51 +03:00
|
|
|
<body id="main" style="display: none; background-color: {{ '#000' if config.dark else '#fff' }}">
|
Add tor and http/socks proxy support (#137)
* Add tor and http/socks proxy support
Allows users to enable/disable tor from the config menu, which will
forward all requests through Tor.
Also adds support for setting environment variables for alternative
proxy support. Setting the following variables will forward requests
through the proxy:
- WHOOGLE_PROXY_USER (optional)
- WHOOGLE_PROXY_PASS (optional)
- WHOOGLE_PROXY_TYPE (required)
- Can be "http", "socks4", or "socks5"
- WHOOGLE_PROXY_LOC (required)
- Format: "<ip address>:<port>"
See #30
* Refactor acquire_tor_conn -> acquire_tor_identity
Also updated travis CI to set up tor
* Add check for Tor socket on init, improve Tor error handling
Initializing the app sends a heartbeat request to Tor to check for
availability, and updates the home page config options accordingly. This
heartbeat is sent on every request, to ensure Tor support can be
reconfigured without restarting the entire app.
If Tor support is enabled, and a subsequent request fails, then a new
TorError exception is raised, and the Tor feature is disabled until a
valid connection is restored.
The max attempts has been updated to 10, since 5 seemed a bit too low
for how quickly the attempts go by.
* Change send_tor_signal arg type, update function doc
send_tor_signal now accepts a stem.Signal arg (a bit cleaner tbh). Also
added the doc string for the "disable" attribute in TorError.
* Fix tor identity logic in Request.send
* Update proxy init, change proxyloc var name
Proxy is now only initialized if both type and location are specified,
as neither have a default fallback and both are required. I suppose the
type could fall back to http, but seems safer this way.
Also refactored proxyurl -> proxyloc for the runtime args in order to
match the Dockerfile args.
* Add tor/proxy support for Docker builds, fix opensearch/init
The Dockerfile is now updated to include support for Tor configuration,
with a working torrc file included in the repo.
An issue with opensearch was fixed as well, which was uncovered during
testing and was simple enough to fix here. Likewise, DDG bang gen was
updated to only ever happen if the file didn't exist previously, as
testing with the file being regenerated every time was tedious.
* Add missing "@" for socks proxy requests
2020-10-29 03:47:42 +03:00
|
|
|
<script>
|
|
|
|
{% if error_message|length > 0 %}
|
|
|
|
let error = "{{ error_message|safe }}";
|
|
|
|
alert(error);
|
|
|
|
{% endif %}
|
|
|
|
</script>
|
2020-04-07 23:12:16 +03:00
|
|
|
<div class="search-container">
|
|
|
|
<img class="logo" src="/static/img/logo.png">
|
2020-06-11 22:38:51 +03:00
|
|
|
<form id="search-form" action="/search" method="{{ 'get' if config.get_only else 'post' }}">
|
2020-04-29 03:19:34 +03:00
|
|
|
<div class="search-fields">
|
2020-05-24 23:03:11 +03:00
|
|
|
<div class="autocomplete">
|
2020-10-04 20:53:37 +03:00
|
|
|
<input type="text" name="q" id="search-bar" autofocus="autofocus" autocomplete="off">
|
2020-05-24 23:03:11 +03:00
|
|
|
</div>
|
2020-04-29 19:03:34 +03:00
|
|
|
<input type="submit" id="search-submit" value="Search">
|
2020-04-29 03:19:34 +03:00
|
|
|
</div>
|
|
|
|
</form>
|
2020-04-07 23:12:16 +03:00
|
|
|
<br/>
|
2020-04-08 21:47:21 +03:00
|
|
|
<button id="config-collapsible" class="collapsible">Configuration</button>
|
|
|
|
<div class="content">
|
|
|
|
<div class="config-fields">
|
2020-06-11 22:38:51 +03:00
|
|
|
<form id="config-form" action="/config" method="post">
|
2020-05-23 23:27:23 +03:00
|
|
|
<div class="config-div">
|
2020-09-18 01:59:37 +03:00
|
|
|
<label for="config-ctry">Filter Results by Country: </label>
|
2020-05-23 23:27:23 +03:00
|
|
|
<select name="ctry" id="config-ctry">
|
|
|
|
{% for ctry in countries %}
|
|
|
|
<option value="{{ ctry.value }}"
|
2020-06-11 22:38:51 +03:00
|
|
|
{% if ctry.value in config.ctry %}
|
2020-05-23 23:27:23 +03:00
|
|
|
selected
|
|
|
|
{% endif %}>
|
|
|
|
{{ ctry.name }}
|
|
|
|
</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2020-09-18 01:59:37 +03:00
|
|
|
<div><span class="info-text"> — Note: If enabled, a website will only appear in the results if it is *hosted* in the selected country.</span></div>
|
2020-05-23 23:27:23 +03:00
|
|
|
</div>
|
2020-05-13 02:15:53 +03:00
|
|
|
<div class="config-div">
|
2020-06-27 23:23:17 +03:00
|
|
|
<label for="config-lang-interface">Interface Language: </label>
|
|
|
|
<select name="lang_interface" id="config-lang-interface">
|
2020-05-13 02:15:53 +03:00
|
|
|
{% for lang in languages %}
|
|
|
|
<option value="{{ lang.value }}"
|
2020-06-27 23:23:17 +03:00
|
|
|
{% if lang.value in config.lang_interface %}
|
|
|
|
selected
|
|
|
|
{% endif %}>
|
|
|
|
{{ lang.name }}
|
|
|
|
</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="config-div">
|
|
|
|
<label for="config-lang-search">Search Language: </label>
|
|
|
|
<select name="lang_search" id="config-lang-search">
|
|
|
|
{% for lang in languages %}
|
|
|
|
<option value="{{ lang.value }}"
|
|
|
|
{% if lang.value in config.lang_search %}
|
2020-05-13 02:15:53 +03:00
|
|
|
selected
|
|
|
|
{% endif %}>
|
|
|
|
{{ lang.name }}
|
|
|
|
</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
2020-04-29 05:50:12 +03:00
|
|
|
<div class="config-div">
|
|
|
|
<label for="config-near">Near: </label>
|
|
|
|
<input type="text" name="near" id="config-near" placeholder="City Name">
|
|
|
|
</div>
|
|
|
|
<div class="config-div">
|
|
|
|
<label for="config-nojs">Show NoJS Links: </label>
|
|
|
|
<input type="checkbox" name="nojs" id="config-nojs">
|
|
|
|
</div>
|
|
|
|
<div class="config-div">
|
|
|
|
<label for="config-dark">Dark Mode: </label>
|
|
|
|
<input type="checkbox" name="dark" id="config-dark">
|
|
|
|
</div>
|
2020-05-23 23:27:23 +03:00
|
|
|
<div class="config-div">
|
|
|
|
<label for="config-safe">Safe Search: </label>
|
|
|
|
<input type="checkbox" name="safe" id="config-safe">
|
|
|
|
</div>
|
2020-07-26 20:53:59 +03:00
|
|
|
<div class="config-div">
|
|
|
|
<label class="tooltip" for="config-alts">Replace Social Media Links: </label>
|
|
|
|
<input type="checkbox" name="alts" id="config-alts">
|
|
|
|
<div><span class="info-text"> — Replaces Twitter/YouTube/Instagram links
|
|
|
|
with Nitter/Invidious/Bibliogram links.</span></div>
|
|
|
|
</div>
|
2020-05-16 01:10:31 +03:00
|
|
|
<div class="config-div">
|
|
|
|
<label for="config-new-tab">Open Links in New Tab: </label>
|
|
|
|
<input type="checkbox" name="new_tab" id="config-new-tab">
|
|
|
|
</div>
|
Add tor and http/socks proxy support (#137)
* Add tor and http/socks proxy support
Allows users to enable/disable tor from the config menu, which will
forward all requests through Tor.
Also adds support for setting environment variables for alternative
proxy support. Setting the following variables will forward requests
through the proxy:
- WHOOGLE_PROXY_USER (optional)
- WHOOGLE_PROXY_PASS (optional)
- WHOOGLE_PROXY_TYPE (required)
- Can be "http", "socks4", or "socks5"
- WHOOGLE_PROXY_LOC (required)
- Format: "<ip address>:<port>"
See #30
* Refactor acquire_tor_conn -> acquire_tor_identity
Also updated travis CI to set up tor
* Add check for Tor socket on init, improve Tor error handling
Initializing the app sends a heartbeat request to Tor to check for
availability, and updates the home page config options accordingly. This
heartbeat is sent on every request, to ensure Tor support can be
reconfigured without restarting the entire app.
If Tor support is enabled, and a subsequent request fails, then a new
TorError exception is raised, and the Tor feature is disabled until a
valid connection is restored.
The max attempts has been updated to 10, since 5 seemed a bit too low
for how quickly the attempts go by.
* Change send_tor_signal arg type, update function doc
send_tor_signal now accepts a stem.Signal arg (a bit cleaner tbh). Also
added the doc string for the "disable" attribute in TorError.
* Fix tor identity logic in Request.send
* Update proxy init, change proxyloc var name
Proxy is now only initialized if both type and location are specified,
as neither have a default fallback and both are required. I suppose the
type could fall back to http, but seems safer this way.
Also refactored proxyurl -> proxyloc for the runtime args in order to
match the Dockerfile args.
* Add tor/proxy support for Docker builds, fix opensearch/init
The Dockerfile is now updated to include support for Tor configuration,
with a working torrc file included in the repo.
An issue with opensearch was fixed as well, which was uncovered during
testing and was simple enough to fix here. Likewise, DDG bang gen was
updated to only ever happen if the file didn't exist previously, as
testing with the file being regenerated every time was tedious.
* Add missing "@" for socks proxy requests
2020-10-29 03:47:42 +03:00
|
|
|
<div class="config-div">
|
|
|
|
<label for="config-tor">Use Tor: {{ '' if tor_available else 'Unavailable' }}</label>
|
|
|
|
<input type="checkbox" name="tor" id="config-tor" {{ '' if tor_available else 'hidden' }}>
|
|
|
|
</div>
|
2020-05-13 09:19:51 +03:00
|
|
|
<div class="config-div">
|
|
|
|
<label for="config-get-only">GET Requests Only: </label>
|
|
|
|
<input type="checkbox" name="get_only" id="config-get-only">
|
|
|
|
</div>
|
2020-05-10 22:27:02 +03:00
|
|
|
<div class="config-div">
|
|
|
|
<label for="config-url">Root URL: </label>
|
|
|
|
<input type="text" name="url" id="config-url" value="">
|
|
|
|
</div>
|
2020-04-29 05:50:12 +03:00
|
|
|
<div class="config-div">
|
2020-06-11 22:38:51 +03:00
|
|
|
<input type="submit" id="config-load" onclick="loadConfig(event)" value="Load">
|
|
|
|
<input type="submit" id="config-submit" value="Apply">
|
|
|
|
<input type="submit" id="config-submit" onclick="saveConfig(event)" value="Save As...">
|
2020-04-29 05:50:12 +03:00
|
|
|
</div>
|
|
|
|
</form>
|
2020-04-08 21:47:21 +03:00
|
|
|
</div>
|
2020-04-07 23:12:16 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-20 20:02:30 +03:00
|
|
|
<footer>
|
2020-06-12 06:13:43 +03:00
|
|
|
<p style="color: {{ '#fff' if config.dark else '#000' }};">
|
2020-05-25 19:33:24 +03:00
|
|
|
Whoogle Search v{{ version_number }} ||
|
|
|
|
<a style="color: #685e79" href="https://github.com/benbusby/whoogle-search">View on GitHub</a>
|
|
|
|
</p>
|
2020-05-20 20:02:30 +03:00
|
|
|
</footer>
|
2020-04-07 23:12:16 +03:00
|
|
|
</body>
|
|
|
|
</html>
|