From 598a6147aadc3e3aecca6b2a1f62c86fcf42d6c4 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Thu, 13 Jun 2013 21:25:47 +0000 Subject: Add RSS feeds --- Makefile | 2 +- NEWS | 1 + config_default | 1 + tmpl/advisories.html | 3 ++- tmpl/advisories.rss | 17 +++++++++++++++ tmpl/advisory_item.rss | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ tmpl/by_rel.html | 3 ++- tmpl/by_rel.rss | 17 +++++++++++++++ tmpl/by_src.html | 3 ++- tmpl/by_src.rss | 17 +++++++++++++++ tmpl/index.html | 4 ++-- 11 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 tmpl/advisories.rss create mode 100644 tmpl/advisory_item.rss create mode 100644 tmpl/by_rel.rss create mode 100644 tmpl/by_src.rss 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 @@ Mageia Advisories + -

Mageia Advisories

+

Mageia Advisories rss

[% INCLUDE advisories_table.html advlst = advdb.sorted %] 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 -%] + + + + + Mageia Advisories + [% config.site_url %] + Mageia Advisories + en + + + + [%- FOR adv IN advdb.sorted -%] + [% INCLUDE advisory_item.rss %] + [%- END -%] + + 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 -%] + + [% adv %] - [% advisory.subject %] + [% config.site_url %]/[% basename.ID(adv) %].html + [% adv %] + [% date.format(advisory.status.published, format => '%a, %d %b %Y %H:%M:%S', gmt => 1) %] GMT + [% advisory.type %] + + + 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 -%] + + + 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 @@ Mageia [% rel %] Advisories + -

Mageia [% rel %] Advisories

+

Mageia [% rel %] Advisories rss

[% INCLUDE advisories_table.html advlst = advdb.by_rel.$rel %] 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 -%] + + + + + Mageia [% rel %] Advisories + [% config.site_url %] + Mageia [% rel %] Advisories + en + + + + [%- FOR adv IN advdb.by_rel.$rel -%] + [% INCLUDE advisory_item.rss %] + [%- END -%] + + 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 @@ Mageia advisories for package [% src %] + -

Mageia advisories for package [% src %]

+

Mageia advisories for package [% src %] rss

[% INCLUDE advisories_table.html advlst = advdb.by_src.$src %] 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 -%] + + + + + Mageia Advisories for package [% src %] + [% config.site_url %] + Mageia Advisories for package [% src %] + en + + + + [%- FOR adv IN advdb.by_src.$src -%] + [% INCLUDE advisory_item.rss %] + [%- END -%] + + 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 @@

Mageia Advisories

CVE list

-- cgit v1.2.1