From bfea8d3e3209fb6fdabbeb428de86257a80b211f Mon Sep 17 00:00:00 2001 From: wurstsalat Date: Mon, 1 Apr 2024 21:56:36 +0200 Subject: [PATCH 1/3] README: Remove obsolete badge and add build instructions --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 96635b5..df2cce1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,13 @@ -[![Docker Build Status](https://img.shields.io/docker/build/xmppxsf/xep-attic.svg)](https://hub.docker.com/r/xmppxsf/xep-attic/) - # xep-attic -Archive of old XEP versions, as published on [www.xmpp.org/extensions/attic/](https://www.xmpp.org/extensions/attic/) + +Archive of old XEP versions, as published on [xmpp.org/extensions/attic/](https://xmpp.org/extensions/attic/) + +## Building + +```shell +sudo docker build -t xep-attic:latest . +``` + +```shell +sudo docker run -t -p 80:80 xep-attic:latest +``` From c38de917c09fd894979afbaf52f8b23d965de637 Mon Sep 17 00:00:00 2001 From: wurstsalat Date: Mon, 1 Apr 2024 21:56:57 +0200 Subject: [PATCH 2/3] Dockerfile: Update deprecated MAINTAINER property --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 86c9792..d185023 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Docker image that serves static content via NGINX, with autoindex enabled. FROM nginx:alpine -MAINTAINER XSF Editors +LABEL org.opencontainers.image.authors="editor@xmpp.org" COPY deploy/nginx.vh.default.conf /etc/nginx/conf.d/default.conf COPY content /usr/share/nginx/html RUN rm /usr/share/nginx/html/index.html From 73e6d4d5ea3d622caf6fe65d2ca45283be5790d1 Mon Sep 17 00:00:00 2001 From: wurstsalat Date: Mon, 1 Apr 2024 21:57:27 +0200 Subject: [PATCH 3/3] Add Attic disclaimer --- content/attic.css | 12 ++++++++++++ content/attic.js | 23 +++++++++++++++++++++++ deploy/nginx.vh.default.conf | 3 +++ 3 files changed, 38 insertions(+) create mode 100644 content/attic.css create mode 100644 content/attic.js diff --git a/content/attic.css b/content/attic.css new file mode 100644 index 0000000..b7c3212 --- /dev/null +++ b/content/attic.css @@ -0,0 +1,12 @@ +#attic_notice { + position: fixed; + top: 0; + left: 0; + width: 100%; + margin: 0; + padding: 1em; + opacity: 0.95; + background-color: #ff8f2c; + color: #282828; + font-family: sans-serif; +} diff --git a/content/attic.js b/content/attic.js new file mode 100644 index 0000000..f695c3f --- /dev/null +++ b/content/attic.js @@ -0,0 +1,23 @@ +document.addEventListener("DOMContentLoaded", function () { + const notice = document.createElement("div"); + notice.id = "attic_notice"; + document.getElementsByTagName("body")[0].prepend(notice); + + const noticeText = document.createElement("strong"); + const link = document.createElement("a"); + notice.append(noticeText); + notice.append(link); + + if (window.location.pathname === "/extensions/attic/") { + noticeText.innerHTML = "Beware: You are browsing archived versions of XEPs. "; + link.innerText = "Browse latest versions"; + link.href = `${window.location.protocol}//${window.location.host}/extensions/` + } else { + noticeText.innerHTML = + "Beware: The content that is displayed here is an archived version of the document, that has been updated. "; + + const xepNumber = window.location.pathname.match(/\d{4}/)[0]; + link.innerText = "View latest version"; + link.href = `${window.location.protocol}//${window.location.host}/extensions/xep-${xepNumber}.html`; + } +}); diff --git a/deploy/nginx.vh.default.conf b/deploy/nginx.vh.default.conf index dd14928..fdcc957 100644 --- a/deploy/nginx.vh.default.conf +++ b/deploy/nginx.vh.default.conf @@ -8,6 +8,9 @@ server { location / { autoindex on; root /usr/share/nginx/html; + proxy_set_header Accept-Encoding ""; + sub_filter '' ''; + sub_filter_once on; #index index.html index.htm; }