#!/bin/bash

## Copyright (C) 2012 - 2023 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

source "/usr/libexec/setup-dist/shared"

MSG="
Tunnel Tor through proxy
(user -> proxy -> Tor)

(You can scroll down using the arrow key.)

On Whonix-Gateway:

   sudoedit /usr/local/etc/torrc.d/50_user.conf

Or, if you are using a graphical Whonix-Gateway.

    Start Menu -> System -> Tor User Config

Depending on your proxy configuration, add the settings you'll need to your /usr/local/etc/torrc.d/50_user.conf. For more information on these settings, have a look in the Tor manual and read the FAQ.

HTTPProxy host[:port]
HTTPProxyAuthenticator username:password
HTTPSProxy host[:port]
HTTPSProxyAuthenticator username:password

Socks4Proxy host[:port]

Socks5Proxy host[:port]
Socks5ProxyUsername username
Socks5ProxyPassword password

FascistFirewall 0|1

ReachableAddresses ADDR[/MASK][:PORT]...
ReachableDirAddresses ADDR[/MASK][:PORT]...
ReachableORAddresses ADDR[/MASK][:PORT]...

FAQ:
https://gitlab.torproject.org/legacy/trac/-/wikis/doc/TorFAQ#MyInternetconnectionrequiresanHTTPorSOCKSproxy.

Tor Manual:
https://www.torproject.org/docs/tor-manual.html.en

Whonix documentation online:
(could me more up to date)
https://www.whonix.org/wiki/Tunnel_Tor_through_proxy_or_VPN_or_SSH
"

TITLE="setup-dist - I need a proxy to access the Internet."

dialog_wrapper --title "$TITLE" --msgbox "$MSG" 640 480

exit 0
