From: Michael Tremer Date: Tue, 9 Apr 2024 17:08:25 +0000 (+0200) Subject: ovpnmain.cgi: Remove "additional configs" X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=622a1d615fce9767fdf982b24a8706bbb854b7af;p=people%2Fms%2Fipfire-2.x.git ovpnmain.cgi: Remove "additional configs" Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 5597f5443..930e2a023 100755 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -94,8 +94,6 @@ my $configgrp="${General::swroot}/fwhosts/customgroups"; my $customnet="${General::swroot}/fwhosts/customnetworks"; my $name; my $col=""; -my $local_serverconf = "${General::swroot}/ovpn/scripts/server.conf.local"; -my $local_clientconf = "${General::swroot}/ovpn/scripts/client.conf.local"; # Set default CGI parameters $cgiparams{'ENABLED'} = 'off'; @@ -124,17 +122,6 @@ unless (-e $routes_push_file) { close(RPF); } -# Create additional files it not already existing -unless (-e "$local_serverconf") { - open(LSC, ">$local_serverconf"); - close (LSC); -} - -unless (-e "$local_clientconf") { - open(LCC, ">$local_clientconf"); - close (LCC); -} - ### ### Useful functions ### @@ -320,23 +307,6 @@ sub writeserverconf { print CONF "management /var/run/openvpn.sock unix\n"; print CONF "management-client-auth\n"; - # Print server.conf.local if entries exist to server.conf - if ( !-z $local_serverconf && $sovpnsettings{'ADDITIONAL_CONFIGS'} eq 'on') { - open (LSC, "$local_serverconf"); - print CONF "\n#---------------------------\n"; - print CONF "# Start of custom directives\n"; - print CONF "# from server.conf.local\n"; - print CONF "#---------------------------\n\n"; - while () { - print CONF $_; - } - print CONF "\n#-----------------------------\n"; - print CONF "# End of custom directives\n"; - print CONF "#-----------------------------\n"; - close (LSC); - } - print CONF "\n"; - close(CONF); # Rewrite all CCD configurations @@ -934,7 +904,6 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save-adv-options'}) { $vpnsettings{'DMTU'} = $cgiparams{'DMTU'}; $vpnsettings{'MAX_CLIENTS'} = $cgiparams{'MAX_CLIENTS'}; $vpnsettings{'REDIRECT_GW_DEF1'} = $cgiparams{'REDIRECT_GW_DEF1'}; - $vpnsettings{'ADDITIONAL_CONFIGS'} = $cgiparams{'ADDITIONAL_CONFIGS'}; $vpnsettings{'DHCP_DOMAIN'} = $cgiparams{'DHCP_DOMAIN'}; $vpnsettings{'DHCP_DNS'} = $cgiparams{'DHCP_DNS'}; $vpnsettings{'DHCP_WINS'} = $cgiparams{'DHCP_WINS'}; @@ -2458,23 +2427,6 @@ else } } - # Print client.conf.local if entries exist to client.ovpn - if (!-z $local_clientconf && $vpnsettings{'ADDITIONAL_CONFIGS'} eq 'on') { - open (LCC, "$local_clientconf"); - print CLIENTCONF "\n#---------------------------\n"; - print CLIENTCONF "# Start of custom directives\n"; - print CLIENTCONF "# from client.conf.local\n"; - print CLIENTCONF "#---------------------------\n\n"; - while () { - print CLIENTCONF $_; - } - print CLIENTCONF "\n#---------------------------\n"; - print CLIENTCONF "# End of custom directives\n"; - print CLIENTCONF "#---------------------------\n\n"; - close (LCC); - } - close(CLIENTCONF); - $zip->addFile( "$tempdir/$clientovpn", $clientovpn) or die "Can't add file $clientovpn\n"; my $status = $zip->writeToFileNamed($zippathname); @@ -2720,9 +2672,6 @@ ADV_ERROR: $checked{'REDIRECT_GW_DEF1'}{'off'} = ''; $checked{'REDIRECT_GW_DEF1'}{'on'} = ''; $checked{'REDIRECT_GW_DEF1'}{$cgiparams{'REDIRECT_GW_DEF1'}} = 'CHECKED'; - $checked{'ADDITIONAL_CONFIGS'}{'off'} = ''; - $checked{'ADDITIONAL_CONFIGS'}{'on'} = ''; - $checked{'ADDITIONAL_CONFIGS'}{$cgiparams{'ADDITIONAL_CONFIGS'}} = 'CHECKED'; $checked{'MSSFIX'}{'off'} = ''; $checked{'MSSFIX'}{'on'} = ''; $checked{'MSSFIX'}{$cgiparams{'MSSFIX'}} = 'CHECKED'; @@ -2938,12 +2887,6 @@ END - - $Lang::tr{'ovpn add conf'} - - $Lang::tr{'openvpn default'}: off - - mssfix