import pcs-0.12.0~b1-2.el10

i10cs changed/i10cs/pcs-0.12.0%7eb1-2.el10
MSVSphere Packaging Team 2 months ago
parent 3b6f4c0599
commit 3ef40a9042
Signed by: sys_gitsync
GPG Key ID: B2B0B9F29E528FE8

4
.gitignore vendored

@ -6,8 +6,8 @@ SOURCES/ethon-0.16.0.gem
SOURCES/ffi-1.17.0.gem
SOURCES/mustermann-3.0.3.gem
SOURCES/nio4r-2.7.4.gem
SOURCES/pcs-0.12.0b1.tar.gz
SOURCES/pcs-web-ui-0.1.21.tar.gz
SOURCES/pcs-1353dfbb3af82d77f4de17a3fa4cbde185bb2b2d.tar.gz
SOURCES/pcs-web-ui-34372d1268f065ed186546f55216aaa2d7e76b54.tar.gz
SOURCES/pcs-web-ui-node-modules-0.1.21.tar.xz
SOURCES/puma-6.4.3.gem
SOURCES/pyagentx-0.4.pcs.2.tar.gz

@ -6,8 +6,8 @@ ea3a591bdfa93655d8eec9d7bdd7fb87ecb5616a SOURCES/base64-0.2.0.gem
8edfdd7cc314b5dc84851ea05b6fceedadf386a1 SOURCES/ffi-1.17.0.gem
249a573022dde130372f0ebbeaf2430f36c2b664 SOURCES/mustermann-3.0.3.gem
34b5b1cb50f18d6ec6c5d5cbcb823e7f81f54290 SOURCES/nio4r-2.7.4.gem
188cea0a72ea4804e277c8a7fdbed02a9d28808e SOURCES/pcs-0.12.0b1.tar.gz
a0d519196474b8768129569ba14b459cf4732945 SOURCES/pcs-web-ui-0.1.21.tar.gz
09a122796456f783476deb0cf27d3934d7fcf424 SOURCES/pcs-1353dfbb3af82d77f4de17a3fa4cbde185bb2b2d.tar.gz
e6f16c816ed78545b64f4072d8156e98c41c9d9c SOURCES/pcs-web-ui-34372d1268f065ed186546f55216aaa2d7e76b54.tar.gz
73838169577c2ec6c1dae9bf6b0c371cc7c12020 SOURCES/pcs-web-ui-node-modules-0.1.21.tar.xz
f72357acbdcfd68b4b41a999ed47926c0e54ea5e SOURCES/puma-6.4.3.gem
3176b2f2b332c2b6bf79fe882e83feecf3d3f011 SOURCES/pyagentx-0.4.pcs.2.tar.gz

