diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | config_default | 1 | ||||
-rw-r--r-- | tmpl/advisories.html | 3 | ||||
-rw-r--r-- | tmpl/advisories.rss | 17 | ||||
-rw-r--r-- | tmpl/advisory_item.rss | 56 | ||||
-rw-r--r-- | tmpl/by_rel.html | 3 | ||||
-rw-r--r-- | tmpl/by_rel.rss | 17 | ||||
-rw-r--r-- | tmpl/by_src.html | 3 | ||||
-rw-r--r-- | tmpl/by_src.rss | 17 | ||||
-rw-r--r-- | tmpl/index.html | 4 |
11 files changed, 118 insertions, 6 deletions
@@ -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 @@ -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) %]<br /> + Type: [% advisory.type %]<br /> + Affected Mageia releases : + [% SET sep = '' %] + [% FOREACH rel IN advisory.src.keys.sort %] + [% sep %] + [% SET sep = ', ' %] + <a href="[% basename.rel(rel) %].html">[% rel %]</a> + [% END %] + <br /> + + [% SET sep = '' %] + [% IF advisory.CVE.list.size != 0 %] + CVE: + [% FOREACH cve IN advisory.CVE %] + [% sep %] + [% SET sep = ', ' %] + <a href="[% basename.CVE(cve) %].html">[% cve %]</a> + [% END %] + [% END %] + + <h2>Description</h2> + <pre> + [%- advisory.description -%] + </pre> + + <h2>References</h2> + <ul> + [% FOREACH ref IN advisory.references -%] + <li><a href="[% ref %]">[% ref %]</a></li> + [% END %] + </ul> + + <h2>SRPMS</h2> + [% FOREACH rel IN advisory.src.keys -%] + [% FOREACH media IN advisory.src.$rel.keys -%] + <h3>[% rel %]/[% media %]</h3> + <ul> + [% FOREACH srpm IN advisory.src.$rel.$media -%] + <li>[% srpm %]</li> + [% END -%] + </ul> + [% 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> |