From ffd391f0aa1b4b881408f1edf9e7c131e9a0d185 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 23 2015 09:23:09 +0000 Subject: import cockpit-0.58-2.el7 --- diff --git a/.cockpit.metadata b/.cockpit.metadata index 48409d3..2aae7ae 100644 --- a/.cockpit.metadata +++ b/.cockpit.metadata @@ -1,2 +1 @@ -76dcf298094d7afa724a0a657c186e223089149b SOURCES/branding.tar -caaa0d7c500001dbf54f7c479628fc61d66baf58 SOURCES/cockpit-0.53.tar.bz2 +fcc7398a5f9a7787d272f20969d5cb61a5dce072 SOURCES/cockpit-0.58.tar.bz2 diff --git a/.gitignore b/.gitignore index a4fe7ef..0722740 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/branding.tar -SOURCES/cockpit-0.53.tar.bz2 +SOURCES/cockpit-0.58.tar.bz2 diff --git a/SOURCES/branding-full-logo.patch b/SOURCES/branding-full-logo.patch new file mode 100644 index 0000000..f790394 --- /dev/null +++ b/SOURCES/branding-full-logo.patch @@ -0,0 +1,68 @@ +From 8677e511ef32d143b81b83ebb1f7602612a8bec9 Mon Sep 17 00:00:00 2001 +From: Andreas Nilsson +Date: Mon, 25 May 2015 16:30:12 +0200 +Subject: [PATCH] branding: Look for the full wordmark logos for Fedora and + RHEL + +Instead of just the square logo + +Closes #2343 +Reviewed-by: Stef Walter +--- + branding/fedora/Makefile.am | 2 +- + branding/fedora/branding.css | 4 ++-- + branding/rhel/Makefile.am | 2 +- + branding/rhel/branding.css | 4 ++-- + 4 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/branding/fedora/Makefile.am b/branding/fedora/Makefile.am +index 52f03e8..9735066 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -8530,11 +8530,11 @@ + # Opportunistically use fedora-logos + install-data-hook:: +- $(LN_S) -f /usr/share/pixmaps/fedora-logo-sprite.png $(DESTDIR)$(fedorabrandingdir)/logo.png ++ $(LN_S) -f /usr/share/pixmaps/system-logo-white.png $(DESTDIR)$(fedorabrandingdir)/logo.png + $(LN_S) -f /usr/share/pixmaps/fedora-logo-sprite.png $(DESTDIR)$(fedorabrandingdir)/apple-touch-icon.png + $(LN_S) -f /etc/favicon.png $(DESTDIR)$(fedorabrandingdir)/favicon.ico + + # Opportunistically use redhat-logos ... yes they're called 'fedora' + install-data-hook:: +- $(LN_S) -f /usr/share/pixmaps/fedora-logo-sprite.png $(DESTDIR)$(rhelbrandingdir)/logo.png ++ $(LN_S) -f /usr/share/pixmaps/system-logo-white.png $(DESTDIR)$(rhelbrandingdir)/logo.png + $(LN_S) -f /usr/share/pixmaps/fedora-logo-sprite.png $(DESTDIR)$(rhelbrandingdir)/apple-touch-icon.png + $(LN_S) -f /etc/favicon.png $(DESTDIR)$(rhelbrandingdir)/favicon.ico +diff --git a/branding/fedora/branding.css b/branding/fedora/branding.css +index 96acb6e..0e8fa7d 100644 +--- a/branding/fedora/branding.css ++++ b/branding/fedora/branding.css +@@ -5,8 +5,8 @@ body.login-pf { + } + + #badge { +- width: 64px; +- height: 64px; ++ width: 225px; ++ height: 80px; + background-image: url("/cockpit/static/logo.png"); + background-size: contain; + } +diff --git a/branding/rhel/branding.css b/branding/rhel/branding.css +index 60cd016..5e8434c 100644 +--- a/branding/rhel/branding.css ++++ b/branding/rhel/branding.css +@@ -11,8 +11,8 @@ body.login-pf { + } + + #badge { +- width: 64px; +- height: 64px; ++ width: 225px; ++ height: 80px; + background-image: url("/cockpit/static/logo.png"); + background-size: contain; + } +-- +2.4.1 + diff --git a/SOURCES/chunked-streaming.patch b/SOURCES/chunked-streaming.patch deleted file mode 100644 index ba5b27a..0000000 --- a/SOURCES/chunked-streaming.patch +++ /dev/null @@ -1,302 +0,0 @@ -From f5d7586a12f5313d6301ba96aadaa06d84f2fc21 Mon Sep 17 00:00:00 2001 -From: petervo -Date: Fri, 24 Apr 2015 02:26:24 -0700 -Subject: [PATCH] bridge: Fix bug with streaming chunked data - -Fixes #2170 -Closes #2204 -Signed-off-by: Stef Walter - * Tweak the comments a bit, change order of checks ---- - src/bridge/cockpithttpstream.c | 6 ++ - src/bridge/mock-transport.c | 25 ++++++++ - src/bridge/mock-transport.h | 4 ++ - src/bridge/test-httpstream.c | 132 +++++++++++++++++++++++++++++++++++++++++ - src/bridge/test-packages.c | 30 +--------- - 5 files changed, 170 insertions(+), 27 deletions(-) - -diff --git a/src/bridge/cockpithttpstream.c b/src/bridge/cockpithttpstream.c -index d9ee3df..0e573a9 100644 ---- a/src/bridge/cockpithttpstream.c -+++ b/src/bridge/cockpithttpstream.c -@@ -426,6 +426,12 @@ relay_chunked (CockpitHttpStream *self, - return FALSE; /* want more data */ - - beg = (pos + 2) - data; -+ if (length < beg) -+ { -+ /* have to have a least the ending chars */ -+ return FALSE; /* want more data */ -+ } -+ - size = g_ascii_strtoull (data, &end, 16); - if (pos[1] != '\n' || end != pos) - { -diff --git a/src/bridge/mock-transport.c b/src/bridge/mock-transport.c -index 4ad2b41..8ff0892 100644 ---- a/src/bridge/mock-transport.c -+++ b/src/bridge/mock-transport.c -@@ -194,3 +194,28 @@ mock_transport_count_sent (MockTransport *mock) - { - return mock->count; - } -+ -+GBytes * -+mock_transport_combine_output (MockTransport *transport, -+ const gchar *channel_id, -+ guint *count) -+{ -+ GByteArray *combined; -+ GBytes *block; -+ -+ if (count) -+ *count = 0; -+ -+ combined = g_byte_array_new (); -+ for (;;) -+ { -+ block = mock_transport_pop_channel (transport, channel_id); -+ if (!block) -+ break; -+ -+ g_byte_array_append (combined, g_bytes_get_data (block, NULL), g_bytes_get_size (block)); -+ if (count) -+ (*count)++; -+ } -+ return g_byte_array_free_to_bytes (combined); -+} -diff --git a/src/bridge/mock-transport.h b/src/bridge/mock-transport.h -index 6722870..e824051 100644 ---- a/src/bridge/mock-transport.h -+++ b/src/bridge/mock-transport.h -@@ -49,4 +49,8 @@ JsonObject * mock_transport_pop_control (MockTransport *mock); - GBytes * mock_transport_pop_channel (MockTransport *mock, - const gchar *channel); - -+GBytes * mock_transport_combine_output (MockTransport *transport, -+ const gchar *channel_id, -+ guint *count); -+ - #endif /* MOCK_TRANSPORT_H */ -diff --git a/src/bridge/test-httpstream.c b/src/bridge/test-httpstream.c -index 68b27ae..a4ef436 100644 ---- a/src/bridge/test-httpstream.c -+++ b/src/bridge/test-httpstream.c -@@ -23,6 +23,8 @@ - #include "cockpithttpstream.h" - #include "cockpithttpstream.c" - #include "common/cockpittest.h" -+#include "common/cockpitwebresponse.h" -+#include "common/cockpitwebserver.h" - - #include "mock-transport.h" - #include -@@ -31,6 +33,135 @@ - * Test - */ - -+typedef struct { -+ gchar *problem; -+ gboolean done; -+} TestResult; -+ -+/* -+ * Yes this is a magic number. It's the lowest number that would -+ * trigger a bug where chunked data would be rejected due to an incomplete read. -+ */ -+const gint MAGIC_NUMBER = 3068; -+ -+static gboolean -+handle_chunked (CockpitWebServer *server, -+ const gchar *path, -+ GHashTable *headers, -+ CockpitWebResponse *response, -+ gpointer user_data) -+{ -+ GBytes *bytes; -+ GHashTable *h = g_hash_table_new (g_str_hash, g_str_equal); -+ -+ cockpit_web_response_headers_full (response, 200, -+ "OK", -1, h); -+ bytes = g_bytes_new_take (g_strdup_printf ("%0*d", -+ MAGIC_NUMBER, 0), -+ MAGIC_NUMBER); -+ cockpit_web_response_queue (response, bytes); -+ cockpit_web_response_complete (response); -+ -+ g_bytes_unref (bytes); -+ g_hash_table_unref (h); -+ return TRUE; -+} -+ -+static void -+on_channel_close (CockpitChannel *channel, -+ const gchar *problem, -+ gpointer user_data) -+{ -+ TestResult *tr = user_data; -+ g_assert (tr->done == FALSE); -+ tr->done = TRUE; -+ tr->problem = g_strdup (problem); -+} -+ -+static void -+on_transport_closed (CockpitTransport *transport, -+ const gchar *problem, -+ gpointer user_data) -+{ -+ g_assert_not_reached (); -+} -+ -+static void -+test_http_chunked (void) -+{ -+ MockTransport *transport = NULL; -+ CockpitChannel *channel = NULL; -+ CockpitWebServer *web_server = NULL; -+ JsonObject *options = NULL; -+ JsonObject *headers = NULL; -+ TestResult *tr = g_slice_new (TestResult); -+ -+ GBytes *bytes = NULL; -+ GBytes *data = NULL; -+ -+ const gchar *control; -+ gchar *expected = g_strdup_printf ("{\"status\":200,\"reason\":\"OK\",\"headers\":{}}%0*d", MAGIC_NUMBER, 0); -+ guint count; -+ guint port; -+ -+ web_server = cockpit_web_server_new (0, NULL, -+ NULL, NULL, NULL); -+ g_assert (web_server); -+ port = cockpit_web_server_get_port (web_server); -+ g_signal_connect (web_server, "handle-resource::/", -+ G_CALLBACK (handle_chunked), NULL); -+ -+ transport = mock_transport_new (); -+ g_signal_connect (transport, "closed", G_CALLBACK (on_transport_closed), NULL); -+ -+ options = json_object_new (); -+ json_object_set_int_member (options, "port", port); -+ json_object_set_string_member (options, "payload", "http-stream1"); -+ json_object_set_string_member (options, "method", "GET"); -+ json_object_set_string_member (options, "path", "/"); -+ -+ headers = json_object_new (); -+ json_object_set_string_member (headers, "Pragma", "no-cache"); -+ json_object_set_object_member (options, "headers", headers); -+ -+ channel = g_object_new (COCKPIT_TYPE_HTTP_STREAM, -+ "transport", transport, -+ "id", "444", -+ "options", options, -+ NULL); -+ -+ json_object_unref (options); -+ -+ /* Tell HTTP we have no more data to send */ -+ control = "{\"command\": \"done\", \"channel\": \"444\"}"; -+ bytes = g_bytes_new_static (control, strlen (control)); -+ cockpit_transport_emit_recv (COCKPIT_TRANSPORT (transport), NULL, bytes); -+ g_bytes_unref (bytes); -+ -+ tr->done = FALSE; -+ g_signal_connect (channel, "closed", G_CALLBACK (on_channel_close), tr); -+ -+ while (tr->done == FALSE) -+ g_main_context_iteration (NULL, TRUE); -+ g_assert_cmpstr (tr->problem, ==, NULL); -+ -+ data = mock_transport_combine_output (transport, "444", &count); -+ cockpit_assert_bytes_eq (data, expected, -1); -+ g_assert_cmpuint (count, ==, 2); -+ -+ g_bytes_unref (data); -+ g_free (expected); -+ -+ g_object_unref (transport); -+ g_object_add_weak_pointer (G_OBJECT (channel), (gpointer *)&channel); -+ g_object_unref (channel); -+ g_assert (channel == NULL); -+ g_clear_object (&web_server); -+ -+ g_free (tr->problem); -+ g_slice_free (TestResult, tr); -+} -+ - static void - test_parse_keep_alive (void) - { -@@ -82,6 +213,7 @@ main (int argc, - { - cockpit_test_init (&argc, &argv); - g_test_add_func ("/http-stream/parse_keepalive", test_parse_keep_alive); -+ g_test_add_func ("/http-stream/http_chunked", test_http_chunked); - - return g_test_run (); - } -diff --git a/src/bridge/test-packages.c b/src/bridge/test-packages.c -index 09596b9..dbfb6d6 100644 ---- a/src/bridge/test-packages.c -+++ b/src/bridge/test-packages.c -@@ -146,30 +146,6 @@ teardown (TestCase *tc, - cockpit_bridge_data_dirs = NULL; - } - --static GBytes * --combine_output (TestCase *tc, -- guint *count) --{ -- GByteArray *combined; -- GBytes *block; -- -- if (count) -- *count = 0; -- -- combined = g_byte_array_new (); -- for (;;) -- { -- block = mock_transport_pop_channel (tc->transport, "444"); -- if (!block) -- break; -- -- g_byte_array_append (combined, g_bytes_get_data (block, NULL), g_bytes_get_size (block)); -- if (count) -- (*count)++; -- } -- return g_byte_array_free_to_bytes (combined); --} -- - static const Fixture fixture_simple = { - .path = "/test/sub/file.ext", - }; -@@ -187,7 +163,7 @@ test_simple (TestCase *tc, - g_main_context_iteration (NULL, TRUE); - g_assert_cmpstr (tc->problem, ==, NULL); - -- data = combine_output (tc, &count); -+ data = mock_transport_combine_output (tc->transport, "444", &count); - cockpit_assert_bytes_eq (data, "{\"status\":200,\"reason\":\"OK\",\"headers\":{}}" - "These are the contents of file.ext\nOh marmalaaade\n", -1); - g_assert_cmpuint (count, ==, 2); -@@ -220,7 +196,7 @@ test_large (TestCase *tc, - &contents, &length, &error); - g_assert_no_error (error); - -- data = combine_output (tc, &count); -+ data = mock_transport_combine_output (tc->transport, "444", &count); - - /* Should not have been sent as one block */ - g_assert_cmpuint (count, ==, 8); -@@ -442,7 +418,7 @@ test_list_bad_name (TestCase *tc, - g_main_context_iteration (NULL, TRUE); - g_assert_cmpstr (tc->problem, ==, NULL); - -- data = combine_output (tc, &count); -+ data = mock_transport_combine_output (tc->transport, "444", &count); - cockpit_assert_bytes_eq (data, "{\"status\":200,\"reason\":\"OK\",\"headers\":" - "{\"Content-Type\":\"application/json\"}}" - "{\"ok\":{}}", -1); --- -2.3.5 - diff --git a/SPECS/cockpit.spec b/SPECS/cockpit.spec index 43065b1..e77606a 100644 --- a/SPECS/cockpit.spec +++ b/SPECS/cockpit.spec @@ -2,19 +2,17 @@ # * gitcommit xxxx # * selinux 1 -%define branding default +%define branding auto # Our SELinux policy gets built in tests and f21 and lower %if %{defined gitcommit} %define extra_flags CFLAGS='-O2 -Wall -Werror -fPIC' %define selinux 1 +%define branding default %endif %if 0%{?fedora} > 0 && 0%{?fedora} <= 21 %define selinux 1 %endif -%if 0%{?fedora} > 0 && 0%{?fedora} <= 23 -%define branding fedora -%endif %if 0%{?rhel} %define selinux 1 %endif @@ -28,9 +26,9 @@ Name: cockpit %if %{defined gitcommit} Version: %{gitcommit} %else -Version: 0.53 +Version: 0.58 %endif -Release: 3%{?dist} +Release: 2%{?dist} Summary: A user interface for Linux servers License: LGPLv2+ @@ -42,8 +40,7 @@ Source0: cockpit-%{version}.tar.gz Source0: https://github.com/cockpit-project/cockpit/releases/download/%{version}/cockpit-%{version}.tar.bz2 %endif Source1: cockpit.pam -Source2: branding.tar -Patch0: chunked-streaming.patch +Patch10: branding-full-logo.patch BuildRequires: pkgconfig(gio-unix-2.0) BuildRequires: pkgconfig(json-glib-1.0) @@ -136,6 +133,7 @@ Requires: %{name}-bridge = %{version}-%{release} Requires: NetworkManager Requires: shadow-utils Requires: grep +Requires: libpwquality Requires: /usr/bin/date Requires: mdadm Requires: lvm2 @@ -147,6 +145,7 @@ Requires: subscription-manager >= 1.13 %ifarch x86_64 armv7hl Provides: %{name}-docker = %{version}-%{release} Requires: docker +Provides: %{name}-kubernetes = %{version}-%{release} %endif %endif Provides: %{name}-assets @@ -170,10 +169,7 @@ The Cockpit Web Service listens on the network, and authenticates users. %prep %setup -q -%patch0 -p1 -tar -C branding -xf %{SOURCE2} -rm -rf branding/default -mv branding/rhel branding/default +%patch10 -p 1 %if 0%{?fedora} == 20 sed -i s/unconfined_service_t/unconfined_t/g src/ws/test-server.service.in %endif @@ -247,12 +243,6 @@ touch kubernetes.list sed -i "s|%{buildroot}||" *.list -# Build the package lists for debug package, and move debug files to installed locations -find %{buildroot}/debug%{_datadir}/%{name} -type f -o -type l > debug.list -sed -i "s|%{buildroot}/debug||" debug.list -tar -C %{buildroot}/debug -cf - . | tar -C %{buildroot} -xf - -rm -rf %{buildroot}/debug - %if 0%{?rhel} # On RHEL subscriptions and docker are part of the shell package cat subscriptions.list docker.list >> shell.list @@ -260,8 +250,17 @@ cat subscriptions.list docker.list >> shell.list # The dashboard is not ready for RHEL sed -i '/dashboard\/manifest.json/d' shell.list rm %{buildroot}%{_datadir}/%{name}/dashboard/manifest.json + +# Kubernetes is not ready for RHEL +rm -rf %{buildroot}%{_datadir}/%{name}/kubernetes %endif +# Build the package lists for debug package, and move debug files to installed locations +find %{buildroot}/debug%{_datadir}/%{name} -type f -o -type l > debug.list +sed -i "s|%{buildroot}/debug||" debug.list +tar -C %{buildroot}/debug -cf - . | tar -C %{buildroot} -xf - +rm -rf %{buildroot}/debug + # Redefine how debug info is built to slip in our extra debug files %define __debug_install_post \ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}" \ @@ -299,10 +298,15 @@ rm %{buildroot}%{_datadir}/%{name}/dashboard/manifest.json %files pcp %{_libexecdir}/cockpit-pcp +/var/lib/pcp/config/pmlogconf/tools/cockpit %post pcp # HACK - https://bugzilla.redhat.com/show_bug.cgi?id=1185749 ( cd /var/lib/pcp/pmns && ./Rebuild -du ) +# HACK - https://bugzilla.redhat.com/show_bug.cgi?id=1185764 +# We can't use "systemctl reload-or-try-restart" since systemctl might +# be out of sync with reality. +/usr/share/pcp/lib/pmlogger reload %files shell -f shell.list @@ -320,6 +324,7 @@ rm %{buildroot}%{_datadir}/%{name}/dashboard/manifest.json %attr(4750, root, cockpit-ws) %{_libexecdir}/cockpit-session %attr(775, -, wheel) %{_sharedstatedir}/%{name} %{_datadir}/%{name}/static +%{_datadir}/%{name}/branding %pre ws getent group cockpit-ws >/dev/null || groupadd -r cockpit-ws @@ -365,13 +370,11 @@ This package is not yet complete. %endif -%endif - %ifarch x86_64 %package kubernetes Summary: Cockpit user interface for Kubernetes cluster -Requires: kubernetes +Requires: kubernetes >= 0.16.2 %description kubernetes The Cockpit components for visualizing and configuring a Kubernetes @@ -381,6 +384,8 @@ cluster. Installed on the Kubernetes master. This package is not yet complete. %endif +%endif + %if %{defined gitcommit} %package test-assets @@ -437,6 +442,22 @@ fi %endif %changelog +* Mon May 25 2015 Stef Walter - 0.58-2 +- Fix choice of logo for RHEL and Fedora branding + +* Fri May 22 2015 Stef Walter - 0.58-1 +- Update to 0.58 release rhbz#1223543 +- Fix up wording in branding rhbz#1223362 + +* Wed May 20 2015 Stef Walter - 0.53-6 +- The kubernetes code is not ready for RHEL + +* Wed May 20 2015 Stef Walter - 0.53-5 +- Fix further branding issues rhbz#1223362 + +* Wed May 20 2015 Stef Walter - 0.53-4 +- Remove "Not ready for use on production servers." rhbz#1223362 + * Fri Apr 24 2015 Stef Walter - 0.53-3 - Fix intermittent issue loading packages, that prevents login