@ -0,0 +1,146 @@
From 6e7fa90fc265063b65e3192ed513d0a52b000a2c Mon Sep 17 00:00:00 2001
From: Ivan Devat <idevat@redhat.com>
Date: Tue, 5 Nov 2024 16:35:02 +0100
Subject: [PATCH] show info page instead of webui
---
pcs/Makefile.am | 1 +
pcs/daemon/app/webui_info_handler.py | 31 ++++++++++++++++++++++++++++
pcs/daemon/run.py | 4 +++-
pcs_test/smoke.sh.in | 4 ++--
pcsd/public/ui_instructions.html | 26 ++++++++---------------
5 files changed, 46 insertions(+), 20 deletions(-)
create mode 100644 pcs/daemon/app/webui_info_handler.py
diff --git a/pcs/Makefile.am b/pcs/Makefile.am
index 28244dd7..4d4401fa 100644
--- a/pcs/Makefile.am
+++ b/pcs/Makefile.am
@@ -206,6 +206,7 @@ EXTRA_DIST = \
daemon/app/webui/core.py \
daemon/app/webui/session.py \
daemon/app/webui/sinatra_ui.py \
+ daemon/app/webui_info_handler.py \
daemon/async_tasks/__init__.py \
daemon/async_tasks/scheduler.py \
daemon/async_tasks/task.py \
diff --git a/pcs/daemon/app/webui_info_handler.py b/pcs/daemon/app/webui_info_handler.py
new file mode 100644
index 00000000..3ab8275b
--- /dev/null
+++ b/pcs/daemon/app/webui_info_handler.py
@@ -0,0 +1,31 @@
+from pcs.daemon.app.common import (
+ BaseHandler,
+ RoutesType,
+)
+
+
+class _WebuiInfoHandler(BaseHandler):
+ __path = None
+
+ def initialize(self, path):
+ self.__path = path
+
+ def get(self):
+ self.set_status(404)
+ self.render(self.__path)
+
+
+def get_routes(path: str) -> RoutesType:
+ return [
+ # The following two rules can be compressed into one: r"/(ui/?)?".
+ # However, the content of the parentheses used here should be captured
+ # and passed in to the handlers get method as an argument.
+ # Unfortunately, it seems that tornado version 6.4.1 don't pass this
+ # argument (unlike version 6.3.3). Maybe it's a bug (it needs further
+ # inspection). These rules are a safe way to avoid surprises.
+ # Moreover, the captured parameter is irrelevant to the functionality
+ # of the handler.
+ (r"/", _WebuiInfoHandler, dict(path=path)),
+ (r"/ui/?", _WebuiInfoHandler, dict(path=path)),
+ (r"/ui/.*", _WebuiInfoHandler, dict(path=path)),
+ ]
diff --git a/pcs/daemon/run.py b/pcs/daemon/run.py
index b555bc18..10e394eb 100644
--- a/pcs/daemon/run.py
+++ b/pcs/daemon/run.py
@@ -35,6 +35,7 @@ from pcs.daemon.app import capabilities as capabilities_app
from pcs.daemon.app import (
sinatra_remote,
sinatra_ui,
+ webui_info_handler,
)
try:
@@ -141,7 +142,8 @@ def configure_app(
# Even with disabled (standalone) webui the following routes must be
# provided because they can be used via unix socket from cockpit.
routes.extend(
- sinatra_ui.get_routes(auth_provider, ruby_pcsd_wrapper)
+ webui_info_handler.get_routes(webui_fallback)
+ + sinatra_ui.get_routes(auth_provider, ruby_pcsd_wrapper)
)
return Application(
diff --git a/pcs_test/smoke.sh.in b/pcs_test/smoke.sh.in
index fdfe8be2..a9bb8344 100755
--- a/pcs_test/smoke.sh.in
+++ b/pcs_test/smoke.sh.in
@@ -71,10 +71,10 @@ if [ "$webui_http_code_response" = "200" ]; then
curl --insecure --cookie ${cookie_file} --header "X-Requested-With: XMLHttpRequest" --data "hidden[hidden_input]=&config[stonith-enabled]=false" https://localhost:2224/managec/${cluster_name}/update_cluster_settings > "${output_file}"
cat "${output_file}"; echo ""
[ "$(cat ${output_file})" = "Update Successful" ]
-elif [ "$webui_http_code_response" = "401" ]; then
+elif [ "$webui_http_code_response" = "404" ]; then
curl --insecure https://localhost:2224/ui/ > "${output_file}"
cat "${output_file}"; echo ""
- [ "$(cat "${output_file}")" = '{"notauthorized":"true"}' ]
+ grep "HA cluster management has been moved" "${output_file}"
else
echo "Unexpected response from https://localhost:2224/ui/ - http code: '${webui_http_code_response}'"
exit 1
diff --git a/pcsd/public/ui_instructions.html b/pcsd/public/ui_instructions.html
index a120ed3d..5f9214d0 100644
--- a/pcsd/public/ui_instructions.html
+++ b/pcsd/public/ui_instructions.html
@@ -1,27 +1,19 @@
<!DOCTYPE html>
<html>
<head>
- <title>Pcs WebUI instructions</title>
+ <title>HA cluster management has been moved</title>
<meta charset="utf-8" />
</head>
<body>
- <h1>Pcs WebUI instructions</h1>
+ <h1>HA cluster management has been moved</h1>
<p>
- WebUI is not a part of pcs repository but it has its own
- <a href="https://github.com/ClusterLabs/pcs-web-ui">repository</a>.
- </p>
- <p>
- You can clone <a href="https://github.com/ClusterLabs/pcs-web-ui">WebUI repository</a>
- and build the web application into pcs by:
- </p>
- <pre><code>
- $ npm install
- $ npm run build
- $ mv ./build [/path/to/]pcs/pcsd/public/ui
- </code></pre>
- <p>
- For more details, see instructions in
- <a href="https://github.com/ClusterLabs/pcs-web-ui/blob/main/README.md">README.md</a>.
+ Since RHEL 10.0, pcsd web UI is no longer available. Management of high
+ availability clusters has been moved to an add-on for the RHEL web console.
+ The HA Cluster Management add-on can be installed from the cockpit-ha-cluster
+ RPM package or from the RHEL web console. To learn more, please visit:
+ <a href="https://access.redhat.com/solutions/7099451">
+ https://access.redhat.com/solutions/7099451
+ </a>
</p>
</body>
</html>
--
2.47.0

@ -1,6 +1,6 @@
Name: pcs
Version: 0.12.0~b1
Release: 1%{?dist}
Release: 2%{?dist}
# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
# GPL-2.0-only: pcs
@ -20,15 +20,30 @@ ExclusiveArch: x86_64 s390x ppc64le aarch64
# Remove a tilde used by RPM to get the correct upstream version
%global clean_version %(echo %{version} | sed 's/~//')
# When specifying a commit, use its long hash
%global version_or_commit %{clean_version}
# %%global version_or_commit 5b7d498915e0cc876b29fe9ebd709c061ac754db
# To build an official pcs release, comment out branch_or_commit
# Use long commit hash or branch name to build an unreleased version
%global branch_or_commit 1353dfbb3af82d77f4de17a3fa4cbde185bb2b2d
%if "x{?branch_or_commit}" == "x"
%global version_or_commit %{clean_version}
%else
%global version_or_commit %{branch_or_commit}
%endif
%global pcs_source_name %{name}-%{version_or_commit}
# ui_commit can be determined by hash, tag or branch
%global ui_commit 0.1.21
# To build an official pcs-web-ui release, comment out ui_branch_or_commit
# Last tagged version, also used as fallback version for untagged tarballs
%global ui_version 0.1.21
# Use long commit hash or branch name to build an unreleased version
%global ui_branch_or_commit 34372d1268f065ed186546f55216aaa2d7e76b54
%if "x{?ui_branch_or_commit}" == "x"
%global ui_version_or_commit %{ui_version}
%else
%global ui_version_or_commit %{ui_branch_or_commit}
%endif
%global ui_src_name pcs-web-ui-%{ui_version_or_commit}
%global ui_modules_version 0.1.21
%global ui_src_name pcs-web-ui-%{ui_commit}
%global dacite_version 1.8.1
%global pyagentx_version 0.4.pcs.2
@ -68,7 +83,9 @@ ExclusiveArch: x86_64 s390x ppc64le aarch64
%global rubygem_cache_dir %{rubygem_bundle_dir}/cache
%global cockpit_dir %{_datadir}/cockpit/
%global ui_appstream_metainfo org.clusterlabs.cockpit_pcs_web_ui.metainfo.xml
%global metainfo_dir %{_datadir}/metainfo
%global ui_metainfo_name org.clusterlabs.cockpit_pcs_web_ui.metainfo.xml
%global ui_metainfo %{metainfo_dir}/%{ui_metainfo_name}
%global pkg_pcs_snmp pcs-snmp
%global pkg_cockpit_ha_cluster cockpit-ha-cluster
@ -101,13 +118,14 @@ Source73: https://rubygems.org/downloads/rackup-%{version_rubygem_rackup}.gem
Source75: https://rubygems.org/downloads/sinatra-%{version_rubygem_sinatra}.gem
Source76: https://rubygems.org/downloads/tilt-%{version_rubygem_tilt}.gem
Source100: https://github.com/ClusterLabs/pcs-web-ui/archive/%{ui_commit}/%{ui_src_name}.tar.gz
Source101: https://github.com/ClusterLabs/pcs-web-ui/releases/download/%{ui_commit}/pcs-web-ui-node-modules-%{ui_modules_version}.tar.xz
Source100: https://github.com/ClusterLabs/pcs-web-ui/archive/%{ui_version_or_commit}/%{ui_src_name}.tar.gz
Source101: https://github.com/ClusterLabs/pcs-web-ui/releases/download/%{ui_version_or_commit}/pcs-web-ui-node-modules-%{ui_modules_version}.tar.xz
# pcs patches: <= 200
# Patch1: name.patch
Patch1: do-not-support-cluster-setup-with-udp-u-transport.patch
Patch2: show-info-page-instead-of-webui.patch
# ui patches: >200
# Patch201: name-web-ui.patch
@ -274,7 +292,7 @@ SNMP agent that provides information about pacemaker cluster to the master agent
(snmpd).
%description -n %{pkg_cockpit_ha_cluster}
Cockpit application for managing Pacemaker based clusters. Uses
RHEL web console add-on for managing Pacemaker based clusters. Uses
Pacemaker/Corosync Configuration System (pcs) in the background.
@ -322,21 +340,17 @@ update_times_patch(){
# * http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html
# * https://rpm-software-management.github.io/rpm/manual/autosetup.html
# patch web-ui sources
# -q limits verbosity of %setup macro. Only tar -xof is executed instead of tar
# -xvvof. This option has to be used as first.
# This option is used to suppress a listing of all node_modules files that is
# too long and exceeds capacity of CI log
# -n <name> — Set Name of Build Directory
# -T — Do Not Perform Default Archive Unpacking
# -b <n> — Unpack The nth Sources Before Changing Directory
# -a <n> — Unpack The nth Sources After Changing Directory
# -N — disables automatic patch application, use autopatch to apply patches
#
# 1. unpack sources (-b 0)
# 2. then cd into sources tree (the setup macro itself)
# 3. then unpack node_modules into sources tree (-a 1).
%setup -q -T -b 100 -a 101 -n %{ui_src_name}
# patching is handled by applying the individual patches
# %%patch -P201
%autosetup -T -b 100 -a 101 -N -n %{ui_src_name}
%autopatch -p1 -m 201
# update_times_patch %%{PATCH201}
@ -345,6 +359,7 @@ update_times_patch(){
%autopatch -p1 -M 200
# update_times_patch %%{PATCH1}
update_times_patch %{PATCH1}
update_times_patch %{PATCH2}
# generate .tarball-version if building from an untagged commit, not a released version
# autogen uses git-version-gen which uses .tarball-version for generating version number
@ -352,6 +367,10 @@ update_times_patch %{PATCH1}
echo "%{clean_version}+$(echo "%{version_or_commit}" | head -c 8)" > %{_builddir}/%{pcs_source_name}/.tarball-version
%endif
%if "x%{?ui_branch_or_commit}" != "x"
echo "%{ui_version}+$(echo "%{ui_branch_or_commit}" | head -c 8)" > %{_builddir}/%{ui_src_name}/.tarball-version
%endif
# prepare dirs/files necessary for building python bundles
# -----------------------------------------------------
# 1) rubygems sources
@ -399,7 +418,8 @@ cd ../%{ui_src_name}
./autogen.sh
%{configure} \
--disable-standalone \
--with-cockpit-dir=%{cockpit_dir}
--with-cockpit-dir=%{cockpit_dir} \
--with-metainfo-dir=%{metainfo_dir}
make all
@ -411,10 +431,6 @@ pwd
# Install cockpit pcs-web-ui
cd ../%{ui_src_name}
%make_install
# Workaround - metainfo should be installed by make install
mkdir -p %{buildroot}%{_datadir}/metainfo
cp -r %{_builddir}/%{ui_src_name}/packages/app/%{ui_appstream_metainfo} \
%{buildroot}%{_datadir}/metainfo/
# Install pcs
@ -488,7 +504,7 @@ rm -fv %{buildroot}/%{_libdir}/pcsd/vendor/bundle/gems/tilt-*/bin/tilt
%check
# Run validation of cockpit metainfo
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{ui_appstream_metainfo}
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{ui_metainfo_name}
# In the building environment LC_CTYPE is set to C which causes tests to fail
# due to python prints a warning about it to stderr. The following environment
@ -613,7 +629,7 @@ run_all_tests
%exclude %{_libdir}/pcs/pcs_snmp_agent
%exclude %{_libdir}/pcs/%{pcs_bundled_dir}/packages/pyagentx*
%exclude %{_datadir}/cockpit
%exclude %{_datadir}/metainfo/%{ui_appstream_metainfo}
%exclude %{ui_metainfo}
%files -n %{pkg_pcs_snmp}
%{_libdir}/pcs/pcs_snmp_agent
@ -630,10 +646,17 @@ run_all_tests
%files -n %{pkg_cockpit_ha_cluster}
%{cockpit_dir}
%{_datadir}/metainfo/%{ui_appstream_metainfo}
%{ui_metainfo}
%changelog
* Thu Dec 12 2024 Michal Pospíšil <mpospisi@redhat.com> - 0.12.0~b1-2
- Rebased pcs to the latest sources (see CHANGELOG.md)
Resolves: RHEL-7602, RHEL-12709, RHEL-44719
- Rebased HA Cluster Management add-on to the latest sources
- Point users from pcs-web-ui to HA Cluster Management add-on
Resolves: RHEL-68363
* Wed Nov 13 2024 Michal Pospíšil <mpospisi@redhat.com> - 0.12.0~b1-1
- Rebased to the latest sources (see CHANGELOG.md)
Resolves: RHEL-21047, RHEL-33386, RHEL-38483, RHEL-44432, RHEL-48220, RHEL-49520, RHEL-49521, RHEL-49524, RHEL-49527, RHEL-55723, RHEL-61747, RHEL-61889, RHEL-62719

Loading…
Cancel
Save