From 1f57c5d52d8d4058e03964f121fdd7e14618a7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Paksy?= Date: Tue, 24 Dec 2024 08:25:11 +0100 Subject: [PATCH 1/2] HBASE-28832 Upgrade from bootstrap 3.4.1 to non vulnerable version 5.3.3 (#6490) First we upgraded to Bootstrap v4 - this was the majority of the changes - and then I upgraded to Bootstrap 5.3.3 - which is the latest non-vulnerable version according to https://security.snyk.io/package/npm/bootstrap/3.4.1 Changes were based on the migration documentation: - https://getbootstrap.com/docs/4.6/migration/ - https://getbootstrap.com/docs/5.3/migration/ Most of the changes are related to navbar-s, tabs and forms. The new Bootstrap look has a bit bigger font sizes but it is still OK in my opinion. Bootstrap v5 is not requiring JQuery anymore but we have some JQuery plugins (jquery.tablesorter.min.js, tab.js) which still need it so I left JQuery in. - Removed bootstrap-theme.min.css and Glyphicons icon font because these are not present anymore in newer Bootstrap versions. - Upgraded checked in Bootstrap CSS and JS files to v4. - Moved some inline CSS styles to hbase.css file (DRY). - The page-header class was dropped in Bootstrap v4 so added page-header small grey color to hbase.css. - Removed some unused imports in JSP files. - Improved the styling of the Log Level form - Replaced hbase_logo_small.png under thrift module with the hbase-server one. Reason: to make sure that they are the same size (this under thrift was smaller). - Upgraded checked in Bootstrap CSS and JS files to v5. - Migrated navbars for v5: - Navbars now require a container within (to drastically simplify spacing requirements and CSS required). - The .active class can no longer be applied to .nav-items, it must be applied directly on .nav-links. - Migrated data attributes. Data attributes for all Bootstrap JavaScript plugins are now namespaced to help distinguish Bootstrap functionality from third parties and your own code. For example, we use data-bs-toggle instead of data-toggle. - form-inline was dropped in v5, so inline forms had to be styled with grid and utilities instead. - Added the favicon of the HBase website to the web UI pages. Signed-off-by: Nick Dimiduk Signed-off-by: Nihal Jain (cherry picked from commit 744ce131b630fee347c173febd9dafba70758d79) --- NOTICE.txt | 14 +- .../hadoop/hbase/http/log/LogLevel.java | 41 +- .../src/main/resources/META-INF/NOTICE.vm | 14 +- .../resources/hbase-webapps/rest/footer.jsp | 4 +- .../resources/hbase-webapps/rest/header.jsp | 52 +- .../hbase-webapps/rest/processRest.jsp | 18 +- .../resources/hbase-webapps/rest/rest.jsp | 2 +- .../hbase/tmpl/common/TaskMonitorTmpl.jamon | 36 +- .../hbase/tmpl/master/MasterStatusTmpl.jamon | 205 ++-- .../hbase/tmpl/master/RSGroupListTmpl.jamon | 24 +- .../tmpl/master/RegionServerListTmpl.jamon | 42 +- .../tmpl/regionserver/BlockCacheTmpl.jamon | 24 +- .../tmpl/regionserver/RSStatusTmpl.jamon | 75 +- .../tmpl/regionserver/RegionListTmpl.jamon | 24 +- .../regionserver/ReplicationStatusTmpl.jamon | 12 +- .../tmpl/regionserver/ServerMetricsTmpl.jamon | 32 +- .../hbase/tmpl/tool/CanaryStatusTmpl.jamon | 20 +- .../resources/hbase-webapps/master/footer.jsp | 4 +- .../resources/hbase-webapps/master/header.jsp | 91 +- .../hbase-webapps/master/operationDetails.jsp | 17 +- .../hbase-webapps/master/processMaster.jsp | 16 +- .../resources/hbase-webapps/master/quotas.jsp | 10 +- .../hbase-webapps/master/rsgroup.jsp | 34 +- .../hbase-webapps/master/startupProgress.jsp | 1 + .../resources/hbase-webapps/master/table.jsp | 1038 +++++++++-------- .../hbase-webapps/regionserver/footer.jsp | 4 +- .../hbase-webapps/regionserver/header.jsp | 77 +- .../hbase-webapps/regionserver/processRS.jsp | 16 +- .../regionserver/rsOperationDetails.jsp | 16 +- .../static/css/bootstrap-theme.min.css | 6 - .../static/css/bootstrap.min.css | 12 +- .../hbase-webapps/static/css/hbase.css | 81 +- .../hbase-webapps/static/favicon.ico | Bin 0 -> 1150 bytes .../fonts/glyphicons-halflings-regular.eot | Bin 20127 -> 0 bytes .../fonts/glyphicons-halflings-regular.svg | 288 ----- .../fonts/glyphicons-halflings-regular.ttf | Bin 45404 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 23424 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff2 | Bin 18028 -> 0 bytes .../hbase-webapps/static/js/bootstrap.min.js | 11 +- .../hbase-webapps/static/js/jqSpager.js | 20 +- .../main/appended-resources/META-INF/NOTICE | 14 +- .../static/css/bootstrap-theme.min.css | 6 - .../static/css/bootstrap.min.css | 12 +- .../hbase-webapps/static/css/hbase.css | 68 +- .../hbase-webapps/static/favicon.ico | Bin 0 -> 1150 bytes .../fonts/glyphicons-halflings-regular.eot | Bin 20127 -> 0 bytes .../fonts/glyphicons-halflings-regular.svg | 288 ----- .../fonts/glyphicons-halflings-regular.ttf | Bin 45404 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 23424 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff2 | Bin 18028 -> 0 bytes .../hbase-webapps/static/hbase_logo_small.png | Bin 1926 -> 3206 bytes .../hbase-webapps/static/js/bootstrap.min.js | 11 +- .../resources/hbase-webapps/thrift/footer.jsp | 4 +- .../resources/hbase-webapps/thrift/header.jsp | 53 +- 54 files changed, 1193 insertions(+), 1644 deletions(-) delete mode 100644 hbase-server/src/main/resources/hbase-webapps/static/css/bootstrap-theme.min.css create mode 100644 hbase-server/src/main/resources/hbase-webapps/static/favicon.ico delete mode 100644 hbase-server/src/main/resources/hbase-webapps/static/fonts/glyphicons-halflings-regular.eot delete mode 100644 hbase-server/src/main/resources/hbase-webapps/static/fonts/glyphicons-halflings-regular.svg delete mode 100644 hbase-server/src/main/resources/hbase-webapps/static/fonts/glyphicons-halflings-regular.ttf delete mode 100644 hbase-server/src/main/resources/hbase-webapps/static/fonts/glyphicons-halflings-regular.woff delete mode 100644 hbase-server/src/main/resources/hbase-webapps/static/fonts/glyphicons-halflings-regular.woff2 delete mode 100644 hbase-thrift/src/main/resources/hbase-webapps/static/css/bootstrap-theme.min.css create mode 100644 hbase-thrift/src/main/resources/hbase-webapps/static/favicon.ico delete mode 100644 hbase-thrift/src/main/resources/hbase-webapps/static/fonts/glyphicons-halflings-regular.eot delete mode 100644 hbase-thrift/src/main/resources/hbase-webapps/static/fonts/glyphicons-halflings-regular.svg delete mode 100644 hbase-thrift/src/main/resources/hbase-webapps/static/fonts/glyphicons-halflings-regular.ttf delete mode 100644 hbase-thrift/src/main/resources/hbase-webapps/static/fonts/glyphicons-halflings-regular.woff delete mode 100644 hbase-thrift/src/main/resources/hbase-webapps/static/fonts/glyphicons-halflings-regular.woff2 diff --git a/NOTICE.txt b/NOTICE.txt index 41ed32c1c691..b48c5475c962 100755 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -23,19 +23,11 @@ relicensed so we could use it as Creative Commons Attribution 3.0. The license is bundled with the download available here: http://www.vectorportal.com/subcategory/205/KILLER-WHALE-FREE-VECTOR.eps/ifile/9136/detailtest.asp -- -This product includes portions of the Bootstrap project v3.0.0 +This product includes portions of the Bootstrap project v5.3.3 -Copyright 2013 Twitter, Inc. +Copyright 2011-2024 The Bootstrap Authors -Licensed under the Apache License v2.0 - -This product uses the Glyphicons Halflings icon set. - -http://glyphicons.com/ - -Copyright Jan Kovařík - -Licensed under the Apache License v2.0 as a part of the Bootstrap project. +Licensed under the MIT license -- This product includes portions of the Guava project v14 and v21, specifically diff --git a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/log/LogLevel.java b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/log/LogLevel.java index 2581d9cbf358..a9e8fa7cbe16 100644 --- a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/log/LogLevel.java +++ b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/log/LogLevel.java @@ -326,7 +326,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) String[] readOnlyLogLevels = conf.getStrings(READONLY_LOGGERS_CONF_KEY); if (logName != null) { - out.println("

Results:

"); + out.println("

Results

"); out.println(MARKER + "Submitted Log Name: " + logName + "
"); Logger log = LoggerFactory.getLogger(logName); @@ -373,23 +373,28 @@ private void sendError(HttpServletResponse response, int code, String message) static final String FORMS = "
\n" + "
\n" + "\n" + "
\n" + "Actions:" + "

" + "

\n" - + "\n" + "\n" + "\n" - + "\n" + "\n" + "\n" + "\n" - + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" - + "\n" + "
\n" - + "\n" + "\n" - + "\n" + "" - + "Get the current log level for the specified log name." + "
\n" - + "\n" + "\n" - + "\n" - + "\n" + "" - + "Set the specified log level for the specified log name." + "
\n" + "
\n" + "

\n" + "
\n"; + + "

Get/Set Log Level

\n" + "
\n" + "\n" + "\n" + "

Actions

\n" + + "\n" + "
\n" + "
\n" + + "
\n" + + "
\n" + + "\n" + "
\n" + + "
\n" + + "\n" + "
\n" + + "
\n" + + "Gets the current log level for the specified log name.\n" + "
\n" + + "
\n" + "
\n" + "
\n" + "\n" + "
\n" + "
\n" + + "\n" + "
\n" + + "
\n" + + "\n" + "
\n" + + "
\n" + + "\n" + + "\n" + "
\n" + + "
\n" + + "Sets the specified log level for the specified log name.\n" + "
\n" + + "
\n" + "\n" + "
\n" + "
" + "
\n"; private static void process(Logger logger, String levelName, PrintWriter out) { if (levelName != null) { diff --git a/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm b/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm index 067ed3d0c66d..8be266c787ef 100644 --- a/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm +++ b/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm @@ -54,19 +54,11 @@ http://www.vectorportal.com/subcategory/205/KILLER-WHALE-FREE-VECTOR.eps/ifile/9 ## For modules that have bootstrap in their source tree #macro(bootstrap_notice) -- -This product includes portions of the Bootstrap project v3.0.0 +This product includes portions of the Bootstrap project v5.3.3 -Copyright 2013 Twitter, Inc. +Copyright 2011-2024 The Bootstrap Authors -Licensed under the Apache License v2.0 - -This product uses the Glyphicons Halflings icon set. - -http://glyphicons.com/ - -Copyright Jan Kovařík - -Licensed under the Apache License v2.0 as a part of the Bootstrap project. +Licensed under the MIT license #end ## no NOTICE file. #macro(findbugs_cleanroom_notice) diff --git a/hbase-rest/src/main/resources/hbase-webapps/rest/footer.jsp b/hbase-rest/src/main/resources/hbase-webapps/rest/footer.jsp index 80ca464aad06..55d8fec75247 100644 --- a/hbase-rest/src/main/resources/hbase-webapps/rest/footer.jsp +++ b/hbase-rest/src/main/resources/hbase-webapps/rest/footer.jsp @@ -23,8 +23,8 @@ diff --git a/hbase-rest/src/main/resources/hbase-webapps/rest/header.jsp b/hbase-rest/src/main/resources/hbase-webapps/rest/header.jsp index cf1ccf8775cf..4d42e8d1d576 100644 --- a/hbase-rest/src/main/resources/hbase-webapps/rest/header.jsp +++ b/hbase-rest/src/main/resources/hbase-webapps/rest/header.jsp @@ -30,44 +30,40 @@ - + - + + + diff --git a/hbase-rest/src/main/resources/hbase-webapps/rest/processRest.jsp b/hbase-rest/src/main/resources/hbase-webapps/rest/processRest.jsp index 2b2d35fbfb3f..a5820de572af 100644 --- a/hbase-rest/src/main/resources/hbase-webapps/rest/processRest.jsp +++ b/hbase-rest/src/main/resources/hbase-webapps/rest/processRest.jsp @@ -105,16 +105,16 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil. <% if (gcBeans.size() == 2) { %>
-