Commit 9ceff3c1 authored by Marius Burkard's avatar Marius Burkard

LE Renewal issue on systems that use the relative symlink option for websites, fixes #5326

parent dda2b474
......@@ -388,12 +388,8 @@ class letsencrypt {
$app->system->unlink($key_file);
}
if ($web_config["website_symlinks_rel"] == 'y') {
$app->system->create_relative_link(escapeshellcmd($key_tmp_file), escapeshellcmd($key_file));
} else {
if(@is_link($key_file)) $app->system->unlink($key_file);
if(@file_exists($key_tmp_file)) exec("ln -s ".escapeshellcmd($key_tmp_file)." ".escapeshellcmd($key_file));
}
if(@is_link($key_file)) $app->system->unlink($key_file);
if(@file_exists($key_tmp_file)) exec("ln -s ".escapeshellcmd($key_tmp_file)." ".escapeshellcmd($key_file));
if(is_file($crt_file)) {
$app->system->copy($crt_file, $crt_file.'.old.'.$date);
......@@ -401,12 +397,8 @@ class letsencrypt {
$app->system->unlink($crt_file);
}
if($web_config["website_symlinks_rel"] == 'y') {
$app->system->create_relative_link(escapeshellcmd($crt_tmp_file), escapeshellcmd($crt_file));
} else {
if(@is_link($crt_file)) $app->system->unlink($crt_file);
if(@file_exists($crt_tmp_file))exec("ln -s ".escapeshellcmd($crt_tmp_file)." ".escapeshellcmd($crt_file));
}
if(@is_link($crt_file)) $app->system->unlink($crt_file);
if(@file_exists($crt_tmp_file))exec("ln -s ".escapeshellcmd($crt_tmp_file)." ".escapeshellcmd($crt_file));
if(is_file($bundle_file)) {
$app->system->copy($bundle_file, $bundle_file.'.old.'.$date);
......@@ -414,12 +406,8 @@ class letsencrypt {
$app->system->unlink($bundle_file);
}
if($web_config["website_symlinks_rel"] == 'y') {
$app->system->create_relative_link(escapeshellcmd($bundle_tmp_file), escapeshellcmd($bundle_file));
} else {
if(@is_link($bundle_file)) $app->system->unlink($bundle_file);
if(@file_exists($bundle_tmp_file)) exec("ln -s ".escapeshellcmd($bundle_tmp_file)." ".escapeshellcmd($bundle_file));
}
if(@is_link($bundle_file)) $app->system->unlink($bundle_file);
if(@file_exists($bundle_tmp_file)) exec("ln -s ".escapeshellcmd($bundle_tmp_file)." ".escapeshellcmd($bundle_file));
return true;
} else {
......
......@@ -918,7 +918,7 @@ class system{
// Add ($cnt_to-1) number of "../" elements to left side of $cfrom
for ($c = 0; $c < (count($a2)-1); $c++) { $cfrom = '../'.$cfrom; }
if(strstr($to,'/etc/letsencrypt/archive/')) $to = str_replace('/etc/letsencrypt/archive/','/etc/letsencrypt/live/',$to);
//if(strstr($to,'/etc/letsencrypt/archive/')) $to = str_replace('/etc/letsencrypt/archive/','/etc/letsencrypt/live/',$to);
return symlink($cfrom, $to);
}
......
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