From 0573484405a837e3550dd10ff43597f1b4e649ae Mon Sep 17 00:00:00 2001 From: Ben Busby <33362396+benbusby@users.noreply.github.com> Date: Sun, 25 Oct 2020 21:39:44 -0400 Subject: [PATCH] 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. --- app/routes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/routes.py b/app/routes.py index 258f60c..3916c23 100644 --- a/app/routes.py +++ b/app/routes.py @@ -301,7 +301,7 @@ def run_app(): help='Sets a username/password for a HTTP/SOCKS proxy (default None)') parser.add_argument('--proxytype', default='', metavar='', help='Sets a proxy type for all connections (default None)') - parser.add_argument('--proxyurl', default='', metavar='', + parser.add_argument('--proxyloc', default='', metavar='', help='Sets a proxy location for all connections (default None)') args = parser.parse_args() @@ -310,13 +310,13 @@ def run_app(): os.environ['WHOOGLE_USER'] = user_pass[0] os.environ['WHOOGLE_PASS'] = user_pass[1] - if args.proxyauth or args.proxytype or args.proxyurl: + if args.proxytype and args.proxyloc: if args.proxyauth: proxy_user_pass = args.proxyauth.split(':') os.environ['WHOOGLE_PROXY_USER'] = proxy_user_pass[0] os.environ['WHOOGLE_PROXY_PASS'] = proxy_user_pass[1] os.environ['WHOOGLE_PROXY_TYPE'] = args.proxytype - os.environ['WHOOGLE_PROXY_LOC'] = args.proxyurl + os.environ['WHOOGLE_PROXY_LOC'] = args.proxyloc os.environ['HTTPS_ONLY'] = '1' if args.https_only else ''