aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-06-13 21:25:47 +0000
committerNicolas Vigier <boklm@mageia.org>2013-06-13 21:25:47 +0000
commit598a6147aadc3e3aecca6b2a1f62c86fcf42d6c4 (patch)
treed2e10383baaf0d987e6873a941947c69964f8bd6
parent4c01a9deaaccf95603e4483a4599335ac39a7e0d (diff)
downloadmgaadvisories-598a6147aadc3e3aecca6b2a1f62c86fcf42d6c4.tar
mgaadvisories-598a6147aadc3e3aecca6b2a1f62c86fcf42d6c4.tar.gz
mgaadvisories-598a6147aadc3e3aecca6b2a1f62c86fcf42d6c4.tar.bz2
mgaadvisories-598a6147aadc3e3aecca6b2a1f62c86fcf42d6c4.tar.xz
mgaadvisories-598a6147aadc3e3aecca6b2a1f62c86fcf42d6c4.zip
Add RSS feeds
-rw-r--r--Makefile2
-rw-r--r--NEWS1
-rw-r--r--config_default1
-rw-r--r--tmpl/advisories.html3
-rw-r--r--tmpl/advisories.rss17
-rw-r--r--tmpl/advisory_item.rss56
-rw-r--r--tmpl/by_rel.html3
-rw-r--r--tmpl/by_rel.rss17
-rw-r--r--tmpl/by_src.html3
-rw-r--r--tmpl/by_src.rss17
-rw-r--r--tmpl/index.html4
11 files changed, 118 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 4eebb6e..aaf894b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ VERSION=0.4
PROJECTNAME=mga-advisories
BINFILES=mgaadv
CFGFILES=mga-advisories.conf
-TMPLFILES=tmpl/*.html tmpl/*.txt tmpl/*.adv
+TMPLFILES=tmpl/*.html tmpl/*.txt tmpl/*.adv tmpl/*.rss
sysconfdir=/etc
bindir=/usr/bin
diff --git a/NEWS b/NEWS
index b4756f1..48d341b 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@
- add option to load advisories db from a file dump instead of a directory
- add 'update' command to download new advisories db
- add 'initqaconf' command to initialize config for QA team members
+- add RSS feeds
Version 0.4
diff --git a/config_default b/config_default
index af9165a..0b9448b 100644
--- a/config_default
+++ b/config_default
@@ -6,6 +6,7 @@ tmpl_dir: /usr/share/mga-advisories/tmpl
output_format:
- txt
- html
+ - rss
out_dir: /var/lib/mga-advisories/out
site_url: http://advisories.mageia.org
advisories_repo_url: svn+ssh://svn.mageia.org/svn/advisories
diff --git a/tmpl/advisories.html b/tmpl/advisories.html
index 7daaeb3..5ff26f1 100644
--- a/tmpl/advisories.html
+++ b/tmpl/advisories.html
@@ -3,9 +3,10 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mageia Advisories</title>
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="[% config.site_url %]/advisories.rss" />
</head>
<body>
- <h1>Mageia Advisories</h1>
+ <h1>Mageia Advisories <a href="advisories.rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></h1>
[% INCLUDE advisories_table.html advlst = advdb.sorted %]
</body>
diff --git a/tmpl/advisories.rss b/tmpl/advisories.rss
new file mode 100644
index 0000000..cdde3c7
--- /dev/null
+++ b/tmpl/advisories.rss
@@ -0,0 +1,17 @@
+[%- USE date -%]
+<?xml version="1.0"?>
+
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>Mageia Advisories</title>
+ <link>[% config.site_url %]</link>
+ <description>Mageia Advisories</description>
+ <language>en</language>
+
+ <atom:link href="[% config.site_url %]/advisories.rss" rel="self" type="application/rss+xml" />
+
+ [%- FOR adv IN advdb.sorted -%]
+ [% INCLUDE advisory_item.rss %]
+ [%- END -%]
+ </channel>
+</rss>
diff --git a/tmpl/advisory_item.rss b/tmpl/advisory_item.rss
new file mode 100644
index 0000000..186c2f8
--- /dev/null
+++ b/tmpl/advisory_item.rss
@@ -0,0 +1,56 @@
+[% SET advisory = advdb.advisories.$adv -%]
+ <item>
+ <title>[% adv %] - [% advisory.subject %]</title>
+ <link>[% config.site_url %]/[% basename.ID(adv) %].html</link>
+ <guid isPermaLink="false">[% adv %]</guid>
+ <pubDate>[% date.format(advisory.status.published, format => '%a, %d %b %Y %H:%M:%S', gmt => 1) %] GMT</pubDate>
+ <category>[% advisory.type %]</category>
+ <description>
+
+ Publication date: [% date.format(advisory.pubtime, format => '%d %b %Y', gmt => 1) %]&lt;br /&gt;
+ Type: [% advisory.type %]&lt;br /&gt;
+ Affected Mageia releases :
+ [% SET sep = '' %]
+ [% FOREACH rel IN advisory.src.keys.sort %]
+ [% sep %]
+ [% SET sep = ', ' %]
+ &lt;a href="[% basename.rel(rel) %].html"&gt;[% rel %]&lt;/a&gt;
+ [% END %]
+ &lt;br /&gt;
+
+ [% SET sep = '' %]
+ [% IF advisory.CVE.list.size != 0 %]
+ CVE:
+ [% FOREACH cve IN advisory.CVE %]
+ [% sep %]
+ [% SET sep = ', ' %]
+ &lt;a href="[% basename.CVE(cve) %].html"&gt;[% cve %]&lt;/a&gt;
+ [% END %]
+ [% END %]
+
+ &lt;h2&gt;Description&lt;/h2&gt;
+ &lt;pre&gt;
+ [%- advisory.description -%]
+ &lt;/pre&gt;
+
+ &lt;h2&gt;References&lt;/h2&gt;
+ &lt;ul&gt;
+ [% FOREACH ref IN advisory.references -%]
+ &lt;li&gt;&lt;a href="[% ref %]"&gt;[% ref %]&lt;/a&gt;&lt;/li&gt;
+ [% END %]
+ &lt;/ul&gt;
+
+ &lt;h2&gt;SRPMS&lt;/h2&gt;
+ [% FOREACH rel IN advisory.src.keys -%]
+ [% FOREACH media IN advisory.src.$rel.keys -%]
+ &lt;h3&gt;[% rel %]/[% media %]&lt;/h3&gt;
+ &lt;ul&gt;
+ [% FOREACH srpm IN advisory.src.$rel.$media -%]
+ &lt;li&gt;[% srpm %]&lt;/li&gt;
+ [% END -%]
+ &lt;/ul&gt;
+ [% END -%]
+ [% END -%]
+
+ </description>
+ </item>
diff --git a/tmpl/by_rel.html b/tmpl/by_rel.html
index ac7dc82..883d9f6 100644
--- a/tmpl/by_rel.html
+++ b/tmpl/by_rel.html
@@ -3,9 +3,10 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mageia [% rel %] Advisories</title>
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="[% config.site_url %]/[% basename.rel(rel) %].rss" />
</head>
<body>
- <h1>Mageia [% rel %] Advisories</h1>
+ <h1>Mageia [% rel %] Advisories <a href="[% basename.rel(rel) %].rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></h1>
[% INCLUDE advisories_table.html advlst = advdb.by_rel.$rel %]
</body>
diff --git a/tmpl/by_rel.rss b/tmpl/by_rel.rss
new file mode 100644
index 0000000..0ba3dc8
--- /dev/null
+++ b/tmpl/by_rel.rss
@@ -0,0 +1,17 @@
+[%- USE date -%]
+<?xml version="1.0"?>
+
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>Mageia [% rel %] Advisories</title>
+ <link>[% config.site_url %]</link>
+ <description>Mageia [% rel %] Advisories</description>
+ <language>en</language>
+
+ <atom:link href="[% config.site_url %]/[% basename.rel(rel) %].rss" rel="self" type="application/rss+xml" />
+
+ [%- FOR adv IN advdb.by_rel.$rel -%]
+ [% INCLUDE advisory_item.rss %]
+ [%- END -%]
+ </channel>
+</rss>
diff --git a/tmpl/by_src.html b/tmpl/by_src.html
index 4e58347..7456918 100644
--- a/tmpl/by_src.html
+++ b/tmpl/by_src.html
@@ -3,9 +3,10 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mageia advisories for package [% src %]</title>
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="[% config.site_url %]/[% basename.src(src) %].rss" />
</head>
<body>
- <h1>Mageia advisories for package [% src %]</h1>
+ <h1>Mageia advisories for package [% src %] <a href="[% basename.src(src) %].rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></h1>
[% INCLUDE advisories_table.html advlst = advdb.by_src.$src %]
</body>
diff --git a/tmpl/by_src.rss b/tmpl/by_src.rss
new file mode 100644
index 0000000..8f681e6
--- /dev/null
+++ b/tmpl/by_src.rss
@@ -0,0 +1,17 @@
+[%- USE date -%]
+<?xml version="1.0"?>
+
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>Mageia Advisories for package [% src %]</title>
+ <link>[% config.site_url %]</link>
+ <description>Mageia Advisories for package [% src %]</description>
+ <language>en</language>
+
+ <atom:link href="[% config.site_url %]/[% basename.src(src) %].rss" rel="self" type="application/rss+xml" />
+
+ [%- FOR adv IN advdb.by_src.$src -%]
+ [% INCLUDE advisory_item.rss %]
+ [%- END -%]
+ </channel>
+</rss>
diff --git a/tmpl/index.html b/tmpl/index.html
index 17ce430..3419338 100644
--- a/tmpl/index.html
+++ b/tmpl/index.html
@@ -8,9 +8,9 @@
<h1>Mageia Advisories</h1>
<ul>
[% FOREACH rel IN advdb.by_rel.keys.sort -%]
- <li><a href="[% basename.rel(rel) %].html">Mageia [% rel %] advisories</a></li>
+ <li><a href="[% basename.rel(rel) %].html">Mageia [% rel %] advisories</a> <a href="[% basename.rel(rel) %].rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></li>
[%- END -%]
- <li><a href="advisories.html">All advisories</a></li>
+ <li><a href="advisories.html">All advisories</a> <a href="advisories.rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></li>
</ul>
<h1>CVE list</h1>