Commit 22c565db authored by Franco Fichtner's avatar Franco Fichtner

openvpn: go full-circle on zip package

We don't need 7z anymore, so it's better to use the lightweight package.

(cherry picked from commit 804d915b)
parent 8e294e37
...@@ -94,7 +94,6 @@ CORE_DEPENDS?= apinger \ ...@@ -94,7 +94,6 @@ CORE_DEPENDS?= apinger \
openvpn \ openvpn \
opnsense-lang \ opnsense-lang \
opnsense-update \ opnsense-update \
p7zip \
pecl-radius \ pecl-radius \
pftop \ pftop \
phalcon \ phalcon \
...@@ -133,7 +132,8 @@ CORE_DEPENDS?= apinger \ ...@@ -133,7 +132,8 @@ CORE_DEPENDS?= apinger \
suricata \ suricata \
syslogd \ syslogd \
unbound \ unbound \
wol wol \
zip
WRKDIR?=${.CURDIR}/work WRKDIR?=${.CURDIR}/work
WRKSRC?=${WRKDIR}/src WRKSRC?=${WRKDIR}/src
......
...@@ -370,7 +370,7 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $verifys ...@@ -370,7 +370,7 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $verifys
} }
} }
$command = "cd " . escapeshellarg("{$tempdir}/..") $command = "cd " . escapeshellarg("{$tempdir}/..")
. " && /usr/local/bin/7z -tzip -y a " . " && /usr/local/bin/zip -r "
. escapeshellarg("/tmp/{$prefix}-config.zip") . escapeshellarg("/tmp/{$prefix}-config.zip")
. " " . escapeshellarg($prefix); . " " . escapeshellarg($prefix);
exec($command); exec($command);
...@@ -563,7 +563,7 @@ EOF; ...@@ -563,7 +563,7 @@ EOF;
exec("cd {$tempdir}/.. && /usr/bin/tar cfz {$outputfile} Viscosity.visc"); exec("cd {$tempdir}/.. && /usr/bin/tar cfz {$outputfile} Viscosity.visc");
} else { } else {
$outputfile = "/tmp/{$uniq}-Viscosity.visc.zip"; $outputfile = "/tmp/{$uniq}-Viscosity.visc.zip";
exec("cd {$tempdir}/.. && /usr/local/bin/7z -tzip -y a {$outputfile} Viscosity.visc"); exec("cd {$tempdir}/.. && /usr/local/bin/zip -r {$outputfile} Viscosity.visc");
} }
// Remove temporary directory // Remove temporary directory
...@@ -688,7 +688,7 @@ function openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipco ...@@ -688,7 +688,7 @@ function openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipco
file_put_contents("{$tempdir}/{$prefix}.ovpn", $conf); file_put_contents("{$tempdir}/{$prefix}.ovpn", $conf);
$shkeyfile = "{$tempdir}/{$shkeyfile}"; $shkeyfile = "{$tempdir}/{$shkeyfile}";
file_put_contents("{$shkeyfile}", base64_decode($settings['shared_key'])); file_put_contents("{$shkeyfile}", base64_decode($settings['shared_key']));
exec("cd {$tempdir}/.. && /usr/local/bin/7z -tzip -y a /tmp/{$prefix}-config.zip {$prefix}"); exec("cd {$tempdir}/.. && /usr/local/bin/zip -r /tmp/{$prefix}-config.zip {$prefix}");
// Remove temporary directory // Remove temporary directory
exec("rm -rf {$tempdir}"); exec("rm -rf {$tempdir}");
return "/tmp/{$prefix}-config.zip"; return "/tmp/{$prefix}-config.zip";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment