From fd625203555147b7a50e5abb3b73e096f8a6b74e Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 6 Feb 2021 08:18:27 +0000 Subject: [PATCH 01/18] Create openvpn subtemplates --- templates/openvpn.php | 87 +++++++++++------------------------ templates/openvpn/configs.php | 9 ++++ templates/openvpn/general.php | 37 +++++++++++++++ templates/openvpn/logging.php | 11 +++++ 4 files changed, 83 insertions(+), 61 deletions(-) create mode 100644 templates/openvpn/configs.php create mode 100644 templates/openvpn/general.php create mode 100644 templates/openvpn/logging.php diff --git a/templates/openvpn.php b/templates/openvpn.php index 65976dee..02cf6b18 100755 --- a/templates/openvpn.php +++ b/templates/openvpn.php @@ -1,3 +1,15 @@ + + + + ' , PHP_EOL; + } else { + echo '' , PHP_EOL; + } + ?> + + +
@@ -21,70 +33,23 @@ +
-
-

-
-
-
-
-
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
-
- - -
-
-
-
-
- -
-
-
-
-

-
-
- '; - ?> -
-
-
- - - ' , PHP_EOL; - } else { - echo '' , PHP_EOL; - } - ?> - - -
+ + + +
+ + + +
- - - + + + diff --git a/templates/openvpn/configs.php b/templates/openvpn/configs.php new file mode 100644 index 00000000..fd9fd3ef --- /dev/null +++ b/templates/openvpn/configs.php @@ -0,0 +1,9 @@ +
+

+
+
+
+
+
+ + diff --git a/templates/openvpn/general.php b/templates/openvpn/general.php new file mode 100644 index 00000000..ddc751e7 --- /dev/null +++ b/templates/openvpn/general.php @@ -0,0 +1,37 @@ +
+

+
+
+
+
+
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ +
+
+
+ diff --git a/templates/openvpn/logging.php b/templates/openvpn/logging.php new file mode 100644 index 00000000..caba8862 --- /dev/null +++ b/templates/openvpn/logging.php @@ -0,0 +1,11 @@ +
+

