From patchwork Sun Apr 11 12:01:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo-Andres Hofmann X-Patchwork-Id: 4143 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FJ9Sd1Ttkz3yBV for ; Sun, 11 Apr 2021 12:01:21 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FJ9Sc0r3Qz27K; Sun, 11 Apr 2021 12:01:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FJ9Sc0LG9z2yFQ; Sun, 11 Apr 2021 12:01:20 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FJ9SZ6Zgcz2xB0 for ; Sun, 11 Apr 2021 12:01:18 +0000 (UTC) Received: from arche.uberspace.de (arche.uberspace.de [185.26.156.147]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4FJ9SY5bMKz1Zh for ; Sun, 11 Apr 2021 12:01:17 +0000 (UTC) Received: (qmail 29188 invoked from network); 11 Apr 2021 12:01:17 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by arche.uberspace.de with SMTP; 11 Apr 2021 12:01:17 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH] rrdimage: Improve CGI & cosmetic changes Date: Sun, 11 Apr 2021 14:01:06 +0200 Message-Id: <20210411120106.1993-1-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1618142478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=h4wEtIK+rU/XybThI8MVPbREDGlR5xWAu2HMI8bxvAU=; b=H6s6FjDpbwsLeH0bvlaaeEutLtU8ztsTmCWaBGTEkyVEiA6Nim07/keA6LKzGJ8N4G5OnH NgP0jtBR7PnbF4/uXpP391Jm/q7C/79TFBbKXHqdQHd9vHB6nnKhqPUaNhODz8wbVObaNK u3iajp5mj9Vt8Q/YNbBgN1dr4gRqxEfjdvytvcE7Hro4KbtIrYfNahtlhG0NpZlhyLnJV2 JAesNITjxtnaokBcV+UGFsSAmFNsZRygGyL2G8UIry4oWG3+qV57FL1lRvwZRtm27IM7LB Ktgqn5OJQj/wMKAO7KP8ygEkaOn9QjkMr1/nSYIF6i2yr4Q3rBgkV9xcgMGV/w== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1618142478; a=rsa-sha256; cv=none; b=eP0MDX7b/fK6ItylXxt4EPfm8FkPqLde15Ux8oxs1q0EaTMR6X2Vu1fV7cXEM1H0HsEUTQ E/EDt8cJmCWewif+Mtw99rO75oXJNZ/4ud75sx0qQhfvACoFK/2WMHczZYL+zpbiBvXouK y4e/WgVQ17sTLaTQA39+3e+SAjEbKsMgRWs5PfptcLXfDKHtLkGQdekSwc6KGJn0gXP3xX dNT3gOrKR9H5abHAJctpGMURbf54pyWp4qu7ercrQ1SkiR5RrBwMepd38QS5liT8zIFw5K 8ODxr/SjXtcGli6iTIBD3V5UJhUlZGraiRRLAKGRbXDKZ6IMLlz66XN2T3vlmA== X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-0.54 / 11.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; IP_REPUTATION_HAM(-2.24)[asn: 205766(-0.32), country: DE(-0.01), ip: 185.26.156.147(-0.79)]; MID_CONTAINS_FROM(1.00)[]; R_SPF_ALLOW(-0.20)[+mx]; DMARC_NA(0.00)[leo-andres.de]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; RCVD_COUNT_TWO(0.00)[2]; BAYES_HAM(-3.00)[99.99%] X-Rspamd-Queue-Id: 4FJ9SY5bMKz1Zh Authentication-Results: mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Write graph error messages to the system log, to simplify further inspection by the user. Add additional parameter check to prevent a possible redirect loop if the URL format is changed in the future. Cosmetic: Use underlining instead of background color for highlighting Fixes #10643 Signed-off-by: Leo-Andres Hofmann --- html/cgi-bin/getrrdimage.cgi | 6 +++++- html/html/themes/ipfire/include/css/style.css | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/html/cgi-bin/getrrdimage.cgi b/html/cgi-bin/getrrdimage.cgi index 0caefe0ac..34ee4bf7a 100644 --- a/html/cgi-bin/getrrdimage.cgi +++ b/html/cgi-bin/getrrdimage.cgi @@ -60,7 +60,7 @@ unless(($origin =~ /^\w+?\.cgi$/) && ($graph =~ /^[\w-]+?$/) && ($range ~~ @Grap # Unsupported graph origin: Redirect request to the CGI specified in the "origin" parameter # This enables backwards compatibility with addons that use Graphs::makegraphbox to ouput their own graphs -unless($origin ~~ @supported_origins) { +unless(($origin ~~ @supported_origins) || ($origin eq "getrrdimage.cgi")) { # Rewrite to old URL format: /[graph origin cgi]?[graph name]?[time range] my $location = "https://$ENV{'SERVER_NAME'}:$ENV{'SERVER_PORT'}/cgi-bin/${origin}?${graph}?${range}"; @@ -195,6 +195,10 @@ if($origin eq "entropy.cgi") { ## entropy.cgi # Add request parameters for debugging if($graphstatus) { $graphstatus = "$graphstatus\n($origin, $graph, $range)"; + + # Save message in system log for further inspection + General::log($graphstatus); + _print_error($graphstatus); } diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css index 10644a9f8..2c727a770 100644 --- a/html/html/themes/ipfire/include/css/style.css +++ b/html/html/themes/ipfire/include/css/style.css @@ -348,14 +348,14 @@ div.rrdimage > ul { border: none; background: none; cursor: pointer; - text-decoration: underline; + text-decoration: none; } .rrdimage button:focus { outline: none; box-shadow: none; } .rrdimage button.selected { - background-color: rgba(135, 203, 0, 0.2); + text-decoration: underline; } div.rrdimage > img {