diff mbox series

[bug#69783] hydra: nginx: Adjust to website themes in guix-artwork.

Message ID 20240317202531.21599-2-pelzflorian@pelzflorian.de
State New
Headers show
Series [bug#69783] hydra: nginx: Adjust to website themes in guix-artwork. | expand

Commit Message

pelzflorian (Florian Pelz) March 17, 2024, 8:21 p.m. UTC
* hydra/modules/sysadmin/nginx.scm (guix.gnu.org-redirect-locations):
Redirect /static to the new /themes location to fix the 1.4.0 manual.
(guix.gnu.org-other-locations): Adjust to fonts being in /themes now.
Use /static cache settings for /themes as well.
* hydra/nginx/berlin.scm: Use /static cache settings for /themes.
---
 hydra/modules/sysadmin/nginx.scm | 27 +++++++++++++++++++++++----
 hydra/nginx/berlin.scm           | 10 ++++++++++
 2 files changed, 33 insertions(+), 4 deletions(-)


base-commit: e16552ce47aca34dc8597787f1c3f19d7580eb9b
diff mbox series

Patch

diff --git a/hydra/modules/sysadmin/nginx.scm b/hydra/modules/sysadmin/nginx.scm
index 59d5856..14d8461 100644
--- a/hydra/modules/sysadmin/nginx.scm
+++ b/hydra/modules/sysadmin/nginx.scm
@@ -2,7 +2,7 @@ 
 ;; Copyright © 2016-2024 Ludovic Courtès <ludo@gnu.org>
 ;; Copyright © 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
 ;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
-;; Copyright © 2020, 2021 Florian Pelz <pelzflorian@pelzflorian.de>
+;; Copyright © 2020, 2021, 2024 Florian Pelz <pelzflorian@pelzflorian.de>
 ;; Copyright © 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
 ;; Released under the GNU GPLv3 or any later version.
@@ -317,6 +317,20 @@  synonymous IETF language tags that should be mapped to the same $lang."
    (redirect "/manual/en/html_node/Installing-GuixSD-in-a-VM.html" "Installing-Guix-in-a-VM.html")
    (redirect "/manual/en/html_node/Running-GuixSD-in-a-VM.html"
              "Running-Guix-in-a-VM.html")
+   ;; URLs used by the manual for Guix 1.4.0.
+   ;; XXX: Remove after the next release.
+   (redirect "/static/base/css/elements.css" "/themes/initial/css/elements.css")
+   (redirect "/static/base/css/common.css" "/themes/initial/css/common.css")
+   (redirect "/static/base/css/messages.css" "/themes/initial/css/messages.css")
+   (redirect "/static/base/css/navbar.css" "/themes/initial/css/navbar.css")
+   (redirect "/static/base/css/breadcrumbs.css" "/themes/initial/css/breadcrumbs.css")
+   (redirect "/static/base/css/buttons.css" "/themes/initial/css/buttons.css")
+   (redirect "/static/base/css/footer.css" "/themes/initial/css/footer.css")
+   (redirect "/static/base/css/page.css" "/themes/initial/css/page.css")
+   (redirect "/static/base/css/post.css" "/themes/initial/css/post.css")
+   (redirect "/static/base/css/manual.css" "/themes/initial/css/manual.css")
+   (redirect "/static/base/css/code.css" "/themes/initial/css/code.css")
+   (redirect "/static/base/img/language-picker.svg" "/themes/initial/img/language-picker.svg")
    ;; Old URLs not ending in a slash like https://guix.gnu.org/graphics.
    (redirect "/about" "/$lang/about/")
    (redirect "/blog" "/$lang/blog/")
@@ -664,14 +678,14 @@  synonymous IETF language tags that should be mapped to the same $lang."
     (uri "^~ /cuirass/releases")
     (body (list "alias /srv/cuirass-releases;")))
 
-   ;; Let browsers cache files under /static for a while.
+   ;; Let browsers cache files under /themes for a while.
 
    (nginx-location-configuration
-    (uri "/static/base/fonts")
+    (uri "/themes/initial/fonts")
     (body (list "expires 30d;"                    ;fonts never change
                 "gzip on;"
                 "gzip_types *;"
-                "alias /srv/guix.gnu.org/static/base/fonts;")))
+                "alias /srv/guix.gnu.org/themes/initial/fonts;")))
 
    ;; XXX: This is really a hack to work around the fact that we can't have
    ;; 'If-Modified-Since' because timestamps are zeroed.
@@ -680,6 +694,11 @@  synonymous IETF language tags that should be mapped to the same $lang."
     (body (list "expires 1d;"
                 "alias /srv/guix.gnu.org/static;")))
 
+   (nginx-location-configuration
+    (uri "/themes") ;like "/static" above
+    (body (list "expires 1d;"
+                "alias /srv/guix.gnu.org/themes;")))
+
    ;; These rules take precedence over the '.pdf' and '.html' rules below.
    (nginx-location-configuration
     (uri "~ /manual/devel(|/.*)$")
diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm
index 5ba15d1..2f8cd60 100644
--- a/hydra/nginx/berlin.scm
+++ b/hydra/nginx/berlin.scm
@@ -174,6 +174,16 @@  PUBLISH-URL."
               "proxy_cache_valid any 10m;"
               "proxy_ignore_client_abort on;")))
 
+           (nginx-location-configuration
+            (uri "/themes") ;like "/static" above
+            (body
+             (list
+              "proxy_pass http://localhost:8081;"
+              "proxy_cache static;"
+              "proxy_cache_valid 200 2d;"
+              "proxy_cache_valid any 10m;"
+              "proxy_ignore_client_abort on;")))
+
            (nginx-location-configuration
             (uri "/download")                     ;Cuirass "build products"
             (body