2020-05-13 18:56:35 +00:00
|
|
|
FROM python:3.8-slim
|
2020-04-08 20:05:28 +00:00
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
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 00:47:42 +00:00
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
build-essential \
|
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libssl-dev \
|
2021-01-05 22:53:58 +00:00
|
|
|
libxml2-dev \
|
|
|
|
libxslt-dev \
|
|
|
|
libffi-dev \
|
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 00:47:42 +00:00
|
|
|
tor
|
|
|
|
|
2020-10-29 02:18:29 +00:00
|
|
|
COPY misc/tor/torrc /etc/tor/torrc
|
2020-05-10 12:00:22 +00:00
|
|
|
COPY requirements.txt .
|
2020-04-24 23:23:08 +00:00
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
2020-05-10 12:00:22 +00:00
|
|
|
|
2020-05-14 00:27:04 +00:00
|
|
|
ARG config_dir=/config
|
2020-05-16 15:11:00 +00:00
|
|
|
RUN mkdir -p $config_dir
|
2020-05-14 00:27:04 +00:00
|
|
|
VOLUME $config_dir
|
|
|
|
ENV CONFIG_VOLUME=$config_dir
|
|
|
|
|
2020-05-18 16:30:32 +00:00
|
|
|
ARG username=''
|
|
|
|
ENV WHOOGLE_USER=$username
|
|
|
|
ARG password=''
|
|
|
|
ENV WHOOGLE_PASS=$password
|
|
|
|
|
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 00:47:42 +00:00
|
|
|
ARG proxyuser=''
|
|
|
|
ENV WHOOGLE_PROXY_USER=$proxyuser
|
|
|
|
ARG proxypass=''
|
|
|
|
ENV WHOOGLE_PROXY_PASS=$proxypass
|
|
|
|
ARG proxytype=''
|
|
|
|
ENV WHOOGLE_PROXY_TYPE=$proxytype
|
|
|
|
ARG proxyloc=''
|
|
|
|
ENV WHOOGLE_PROXY_LOC=$proxyloc
|
|
|
|
|
2020-05-15 21:44:50 +00:00
|
|
|
ARG use_https=''
|
|
|
|
ENV HTTPS_ONLY=$use_https
|
|
|
|
|
|
|
|
ARG whoogle_port=5000
|
|
|
|
ENV EXPOSE_PORT=$whoogle_port
|
|
|
|
|
2020-12-05 22:01:21 +00:00
|
|
|
ARG twitter_alt=''
|
|
|
|
ENV WHOOGLE_ALT_TW=$twitter_alt
|
|
|
|
ARG youtube_alt=''
|
|
|
|
ENV WHOOGLE_ALT_YT=$youtube_alt
|
|
|
|
ARG instagram_alt=''
|
|
|
|
ENV WHOOGLE_ALT_YT=$instagram_alt
|
|
|
|
|
2020-05-10 12:00:22 +00:00
|
|
|
COPY . .
|
2020-04-08 20:05:28 +00:00
|
|
|
|
2020-05-15 21:44:50 +00:00
|
|
|
EXPOSE $EXPOSE_PORT
|
2020-05-10 12:00:22 +00:00
|
|
|
|
2020-10-29 02:18:29 +00:00
|
|
|
CMD misc/tor/start-tor.sh & ./run
|