From: Michael Tremer Date: Thu, 25 Apr 2024 18:03:49 +0000 (+0200) Subject: wireguard.cgi: Make the client configuration downloadable X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4846ff3a1091f280f3fdabbfdd898adfeff80e87;p=ipfire-2.x.git wireguard.cgi: Make the client configuration downloadable I believe this is much better than copy & paste. Signed-off-by: Michael Tremer --- diff --git a/doc/language_issues.de b/doc/language_issues.de index 3e61e176b..1c023bc5a 100644 --- a/doc/language_issues.de +++ b/doc/language_issues.de @@ -1035,10 +1035,10 @@ WARNING: untranslated string: show tls-auth key = Show tls-auth key WARNING: untranslated string: smb daemon = SMB Daemon WARNING: untranslated string: subscription code = Subscription code WARNING: untranslated string: user management = User Management -WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File WARNING: untranslated string: wg client pool = Client Pool WARNING: untranslated string: wg create peer = Create A New Peer WARNING: untranslated string: wg dns = DNS +WARNING: untranslated string: wg download configuration file = Download the configuration file WARNING: untranslated string: wg edit peer = Edit Peer WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings WARNING: untranslated string: wg invalid client dns = Invalid client DNS address diff --git a/doc/language_issues.en b/doc/language_issues.en index 0a81010b2..221ae3975 100644 --- a/doc/language_issues.en +++ b/doc/language_issues.en @@ -2142,10 +2142,10 @@ WARNING: untranslated string: web server = Web Server WARNING: untranslated string: website = Website WARNING: untranslated string: wednesday = Wednesday WARNING: untranslated string: weeks = Weeks -WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File WARNING: untranslated string: wg client pool = Client Pool WARNING: untranslated string: wg create peer = Create A New Peer WARNING: untranslated string: wg dns = DNS +WARNING: untranslated string: wg download configuration file = Download the configuration file WARNING: untranslated string: wg edit peer = Edit Peer WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings WARNING: untranslated string: wg invalid client dns = Invalid client DNS address diff --git a/doc/language_issues.es b/doc/language_issues.es index 2d9a925b2..a2c280f7a 100644 --- a/doc/language_issues.es +++ b/doc/language_issues.es @@ -1102,10 +1102,10 @@ WARNING: untranslated string: timeformat = %Y-%m-%d at %H:%M:%S %Z WARNING: untranslated string: total = Total WARNING: untranslated string: transport mode does not support vti = VTI is not support in transport mode WARNING: untranslated string: warning = Warning -WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File WARNING: untranslated string: wg client pool = Client Pool WARNING: untranslated string: wg create peer = Create A New Peer WARNING: untranslated string: wg dns = DNS +WARNING: untranslated string: wg download configuration file = Download the configuration file WARNING: untranslated string: wg edit peer = Edit Peer WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings WARNING: untranslated string: wg invalid client dns = Invalid client DNS address diff --git a/doc/language_issues.fr b/doc/language_issues.fr index 0ccbe945f..f99b852ea 100644 --- a/doc/language_issues.fr +++ b/doc/language_issues.fr @@ -1042,10 +1042,10 @@ WARNING: untranslated string: system time = System Time (as of last page load) WARNING: untranslated string: timeformat = %Y-%m-%d at %H:%M:%S %Z WARNING: untranslated string: total = Total WARNING: untranslated string: warning = Warning -WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File WARNING: untranslated string: wg client pool = Client Pool WARNING: untranslated string: wg create peer = Create A New Peer WARNING: untranslated string: wg dns = DNS +WARNING: untranslated string: wg download configuration file = Download the configuration file WARNING: untranslated string: wg edit peer = Edit Peer WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings WARNING: untranslated string: wg invalid client dns = Invalid client DNS address diff --git a/doc/language_issues.it b/doc/language_issues.it index 0fe19599d..5cb57c896 100644 --- a/doc/language_issues.it +++ b/doc/language_issues.it @@ -1388,10 +1388,10 @@ WARNING: untranslated string: vpn weak = Weak WARNING: untranslated string: vulnerability = Vulnerability WARNING: untranslated string: vulnerable = Vulnerable WARNING: untranslated string: warning = Warning -WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File WARNING: untranslated string: wg client pool = Client Pool WARNING: untranslated string: wg create peer = Create A New Peer WARNING: untranslated string: wg dns = DNS +WARNING: untranslated string: wg download configuration file = Download the configuration file WARNING: untranslated string: wg edit peer = Edit Peer WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings WARNING: untranslated string: wg invalid client dns = Invalid client DNS address diff --git a/doc/language_issues.nl b/doc/language_issues.nl index 87c69961d..b9e3c8ff9 100644 --- a/doc/language_issues.nl +++ b/doc/language_issues.nl @@ -1409,10 +1409,10 @@ WARNING: untranslated string: vpn weak = Weak WARNING: untranslated string: vulnerability = Vulnerability WARNING: untranslated string: vulnerable = Vulnerable WARNING: untranslated string: warning = Warning -WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File WARNING: untranslated string: wg client pool = Client Pool WARNING: untranslated string: wg create peer = Create A New Peer WARNING: untranslated string: wg dns = DNS +WARNING: untranslated string: wg download configuration file = Download the configuration file WARNING: untranslated string: wg edit peer = Edit Peer WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings WARNING: untranslated string: wg invalid client dns = Invalid client DNS address diff --git a/doc/language_issues.pl b/doc/language_issues.pl index cb25ad7ea..3f41f4c71 100644 --- a/doc/language_issues.pl +++ b/doc/language_issues.pl @@ -1651,10 +1651,10 @@ WARNING: untranslated string: vpn weak = Weak WARNING: untranslated string: vulnerability = Vulnerability WARNING: untranslated string: vulnerable = Vulnerable WARNING: untranslated string: warning = Warning -WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File WARNING: untranslated string: wg client pool = Client Pool WARNING: untranslated string: wg create peer = Create A New Peer WARNING: untranslated string: wg dns = DNS +WARNING: untranslated string: wg download configuration file = Download the configuration file WARNING: untranslated string: wg edit peer = Edit Peer WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings WARNING: untranslated string: wg invalid client dns = Invalid client DNS address diff --git a/doc/language_issues.ru b/doc/language_issues.ru index ee2eb4edd..674c94813 100644 --- a/doc/language_issues.ru +++ b/doc/language_issues.ru @@ -1644,10 +1644,10 @@ WARNING: untranslated string: vpn weak = Weak WARNING: untranslated string: vulnerability = Vulnerability WARNING: untranslated string: vulnerable = Vulnerable WARNING: untranslated string: warning = Warning -WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File WARNING: untranslated string: wg client pool = Client Pool WARNING: untranslated string: wg create peer = Create A New Peer WARNING: untranslated string: wg dns = DNS +WARNING: untranslated string: wg download configuration file = Download the configuration file WARNING: untranslated string: wg edit peer = Edit Peer WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings WARNING: untranslated string: wg invalid client dns = Invalid client DNS address diff --git a/doc/language_issues.tr b/doc/language_issues.tr index 77b1cb12c..405d65ac8 100644 --- a/doc/language_issues.tr +++ b/doc/language_issues.tr @@ -1271,10 +1271,10 @@ WARNING: untranslated string: vpn wait = WAITING WARNING: untranslated string: vulnerability = Vulnerability WARNING: untranslated string: vulnerable = Vulnerable WARNING: untranslated string: warning = Warning -WARNING: untranslated string: wg client configuration file = WireGuard Client Configuration File WARNING: untranslated string: wg client pool = Client Pool WARNING: untranslated string: wg create peer = Create A New Peer WARNING: untranslated string: wg dns = DNS +WARNING: untranslated string: wg download configuration file = Download the configuration file WARNING: untranslated string: wg edit peer = Edit Peer WARNING: untranslated string: wg host to net client settings = Host-To-Net Client Settings WARNING: untranslated string: wg invalid client dns = Invalid client DNS address diff --git a/doc/language_missings b/doc/language_missings index 66f31028e..4aac70978 100644 --- a/doc/language_missings +++ b/doc/language_missings @@ -120,6 +120,7 @@ < wg client pool < wg create peer < wg dns +< wg download configuration file < wg edit peer < wg host to net client settings < wg invalid client dns @@ -216,6 +217,7 @@ < wg client pool < wg create peer < wg dns +< wg download configuration file < wg edit peer < wg host to net client settings < wg invalid client dns @@ -290,6 +292,7 @@ < wg client pool < wg create peer < wg dns +< wg download configuration file < wg edit peer < wg host to net client settings < wg invalid client dns @@ -818,6 +821,7 @@ < wg client pool < wg create peer < wg dns +< wg download configuration file < wg edit peer < wg host to net client settings < wg invalid client dns @@ -1422,6 +1426,7 @@ < wg client pool < wg create peer < wg dns +< wg download configuration file < wg edit peer < wg host to net client settings < wg invalid client dns @@ -2442,6 +2447,7 @@ < wg client pool < wg create peer < wg dns +< wg download configuration file < wg edit peer < wg host to net client settings < wg invalid client dns @@ -3499,6 +3505,7 @@ < wg client pool < wg create peer < wg dns +< wg download configuration file < wg edit peer < wg host to net client settings < wg invalid client dns @@ -3933,6 +3940,7 @@ < wg client pool < wg create peer < wg dns +< wg download configuration file < wg edit peer < wg host to net client settings < wg invalid client dns diff --git a/html/cgi-bin/wireguard.cgi b/html/cgi-bin/wireguard.cgi index 8b62bfedc..80b793c64 100644 --- a/html/cgi-bin/wireguard.cgi +++ b/html/cgi-bin/wireguard.cgi @@ -974,6 +974,9 @@ sub show_peer_configuration($$) { # Encode the image as bas64 $qrcode = &MIME::Base64::encode_base64($qrcode); + # Encode the configuration as Base64 + $config = &MIME::Base64::encode_base64($config); + # Open a new box &Header::openbox('100%', '', "$Lang::tr{'wg peer configuration'}: $peer{'NAME'}"); @@ -986,11 +989,13 @@ sub show_peer_configuration($$) {

$Lang::tr{'wg scan the qr code'}

- - -
$Lang::tr{'wg client configuration file'}
-
$config
+			

+ + $Lang::tr{'wg download configuration file'} + +

+ END &Header::closebox(); diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 4b6d793e8..e2a8ca0f5 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -3043,6 +3043,7 @@ 'wg client pool' => 'Client Pool', 'wg create peer' => 'Create A New Peer', 'wg dns' => 'DNS', +'wg download configuration file' => 'Download the configuration file', 'wg edit peer' => 'Edit Peer', 'wg host to net client settings' => 'Host-To-Net Client Settings', 'wg invalid client dns' => 'Invalid client DNS address',