aboutsummaryrefslogtreecommitdiffstats
path: root/tmpl
diff options
context:
space:
mode:
authorDan Fandrich <danf@mageia.org>2024-04-15 23:26:06 -0700
committerDan Fandrich <danf@mageia.org>2024-04-16 10:58:32 -0700
commit7b864281523a0bf15ecea235f463c27bb77dec53 (patch)
treeaa9d4435296bc296f306e0b1485f424191b28a56 /tmpl
parent63160c8456f5fc561ce86a373d027d8acd630d4e (diff)
downloadmgaadvisories-7b864281523a0bf15ecea235f463c27bb77dec53.tar
mgaadvisories-7b864281523a0bf15ecea235f463c27bb77dec53.tar.gz
mgaadvisories-7b864281523a0bf15ecea235f463c27bb77dec53.tar.bz2
mgaadvisories-7b864281523a0bf15ecea235f463c27bb77dec53.tar.xz
mgaadvisories-7b864281523a0bf15ecea235f463c27bb77dec53.zip
Get the last modified date of advisories from SVN
The modification date helps track if an advisory was changed after initial publication. This is especially important for OSV users who need the modification date in the vulns.json index to determine whether an existing advisory was updated so they can download the update. Also, keep "ref" (pointing to bug number) in all advisories, not just the TODO ones.
Diffstat (limited to 'tmpl')
-rw-r--r--tmpl/advisory.html1
-rw-r--r--tmpl/advisory.json1
-rw-r--r--tmpl/vulns.json3
3 files changed, 4 insertions, 1 deletions
diff --git a/tmpl/advisory.html b/tmpl/advisory.html
index a5cbb52..dda79a4 100644
--- a/tmpl/advisory.html
+++ b/tmpl/advisory.html
@@ -15,6 +15,7 @@
<h2>[% adv.subject %]</h2>
Publication date: [% date.format(adv.status.published, format => '%d %b %Y', gmt => 1) %]<br />
+ Modification date: [% date.format(adv.status.modified, format => '%d %b %Y', gmt => 1) %]<br />
Type: [% adv.type %]<br />
Affected Mageia releases :
[% SET sep = '' %]
diff --git a/tmpl/advisory.json b/tmpl/advisory.json
index 475012f..ab46f2b 100644
--- a/tmpl/advisory.json
+++ b/tmpl/advisory.json
@@ -11,6 +11,7 @@ print JSON::encode_json($stash->get($stash->get('var')));
"schema_version": "1.6.2",
"id": [% jsonvar('advisory') %],
"published": "[% date.format(adv.status.published, format => '%Y-%m-%dT%H:%M:%SZ', gmt => 1) %]",
+ "modified": "[% date.format(adv.status.modified, format => '%Y-%m-%dT%H:%M:%SZ', gmt => 1) %]",
"summary": [% jsonvar('adv.subject') %],
"details": [% jsonvar('adv.description') %],
[% IF adv.CVE && adv.CVE.list.size != 0 -%]
diff --git a/tmpl/vulns.json b/tmpl/vulns.json
index aadcd05..790f88a 100644
--- a/tmpl/vulns.json
+++ b/tmpl/vulns.json
@@ -1,9 +1,10 @@
+[%- USE date -%]
[
[%- FOR adv IN advdb.sorted -%]
[% USE advid = String(basename.ID(adv)) -%]
[% IF advid.search('^MGASA-') -%]
[%- "," IF gotone %]
-{"id": "[% basename.ID(adv) %]"}
+{"id": "[% basename.ID(adv) %]","modified": "[% date.format(advdb.advisories.$adv.status.modified, format => '%Y-%m-%dT%H:%M:%SZ', gmt => 1) %]"}
[%- SET gotone = 1 %]
[%- END %]
[%- END %]