You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by oc...@apache.org on 2021/03/19 18:01:48 UTC
[trafficcontrol] branch 5.1.x updated (4cbce4f -> 932d319)
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a change to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git.
from 4cbce4f Le fix 5.1.x (#5651)
new 03999e6 Allow PURGE over localhost in atscfg (#5619)
new 217bbe1 Fix t3c reload and updPending unset (#5583)
new dc81fdf Fix atscfg comparing pointers not values (#5536)
new ed89519 Fix logrotate permissions for Traffic Stats (#5650)
new 6dbce7b Remove crconfig generation warning for topology-based DSes (#5654)
new 667e393 TM init.d script: Append to traffic_monitor.log (#5655)
new f22b5d3 Fix ORT to reload traffic server when lua scripts are added or changed. (#5574)
new 932d319 Fix atscfg Service Category hdr to be internal (#5657)
The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CHANGELOG.md | 15 +++++++--
lib/go-atscfg/headerrewritedotconfig.go | 4 ++-
lib/go-atscfg/headerrewritemiddotconfig.go | 2 +-
lib/go-atscfg/headerrewritemiddotconfig_test.go | 20 +++++++----
lib/go-atscfg/ipallowdotconfig.go | 11 ++++++
lib/go-atscfg/ipallowdotconfig_test.go | 4 +--
lib/go-atscfg/meta.go | 10 +++---
lib/go-atscfg/remapdotconfig.go | 10 +++---
traffic_monitor/build/traffic_monitor.init | 2 +-
traffic_ops/traffic_ops_golang/crconfig/servers.go | 6 ++--
traffic_ops_ort/t3c/torequest/torequest.go | 39 +++++++++++-----------
traffic_ops_ort/traffic_ops_ort.pl | 6 +++-
traffic_stats/build/traffic_stats.spec | 2 +-
13 files changed, 85 insertions(+), 46 deletions(-)
[trafficcontrol] 05/08: Remove crconfig generation warning for
topology-based DSes (#5654)
Posted by oc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit 6dbce7b40d43d5d5b3d58bda495d12768db0ce74
Author: Rawlin Peters <ra...@apache.org>
AuthorDate: Thu Mar 18 08:49:06 2021 -0600
Remove crconfig generation warning for topology-based DSes (#5654)
(cherry picked from commit 2a9229ed3d88c82305e326a69e40fd583c859202)
---
CHANGELOG.md | 1 +
traffic_ops/traffic_ops_golang/crconfig/servers.go | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9510d72..2dc9946 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#5565](https://github.com/apache/trafficcontrol/issues/5565) - TO GET /caches/stats panic converting string to uint64
- [#5558](https://github.com/apache/trafficcontrol/issues/5558) - Fixed `TM UI` and `/api/cache-statuses` to report aggregate `bandwidth_kbps` correctly.
- Fix for config gen missing max_origin_connections on mids in certain scenarios
+- [#5192](https://github.com/apache/trafficcontrol/issues/5192) - Fixed TO log warnings when generating snapshots for topology-based delivery services.
- Fixed Invalid TS logrotate configuration permissions causing TS logs to be ignored by logrotate.
## [5.1.0] - 2021-02-21
diff --git a/traffic_ops/traffic_ops_golang/crconfig/servers.go b/traffic_ops/traffic_ops_golang/crconfig/servers.go
index 2d1112a..bba5838 100644
--- a/traffic_ops/traffic_ops_golang/crconfig/servers.go
+++ b/traffic_ops/traffic_ops_golang/crconfig/servers.go
@@ -327,8 +327,9 @@ order by dsr.set_number asc
hostReplacer := strings.NewReplacer(`\`, ``, `.*`, ``)
dsInfs := map[string][]DSRouteInfo{}
- var hasTopology bool
+ dsHasTopology := make(map[string]bool)
for rows.Next() {
+ hasTopology := false
ds := ""
dsType := ""
dsPattern := ""
@@ -337,6 +338,7 @@ order by dsr.set_number asc
if err := rows.Scan(&ds, &dsType, &dsRoutingName, &dsPattern, &hasTopology); err != nil {
return nil, errors.New("Error scanning server deliveryservices: " + err.Error())
}
+ dsHasTopology[ds] = hasTopology
// Topology-based delivery services do not use the contentServers.deliveryServices field
if hasTopology {
continue
@@ -361,7 +363,7 @@ order by dsr.set_number asc
for _, dsName := range dses {
dsInfList, ok := dsInfs[string(dsName)]
if !ok {
- if !hasTopology {
+ if !dsHasTopology[string(dsName)] {
log.Warnln("Creating CRConfig: deliveryservice " + string(dsName) + " has no regexes, skipping")
}
continue
[trafficcontrol] 07/08: Fix ORT to reload traffic server when lua
scripts are added or changed. (#5574)
Posted by oc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit f22b5d337449e9cc3b57c8e89383ab8f69c27a5d
Author: Joe Pappano <jo...@cable.comcast.com>
AuthorDate: Thu Mar 18 17:48:02 2021 -0400
Fix ORT to reload traffic server when lua scripts are added or changed. (#5574)
* Updated process_reload_restarts to include .lua files.
* line 1337 removed exclusion for .lua files. so remap.config will be touched if lua files are changed.
* Added LUA fix to change log
(cherry picked from commit a289d9ce008df420b41f4b3ac488e094860b10f0)
---
CHANGELOG.md | 1 +
traffic_ops_ort/traffic_ops_ort.pl | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0685770..579de5a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#5192](https://github.com/apache/trafficcontrol/issues/5192) - Fixed TO log warnings when generating snapshots for topology-based delivery services.
- Fixed Invalid TS logrotate configuration permissions causing TS logs to be ignored by logrotate.
- [#5604](https://github.com/apache/trafficcontrol/issues/5604) - traffic_monitor.log is no longer truncated when restarting Traffic Monitor
+- [#1624](https://github.com/apache/trafficcontrol/issues/1624) - Fixed ORT to reload Traffic Server if LUA scripts are added or changed.
## [5.1.0] - 2021-02-21
### Added
diff --git a/traffic_ops_ort/traffic_ops_ort.pl b/traffic_ops_ort/traffic_ops_ort.pl
index 5677297..dcfd41e 100755
--- a/traffic_ops_ort/traffic_ops_ort.pl
+++ b/traffic_ops_ort/traffic_ops_ort.pl
@@ -1318,7 +1318,7 @@ sub check_plugins {
( my @parts ) = split( /\//, $plugin_config_file );
$plugin_config_file = $parts[$#parts];
$plugin_config_file =~ s/\s+//g;
- if ( !exists($cfg_file_tracker->{$plugin_config_file}->{'remap_plugin_config_file'} ) && $plugin_config_file !~ /.lua$/ ) {
+ if ( !exists($cfg_file_tracker->{$plugin_config_file}->{'remap_plugin_config_file'} )) {
$cfg_file_tracker->{$plugin_config_file}->{'remap_plugin_config_file'} = 1;
}
}
@@ -1437,6 +1437,10 @@ sub process_reload_restarts {
( $log_level >> $DEBUG ) && print "DEBUG New/changed header rewrite rule, installed in: $cfg_file. Later I will attempt to touch remap.config.\n";
$traffic_ctl_needed++;
}
+ elsif ( $cfg_file =~ m/(.*)\.lua/ ) {
+ ( $log_level >> $DEBUG ) && print "DEBUG New/changed lua script, installed in: $cfg_file. touch remap.config, and traffic_ctl config reload needed.\n";
+ $traffic_ctl_needed++;
+ }
elsif ( $cfg_file eq "plugin.config" || $cfg_file eq "50-ats.rules" ) {
( $log_level >> $DEBUG ) && print "DEBUG $cfg_file changed, trafficserver restart needed.\n";
$trafficserver_restart_needed++;
[trafficcontrol] 04/08: Fix logrotate permissions for Traffic Stats
(#5650)
Posted by oc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit ed89519f9228be29368af5fe18b94f3170e156a7
Author: Hank Beatty <hb...@users.noreply.github.com>
AuthorDate: Wed Mar 17 15:48:03 2021 -0400
Fix logrotate permissions for Traffic Stats (#5650)
(cherry picked from commit 15b574a705a04d6db1ef3605a319947de5205b03)
---
CHANGELOG.md | 3 ++-
traffic_stats/build/traffic_stats.spec | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 230a1b0..9510d72 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,7 +10,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Fixed
- [#5565](https://github.com/apache/trafficcontrol/issues/5565) - TO GET /caches/stats panic converting string to uint64
- [#5558](https://github.com/apache/trafficcontrol/issues/5558) - Fixed `TM UI` and `/api/cache-statuses` to report aggregate `bandwidth_kbps` correctly.
-- - Fix for config gen missing max_origin_connections on mids in certain scenarios
+- Fix for config gen missing max_origin_connections on mids in certain scenarios
+- Fixed Invalid TS logrotate configuration permissions causing TS logs to be ignored by logrotate.
## [5.1.0] - 2021-02-21
### Added
diff --git a/traffic_stats/build/traffic_stats.spec b/traffic_stats/build/traffic_stats.spec
index dae4e02..f498960 100644
--- a/traffic_stats/build/traffic_stats.spec
+++ b/traffic_stats/build/traffic_stats.spec
@@ -116,7 +116,7 @@ fi
%config(noreplace) %attr(600, traffic_stats, traffic_stats) /opt/traffic_stats/conf/traffic_stats.cfg
%config(noreplace) %attr(600, traffic_stats, traffic_stats) /opt/traffic_stats/conf/traffic_stats_seelog.xml
-%config(noreplace) /etc/logrotate.d/traffic_stats
+%config(noreplace) %attr(644, root, root) /etc/logrotate.d/traffic_stats
%dir /opt/traffic_stats
%dir /opt/traffic_stats/bin
[trafficcontrol] 02/08: Fix t3c reload and updPending unset (#5583)
Posted by oc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit 217bbe1cc73ab429b27914764b015aabeb7aaa23
Author: Robert O Butts <ro...@users.noreply.github.com>
AuthorDate: Mon Mar 15 10:46:09 2021 -0600
Fix t3c reload and updPending unset (#5583)
Fixes t3c to do an ATS Reload and un-set the update-pending flag
for various things that need them, matching ort.pl.
(cherry picked from commit 2d476cf2a8e1302bb585e5d5364b960cd73d8eee)
---
traffic_ops_ort/t3c/torequest/torequest.go | 39 +++++++++++++++---------------
1 file changed, 20 insertions(+), 19 deletions(-)
diff --git a/traffic_ops_ort/t3c/torequest/torequest.go b/traffic_ops_ort/t3c/torequest/torequest.go
index 305be62..46390fd 100644
--- a/traffic_ops_ort/t3c/torequest/torequest.go
+++ b/traffic_ops_ort/t3c/torequest/torequest.go
@@ -680,26 +680,27 @@ func (r *TrafficOpsReq) replaceCfgFile(cfg *ConfigFile) error {
_, err = r.writeCfgFile(cfg, "", data)
if err != nil {
return errors.New("Failed to write the new config file: " + err.Error())
- } else {
- cfg.ChangeApplied = true
- if cfg.RemapPluginConfig == true { // trafficserver config reload is required
- r.TrafficCtlReload = true
- r.RemapConfigReload = true
- }
- if cfg.Name == "plugin.config" { // trafficserver restart is required
- r.TrafficServerRestart = true
- } else if cfg.Name == "remap.config" {
- r.TrafficCtlReload = true
- r.RemapConfigReload = true
- } else if cfg.Name == "sysctl.conf" { // sysctl reload is required
- r.SysCtlReload = true
- } else if cfg.Name == "ssl_multicert.config" {
- r.TrafficCtlReload = true
- } else if cfg.Name == "ntpd.conf" { // ntpd reload is required
- r.NtpdRestart = true
- }
- log.Debugf("Setting change applied for '%s'\n", cfg.Name)
}
+ cfg.ChangeApplied = true
+
+ r.TrafficCtlReload = r.TrafficCtlReload ||
+ strings.HasSuffix(cfg.Dir, "trafficserver") ||
+ cfg.RemapPluginConfig ||
+ cfg.Name == "remap.config" ||
+ cfg.Name == "ssl_multicert.config" ||
+ strings.HasPrefix(cfg.Name, "url_sig_") ||
+ strings.HasPrefix(cfg.Name, "uri_signing") ||
+ strings.HasPrefix(cfg.Name, "hdr_rw_") ||
+ (strings.HasSuffix(cfg.Dir, "ssl") && strings.HasSuffix(cfg.Name, ".cer")) ||
+ (strings.HasSuffix(cfg.Dir, "ssl") && strings.HasSuffix(cfg.Name, ".key"))
+
+ r.TrafficServerRestart = cfg.Name == "plugin.config"
+ r.RemapConfigReload = cfg.RemapPluginConfig || cfg.Name == "remap.config"
+ r.NtpdRestart = cfg.Name == "ntpd.conf"
+ r.SysCtlReload = cfg.Name == "sysctl.conf"
+
+ log.Debugf("Setting change applied for '%s'\n", cfg.Name)
+
} else {
log.Infof("You elected not to replace %s with the version from Traffic Ops.\n", cfg.Name)
cfg.ChangeApplied = false
[trafficcontrol] 03/08: Fix atscfg comparing pointers not values
(#5536)
Posted by oc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit dc81fdff9055e08f2589ecf0907795c4acebac5f
Author: Robert O Butts <ro...@users.noreply.github.com>
AuthorDate: Mon Mar 15 11:40:45 2021 -0600
Fix atscfg comparing pointers not values (#5536)
(cherry picked from commit 7c8fae62ed6869136946db362e80c0251d5beb5b)
---
CHANGELOG.md | 1 +
lib/go-atscfg/headerrewritemiddotconfig.go | 2 +-
lib/go-atscfg/headerrewritemiddotconfig_test.go | 20 ++++++++++++++------
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0aa9949..230a1b0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Fixed
- [#5565](https://github.com/apache/trafficcontrol/issues/5565) - TO GET /caches/stats panic converting string to uint64
- [#5558](https://github.com/apache/trafficcontrol/issues/5558) - Fixed `TM UI` and `/api/cache-statuses` to report aggregate `bandwidth_kbps` correctly.
+- - Fix for config gen missing max_origin_connections on mids in certain scenarios
## [5.1.0] - 2021-02-21
### Added
diff --git a/lib/go-atscfg/headerrewritemiddotconfig.go b/lib/go-atscfg/headerrewritemiddotconfig.go
index f4e7947..d0a6bf4 100644
--- a/lib/go-atscfg/headerrewritemiddotconfig.go
+++ b/lib/go-atscfg/headerrewritemiddotconfig.go
@@ -94,7 +94,7 @@ func MakeHeaderRewriteMidDotConfig(
continue
}
- if sv.CDNName != server.CDNName {
+ if *sv.CDNName != *server.CDNName {
continue
}
if _, ok := assignedServers[*sv.ID]; !ok && (tcDS.Topology == nil || *tcDS.Topology == "") {
diff --git a/lib/go-atscfg/headerrewritemiddotconfig_test.go b/lib/go-atscfg/headerrewritemiddotconfig_test.go
index b6203a5..92cf693 100644
--- a/lib/go-atscfg/headerrewritemiddotconfig_test.go
+++ b/lib/go-atscfg/headerrewritemiddotconfig_test.go
@@ -32,39 +32,47 @@ func TestMakeHeaderRewriteMidDotConfig(t *testing.T) {
hdr := "myHeaderComment"
server := makeGenericServer()
- server.CDNName = &cdnName
+ server.CDNName = util.StrPtr(cdnName)
server.Cachegroup = util.StrPtr("edgeCG")
server.HostName = util.StrPtr("myserver")
serverStatus := string(tc.CacheStatusReported)
server.Status = &serverStatus
+ // server, as inserted in servers.
+ // needs to be different, so the pointers are different, like they will be with different API calls.
+ serverSvs := makeGenericServer()
+ serverSvs.CDNName = util.StrPtr(cdnName)
+ serverSvs.Cachegroup = util.StrPtr("edgeCG")
+ serverSvs.HostName = util.StrPtr("myserver")
+ serverSvs.Status = util.StrPtr(string(tc.CacheStatusReported))
+
ds := makeGenericDS()
ds.EdgeHeaderRewrite = util.StrPtr("edgerewrite")
ds.ID = util.IntPtr(24)
ds.XMLID = util.StrPtr("ds0")
ds.MaxOriginConnections = util.IntPtr(42)
ds.MidHeaderRewrite = util.StrPtr("midrewrite")
- ds.CDNName = &cdnName
+ ds.CDNName = util.StrPtr(cdnName)
dsType := tc.DSTypeHTTP
ds.Type = &dsType
ds.ServiceCategory = util.StrPtr("servicecategory")
mid0 := makeGenericServer()
- mid0.CDNName = &cdnName
+ mid0.CDNName = util.StrPtr(cdnName)
mid0.Cachegroup = util.StrPtr("midCG")
mid0.HostName = util.StrPtr("mymid0")
mid0Status := string(tc.CacheStatusReported)
mid0.Status = &mid0Status
mid1 := makeGenericServer()
- mid1.CDNName = &cdnName
+ mid1.CDNName = util.StrPtr(cdnName)
mid1.Cachegroup = util.StrPtr("midCG")
mid1.HostName = util.StrPtr("mymid1")
mid1Status := string(tc.CacheStatusOnline)
mid1.Status = &mid1Status
mid2 := makeGenericServer()
- mid2.CDNName = &cdnName
+ mid2.CDNName = util.StrPtr(cdnName)
mid2.Cachegroup = util.StrPtr("midCG")
mid2.HostName = util.StrPtr("mymid2")
mid2Status := string(tc.CacheStatusOffline)
@@ -85,7 +93,7 @@ func TestMakeHeaderRewriteMidDotConfig(t *testing.T) {
mCG.Type = &mCGType
cgs := []tc.CacheGroupNullable{*eCG, *mCG}
- servers := []Server{*server, *mid0, *mid1, *mid2}
+ servers := []Server{*serverSvs, *mid0, *mid1, *mid2}
dses := []DeliveryService{*ds}
dss := makeDSS(servers, dses)
[trafficcontrol] 08/08: Fix atscfg Service Category hdr to be
internal (#5657)
Posted by oc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit 932d31975add233aa330572ae94d18301a6ecc26
Author: Robert O Butts <ro...@users.noreply.github.com>
AuthorDate: Fri Mar 19 11:18:42 2021 -0600
Fix atscfg Service Category hdr to be internal (#5657)
(cherry picked from commit cfe87f72a661a92d44cef72e23bf5efa14b2c36c)
---
lib/go-atscfg/headerrewritedotconfig.go | 4 +++-
lib/go-atscfg/meta.go | 10 +++++-----
lib/go-atscfg/remapdotconfig.go | 10 +++++-----
3 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/lib/go-atscfg/headerrewritedotconfig.go b/lib/go-atscfg/headerrewritedotconfig.go
index a72d2b5..4d6a0ef 100644
--- a/lib/go-atscfg/headerrewritedotconfig.go
+++ b/lib/go-atscfg/headerrewritedotconfig.go
@@ -35,7 +35,9 @@ const HeaderRewritePrefix = "hdr_rw_"
const ContentTypeHeaderRewriteDotConfig = ContentTypeTextASCII
const LineCommentHeaderRewriteDotConfig = LineCommentHash
-const ServiceCategoryHeader = "CDN-SVC"
+// ServiceCategoryHeader is the internal service category header for logging the service category.
+// Note this is internal, and will never be set in an HTTP Request or Response by ATS.
+const ServiceCategoryHeader = "@CDN-SVC"
const MaxOriginConnectionsNoMax = 0 // 0 indicates no limit on origin connections
diff --git a/lib/go-atscfg/meta.go b/lib/go-atscfg/meta.go
index 88a20d8..8e74cc8 100644
--- a/lib/go-atscfg/meta.go
+++ b/lib/go-atscfg/meta.go
@@ -215,7 +215,7 @@ func addMetaObjConfigDir(
return nil, warnings, errors.New("getting topology placement: " + err.Error())
}
if placement.IsFirstCacheTier {
- if ds.FirstHeaderRewrite != nil && *ds.FirstHeaderRewrite != "" || ds.MaxOriginConnections != nil {
+ if (ds.FirstHeaderRewrite != nil && *ds.FirstHeaderRewrite != "") || ds.MaxOriginConnections != nil || ds.ServiceCategory != nil {
fileName := FirstHeaderRewriteConfigFileName(*ds.XMLID)
if configFilesM, err = ensureConfigFile(configFilesM, fileName, configDir); err != nil {
warnings = append(warnings, "ensuring config file '"+fileName+"': "+err.Error())
@@ -223,7 +223,7 @@ func addMetaObjConfigDir(
}
}
if placement.IsInnerCacheTier {
- if ds.InnerHeaderRewrite != nil && *ds.InnerHeaderRewrite != "" || ds.MaxOriginConnections != nil {
+ if (ds.InnerHeaderRewrite != nil && *ds.InnerHeaderRewrite != "") || ds.MaxOriginConnections != nil || ds.ServiceCategory != nil {
fileName := InnerHeaderRewriteConfigFileName(*ds.XMLID)
if configFilesM, err = ensureConfigFile(configFilesM, fileName, configDir); err != nil {
warnings = append(warnings, "ensuring config file '"+fileName+"': "+err.Error())
@@ -231,7 +231,7 @@ func addMetaObjConfigDir(
}
}
if placement.IsLastCacheTier {
- if ds.LastHeaderRewrite != nil && *ds.LastHeaderRewrite != "" || ds.MaxOriginConnections != nil {
+ if (ds.LastHeaderRewrite != nil && *ds.LastHeaderRewrite != "") || ds.MaxOriginConnections != nil || ds.ServiceCategory != nil {
fileName := LastHeaderRewriteConfigFileName(*ds.XMLID)
if configFilesM, err = ensureConfigFile(configFilesM, fileName, configDir); err != nil {
warnings = append(warnings, "ensuring config file '"+fileName+"': "+err.Error())
@@ -239,7 +239,7 @@ func addMetaObjConfigDir(
}
}
} else if strings.HasPrefix(server.Type, tc.EdgeTypePrefix) {
- if (ds.EdgeHeaderRewrite != nil || ds.MaxOriginConnections != nil) &&
+ if (ds.EdgeHeaderRewrite != nil || ds.MaxOriginConnections != nil || ds.ServiceCategory != nil) &&
strings.HasPrefix(server.Type, tc.EdgeTypePrefix) {
fileName := "hdr_rw_" + *ds.XMLID + ".config"
if configFilesM, err = ensureConfigFile(configFilesM, fileName, configDir); err != nil {
@@ -247,7 +247,7 @@ func addMetaObjConfigDir(
}
}
} else if strings.HasPrefix(server.Type, tc.MidTypePrefix) {
- if (ds.MidHeaderRewrite != nil || ds.MaxOriginConnections != nil) &&
+ if (ds.MidHeaderRewrite != nil || ds.MaxOriginConnections != nil || ds.ServiceCategory != nil) &&
ds.Type != nil && ds.Type.UsesMidCache() &&
strings.HasPrefix(server.Type, tc.MidTypePrefix) {
fileName := "hdr_rw_mid_" + *ds.XMLID + ".config"
diff --git a/lib/go-atscfg/remapdotconfig.go b/lib/go-atscfg/remapdotconfig.go
index 2ad3538..e5ca856 100644
--- a/lib/go-atscfg/remapdotconfig.go
+++ b/lib/go-atscfg/remapdotconfig.go
@@ -163,7 +163,7 @@ func getServerConfigRemapDotConfigForMid(
return "", warnings, err
}
midRemap += topoTxt
- } else if ds.MidHeaderRewrite != nil && *ds.MidHeaderRewrite != "" {
+ } else if (ds.MidHeaderRewrite != nil && *ds.MidHeaderRewrite != "") || ds.MaxOriginConnections != nil || ds.ServiceCategory != nil {
midRemap += ` @plugin=header_rewrite.so @pparam=` + midHeaderRewriteConfigFileName(*ds.XMLID)
}
@@ -332,7 +332,7 @@ func buildEdgeRemapLine(
return "", warnings, err
}
text += topoTxt
- } else if ds.EdgeHeaderRewrite != nil && *ds.EdgeHeaderRewrite != "" {
+ } else if (ds.EdgeHeaderRewrite != nil && *ds.EdgeHeaderRewrite != "") || ds.ServiceCategory != nil || ds.MaxOriginConnections != nil {
text += ` @plugin=header_rewrite.so @pparam=` + edgeHeaderRewriteConfigFileName(*ds.XMLID)
}
@@ -439,13 +439,13 @@ func makeDSTopologyHeaderRewriteTxt(ds DeliveryService, cg tc.CacheGroupName, to
}
txt := ""
const pluginTxt = ` @plugin=header_rewrite.so @pparam=`
- if placement.IsFirstCacheTier && ds.FirstHeaderRewrite != nil && *ds.FirstHeaderRewrite != "" {
+ if placement.IsFirstCacheTier && ((ds.FirstHeaderRewrite != nil && *ds.FirstHeaderRewrite != "") || ds.ServiceCategory != nil) {
txt += pluginTxt + FirstHeaderRewriteConfigFileName(*ds.XMLID) + ` `
}
- if placement.IsInnerCacheTier && ds.InnerHeaderRewrite != nil && *ds.InnerHeaderRewrite != "" {
+ if placement.IsInnerCacheTier && ((ds.InnerHeaderRewrite != nil && *ds.InnerHeaderRewrite != "") || ds.ServiceCategory != nil) {
txt += pluginTxt + InnerHeaderRewriteConfigFileName(*ds.XMLID) + ` `
}
- if placement.IsLastCacheTier && ds.LastHeaderRewrite != nil && *ds.LastHeaderRewrite != "" {
+ if placement.IsLastCacheTier && ((ds.LastHeaderRewrite != nil && *ds.LastHeaderRewrite != "") || ds.ServiceCategory != nil || ds.MaxOriginConnections != nil) {
txt += pluginTxt + LastHeaderRewriteConfigFileName(*ds.XMLID) + ` `
}
return txt, nil
[trafficcontrol] 06/08: TM init.d script: Append to
traffic_monitor.log (#5655)
Posted by oc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit 667e393fb100096d9458fd7b11df1b638568cec7
Author: Zach Hoffman <zr...@apache.org>
AuthorDate: Thu Mar 18 14:50:11 2021 -0600
TM init.d script: Append to traffic_monitor.log (#5655)
* TM init.d script: Append to traffic_monitor.log
* Do not have the init.d script to append stdout to the Traffic Monitor log
* Do not redirect stderr to stdout
(cherry picked from commit 12a4843f3b762887d0bb31f48d1b37080cccefbe)
---
CHANGELOG.md | 1 +
traffic_monitor/build/traffic_monitor.init | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2dc9946..0685770 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fix for config gen missing max_origin_connections on mids in certain scenarios
- [#5192](https://github.com/apache/trafficcontrol/issues/5192) - Fixed TO log warnings when generating snapshots for topology-based delivery services.
- Fixed Invalid TS logrotate configuration permissions causing TS logs to be ignored by logrotate.
+- [#5604](https://github.com/apache/trafficcontrol/issues/5604) - traffic_monitor.log is no longer truncated when restarting Traffic Monitor
## [5.1.0] - 2021-02-21
### Added
diff --git a/traffic_monitor/build/traffic_monitor.init b/traffic_monitor/build/traffic_monitor.init
index 9240ead..6fa6b69 100644
--- a/traffic_monitor/build/traffic_monitor.init
+++ b/traffic_monitor/build/traffic_monitor.init
@@ -63,7 +63,7 @@ start() {
# Start daemons.
echo -n $"Starting $name: "
- daemon nohup $prog $options < /dev/null > /opt/traffic_monitor/var/log/traffic_monitor.log 2>&1 &
+ daemon nohup $prog $options < /dev/null &
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
[trafficcontrol] 01/08: Allow PURGE over localhost in atscfg (#5619)
Posted by oc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit 03999e6ec7eca00186efc5862c25abede9b47faf
Author: Dylan Souza <dy...@gmail.com>
AuthorDate: Thu Mar 11 10:22:31 2021 -0700
Allow PURGE over localhost in atscfg (#5619)
Add rules to ip_allow in atscfg to allow for PURGE requests over
localhost. Currently there is a parameter called purge_allow_ip
that specifies specific IPs where purge requests can come from. This
parameter DOES NOT WORK on Mids because PURGE/PUSH request denials
are prepended to the very beginning of ip_allow.
This does not fix that parameter, but opens up PURGE requests specifically
over localhost.
Co-authored-by: dsouza550 <dy...@comcast.com>
(cherry picked from commit 878b157cfae70116cfa08d10913bc359827ea0f9)
---
CHANGELOG.md | 10 ++++++++--
lib/go-atscfg/ipallowdotconfig.go | 11 +++++++++++
lib/go-atscfg/ipallowdotconfig_test.go | 4 ++--
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8776d18..0aa9949 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
+## [5.1.1] - 2021-03-19
+### Added
+- Atscfg: Added a rule to ip_allow such that PURGE requests are allowed over localhost
+
+### Fixed
+- [#5565](https://github.com/apache/trafficcontrol/issues/5565) - TO GET /caches/stats panic converting string to uint64
+- [#5558](https://github.com/apache/trafficcontrol/issues/5558) - Fixed `TM UI` and `/api/cache-statuses` to report aggregate `bandwidth_kbps` correctly.
+
## [5.1.0] - 2021-02-21
### Added
- Traffic Portal: [#5394](https://github.com/apache/trafficcontrol/issues/5394) - Converts the tenant table to a tenant tree for usability
@@ -19,8 +27,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added license files to the RPMs
### Fixed
-- [#5565](https://github.com/apache/trafficcontrol/issues/5565) - TO GET /caches/stats panic converting string to uint64
-- [#5558](https://github.com/apache/trafficcontrol/issues/5558) - Fixed `TM UI` and `/api/cache-statuses` to report aggregate `bandwidth_kbps` correctly.
- [#5445](https://github.com/apache/trafficcontrol/issues/5445) - When updating a registered user, ignore updates on registration_sent field.
- [#5335](https://github.com/apache/trafficcontrol/issues/5335) - Don't create a change log entry if the delivery service primary origin hasn't changed
- [#5333](https://github.com/apache/trafficcontrol/issues/5333) - Don't create a change log entry for any delivery service consistent hash query params updates
diff --git a/lib/go-atscfg/ipallowdotconfig.go b/lib/go-atscfg/ipallowdotconfig.go
index 9313b97..827b793 100644
--- a/lib/go-atscfg/ipallowdotconfig.go
+++ b/lib/go-atscfg/ipallowdotconfig.go
@@ -271,9 +271,20 @@ func MakeIPAllowDotConfig(
sort.Sort(ipAllowDatas(ipAllowDat))
// start with a deny for PUSH and PURGE - TODO CDL: parameterize
+ // but leave purge open through localhost
if isMid { // Edges already deny PUSH and PURGE
ipAllowDat = append([]ipAllowData{
{
+ Src: `127.0.0.1`,
+ Action: ActionAllow,
+ Method: `PURGE`,
+ },
+ {
+ Src: `::1`,
+ Action: ActionAllow,
+ Method: `PURGE`,
+ },
+ {
Src: `0.0.0.0-255.255.255.255`,
Action: ActionDeny,
Method: `PUSH|PURGE`,
diff --git a/lib/go-atscfg/ipallowdotconfig_test.go b/lib/go-atscfg/ipallowdotconfig_test.go
index 64880e5..c69e5e1 100644
--- a/lib/go-atscfg/ipallowdotconfig_test.go
+++ b/lib/go-atscfg/ipallowdotconfig_test.go
@@ -112,7 +112,7 @@ func TestMakeIPAllowDotConfig(t *testing.T) {
ip4deny = true
case strings.Contains(line, `::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff`) && strings.Contains(line, `ip_deny`) && strings.Contains(line, `PUSH`) && strings.Contains(line, `PURGE`):
ip6deny = true
- case strings.Contains(line, `ip_allow`):
+ case strings.Contains(line, `ip_allow`) && !(strings.Contains(line, `127.0.0.1`) || strings.Contains(line, `::1`)):
if !(ip4deny && ip6deny) {
t.Errorf("Expected denies for PUSH and PURGE before any ips are allowed; pre-denial allowance on line %d.", i+1)
}
@@ -402,7 +402,7 @@ func TestMakeIPAllowDotConfigTopologies(t *testing.T) {
ip4deny = true
case strings.Contains(line, `::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff`) && strings.Contains(line, `ip_deny`) && strings.Contains(line, `PUSH`) && strings.Contains(line, `PURGE`):
ip6deny = true
- case strings.Contains(line, `ip_allow`):
+ case strings.Contains(line, `ip_allow`) && !(strings.Contains(line, `127.0.0.1`) || strings.Contains(line, `::1`)):
if !(ip4deny && ip6deny) {
t.Errorf("Expected denies for PUSH and PURGE before any ips are allowed; pre-denial allowance on line %d.", i+1)
}