[Bps-public-commit] rtir-extension-misp branch master updated. 8ccc1a39a9fad30ca5e31c0a0702a260a89bcc0a
BPS Git Server
git at git.bestpractical.com
Thu Oct 7 15:36:18 UTC 2021
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rtir-extension-misp".
The branch, master has been updated
via 8ccc1a39a9fad30ca5e31c0a0702a260a89bcc0a (commit)
from 01bed9682c69df9435003604f1f8bf2868f82b13 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8ccc1a39a9fad30ca5e31c0a0702a260a89bcc0a
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 7 23:34:59 2021 +0800
Add patch to make it work with RTIR versions prior to 5.0.2
diff --git a/README b/README
index 49534ac..b26d356 100644
--- a/README
+++ b/README
@@ -15,6 +15,9 @@ INSTALLATION
make install
May need root permissions
+ Patch RTIR for versions prior to 5.0.2
+ patch -p1 -d /opt/rt5/local/plugins/RT-IR < patches/Add-callbacks-to-the-feed-listing-and-display-pages.patch
+
Edit your /opt/rt4/etc/RT_SiteConfig.pm
Add this line:
diff --git a/lib/RTIR/Extension/MISP.pm b/lib/RTIR/Extension/MISP.pm
index 8c3e600..d06c0d0 100644
--- a/lib/RTIR/Extension/MISP.pm
+++ b/lib/RTIR/Extension/MISP.pm
@@ -33,6 +33,10 @@ Works with RTIR 5.0
May need root permissions
+=item Patch RTIR for versions prior to 5.0.2
+
+ patch -p1 -d /opt/rt5/local/plugins/RT-IR < patches/Add-callbacks-to-the-feed-listing-and-display-pages.patch
+
=item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
Add this line:
diff --git a/patches/Add-callbacks-to-the-feed-listing-and-display-pages.patch b/patches/Add-callbacks-to-the-feed-listing-and-display-pages.patch
new file mode 100644
index 0000000..ffab0ca
--- /dev/null
+++ b/patches/Add-callbacks-to-the-feed-listing-and-display-pages.patch
@@ -0,0 +1,81 @@
+From fd66d0f512c75548e69062e5b267133372e746aa Mon Sep 17 00:00:00 2001
+From: Jim Brandt <jbrandt at bestpractical.com>
+Date: Fri, 23 Jul 2021 14:28:28 -0400
+Subject: [PATCH] Add callbacks to the feed listing and display pages
+
+This makes it possible for an extension to add a new
+feed to the existing page.
+---
+ html/RTIR/Tools/ExternalFeeds.html | 19 ++++++++++++++-----
+ lib/RT/IR/ExternalFeeds.pm | 2 ++
+ 2 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/html/RTIR/Tools/ExternalFeeds.html b/html/RTIR/Tools/ExternalFeeds.html
+index a99a30a8..733a9f4d 100644
+--- a/html/RTIR/Tools/ExternalFeeds.html
++++ b/html/RTIR/Tools/ExternalFeeds.html
+@@ -51,8 +51,9 @@
+ <div class="form-row">
+ <div class="col-12">
+ % my $i = 0;
+-% if ($FeedName) {
++% if ( $FeedName and $ExternalFeeds->{rss_feeds}{$FeedName} ) {
+ % my $feed = $ExternalFeeds->fetch_rss_feed($FeedName);
++
+ <&|/Widgets/TitleBox,
+ title => $feed->{Title},
+ class => "external-feeds fullwidth",
+@@ -111,13 +112,19 @@
+ </div>
+ % }
+ </&>
++% }
++% elsif ( $FeedName ) {
++% # Allow non-RSS feeds from extensions to run
++% $m->callback( CallbackName => 'DisplayFeedContent', %ARGS, FeedsObj => $ExternalFeeds, FeedName => $FeedName, Lifecycle => $Lifecycle );
+ % } else {
++% my $found_feed;
++% if ( $ExternalFeeds->have_rss_feeds) {
+ <&|/Widgets/TitleBox,
+ title => loc("RSS"),
+ class => "fullwidth",
+ bodyclass => ""
+ &>
+-% if ( $ExternalFeeds->have_rss_feeds) {
++% $found_feed = 1;
+ <div class="table-responsive">
+ <table cellspacing="0" class="table collection collection-as-table">
+ <tr class="collection-as-table">
+@@ -133,13 +140,15 @@
+ % }
+ </table>
+ </div>
++ </&>
+ % }
+-% else {
++% $m->callback( CallbackName => 'AfterFeedsList', %ARGS, FeedsObj => $ExternalFeeds, FoundFeedRef => \$found_feed );
++
++% unless ( $found_feed ) {
+ <p class="mt-3 mt-1 ml-3">
+- <&|/l&>No RSS feeds currently configured, you can configure feeds in the %ExternalFeeds option, a default set of security feeds is included in the inital RTIR configuration.</&>
++ <&|/l&>No feeds currently configured. You can configure feeds in the %ExternalFeeds option. A default set of security feeds is included in the inital RTIR configuration.</&>
+ </p>
+ % }
+- </&>
+ % }
+
+ </div>
+diff --git a/lib/RT/IR/ExternalFeeds.pm b/lib/RT/IR/ExternalFeeds.pm
+index bf93895d..66112f9b 100644
+--- a/lib/RT/IR/ExternalFeeds.pm
++++ b/lib/RT/IR/ExternalFeeds.pm
+@@ -150,4 +150,6 @@ sub _scrub_html {
+ return $scrubbed_html;
+ }
+
++RT::IR->ImportOverlays;
++
+ 1;
+--
+2.30.1 (Apple Git-130)
+
-----------------------------------------------------------------------
Summary of changes:
README | 3 +
lib/RTIR/Extension/MISP.pm | 4 ++
...cks-to-the-feed-listing-and-display-pages.patch | 81 ++++++++++++++++++++++
3 files changed, 88 insertions(+)
create mode 100644 patches/Add-callbacks-to-the-feed-listing-and-display-pages.patch
hooks/post-receive
--
rtir-extension-misp
More information about the Bps-public-commit
mailing list