From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4c9QGh1xbMz2yrn for ; Mon, 25 Aug 2025 09:19:24 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4c9QGc50tZz2xQ9 for ; Mon, 25 Aug 2025 09:19:20 +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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4c9QGb54t1z2Q; Mon, 25 Aug 2025 09:19:19 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1756113559; 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=VyD296ivw9ICuU+MeZho8tMTSooKp9gxumDqEYejjFQ=; b=4zInSWEFxpTHcxqzHIYyZYE2KRSbJ7JSFsJOGQ+2xIWSyYFXZ8eyd312pMJTxA/MyXT13A w8GxGzZ3xcxyocDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1756113559; 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=VyD296ivw9ICuU+MeZho8tMTSooKp9gxumDqEYejjFQ=; b=oGalBq1xHwzdwiwEHZ6bhY4RXM38jQvSOk7sV+kJ9hA4yl3vdBvYgJGeLDafEFOWNeRwme foSqwtpyxgnXGLE1lx4hLugloPgTYw3l4SsgAVcenCAjKxKeGKgRtpOUwiL3K59dgVuPkm n8H/xENu+jXYA0ox0ekEykb6/pmHCLDZDLGJPWCmpjA9KSVYWwN96LZ8BhE04dc6BihatT ZBy08VFUZKt2SniDtB5ZNB11YrPwxhop9nHwijS1VFXjfB5kocodo3905Xn640ifdeXuU5 eyKv4U1w+YdUu/tD3+rohD1CK+G2X9phWdtXIh1qyxDo9FWU80bn4x282uH+DA== From: Adolf Belka To: development@lists.ipfire.org Cc: Adolf Belka Subject: [PATCH 1/2] backup.pl: Ensure ncp-disable is removed from old backups and DATACIPHERS added Date: Mon, 25 Aug 2025 11:19:13 +0200 Message-ID: <20250825091914.5761-1-adolf.belka@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit - With commit https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=e04f5376ba18767a6a9eccf104c472295a75340b then the settings file which is hashed into %vpnsettings already exists and so none of the defaults are set. Running the ovpnmain.cgi code resolves this for most of the settings but not for ncp-disable being present in server.conf and no DATACIPHERS entry in the settings file. ncp-disable then causes the openvpn server to fail to start as it is no longer recognised in OpenVPN-2.6 - This patch checks if ncp-disable is in the server.conf file from the restored backup and if it is it is then removed and the default values for DATACIPHERS is added into the settings file. - Tested out in my vm testbed and successfully worked. The previously found issue after the above patch was added in has been resolved. - Associated patch in this set is to do a similar thing for the update.sh file for CU197 Tested-by: Adolf Belka Signed-off-by: Adolf Belka --- config/backup/backup.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/backup/backup.pl b/config/backup/backup.pl index e79f510c6..42d24aa3c 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -350,6 +350,11 @@ restore_backup() { fi # Update the OpenVPN configuration and restart the openvpn daemons + if grep -q "ncp-disable" /var/ipfire/ovpn/server.conf; then + sed -r -e "/ncp-disable/d" -i /var/ipfire/ovpn/server.conf + echo "DATACIPHERS=AES-256-GCM|AES-128-GCM|CHACHA20-POLY1305" >> \ + /var/ipfire/ovpn/settings + fi sudo -u nobody /srv/web/ipfire/cgi-bin/ovpnmain.cgi /etc/init.d/openvpn-n2n restart /etc/init.d/openvpn-rw restart -- 2.50.1