diff options
| -rw-r--r-- | MANUAL.txt | 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | custom/cgitrc | 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0301-security.sh | 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 files changed, 36 insertions, 18 deletions
@@ -22,10 +22,11 @@ about-filter:: content of the about-file on its stdin and the name of the file, with the tree url its links resolve against, as arguments, and the stdout from the command will be included verbatim on the about page. Default - value: none. When no about-filter is set, the readme is escaped and - served as plain text. A bundled Lua filter, about-render.lua, renders - markdown, man pages and plain text when about-filter points at it. See - also: "Filter API". + value: none. When no about-filter is set, a repository's readme is + escaped and served as plain text, while root-readme is included + verbatim. A bundled Lua filter, about-render.lua, renders markdown, man + pages and plain text when about-filter points at it. See also: "Filter + API". age-file:: Specifies a path, relative to each repository path, which can be used to @@ -442,9 +443,10 @@ root-desc:: value: "a fast webinterface for the git dscm". root-readme:: - The content of the file specified with this option will be included - verbatim below the "about" link on the repository index page. Default - value: none. + A file shown as the site's own about page, which an "about" tab on the + repository index page leads to once this is set. The file goes through + about-filter when one is set and is included verbatim otherwise. + Default value: none. root-title:: Text printed as heading on the repository index page. Default value: @@ -703,12 +705,12 @@ repo.path:: this is the .git-directory. Default value: none. repo.readme:: - A path (relative to <repo.path>) which specifies a file to include - verbatim as the "About" page for this repository. A git refspec by head - or by hash may be prepended, followed by a colon, as in - "master:docs/readme.mkd". If the value begins with a colon, as in - ":docs/readme.rst", the head given in the query or the default branch of - the repository is used. Default value: <readme>. + A path (relative to <repo.path>) which specifies a file to show as the + "About" page for this repository. A git refspec by head or by hash may + be prepended, followed by a colon, as in "master:docs/readme.mkd". If + the value begins with a colon, as in ":docs/readme.rst", the head given + in the query or the default branch of the repository is used. Default + value: <readme>. repo.section:: Override the current section name for this repository. Default value: diff --git a/custom/cgitrc b/custom/cgitrc index 9b4b8cf..c661b2f 100644 --- a/custom/cgitrc +++ b/custom/cgitrc @@ -72,8 +72,9 @@ root-title=Git repository browser # fast webinterface for the git dscm. root-desc=a fast webinterface for the git dscm -# File included verbatim below the about link on the index page. Value is a -# filesystem path. Default is none. +# File shown as the site's about page, behind an about tab on the index, and +# included verbatim when no about-filter is set. Value is a filesystem path. +# Default is none. #root-readme=/var/www/htdocs/about.html # Default value or values for repo.readme. The first existing file wins. Value @@ -458,9 +459,8 @@ age-file=info/web/last-modified # Value is an HTML fragment. Default is none. #repo.head-content=<meta name="example" content="value"> -# File included verbatim as the repository About page. A colon-prefixed value -# uses the head or defbranch. Value is a [ref]path entry. Default is the global -# readme value. +# File shown as the repository About page. A colon-prefixed value uses the head +# or defbranch. Value is a [ref]path entry. Default is the global readme value. #repo.readme=:README.md # Per-repository logo image url. Value is a url. Default is the global logo diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh index ce2b5da..3df2cee 100755 --- a/tests/t0301-security.sh +++ b/tests/t0301-security.sh @@ -115,6 +115,22 @@ test_expect_success 'non-markdown readme keeps its line structure' ' grep "pre class=.plaintext." tmp ' +# root-readme is the site's own file rather than repository content, so it +# goes out as written, on an about page of its own. +test_expect_success 'root-readme without a filter is its own page, as written' ' + echo "<b>site</b>" >root.html && + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "root-readme=$PWD/root.html" + } >secrootrc && + CGIT_CONFIG="$PWD/secrootrc" QUERY_STRING="url=" cgit >tmp && + grep "<li><a title=.About this site. href=./?p=about.>about</a>" tmp && + ! grep "<b>site</b>" tmp && + CGIT_CONFIG="$PWD/secrootrc" QUERY_STRING="p=about" cgit >tmp && + grep "^<b>site</b>$" tmp +' + # A Content-Security-Policy without unsafe-inline stops an inline onchange # handler from ever running, so the option form submits through a plain # button and its selects carry no handlers at all. |
