From patchwork Wed Feb 5 14:27:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 2760 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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 48CP604cFKz3xY8 for ; Wed, 5 Feb 2020 14:27:20 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 48CP5y6JLZz6ZP; Wed, 5 Feb 2020 14:27:18 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 48CP5y443vz2yjS; Wed, 5 Feb 2020 14:27:18 +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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 48CP5w4qYBz2yRQ for ; Wed, 5 Feb 2020 14:27:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (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 did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 48CP5v0l1yz2cJ; Wed, 5 Feb 2020 14:27:15 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1580912835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pmYwo/JpZJmsrkVvz4sKX6tUFiFrWyvpU1BT8m2UvTM=; b=+qnbftqOZl3oWyBtTwNb2zmwhRxJIonxEGxT977yOKeaDmcnJsZ4s5qW5qZSHzGJra1G8W g4DXkOcUYjFLqsAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1580912835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pmYwo/JpZJmsrkVvz4sKX6tUFiFrWyvpU1BT8m2UvTM=; b=D7Mtk4NxlSL9i8JP6D9Gl/ewXOFIVPtKipNzrz8jQOrccuYcEIF2H4c/Z3kDrihfAQMrin Tr5SlodeFGbvkORmuSkZrUVbVlbTCaDSkpKxOC3lgddMJAS1FFddCwOFeulV5I5ec+W+nJ QJZCoP/qDD/NhlyCui9ZgH/69WbvnnP5pyjk+l3pPkQpzhtsfi7a0lOrj0JpIcJ1WVY/G2 QtCN68wbkWGTr+FdVN0qw+HGKiaqJXbd5ip3LWC4DEeG2Le88zXUiluGvVKxk8j3+vhovK ltbGcwh71HceCBMcgOPozVH669ASp+zyW3KZ5AxvI71FsYBmKTbYvgwQF1YY+w== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 1/3] dns.cgi: Do not show table header if no servers are configured Date: Wed, 5 Feb 2020 14:27:06 +0000 Message-Id: <20200205142708.22129-1-michael.tremer@ipfire.org> MIME-Version: 1.0 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: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- html/cgi-bin/dns.cgi | 71 ++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi index 4f3418a70..09fd50206 100755 --- a/html/cgi-bin/dns.cgi +++ b/html/cgi-bin/dns.cgi @@ -449,7 +449,7 @@ sub show_nameservers () { $dns_status_string .= " (" . $Lang::tr{'dns recursor mode'} . ")"; } -print < @@ -458,7 +458,36 @@ print < +END + + # Check the usage of ISP assigned nameservers is enabled. + my $id = 1; + + # Loop through the array which stores the files. + foreach my $file (@ISP_nameserver_files) { + # Grab the address of the nameserver. + my $address = &General::grab_address_from_file($file); + + # Check if we got an address. + if ($address) { + # Add the address to the hash of nameservers. + $dns_servers{$id} = [ "$address", "none", + ($settings{'USE_ISP_NAMESERVERS'} eq "on") ? "enabled" : "disabled", + "$Lang::tr{'dns isp assigned nameserver'}" ]; + + # Increase id by one. + $id++; + } + } + # Check some DNS servers have been configured. In this case + # the hash contains at least one key. + my $server_amount; + if (keys %dns_servers) { + # Sort the keys by their ID and store them in an array. + my @keys = sort { $a <=> $b } keys %dns_servers; + + print < @@ -479,51 +508,23 @@ print <$Lang::tr{'remark'} END - # Check if the status should be displayed. - if ($check_servers) { -print < $Lang::tr{'status'} END -; - } + } -print < $Lang::tr{'action'} END -; - - # Check the usage of ISP assigned nameservers is enabled. - my $id = 1; - - # Loop through the array which stores the files. - foreach my $file (@ISP_nameserver_files) { - # Grab the address of the nameserver. - my $address = &General::grab_address_from_file($file); - - # Check if we got an address. - if ($address) { - # Add the address to the hash of nameservers. - $dns_servers{$id} = [ "$address", "none", - ($settings{'USE_ISP_NAMESERVERS'} eq "on") ? "enabled" : "disabled", - "$Lang::tr{'dns isp assigned nameserver'}" ]; - - # Increase id by one. - $id++; - } - } - - # Check some DNS servers have been configured. In this case - # the hash contains at least one key. - my $server_amount; - if (keys %dns_servers) { - # Sort the keys by their ID and store them in an array. - my @keys = sort { $a <=> $b } keys %dns_servers; # Loop through all entries of the array/hash. foreach my $id (@keys) { From patchwork Wed Feb 5 14:27:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 2761 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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 48CP605sg5z3xyL for ; Wed, 5 Feb 2020 14:27:20 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 48CP5y1xXjz6Yk; Wed, 5 Feb 2020 14:27:18 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 48CP5x5Wx0z2yXw; Wed, 5 Feb 2020 14:27:17 +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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 48CP5w3myRz2xmg for ; Wed, 5 Feb 2020 14:27:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (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 did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 48CP5w0y03z6Yk; Wed, 5 Feb 2020 14:27:16 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1580912836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XRQlkfLTy2BlofEX5Lb2OxhmiSstJWWHqoEcx/ptqyk=; b=TO7j6Z0i/ZXSoo0vNyJrYWpWdSSWfq9XGPVHz9bybKzkMxa9644lQp9uUcVDZc4Ye5l8rh VvxP2CEM7vzzxCAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1580912836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XRQlkfLTy2BlofEX5Lb2OxhmiSstJWWHqoEcx/ptqyk=; b=FXELjsRo9Xte1rrSkjKFMn/+tC19Ga6zLgJCgIk+ATmZxW4CiA6JnEFvXcszaw2bAbf6Jd I4T3McQJYiLzIhMpUwfA+Z/bbULrGenGNogCLHMWZ3UzITRzDgdVzhDur26qfHbxysR8ev LJCQtImD1U9C2mnh8rqtxLQxvVRQewjuq0HJETgyg54mpK3aby8i+uOQF1z/tprhsPxGoQ sjlkYXvUpKSO5it2nZUjNYDHKeQwndekNfUsY4NPMViwkEekYx2U+TdxZkzHwFfq7QnnSq MELdbF/T1iZk0TmHz+omBM9yPS2HsnPMIUXgWEOuLYF9Zyy5pqNH+yWV3oHJiQ== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 2/3] aws-setup: Remove some excessive whitespace Date: Wed, 5 Feb 2020 14:27:07 +0000 Message-Id: <20200205142708.22129-2-michael.tremer@ipfire.org> In-Reply-To: <20200205142708.22129-1-michael.tremer@ipfire.org> References: <20200205142708.22129-1-michael.tremer@ipfire.org> MIME-Version: 1.0 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: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- src/initscripts/helper/aws-setup | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/initscripts/helper/aws-setup b/src/initscripts/helper/aws-setup index cee78a283..2c3311fc2 100644 --- a/src/initscripts/helper/aws-setup +++ b/src/initscripts/helper/aws-setup @@ -212,8 +212,6 @@ import_aws_configuration() { # Save CONFIG_TYPE echo "CONFIG_TYPE=${config_type}" >> /var/ipfire/ethernet/settings - - # Actions performed only on the very first start if [ ! -e "/var/ipfire/main/firstsetup_ok" ]; then # Enable SSH From patchwork Wed Feb 5 14:27:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 2762 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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 48CP6105Tkz3xyQ for ; Wed, 5 Feb 2020 14:27: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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 48CP5y5Gxtz6ZJ; Wed, 5 Feb 2020 14:27:18 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 48CP5y1m38z2yXv; Wed, 5 Feb 2020 14:27:18 +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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 48CP5w53lnz2yRX for ; Wed, 5 Feb 2020 14:27:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (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 did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 48CP5w1mSNz6Z2; Wed, 5 Feb 2020 14:27:16 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1580912836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MgNpl/6gfdxqw+PNLX5grlrdSzepQ5mzxFYzpYvIpqw=; b=Jliz/Zk+GP8B3ytVS/2QlEWRwLuuPgktYK3IlEl/AHnRhTJlA7/aW3oqVXulXRozi9dRNW B+xtgL5W2hVoZMAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1580912836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MgNpl/6gfdxqw+PNLX5grlrdSzepQ5mzxFYzpYvIpqw=; b=IlLM3NzVTXNA6Y12xEiSuarcHs12fDVzN78ngs2L8Szdn4SZSdyHYKN/S3gPTWIKXLEhEb hbttIwhim7DET2VDTJ/g4F1CwLPWcRitTlJ6bZVPLfS8RxdJ6N5eJP61odh8CQATiYC8Hp Cjr9DU1tnSMWE7UK6d1+rfcbUK6wyXDA3jdeb9b2SdhzvIGjjeFxTL+eVR5PaHuBNsf3XW f0xoKmFYUnC74+6DJ2zfzrL/rZJ7wj7/be2tJM08yxSXjEWJK8HbHqut1bLuv6kW75XBIa 8C+TxtJVnrToi9XjQB5RwzhM4FpQlUFGWc2aR+tleLJ01SZ3UxyXJCwBMNaCHw== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 3/3] cloud-init: Disable using ISP nameservers Date: Wed, 5 Feb 2020 14:27:08 +0000 Message-Id: <20200205142708.22129-3-michael.tremer@ipfire.org> In-Reply-To: <20200205142708.22129-1-michael.tremer@ipfire.org> References: <20200205142708.22129-1-michael.tremer@ipfire.org> MIME-Version: 1.0 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: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" This is mostly aesthetic because there are no ISP nameservers anyways that we could use here. Signed-off-by: Michael Tremer --- src/initscripts/helper/aws-setup | 3 +++ src/initscripts/helper/azure-setup | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/initscripts/helper/aws-setup b/src/initscripts/helper/aws-setup index 2c3311fc2..884319822 100644 --- a/src/initscripts/helper/aws-setup +++ b/src/initscripts/helper/aws-setup @@ -214,6 +214,9 @@ import_aws_configuration() { # Actions performed only on the very first start if [ ! -e "/var/ipfire/main/firstsetup_ok" ]; then + # Disable using ISP nameservers + sed -e "s/^USE_ISP_NAMESERVERS=.*/USE_ISP_NAMESERVERS=off/" -i /var/ipfire/dns/settings + # Enable SSH sed -e "s/ENABLE_SSH=.*/ENABLE_SSH=on/g" -i /var/ipfire/remote/settings diff --git a/src/initscripts/helper/azure-setup b/src/initscripts/helper/azure-setup index d84ec3aca..291b8e0a4 100644 --- a/src/initscripts/helper/azure-setup +++ b/src/initscripts/helper/azure-setup @@ -240,6 +240,9 @@ import_azure_configuration() { # Actions performed only on the very first start if [ ! -e "/var/ipfire/main/firstsetup_ok" ]; then + # Disable using ISP nameservers + sed -e "s/^USE_ISP_NAMESERVERS=.*/USE_ISP_NAMESERVERS=off/" -i /var/ipfire/dns/settings + # Enable SSH sed -e "s/ENABLE_SSH=.*/ENABLE_SSH=on/g" -i /var/ipfire/remote/settings