aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly@.no>2016-03-23 02:52:26 +0100
committerKristian Lyngstol <kly@kly@.no>2016-03-23 02:52:26 +0100
commite4f3bbbaffcc7315f73ecf55a52ad61814d96100 (patch)
treef47553d841556ddd8c79184ad4d3262cdd11af24
parent6ba9bacb3fee3765a74c603c7fd2f9b492c5329d (diff)
NMS: Fix cache invalidation etc
-rw-r--r--web/etc/varnish/nms.vcl3
-rwxr-xr-xweb/nms.gathering.org/api/read/switches-management2
-rwxr-xr-xweb/nms.gathering.org/api/write/comment-add2
-rwxr-xr-xweb/nms.gathering.org/api/write/comment-change1
4 files changed, 6 insertions, 2 deletions
diff --git a/web/etc/varnish/nms.vcl b/web/etc/varnish/nms.vcl
index 93da9de..0cddebd 100644
--- a/web/etc/varnish/nms.vcl
+++ b/web/etc/varnish/nms.vcl
@@ -11,6 +11,9 @@ backend default {
# Sort magi.
sub vcl_recv {
+ if (req.url ~ "^/where" || req.url ~ "^/location") {
+ set req.url = "/api/public/location";
+ }
if (req.method != "GET" &&
req.method != "HEAD" &&
req.method != "PUT" &&
diff --git a/web/nms.gathering.org/api/read/switches-management b/web/nms.gathering.org/api/read/switches-management
index 7697671..292a6fb 100755
--- a/web/nms.gathering.org/api/read/switches-management
+++ b/web/nms.gathering.org/api/read/switches-management
@@ -13,7 +13,7 @@ use Data::Dumper;
$nms::web::cc{'max-age'} = "60";
#my $q2 = $nms::web::dbh->prepare('select sysname,ip,poll_frequency,subnet4,subnet6,distro,last_updated from switches ');
-my $q2 = $nms::web::dbh->prepare('select switch,sysname,mgmt_v4_addr,mgmt_v6_addr,mgmt_v4_gw,mgmt_v6_gw,mgmt_vlan,traffic_vlan,last_config_fetch,current_mac,poll_frequency,last_updated,switchtype from switches where placement is not null');
+my $q2 = $nms::web::dbh->prepare('select switch,sysname,mgmt_v4_addr,subnet4,subnet6,mgmt_v6_addr,mgmt_v4_gw,mgmt_v6_gw,mgmt_vlan,traffic_vlan,last_config_fetch,current_mac,poll_frequency,last_updated,switchtype from switches where placement is not null');
$q2->execute();
while (my $ref = $q2->fetchrow_hashref()) {
diff --git a/web/nms.gathering.org/api/write/comment-add b/web/nms.gathering.org/api/write/comment-add
index 26ff734..bcea6dc 100755
--- a/web/nms.gathering.org/api/write/comment-add
+++ b/web/nms.gathering.org/api/write/comment-add
@@ -20,5 +20,5 @@ $nms::web::cc{'max-age'} = '0';
$nms::web::cc{'stale-while-revalidate'} = '0';
$nms::web::json{'state'} = 'ok';
-print "X-ban: /api/private/comments\n";
+print "X-ban: /api/read/comments\n";
finalize_output();
diff --git a/web/nms.gathering.org/api/write/comment-change b/web/nms.gathering.org/api/write/comment-change
index fb7da54..0bdabc0 100755
--- a/web/nms.gathering.org/api/write/comment-change
+++ b/web/nms.gathering.org/api/write/comment-change
@@ -21,4 +21,5 @@ $nms::web::cc{'max-age'} = '0';
$nms::web::cc{'stale-while-revalidate'} = '0';
$nms::web::json{'state'} = 'ok';
+print "X-ban: /api/read/comments\n";
finalize_output();