trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [incubator-trafficcontrol] branch master updated: adds the option to disable proxy usage at runtime
Date Wed, 31 Jan 2018 20:12:40 GMT
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 908347d  adds the option to disable proxy usage at runtime
908347d is described below

commit 908347d43cc73c6b9eaa316f791e88530d708c91
Author: Derek Gelinas <mrdgelinas@gmail.com>
AuthorDate: Mon Jan 29 13:39:44 2018 -0700

    adds the option to disable proxy usage at runtime
---
 traffic_ops/bin/traffic_ops_ort.pl | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/traffic_ops/bin/traffic_ops_ort.pl b/traffic_ops/bin/traffic_ops_ort.pl
index 2ba6006..bb4b865 100755
--- a/traffic_ops/bin/traffic_ops_ort.pl
+++ b/traffic_ops/bin/traffic_ops_ort.pl
@@ -40,11 +40,13 @@ my $wait_for_parents = 1;
 my $login_dispersion = 0;
 my $reval_wait_time = 60;
 my $reval_in_use = 0;
+my $rev_proxy_disable = 0;
 
 GetOptions( "dispersion=i"       => \$dispersion, # dispersion (in seconds)
             "retries=i"          => \$retries,
             "wait_for_parents=i" => \$wait_for_parents,
-            "login_dispersion=i" => \$login_dispersion );
+            "login_dispersion=i" => \$login_dispersion,
+            "rev_proxy_disable=i" => \$rev_proxy_disable );
 
 if ( $#ARGV < 1 ) {
 	&usage();
@@ -330,6 +332,7 @@ sub usage {
 	print "\t   login_dispersion=<time>  => wait a random number between 0 and <time>
before login. Default = 0.\n";
 	print "\t   retries=<number>         => retry connection to Traffic Ops URL <number>
times. Default = 3.\n";
 	print "\t   wait_for_parents=<0|1>   => do not update if parent_pending = 1 in
the update json. Default = 1, wait for parents.\n";
+	print "\t   rev_proxy_disable=<0|1>  => bypass the reverse proxy even if one has
been configured Default = 0.\n";
 	print "====-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-====\n";
 	exit 1;
 }
@@ -1784,7 +1787,7 @@ sub get_cfg_file_list {
 	
 	if ($api_in_use == 1) {
 		$to_rev_proxy_url = $ort_ref->{'info'}->{'toRevProxyUrl'};
-		if ( $to_rev_proxy_url ) {
+		if ( $to_rev_proxy_url && $rev_proxy_disable == 0 ) {
 			$to_rev_proxy_url =~ s/\/*$//g;
                         # Note: If traffic_ops_url is changing, would be suggested to get
a new cookie.
                         #       Secrets might not be the same on all Traffic Ops instance.
@@ -1792,6 +1795,9 @@ sub get_cfg_file_list {
 			$rev_proxy_in_use = 1;
 			( $log_level >> $INFO ) && printf("INFO Found Traffic Ops Reverse Proxy
URL from Traffic Ops: $to_rev_proxy_url\n");
 		} else {
+			if ( $rev_proxy_disable == 1 ) {
+				( $log_level >> $INFO ) && printf("INFO Reverse proxy disabled - connecting
directly to traffic ops for all files.\n");
+			}
 			$traffic_ops_host = $to_url;
 		}
 		$profile_name = $ort_ref->{'info'}->{'profileName'};

-- 
To stop receiving notification emails like this one, please contact
elsloo@apache.org.

Mime
View raw message