From ccb2d0a211b9efd65c4943c7594b6e367a371ec9 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 6 Dec 2024 20:08:33 +0100 Subject: [PATCH] wireguard.cgi: It is no longer possible to download the configuration again Signed-off-by: Michael Tremer --- html/cgi-bin/wireguard.cgi | 72 +------------------------------------- 1 file changed, 1 insertion(+), 71 deletions(-) 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 < - -
-- 2.39.5