From: Michael Tremer Date: Fri, 6 Dec 2024 19:08:33 +0000 (+0100) Subject: wireguard.cgi: It is no longer possible to download the configuration again X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ccb2d0a211b9efd65c4943c7594b6e367a371ec9;p=people%2Fms%2Fipfire-2.x.git wireguard.cgi: It is no longer possible to download the configuration again Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/wireguard.cgi b/html/cgi-bin/wireguard.cgi index f34fdef8b..3b07c6c87 100644 --- a/html/cgi-bin/wireguard.cgi +++ b/html/cgi-bin/wireguard.cgi @@ -614,42 +614,6 @@ END if ($Wireguard::settings{'ENABLED'} eq "on") { &General::system("/usr/local/bin/wireguardctrl", "start"); } - -# Download configuration -} elsif ($cgiparams{'ACTION'} eq 'CONFIG') { - my $key = $cgiparams{'KEY'} || 0; - - # Load the peer - my %peer = &Wireguard::load_peer($key); - - # Make the filename for files - my $filename = &Header::normalize($peer{'NAME'}) . ".conf"; - - # Generate the client configuration - my $config = &Wireguard::generate_peer_configuration($key); - - # Send the configuration - if (defined $config) { - print "Content-Type: application/octet-stream\n"; - print "Content-Disposition: filename=\"${filename}\"\n"; - print "\n"; - print $config; - - # If there is no configuration, we return 404 - } else { - &CGI::header(status => 404); - } - - exit(0); - -# Show the configuration as QR code -} elsif ($cgiparams{'ACTION'} eq 'CONFIG-QRCODE') { - my $key = $cgiparams{'KEY'} || 0; - - # Show the configuration - &show_peer_configuration($key); - - exit(0); } # The main page starts here @@ -750,7 +714,7 @@ END $Lang::tr{'status'} - + $Lang::tr{'action'} @@ -855,40 +819,6 @@ END print < -END - - if ($type eq "host") { - print < - - - - -END - } - - print < - - -END - - if ($type eq "host") { - print < - - - - -END - } - - print < - -