diff options
-rw-r--r-- | plugins/release-status.lua | 62 | ||||
-rw-r--r-- | release-status.toml | 15 | ||||
-rw-r--r-- | site/status.md | 27 | ||||
-rw-r--r-- | soupault.toml | 7 | ||||
-rw-r--r-- | templates/main.html | 1 |
5 files changed, 112 insertions, 0 deletions
diff --git a/plugins/release-status.lua b/plugins/release-status.lua new file mode 100644 index 0000000..d7b0fd7 --- /dev/null +++ b/plugins/release-status.lua @@ -0,0 +1,62 @@ +selector = config["selector"] +path = config["file"] +text = config["text"] + +if not selector then + Log.warning("`selector' must be configured.") +elseif path and text then + Log.warning("Only one of `path' and `text' can be specified.") +elseif text then + toml_string = text +elseif path then + toml_string = Sys.read_file(path) +else + Log.warning("Either `path' or `text' must be specified.") +end + +function generate_table(vyos_version, version_table) + local target_elem = HTML.select_one(page, selector) + + local codename_header = HTML.create_element("h3", vyos_version) + HTML.set_attribute(codename_header, "id", vyos_version) + HTML.add_class(codename_header, "version") + local codename_anchor = HTML.create_element("a") + HTML.set_attribute(codename_anchor, "href", "#" .. vyos_version) + HTML.append_child(codename_anchor, codename_header) + HTML.append_child(target_elem, codename_anchor) + + local version_string = version_table["latest"] + local version_header = HTML.create_element("h4", version_string) + HTML.set_attribute(version_header, "id", version_string) + local version_anchor = HTML.create_element("a") + HTML.set_attribute(version_anchor, "href", "#" .. version_string) + HTML.append_child(version_anchor, version_header) + HTML.append_child(target_elem, version_anchor) + + local notes_string = version_table["notes"] + if notes_string then + local notes = HTML.create_element("p", notes_string) + HTML.append_child(target_elem, notes) + end + + local status_table = HTML.create_element("table") + HTML.append_child(status_table, HTML.parse("<tr><th>CVE</th><th>Name</th><th>Description</th><th>Status</th></tr>")) + + local i = 1 + while version_table["security_advisory"][i] do + local row = version_table["security_advisory"][i] + local advisory = HTML.create_element("tr") + HTML.append_child(advisory, HTML.create_element("td", row["cve"])) + HTML.append_child(advisory, HTML.create_element("td", row["title"])) + HTML.append_child(advisory, HTML.create_element("td", row["description"])) + HTML.append_child(advisory, HTML.create_element("td", row["status"])) + HTML.append_child(status_table, advisory) + i = i + 1 + end + HTML.append_child(HTML.select_one(page, selector), status_table) +end + +if toml_string then + local toml_table = TOML.from_string(toml_string) + Table.iter_ordered(generate_table, toml_table["release"]) +end diff --git a/release-status.toml b/release-status.toml new file mode 100644 index 0000000..5dec6e4 --- /dev/null +++ b/release-status.toml @@ -0,0 +1,15 @@ +[release.sagitta] + latest = "1.4.0-epa3" + + security_advisory = [ + {cve="CVE-2024-2961", title="GNU libc iconv buffer overflow", description="Potential DoS in any application that encodes strings", status="fixed"}, + ] + + notes = "Early production access, please report any issues!" + +[release.equuleus] + latest = "1.3.7" + + security_advisory = [ + {cve="CVE-2024-2961", title="GNU libc iconv buffer overflow", description="Potential DoS in any application that encodes strings", status="fixed"}, + ] diff --git a/site/status.md b/site/status.md new file mode 100644 index 0000000..fd2023e --- /dev/null +++ b/site/status.md @@ -0,0 +1,27 @@ +<div class='contribute-page'> + <section class='banner'> + <div class='containerCustom'> + <div class='left-shape'> + <img src='/img/global/shape-left.svg' /> + </div> + <div class='right-shape'> + <img src='/img/global/shape-right.svg' /> + </div> + + <div class='banner-div'> + + # VyOS release status + + Here you can find information about latest releases and any known or fixed security problems. + + </div> + + </div> + </section> + + <section class='content-section'> + <div class='content-div'> + + </div> + +</div> diff --git a/soupault.toml b/soupault.toml index 38ed6ca..14622c2 100644 --- a/soupault.toml +++ b/soupault.toml @@ -114,3 +114,10 @@ Disallow: / after = "insert-nightly-build-containers" profile = "live" + + +[widgets.release_status] + page = "status.md" + widget = "release-status" + file = "release-status.toml" + selector = ".content-div" diff --git a/templates/main.html b/templates/main.html index 2a943aa..7e1c515 100644 --- a/templates/main.html +++ b/templates/main.html @@ -67,6 +67,7 @@ <div class="links"> <a href="/get">GET VYOS</a> <a href="/contribute">CONTRIBUTE</a> + <a href="/status">RELEASE STATUS</a> <a href="http://vyos.io">COMMERCIAL SERVICES</a> <a href="tel:+18449802188"> <img |