diff --git a/docker-compose.yml b/docker-compose.yml index 76167457..320b5a67 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,5 +20,7 @@ services: - "9000" links: - svn:svn + environment: + REPOS_DOWNLOAD_RULE: "|^/svn/[^/]+/downloadableDirs/.+|" volumes: - .:/opt/rweb diff --git a/repos-web/conf/Presentation.class.php b/repos-web/conf/Presentation.class.php index ac756f81..7cea7f63 100644 --- a/repos-web/conf/Presentation.class.php +++ b/repos-web/conf/Presentation.class.php @@ -440,6 +440,9 @@ function showError($error_msg, $headline='An error occurred') { * @param String $headline the contents of the
Shows a defailed view of the folder's contents at the current revision.
{=/if} -{=if $file,isFile}Download this +{=if $file,isDownloadAllowed}
Download this {=if $file,isFile} file {=else} folder as zip archive {=/if} to your hard drive. The revision number {=$file,revision} will be appended to the filename, so you will know which version it is.
diff --git a/repos-web/open/json/listjson.php b/repos-web/open/json/listjson.php index eaaa1345..11c654a9 100644 --- a/repos-web/open/json/listjson.php +++ b/repos-web/open/json/listjson.php @@ -28,7 +28,17 @@ function getListXml($url, $rev=false) { $list->addArgUrl($url); } -if ($list->exec()) trigger_error('Could not read entry for URL '.$url, E_USER_ERROR); + if ($list->exec()) { + $err = implode(array_slice($list->getOutput(), -1)); + if (strBegins($err,'svn: E200009')) { + header('HTTP/1.1 404 Not Found', true, 404); + } else { + header('HTTP/1.1 500 Internal Server Error', true, 500); + } + echo '{"end": "'.preg_replace('/"/', '\\"', $err); + echo '"}'."\n"; + exit; + } // TODO detect access denied return implode($list->getOutput(),"\n");