+
+
+ '; + ?> +
+
+
+ From dc03d9ea002557f1c28a20b6849bb52437e25f6f Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 6 Feb 2021 11:03:30 +0000 Subject: [PATCH 02/18] Prepend .ovpn filename to client + login --- includes/functions.php | 37 +++++++++++++++++++++++++++++++++++++ includes/openvpn.php | 14 +++++++++++--- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index f1dec2c0..923ff007 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -224,6 +224,43 @@ function safefilerewrite($fileName, $dataToSave) } } +/** + * Prepends data to a file if not exists + * + * @param string $filename + * @param string $dataToSave + * @return boolean + */ +function file_prepend_data($filename, $dataToSave) +{ + $context = stream_context_create(); + $file = fopen($filename, 'r', 1, $context); + $file_data = readfile($file); + + if (!preg_match('/^'.$dataToSave.'/', $file_data)) { + $tmp_file = tempnam(sys_get_temp_dir(), 'php_prepend_'); + file_put_contents($tmp_file, $dataToSave); + file_put_contents($tmp_file, $file, FILE_APPEND); + fclose($file); + unlink($filename); + rename($tmp_file, $filename); + return true; + } else { + return false; + } +} + +/** + * Callback function for array_filter + * + * @param string $var + * @return filtered value + */ +function filter_comments($var) +{ + return $var[0] != '#'; +} + /** * Saves a CSRF token in the session */ diff --git a/includes/openvpn.php b/includes/openvpn.php index 6f9e40b5..d337f04d 100755 --- a/includes/openvpn.php +++ b/includes/openvpn.php @@ -47,8 +47,9 @@ function DisplayOpenVPNConfig() // parse client auth credentials if (!empty($auth)) { - $authUser = $auth[0]; - $authPassword = $auth[1]; + $auth = array_filter($auth, 'filter_comments'); + $authUser = current($auth); + $authPassword = next($auth); } echo renderTemplate( @@ -136,18 +137,25 @@ function SaveOpenVPNConfig($status, $file, $authUser, $authPassword) ) { throw new RuntimeException('Unable to move uploaded file'); } + + // Good file upload, update auth credentials if present + $prepend = '# filename '.pathinfo($file['name'], PATHINFO_FILENAME) .PHP_EOL; if (!empty($authUser) && !empty($authPassword)) { $auth_flag = 1; // Move tmp authdata to /etc/openvpn/login.conf - $auth = $authUser .PHP_EOL . $authPassword .PHP_EOL; + $auth.= $authUser .PHP_EOL . $authPassword .PHP_EOL; file_put_contents($tmp_authdata, $auth); + file_prepend_data($tmp_authdata, $prepend); system("sudo cp $tmp_authdata " . RASPI_OPENVPN_CLIENT_LOGIN, $return); if ($return !=0) { $status->addMessage('Unable to save client auth credentials', 'danger'); } } + // Prepend filname tag to .ovpn client config + file_prepend_data($tmp_ovpnclient, $prepend); + // Set iptables rules and, optionally, auth-user-pass exec("sudo /etc/raspap/openvpn/configauth.sh $tmp_ovpnclient $auth_flag " .$_SESSION['ap_interface'], $return); foreach ($return as $line) { From 9bc9f2d3d74ffd47720dcfaa3e6dd58f9d547ac1 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 11:50:52 +0000 Subject: [PATCH 03/18] Add ajax delete handler --- ajax/openvpn/del_ovpncfg.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ajax/openvpn/del_ovpncfg.php diff --git a/ajax/openvpn/del_ovpncfg.php b/ajax/openvpn/del_ovpncfg.php new file mode 100644 index 00000000..77adacff --- /dev/null +++ b/ajax/openvpn/del_ovpncfg.php @@ -0,0 +1,13 @@ +$return]; + echo json_encode($jsonData); +} + From f1b1e96df3959bc2eae1004539ae0b7219c5faf6 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 11:52:58 +0000 Subject: [PATCH 04/18] Progress commit: templates/openvpn --- templates/openvpn.php | 38 ++++++++++++++++++++++++++++++++++- templates/openvpn/configs.php | 32 ++++++++++++++++++++++++----- 2 files changed, 64 insertions(+), 6 deletions(-) diff --git a/templates/openvpn.php b/templates/openvpn.php index 02cf6b18..4f76d6ec 100755 --- a/templates/openvpn.php +++ b/templates/openvpn.php @@ -33,7 +33,7 @@ @@ -53,3 +53,39 @@ + + + + + + diff --git a/templates/openvpn/configs.php b/templates/openvpn/configs.php index fd9fd3ef..84d701d3 100644 --- a/templates/openvpn/configs.php +++ b/templates/openvpn/configs.php @@ -1,9 +1,31 @@
-

-
-
-
-
+

