From 9d72d55d2bad4d621c6361008e9933d3ab52c0f4 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse <guillaume.rousse@renater.fr> Date: Mon, 3 Feb 2025 16:49:41 +0100 Subject: [PATCH] use CDN for all third-party content --- conf/manager.conf | 1 + lib/AccessCheck/App.pm | 1 + public/css/renater.css | 10 +++++----- templates/web/edugain/index.html.tt2 | 12 ++++++------ templates/web/renater/index.html.tt2 | 16 ++++++++-------- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/conf/manager.conf b/conf/manager.conf index 292af27..3563567 100644 --- a/conf/manager.conf +++ b/conf/manager.conf @@ -3,6 +3,7 @@ support_email = support@my.fqdn name = eduGAIN Access Check url = https://access-check.my.fqdn login_url = https://access-check.my.fqdn/Shibboleth.sso/Login +cdn_url = https://cdn.renater.fr [setup] # templates theme diff --git a/lib/AccessCheck/App.pm b/lib/AccessCheck/App.pm index 284c432..95237ae 100644 --- a/lib/AccessCheck/App.pm +++ b/lib/AccessCheck/App.pm @@ -79,6 +79,7 @@ sub startup { support_email => $config->{app}->{support_email}, login_url => $config->{app}->{login_url}, logout_url => $config->{app}->{logout_url}, + cdn_url => $config->{app}->{cdn_url}, name => $config->{app}->{name}, version => ACCESSCHECK_VERSION }, diff --git a/public/css/renater.css b/public/css/renater.css index aa8a251..7c36a34 100644 --- a/public/css/renater.css +++ b/public/css/renater.css @@ -892,16 +892,16 @@ footer aside *{ font-family: "foobar_proregular"; font-style: normal; font-weight: normal; - src: url("../font/foobar/foobar_pro-regular-webfont.woff") format("woff"), - url("../font/foobar/foobar_pro-regular-webfont.ttf") format("truetype"); + src: url("https://cdn.renater.fr/fonts/foobar/foobar_pro-regular-webfont.woff") format("woff"), + url("https://cdn.renater.fr/fonts/foobar/foobar_pro-regular-webfont.ttf") format("truetype"); } /* Webfont: Lato-Regular */ @font-face { font-family: 'LatoWeb'; - src: url('../font/Lato/Lato-Regular.woff2') format('woff2'), /* Modern Browsers */ - url('../font/Lato/Lato-Regular.woff') format('woff'), /* Modern Browsers */ - url('../font/Lato/Lato-Regular.ttf') format('truetype'); + src: url('https://cdn.renater.fr/fonts/lato/Lato-Regular.woff2') format('woff2'), /* Modern Browsers */ + url('https://cdn.renater.fr/fonts/lato/Lato-Regular.woff') format('woff'), /* Modern Browsers */ + url('https://cdn.renater.fr/fonts/lato/Lato-Regular.ttf') format('truetype'); font-style: normal; font-weight: normal; text-rendering: optimizeLegibility; diff --git a/templates/web/edugain/index.html.tt2 b/templates/web/edugain/index.html.tt2 index a72ff22..f94b940 100644 --- a/templates/web/edugain/index.html.tt2 +++ b/templates/web/edugain/index.html.tt2 @@ -7,17 +7,17 @@ <link type="image/png" rel="icon" href="/images/favicon.png"/> - <link type="text/css" rel="stylesheet" href="/font-awesome/css/font-awesome.min.css" /> - <link type="text/css" rel="stylesheet" href="/foundation/css/foundation.min.css"/> - <link type="text/css" rel="stylesheet" href="/jquery-ui-1.12.1/jquery-ui.min.css"/> + <link type="text/css" rel="stylesheet" href="[% app.cdn_url %]/libs/font-awesome/6.5.2/css/all.min.css" /> + <link type="text/css" rel="stylesheet" href="[% app.cdn_url %]/libs/foundation/6.8.1/css/foundation.min.css"> + <link type="text/css" rel="stylesheet" href="[% app.cdn_url %]/libs/jquery-ui/1.13.3/jquery-ui.min.css" /> <link type="text/css" rel="stylesheet" href="/css/style.css"/> <link type="text/css" rel="stylesheet" href="/css/edugain.css" /> <link type="text/css" rel="stylesheet" href="/css/edugain-menu-min-600.css" media="(min-width: 800px)" /> <link type="text/css" rel="stylesheet" href="/css/edugain-min-800.css" media="(min-width: 800px)" /> - <script src="/jquery-3.3.1.min.js"></script> - <script src="/jquery-ui-1.12.1/jquery-ui.min.js"></script> - <script src="/jquery-validation-1.17.0.min.js"></script> + <script src="[% app.cdn_url %]/libs/jquery/3.7.1/jquery.min.js"></script> + <script src="[% app.cdn_url %]/libs/jquery-ui/1.13.3/jquery-ui.min.js"></script> + <script src="[% app.cdn_url %]/libs/jquery-validation/1.19.5/jquery.validate.min.js"></script> <title>[% app.name %]</title> </head> diff --git a/templates/web/renater/index.html.tt2 b/templates/web/renater/index.html.tt2 index 2667efb..75f3942 100644 --- a/templates/web/renater/index.html.tt2 +++ b/templates/web/renater/index.html.tt2 @@ -6,17 +6,17 @@ <link type="image/png" rel="icon" href="/images/favicon-federation.png" /> - <link type="text/css" rel="stylesheet" href="/font-awesome/css/font-awesome.min.css" /> - <link type="text/css" rel="stylesheet" href="/foundation/css/foundation.min.css"> - <link type="text/css" rel="stylesheet" href="/jquery-ui-1.12.1/jquery-ui.min.css" /> + <link type="text/css" rel="stylesheet" href="[% app.cdn_url %]/libs/font-awesome/6.5.2/css/all.min.css" /> + <link type="text/css" rel="stylesheet" href="[% app.cdn_url %]/libs/foundation/6.8.1/css/foundation.min.css"> + <link type="text/css" rel="stylesheet" href="[% app.cdn_url %]/libs/jquery-ui/1.13.3/jquery-ui.min.css" /> <link type="text/css" rel="stylesheet" href="/css/style.css" /> <link type="text/css" rel="stylesheet" href="/css/renater.css" /> - <script src="/jquery-3.3.1.min.js"></script> - <script src="/jquery-ui-1.12.1/jquery-ui.min.js"></script> - <script src="/jquery-validation-1.17.0.min.js"></script> - <script src="/foundation/js/vendor/what-input.js"></script> - <script src="/foundation/js/vendor/foundation.min.js"></script> + <script src="[% app.cdn_url %]/libs/jquery/3.7.1/jquery.min.js"></script> + <script src="[% app.cdn_url %]/libs/jquery-ui/1.13.3/jquery-ui.min.js"></script> + <script src="[% app.cdn_url %]/libs/jquery-validation/1.19.5/jquery.validate.min.js"></script> + <script src="[% app.cdn_url %]/libs/foundation/6.8.1/js/vendor/what-input.js"></script> + <script src="[% app.cdn_url %]/libs/foundation/6.8.1/js/vendor/foundation.min.js"></script> <script src="/js/startup.js"></script> <title>[% app.name %]</title> -- GitLab