diff options
6 files changed, 241 insertions, 0 deletions
diff --git a/roles/webserver/files/user_conf.d/memzero.conf b/roles/webserver/files/user_conf.d/memzero.conf index ed3bd9d..2da3a73 100644 --- a/roles/webserver/files/user_conf.d/memzero.conf +++ b/roles/webserver/files/user_conf.d/memzero.conf @@ -10,6 +10,12 @@ server { include /etc/nginx/inc/ssl.conf; root /www/memzero; + + location /pub/ { + autoindex on; + # https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; + } } server { diff --git a/roles/webserver/files/www/memzero/pub/.gen.sh b/roles/webserver/files/www/memzero/pub/.gen.sh new file mode 100644 index 0000000..9a8030e --- /dev/null +++ b/roles/webserver/files/www/memzero/pub/.gen.sh @@ -0,0 +1,99 @@ +#!/bin/bash + +OUT=references.html + +cat <<EOF > $OUT +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>references</title> + <style> + html { + font-family: Source Code Pro, monospace, sans-serif; + font-size: clamp(12px, 2vw, 16px); + } + button { + font-family: inherit; + font-size: inherit; + } + </style> + <script> + /// Map HTML elements to display kinds. + const elementToDisplay = (E) => { + switch (E.nodeName) { + case "LI": + return "list-item"; + default: + return "block"; + } + } + + /// Display only elements with tag T. + const showTag = (T) => { + Array.from(document.getElementsByClassName("content")).forEach(E => { + E.style.display = "none"; + }); + + Array.from(document.getElementsByClassName(T)).forEach(E => { + E.style.display = elementToDisplay(E); + }); + }; + + /// Initialize buttons and callbacks. + window.onload = () => { + // Handle to the filter placeholder. + const filter = document.getElementById("filter"); + + // Create buttons for each tag T. + ["clear", "sysv", "arm", "x86"].forEach(T => { + const btn = document.createElement("button"); + btn.innerHTML = T; + btn.onclick = T === "clear" + ? (E) => { + showTag("content"); + filter.innerHTML = "filter:"; + } + : (E) => { + showTag(T); + filter.innerHTML = \`filter: <mark>\${T}</mark>\`; + }; + filter.before(btn); + }); + } + </script> +</head> +<body> + <p>Self-hosted collection of frequently referenced documents and specifications. This page provides links to the original sources.</p> + <p id="filter">filter:</p> + <ul> +EOF + +emit() { +cat <<-EOF >> $OUT + <li class="content $1"> + <a style="color:black;" href="/pub/$2">$2</a> + [<a href="$3">original</a>] + </li> +EOF +} + +emit "sysv" abi/sysv/sysv-gabi4-2013 https://www.sco.com/developers/gabi/latest/contents.html +emit "sysv" abi/sysv/sysv-gabi41.pdf https://www.sco.com/developers/devspecs/gabi41.pdf + +emit "sysv x86" abi/sysv-psabi-x86-64.pdf https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build +emit "sysv arm" abi/sysv/sysv-psabi-arm64.pdf https://github.com/ARM-software/abi-aa/releases/download/2023Q3/aaelf64.pdf +emit "sysv arm" abi/arm/aapcs64.pdf https://github.com/ARM-software/abi-aa/releases/download/2023Q3/aapcs64.pdf + +emit "x86" arch/intel/intel64-optimization-ref-vol1.pdf https://cdrdv2.intel.com/v1/dl/getContent/671488 +emit "x86" arch/intel/intel64-optimization-ref-vol2.pdf https://cdrdv2.intel.com/v1/dl/getContent/787036 +emit "x86" arch/intel/intel64-vol1-architecture-manual.pdf https://cdrdv2.intel.com/v1/dl/getContent/671436 +emit "x86" arch/intel/intel64-vol2-instruction-ref.pdf https://cdrdv2.intel.com/v1/dl/getContent/671110 +emit "x86" arch/intel/intel64-vol3-system-programming.pdf https://cdrdv2.intel.com/v1/dl/getContent/671447 + +cat <<EOF >> $OUT + </ul> +</body> +</html> +EOF diff --git a/roles/webserver/files/www/memzero/pub/.gitignore b/roles/webserver/files/www/memzero/pub/.gitignore new file mode 100644 index 0000000..ca51e62 --- /dev/null +++ b/roles/webserver/files/www/memzero/pub/.gitignore @@ -0,0 +1,2 @@ +*.pdf +abi/sysv/sysv-gabi4-2013/*.html diff --git a/roles/webserver/files/www/memzero/pub/abi/sysv/sysv-gabi4-2013/.fetch.sh b/roles/webserver/files/www/memzero/pub/abi/sysv/sysv-gabi4-2013/.fetch.sh new file mode 100644 index 0000000..0ff7818 --- /dev/null +++ b/roles/webserver/files/www/memzero/pub/abi/sysv/sysv-gabi4-2013/.fetch.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +rec_fetch() { + echo fetching $1 + curl --no-progress-meter https://www.sco.com/developers/gabi/latest/$1 -o $1 + + # Handle following link tags: + # <a href=ch4.reloc.html> + # <a href=ch5.dynamic.html#pointer_note> + # <a href="ch4.sheader.html#sh_flags"> + # <a href=#tag_encodings> + # <a href="#sh_type"> + for page in $(grep href $1 |\ + sed 's/.*href="\{0,1\}\([a-zA-Z._0-9]*\)"\{0,1\}[#>].*/\1/g' |\ + sort | uniq); do + if [[ -z $page || -f $page || ${page##*.} != html ]]; then + continue; + fi + + rec_fetch $page + done +} + +rec_fetch contents.html diff --git a/roles/webserver/files/www/memzero/pub/references.html b/roles/webserver/files/www/memzero/pub/references.html new file mode 100644 index 0000000..1f7c71e --- /dev/null +++ b/roles/webserver/files/www/memzero/pub/references.html @@ -0,0 +1,108 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>references</title> + <style> + html { + font-family: Source Code Pro, monospace, sans-serif; + font-size: clamp(12px, 2vw, 16px); + } + button { + font-family: inherit; + font-size: inherit; + } + </style> + <script> + /// Map HTML elements to display kinds. + const elementToDisplay = (E) => { + switch (E.nodeName) { + case "LI": + return "list-item"; + default: + return "block"; + } + } + + /// Display only elements with tag T. + const showTag = (T) => { + Array.from(document.getElementsByClassName("content")).forEach(E => { + E.style.display = "none"; + }); + + Array.from(document.getElementsByClassName(T)).forEach(E => { + E.style.display = elementToDisplay(E); + }); + }; + + /// Initialize buttons and callbacks. + window.onload = () => { + // Handle to the filter placeholder. + const filter = document.getElementById("filter"); + + // Create buttons for each tag T. + ["clear", "sysv", "arm", "x86"].forEach(T => { + const btn = document.createElement("button"); + btn.innerHTML = T; + btn.onclick = T === "clear" + ? (E) => { + showTag("content"); + filter.innerHTML = "filter:"; + } + : (E) => { + showTag(T); + filter.innerHTML = `filter: <mark>${T}</mark>`; + }; + filter.before(btn); + }); + } + </script> +</head> +<body> + <p>Self-hosted collection of frequently referenced documents and specifications. This page provides links to the original sources.</p> + <p id="filter">filter:</p> + <ul> + <li class="content sysv"> + <a style="color:black;" href="/pub/abi/sysv/sysv-gabi4-2013">abi/sysv/sysv-gabi4-2013</a> + [<a href="https://www.sco.com/developers/gabi/latest/contents.html">original</a>] + </li> + <li class="content sysv"> + <a style="color:black;" href="/pub/abi/sysv/sysv-gabi41.pdf">abi/sysv/sysv-gabi41.pdf</a> + [<a href="https://www.sco.com/developers/devspecs/gabi41.pdf">original</a>] + </li> + <li class="content sysv x86"> + <a style="color:black;" href="/pub/abi/sysv-psabi-x86-64.pdf">abi/sysv-psabi-x86-64.pdf</a> + [<a href="https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build">original</a>] + </li> + <li class="content sysv arm"> + <a style="color:black;" href="/pub/abi/sysv/sysv-psabi-arm64.pdf">abi/sysv/sysv-psabi-arm64.pdf</a> + [<a href="https://github.com/ARM-software/abi-aa/releases/download/2023Q3/aaelf64.pdf">original</a>] + </li> + <li class="content sysv arm"> + <a style="color:black;" href="/pub/abi/arm/aapcs64.pdf">abi/arm/aapcs64.pdf</a> + [<a href="https://github.com/ARM-software/abi-aa/releases/download/2023Q3/aapcs64.pdf">original</a>] + </li> + <li class="content x86"> + <a style="color:black;" href="/pub/arch/intel/intel64-optimization-ref-vol1.pdf">arch/intel/intel64-optimization-ref-vol1.pdf</a> + [<a href="https://cdrdv2.intel.com/v1/dl/getContent/671488">original</a>] + </li> + <li class="content x86"> + <a style="color:black;" href="/pub/arch/intel/intel64-optimization-ref-vol2.pdf">arch/intel/intel64-optimization-ref-vol2.pdf</a> + [<a href="https://cdrdv2.intel.com/v1/dl/getContent/787036">original</a>] + </li> + <li class="content x86"> + <a style="color:black;" href="/pub/arch/intel/intel64-vol1-architecture-manual.pdf">arch/intel/intel64-vol1-architecture-manual.pdf</a> + [<a href="https://cdrdv2.intel.com/v1/dl/getContent/671436">original</a>] + </li> + <li class="content x86"> + <a style="color:black;" href="/pub/arch/intel/intel64-vol2-instruction-ref.pdf">arch/intel/intel64-vol2-instruction-ref.pdf</a> + [<a href="https://cdrdv2.intel.com/v1/dl/getContent/671110">original</a>] + </li> + <li class="content x86"> + <a style="color:black;" href="/pub/arch/intel/intel64-vol3-system-programming.pdf">arch/intel/intel64-vol3-system-programming.pdf</a> + [<a href="https://cdrdv2.intel.com/v1/dl/getContent/671447">original</a>] + </li> + </ul> +</body> +</html> diff --git a/roles/webserver/files/www/memzero/robots.txt b/roles/webserver/files/www/memzero/robots.txt new file mode 100644 index 0000000..44b0e56 --- /dev/null +++ b/roles/webserver/files/www/memzero/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /pub/ |