+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
From ef09dd0f6060dc426aefdb4d6c86f5701181c2b7 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 11:53:57 +0000 Subject: [PATCH 05/18] Add file utility functions --- includes/functions.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index 923ff007..7593df18 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -250,6 +250,47 @@ function file_prepend_data($filename, $dataToSave) } } +/** + * Fetches a meta value from a file + * + * @param string $filename + * @param string $pattern + * @return string + */ +function file_get_meta($filename, $pattern) +{ + if(file_exists($filename)) { + $context = stream_context_create(); + $file_data = file_get_contents($filename, false, $context); + preg_match('/^'.$pattern.'/', $file_data, $matched); + return $matched[1]; + } else { + return false; + } +} + +/** + * Renames an openvpn client config with the 'filename' header comment + * + * @param string file + * @return boolean + */ +function file_move_config($file) +{ + if(file_exists($file)) { + $file_data = file_get_contents($file); + preg_match('/^#\sfilename\s(.*)/i', $file_data, $matched); + $renamed = pathinfo($file, PATHINFO_DIRNAME).'/'. + $matched[1] .'_'.pathinfo($file, PATHINFO_FILENAME).'.'. + pathinfo($file, PATHINFO_EXTENSION); + if (!file_exists($renamed)) { + $return = system("sudo mv $file $renamed", $return); + } else { + return false; + } + } +} + /** * Callback function for array_filter * From f48e77da6c3dac71bbc8ef8cdb2b6278ffc8569a Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 11:54:57 +0000 Subject: [PATCH 06/18] Update w/ file_move_config + permissions --- includes/openvpn.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/openvpn.php b/includes/openvpn.php index d337f04d..7b54d4de 100755 --- a/includes/openvpn.php +++ b/includes/openvpn.php @@ -51,6 +51,7 @@ function DisplayOpenVPNConfig() $authUser = current($auth); $authPassword = next($auth); } + $clients = preg_grep('~\login.(conf)$~', scandir(pathinfo(RASPI_OPENVPN_CLIENT_LOGIN, PATHINFO_DIRNAME))); echo renderTemplate( "openvpn", compact( @@ -59,7 +60,8 @@ function DisplayOpenVPNConfig() "openvpnstatus", "public_ip", "authUser", - "authPassword" + "authPassword", + "clients" ) ); } @@ -147,6 +149,8 @@ function SaveOpenVPNConfig($status, $file, $authUser, $authPassword) $auth.= $authUser .PHP_EOL . $authPassword .PHP_EOL; file_put_contents($tmp_authdata, $auth); file_prepend_data($tmp_authdata, $prepend); + file_move_config(RASPI_OPENVPN_CLIENT_LOGIN); + chmod($tmp_authdata, 0644); system("sudo cp $tmp_authdata " . RASPI_OPENVPN_CLIENT_LOGIN, $return); if ($return !=0) { $status->addMessage('Unable to save client auth credentials', 'danger'); @@ -163,6 +167,8 @@ function SaveOpenVPNConfig($status, $file, $authUser, $authPassword) } // Copy tmp client config to /etc/openvpn/client + file_move_config(RASPI_OPENVPN_CLIENT_CONFIG); + chmod($tmp_ovpnclient, 0644); system("sudo cp $tmp_ovpnclient " . RASPI_OPENVPN_CLIENT_CONFIG, $return); if ($return ==0) { $status->addMessage('OpenVPN client.conf uploaded successfully', 'info'); From 56ca7ab281a35ab8ddec3c31e54099f94e648c6a Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 11:56:18 +0000 Subject: [PATCH 07/18] Update w/ openvpn client cfg actions --- installers/raspap.sudoers | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installers/raspap.sudoers b/installers/raspap.sudoers index 00e1d1c7..d141653e 100644 --- a/installers/raspap.sudoers +++ b/installers/raspap.sudoers @@ -20,6 +20,8 @@ www-data ALL=(ALL) NOPASSWD:/bin/systemctl stop openvpn-client@client www-data ALL=(ALL) NOPASSWD:/bin/systemctl disable openvpn-client@client www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/ovpnclient.ovpn /etc/openvpn/client/client.conf www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/authdata /etc/openvpn/client/login.conf +www-data ALL=(ALL) NOPASSWD:/bin/mv /etc/openvpn/client/*.conf /etc/openvpn/client/*.conf +www-data ALL=(ALL) NOPASSWD:/bin/rm /etc/openvpn/client/*.conf www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dnsmasqdata /etc/dnsmasq.d/090_*.conf www-data ALL=(ALL) NOPASSWD:/bin/rm /etc/dnsmasq.d/090_*.conf www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dhcpddata /etc/dhcpcd.conf From 12dd5d824bded89c8187e693a610f64cb73269ab Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 11:59:02 +0000 Subject: [PATCH 08/18] Progress commit: bootstrap modal event handlers --- ajax/openvpn/activate_ovpncfg.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ajax/openvpn/activate_ovpncfg.php diff --git a/ajax/openvpn/activate_ovpncfg.php b/ajax/openvpn/activate_ovpncfg.php new file mode 100644 index 00000000..d2a21897 --- /dev/null +++ b/ajax/openvpn/activate_ovpncfg.php @@ -0,0 +1,14 @@ +$return]; + echo json_encode($jsonData); +} + From 6432efcf34b88faa7094c612ba7a0603d939ab81 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 11:59:16 +0000 Subject: [PATCH 09/18] Progress commit: bootstrap modal event handlers --- app/js/custom.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/app/js/custom.js b/app/js/custom.js index 7a885472..92c73eba 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -248,6 +248,56 @@ $('#hostapdModal').on('shown.bs.modal', function (e) { $('#configureClientModal').on('shown.bs.modal', function (e) { }); +$('#ovpn-confirm-delete').on('click', '.btn-delete', function (e) { + var modalDiv = $(e.delegateTarget); + var cfg_id = $(this).data('recordId'); + console.log(cfg_id); + //console.log(modalDiv.parent().find('.js-remove-openvpn-client').attr('data-record-id')); + //console.log(modalDiv.parent().find( + + $.post('ajax/openvpn/del_ovpncfg.php',{'cfg_id':cfg_id},function(data){ + jsonData = JSON.parse(data); + console.log(jsonData); + //$(this).closest('js-openvpn-client-row').fadeOut(300); + $("#ovpn-confirm-delete").modal('hide'); + if(jsonData['return'] == 0) { + // do something + } else if(jsonData['return'] == 2) { + // something else + } + }); +}); + +$('#ovpn-confirm-delete').on('show.bs.modal', function (e) { + var data = $(e.relatedTarget).data(); + $('.btn-delete', this).data('recordId', data.recordId); +}); + +$('#ovpn-confirm-activate').on('click', '.btn-activate', function (e) { + //var modalDiv = $(e.delegateTarget); + var cfg_id = $(this).data('recordId'); + console.log(cfg_id); + + $.post('ajax/openvpn/activate_ovpncfg.php',{'cfg_id':cfg_id},function(data){ + jsonData = JSON.parse(data); + console.log(jsonData); + //$(this).closest('js-openvpn-client-row').fadeOut(300); + $("#ovpn-confirm-activate").modal('hide'); + if(jsonData['return'] == 0) { + // do something + } else if(jsonData['return'] == 2) { + // something else + } + }); +}); + +$('#ovpn-confirm-activate').on('shown.bs.modal', function (e) { + var data = $(e.relatedTarget).data(); + console.log(data.recordId); + $('.btn-activate', this).data('recordId', data.recordId); +}); + + /* Sets the wirelss channel select options based on hw_mode and country_code. From dc1e4b4bc7bd51eb46b34d7c14365a8a7b7213c6 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 13:04:04 +0000 Subject: [PATCH 10/18] Swap profiles + restart openvpn-client --- ajax/openvpn/activate_ovpncfg.php | 32 ++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/ajax/openvpn/activate_ovpncfg.php b/ajax/openvpn/activate_ovpncfg.php index d2a21897..2f1e808d 100644 --- a/ajax/openvpn/activate_ovpncfg.php +++ b/ajax/openvpn/activate_ovpncfg.php @@ -1,13 +1,39 @@ addMessage('Attempting to restart OpenVPN', 'info'); + exec('sudo /bin/systemctl stop openvpn-client@client', $return); + exec('sudo /bin/systemctl enable openvpn-client@client', $return); + exec('sudo /bin/systemctl start openvpn-client@client', $return); + + foreach ($return as $line) { + $status->addMessage($line, 'info'); + } + $return = $status; $jsonData = ['return'=>$return]; echo json_encode($jsonData); } From ee1da31da0d6ca3826b257b3c00559187ce75ca3 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 13:50:55 +0000 Subject: [PATCH 11/18] Code cleanup --- ajax/openvpn/activate_ovpncfg.php | 19 ++++++------------- app/js/custom.js | 14 +++----------- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/ajax/openvpn/activate_ovpncfg.php b/ajax/openvpn/activate_ovpncfg.php index 2f1e808d..b8f822c2 100644 --- a/ajax/openvpn/activate_ovpncfg.php +++ b/ajax/openvpn/activate_ovpncfg.php @@ -1,12 +1,9 @@ addMessage('Attempting to restart OpenVPN', 'info'); - exec('sudo /bin/systemctl stop openvpn-client@client', $return); - exec('sudo /bin/systemctl enable openvpn-client@client', $return); - exec('sudo /bin/systemctl start openvpn-client@client', $return); + exec("sudo /bin/systemctl stop openvpn-client@client", $return); + sleep(1); + exec("sudo /bin/systemctl enable openvpn-client@client", $return); + sleep(1); + exec("sudo /bin/systemctl start openvpn-client@client", $return); - foreach ($return as $line) { - $status->addMessage($line, 'info'); - } - $return = $status; - $jsonData = ['return'=>$return]; - echo json_encode($jsonData); + echo json_encode($return); } diff --git a/app/js/custom.js b/app/js/custom.js index 92c73eba..b1f445ce 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -274,26 +274,18 @@ $('#ovpn-confirm-delete').on('show.bs.modal', function (e) { }); $('#ovpn-confirm-activate').on('click', '.btn-activate', function (e) { - //var modalDiv = $(e.delegateTarget); var cfg_id = $(this).data('recordId'); - console.log(cfg_id); - $.post('ajax/openvpn/activate_ovpncfg.php',{'cfg_id':cfg_id},function(data){ jsonData = JSON.parse(data); - console.log(jsonData); - //$(this).closest('js-openvpn-client-row').fadeOut(300); $("#ovpn-confirm-activate").modal('hide'); - if(jsonData['return'] == 0) { - // do something - } else if(jsonData['return'] == 2) { - // something else - } + setTimeout(function(){ + window.location.reload(); + },300); }); }); $('#ovpn-confirm-activate').on('shown.bs.modal', function (e) { var data = $(e.relatedTarget).data(); - console.log(data.recordId); $('.btn-activate', this).data('recordId', data.recordId); }); From 361a37332a63eca33bd43cc58d9801c5e27bd0ae Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 15:24:45 +0000 Subject: [PATCH 12/18] Update en_US locale + template --- locale/en_US/LC_MESSAGES/messages.mo | Bin 17365 -> 18271 bytes locale/en_US/LC_MESSAGES/messages.po | 27 ++++++++++++ templates/openvpn/configs.php | 63 +++++++++++++++------------ 3 files changed, 61 insertions(+), 29 deletions(-) diff --git a/locale/en_US/LC_MESSAGES/messages.mo b/locale/en_US/LC_MESSAGES/messages.mo index 34d53bd3567d76aca246ffff641444300801299f..451dd153e80dabdc3f40fdae6f029c35256d88ea 100644 GIT binary patch literal 18271 zcmeI2eViRtdB+C`#Pg8lx^oVoWVVf(55 zv!9*KbH8)WoH^$?&w0){&&=eRSyOKCIA-kSd56Q&G|wC6{PPDX*Yn;!+w2Vd*eIJ6VcZcInsQaIXZ-K8mzWK21zNJw2t%m!;b6x)V z@IcZrlpdEt>3@~WzXkS^z7tBXR~+}Ik^M;T4`r8GQ1>4RrPn+teLCQDcrKg)i%@on zq1xRJrO!2v*F*L5Mp%WnL)qalDpfltKx;3TUIiDD-vc#-7s0jg8mRGo0;;{2pzQct zC_N71qS~DUm46hJp39-GuYww<^-y~H@CtY#RKI`euD=SGl77<>=m^h*$3h>i0EJ0O5N;V47}@1s!l ze%W1r9IF3MLe=vVD8G3Psz1|l0_imy>iQC>b~>T-8Gy2X!7+yNpY2ff+~D$Wg|gRO zQ1-hQT0ep+_XJdX--k>U??ov6_r-`Re*jd!W<&M=c*irK)dS8XzW`Owg;0850vEzt zpz3)Ps@-oujqmetANUHC9C>9eNgS*3a7%mq4fV8l-@g`+IteJo#!A^#Cs7=gKwZR+4B&ncIHC0zYI=?t6jR= z@mwhTjX?D;h122HQ1^cT>i$ncwSNy({SQI4x6`G+?f65eazBNt_t%i6%A0b0#-pJ6 zwGzs%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W1wrDA9N}56g#tvQ=l?_}4 zS>ZQ~dcAUqy3_UQyy159obF<`f0Mg4%gbszI9w>*+L5c&tTiRh(%jb8HNLjBwd1{o z3SYH`Qq;`YjS9p6$5J>j?n$3K8^iRz?0?XVqYx`j$sZ0mTxb&O)fuio;I1y4a~fl^ zX~)JD!^CuR2CjH((j%O9pBn0Rv*?_sZs#?np_2M5tZgsW*y}Ve1?$QPudld^i;1*b zT$VL1))>s$OFH-H49o3=y$A8ucDLD8BAuOIF*(h*lhdiEG)_)ygFbZBt)J-&>0&yU zUWvVic->ZdYr~Gvt+b8rwF@je(JxPTqqRo69fVEGrWJcKPWS5Qo$jym6xp!B&SFg; z_n*wu_MGmf>KQH^*uz0!rjL~U_3QvRW@a;FFn#78%G>QCU@cBk&>e1ik;Nx2+^IXD zZ0o8UPcL)qY%`Y)szgbe26!W}nA8`F32ic}2eYJnlPiy#;1=%bb?k zQ&_IBcXMYv5ayegR0rbb-e`eY5*7;PEn%@3uwBRT`v`B$f{O<@`4)6zy=Y4Js^)A( zZe~*wEa0wePHS`PDa~_EH?6G;TIZeI$}?r9A1BS$j|)DV;=iGWY(LoC%dPPOLrLkP zvw#(0{hFRBohv$*H8!es3hRHuYSFB7-U5>Z8NOdePJ?X{Nmo-{p*6h;rP!cIvv7_x1+ah{NjH6;$BNM6RmR%cU{lM)xB}v z%3jAW?)7)F@r!%i-;ZD1k6+vm*=vLBre^%&e*EIT_Sc{Bi~HJL*mBm_@r(Oc{rkcA z#l0>Q#xL&2FYX)f>UX=vAHTRCzqqem({sT+esMp3ac}=mr16V;{qb-7;$HvHq5G@i S_{Dw0pVR6W_5U9i_x}x#pMUQF diff --git a/locale/en_US/LC_MESSAGES/messages.po b/locale/en_US/LC_MESSAGES/messages.po index 8c4d5f97..b212270d 100644 --- a/locale/en_US/LC_MESSAGES/messages.po +++ b/locale/en_US/LC_MESSAGES/messages.po @@ -677,6 +677,33 @@ msgstr "Attempting to start openvpn" msgid "Attempting to stop openvpn" msgstr "Attempting to stop openvpn" +msgid "Configurations" +msgstr "Configurations" + +msgid "Currently available OpenVPN client configurations are displayed below." +msgstr "Currently available OpenVPN client configurations are displayed below." + +msgid "Activating a configuraton will restart the openvpn-client service." +msgstr "Activating a configuraton will restart the openvpn-client service." + +msgid "Delete OpenVPN client" +msgstr "Delete OpenVPN client" + +msgid "Delete client configuration? This cannot be undone." +msgstr "Delete client configuration? This cannot be undone." + +msgid "Activate OpenVPN client" +msgstr "Activate OpenVPN client" + +msgid "Activate client configuration? This will restart the openvpn-client service." +msgstr "Activate client configuration? This will restart the openvpn-client service." + +msgid "Activate" +msgstr "Activate" + +msgid "Cancel" +msgstr "Cancel" + #: includes/torproxy.php msgid "TOR is not running" msgstr "TOR is not running" diff --git a/templates/openvpn/configs.php b/templates/openvpn/configs.php index 84d701d3..1839c675 100644 --- a/templates/openvpn/configs.php +++ b/templates/openvpn/configs.php @@ -1,31 +1,36 @@
-

-
- -
-
- -
-
- -
-
- -
-
- -
-
+
+
+

+

+ +
openvpn-client service.") ?> +

+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
-
- - +
From c073d18133a4b103d1f83129ad1a8877d8433ddd Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 18:51:21 +0000 Subject: [PATCH 13/18] Cleanup + fadeOut deleted cfg --- app/js/custom.js | 16 ++++------------ templates/openvpn/configs.php | 31 +++++++++++++++---------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/app/js/custom.js b/app/js/custom.js index b1f445ce..dcb05797 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -249,22 +249,14 @@ $('#configureClientModal').on('shown.bs.modal', function (e) { }); $('#ovpn-confirm-delete').on('click', '.btn-delete', function (e) { - var modalDiv = $(e.delegateTarget); var cfg_id = $(this).data('recordId'); - console.log(cfg_id); - //console.log(modalDiv.parent().find('.js-remove-openvpn-client').attr('data-record-id')); - //console.log(modalDiv.parent().find( - $.post('ajax/openvpn/del_ovpncfg.php',{'cfg_id':cfg_id},function(data){ jsonData = JSON.parse(data); - console.log(jsonData); - //$(this).closest('js-openvpn-client-row').fadeOut(300); $("#ovpn-confirm-delete").modal('hide'); - if(jsonData['return'] == 0) { - // do something - } else if(jsonData['return'] == 2) { - // something else - } + var row = $(document.getElementById("openvpn-client-row-" + cfg_id)); + row.fadeOut( "slow", function() { + row.remove(); + }); }); }); diff --git a/templates/openvpn/configs.php b/templates/openvpn/configs.php index 1839c675..6f8056fd 100644 --- a/templates/openvpn/configs.php +++ b/templates/openvpn/configs.php @@ -1,33 +1,32 @@
-
+


openvpn-client service.") ?>

- -
-
+ +
+
-
+
-
+
-
+
From 04edc3a185315108565ff495cb2d3cae5c99a3b5 Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 9 Feb 2021 21:57:15 +0000 Subject: [PATCH 14/18] Implement openvpn logging --- includes/openvpn.php | 12 +++++++++++- installers/openvpnlog.sh | 3 +++ installers/raspap.sudoers | 1 + templates/openvpn/logging.php | 23 ++++++++++++++--------- 4 files changed, 29 insertions(+), 10 deletions(-) create mode 100755 installers/openvpnlog.sh diff --git a/includes/openvpn.php b/includes/openvpn.php index 7b54d4de..16954d23 100755 --- a/includes/openvpn.php +++ b/includes/openvpn.php @@ -20,7 +20,9 @@ function DisplayOpenVPNConfig() if (isset($_POST['authPassword'])) { $authPassword = strip_tags(trim($_POST['authPassword'])); } - $return = SaveOpenVPNConfig($status, $_FILES['customFile'], $authUser, $authPassword); + if (is_uploaded_file( $_FILES["customFile"]["tmp_name"])) { + $return = SaveOpenVPNConfig($status, $_FILES['customFile'], $authUser, $authPassword); + } } elseif (isset($_POST['StartOpenVPN'])) { $status->addMessage('Attempting to start OpenVPN', 'info'); exec('sudo /bin/systemctl start openvpn-client@client', $return); @@ -53,11 +55,19 @@ function DisplayOpenVPNConfig() } $clients = preg_grep('~\login.(conf)$~', scandir(pathinfo(RASPI_OPENVPN_CLIENT_LOGIN, PATHINFO_DIRNAME))); + if (isset($_POST['log-openvpn'])) { + $logEnable = 1; + exec("sudo /etc/raspap/openvpn/openvpnlog.sh", $logOutput); + $logOutput = file_get_contents('/tmp/openvpn.log'); + } + echo renderTemplate( "openvpn", compact( "status", "serviceStatus", "openvpnstatus", + "logEnable", + "logOutput", "public_ip", "authUser", "authPassword", diff --git a/installers/openvpnlog.sh b/installers/openvpnlog.sh new file mode 100755 index 00000000..3e2d681c --- /dev/null +++ b/installers/openvpnlog.sh @@ -0,0 +1,3 @@ +#!/bin/bash +touch /tmp/openvpn.log +grep -m 50 openvpn /var/log/syslog | sudo tee /tmp/openvpn.log diff --git a/installers/raspap.sudoers b/installers/raspap.sudoers index d141653e..49d4032b 100644 --- a/installers/raspap.sudoers +++ b/installers/raspap.sudoers @@ -36,6 +36,7 @@ www-data ALL=(ALL) NOPASSWD:/etc/raspap/hostapd/disablelog.sh www-data ALL=(ALL) NOPASSWD:/etc/raspap/hostapd/servicestart.sh www-data ALL=(ALL) NOPASSWD:/etc/raspap/lighttpd/configport.sh www-data ALL=(ALL) NOPASSWD:/etc/raspap/openvpn/configauth.sh +www-data ALL=(ALL) NOPASSWD:/etc/raspap/openvpn/openvpnlog.sh www-data ALL=(ALL) NOPASSWD:/bin/chmod o+r /tmp/hostapd.log www-data ALL=(ALL) NOPASSWD:/bin/chmod o+r /tmp/dnsmasq.log www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dnsmasqdata /etc/dnsmasq.d/090_adblock.conf diff --git a/templates/openvpn/logging.php b/templates/openvpn/logging.php index caba8862..4d44cece 100644 --- a/templates/openvpn/logging.php +++ b/templates/openvpn/logging.php @@ -1,11 +1,16 @@ +
-

-
-
- '; - ?> -
-
-
+

+

openvpn activity.") ?>

+ +
+ aria-describedby="log-openvpn"> + +
+
+
+ +
+
+
From 0ffe0ecd4b7481b412b0c8014a29b1e4c29bb3c9 Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 10 Feb 2021 11:27:24 +0000 Subject: [PATCH 15/18] Persist log-openvpn option --- includes/openvpn.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/openvpn.php b/includes/openvpn.php index 16954d23..810746a2 100755 --- a/includes/openvpn.php +++ b/includes/openvpn.php @@ -55,7 +55,15 @@ function DisplayOpenVPNConfig() } $clients = preg_grep('~\login.(conf)$~', scandir(pathinfo(RASPI_OPENVPN_CLIENT_LOGIN, PATHINFO_DIRNAME))); - if (isset($_POST['log-openvpn'])) { + $logEnable = 0; + if (!empty($_POST) && !isset($_POST['log-openvpn'])) { + $logOutput = ""; + $f = @fopen("/tmp/openvpn.log", "r+"); + if ($f !== false) { + ftruncate($f, 0); + fclose($f); + } + } elseif (isset($_POST['log-openvpn']) || filesize('/tmp/openvpn.log') >0) { $logEnable = 1; exec("sudo /etc/raspap/openvpn/openvpnlog.sh", $logOutput); $logOutput = file_get_contents('/tmp/openvpn.log'); From 7798e710c1edc8852e59c5d170036be6a916d4f8 Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 10 Feb 2021 11:28:33 +0000 Subject: [PATCH 16/18] Install openvpn logging script --- installers/common.sh | 5 +++-- installers/openvpnlog.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 9f9c9d87..7edad9c6 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -313,9 +313,10 @@ function _create_openvpn_scripts() { _install_log "Creating OpenVPN control scripts" sudo mkdir $raspap_dir/openvpn || _install_status 1 "Unable to create directory '$raspap_dir/openvpn'" - # Move service auth control shell scripts + # Move service auth control & logging shell scripts sudo cp "$webroot_dir/installers/"configauth.sh "$raspap_dir/openvpn" || _install_status 1 "Unable to move auth control script" - # Make configauth.sh writable by www-data group + sudo cp "$webroot_dir/installers/"openvpnlog.sh "$raspap_dir/openvpn" || _install_status 1 "Unable to move logging script" + # Make scripts executable by www-data group sudo chown -c root:"$raspap_user" "$raspap_dir/openvpn/"*.sh || _install_status 1 "Unable change owner and/or group" sudo chmod 750 "$raspap_dir/openvpn/"*.sh || _install_status 1 "Unable to change file permissions" _install_status 0 diff --git a/installers/openvpnlog.sh b/installers/openvpnlog.sh index 3e2d681c..96e79e2d 100755 --- a/installers/openvpnlog.sh +++ b/installers/openvpnlog.sh @@ -1,3 +1,3 @@ #!/bin/bash touch /tmp/openvpn.log -grep -m 50 openvpn /var/log/syslog | sudo tee /tmp/openvpn.log +grep -m 100 openvpn /var/log/syslog | sudo tee /tmp/openvpn.log From 76dc60ca4162d68f26f307b81f8be018e7f9fab7 Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 10 Feb 2021 11:29:12 +0000 Subject: [PATCH 17/18] Update logging template --- templates/openvpn/logging.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/openvpn/logging.php b/templates/openvpn/logging.php index 4d44cece..0aef4217 100644 --- a/templates/openvpn/logging.php +++ b/templates/openvpn/logging.php @@ -4,7 +4,7 @@

openvpn activity.") ?>

- aria-describedby="log-openvpn"> + aria-describedby="log-openvpn">
From 196e17bfd68a469806f2a0697f0bd3fbc150c682 Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 10 Feb 2021 11:29:34 +0000 Subject: [PATCH 18/18] Update en_US locale --- locale/en_US/LC_MESSAGES/messages.po | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/locale/en_US/LC_MESSAGES/messages.po b/locale/en_US/LC_MESSAGES/messages.po index b212270d..dcd715ae 100644 --- a/locale/en_US/LC_MESSAGES/messages.po +++ b/locale/en_US/LC_MESSAGES/messages.po @@ -704,6 +704,15 @@ msgstr "Activate" msgid "Cancel" msgstr "Cancel" +msgid "Enable this option to log openvpn activity." +msgstr "Enable this option to log openvpn activity." + +msgid "Cancel" +msgstr "Cancel" + +msgid "Cancel" +msgstr "Cancel" + #: includes/torproxy.php msgid "TOR is not running" msgstr "TOR is not running"