diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Reorganize the tree into vendor/ and custom/
-rw-r--r--.gitmodules2
-rw-r--r--Makefile8
-rw-r--r--README.txt25
-rw-r--r--cgitrc.5.txt6
-rw-r--r--custom/cgitrc (renamed from examples/cgitrc)4
-rw-r--r--custom/extensions/about-render.lua (renamed from extensions/about-render.lua)0
-rw-r--r--custom/extensions/auth-file.lua (renamed from extensions/auth-file.lua)0
-rw-r--r--custom/extensions/auth-inline.lua (renamed from extensions/auth-inline.lua)0
-rw-r--r--custom/extensions/email-gravatar.lua (renamed from extensions/email-gravatar.lua)0
-rw-r--r--custom/extensions/email-libravatar.lua (renamed from extensions/email-libravatar.lua)0
-rw-r--r--custom/extensions/link-commits.lua (renamed from extensions/link-commits.lua)0
-rw-r--r--custom/extensions/syntax-highlight.lua (renamed from extensions/syntax-highlight.lua)0
-rwxr-xr-xcustom/hooks/post-receive.agefile (renamed from examples/hooks/post-receive.agefile)0
-rwxr-xr-xcustom/hooks/post-update.update-server-info (renamed from examples/hooks/post-update.update-server-info)0
-rw-r--r--custom/servers/apache.conf (renamed from examples/servers/apache.conf)0
-rw-r--r--custom/servers/lighttpd.conf (renamed from examples/servers/lighttpd.conf)0
-rw-r--r--custom/servers/nginx.conf (renamed from examples/servers/nginx.conf)0
-rw-r--r--source/cgit.mk6
-rw-r--r--source/ui-tree.c2
-rw-r--r--tests/Makefile2
-rwxr-xr-xtests/setup.sh2
-rwxr-xr-xtests/t0001-validate-git-versions.sh10
-rwxr-xr-xtests/t0201-limits.sh2
m---------vendor/git (renamed from libraries/git)0
24 files changed, 28 insertions, 41 deletions
diff --git a/.gitmodules b/.gitmodules
index a7ed44a..15d7ed5 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
[submodule "git"]
url = https://git.kernel.org/pub/scm/git/git.git
- path = libraries/git
+ path = vendor/git
diff --git a/Makefile b/Makefile
index 4906686..6029c77 100644
--- a/Makefile
+++ b/Makefile
@@ -6,12 +6,12 @@
.SUFFIXES:
# Project layout. Sources live in source/, web assets in assets/, Lua filters
-# in extensions/, the bundled Git tree in libraries/git, and every generated
+# in custom/extensions/, the bundled Git tree in vendor/git, and every generated
# file lands in build/. CGIT_ROOT reaches from the Git tree back to the root.
SRCDIR = source
ASSETDIR = assets
-EXTDIR = extensions
-GITDIR = libraries/git
+EXTDIR = custom/extensions
+GITDIR = vendor/git
BUILDDIR = build
CGIT_ROOT = ../..
@@ -46,7 +46,7 @@ FILTER_FILES = $(notdir $(wildcard $(EXTDIR)/*.lua))
# Extra files and whole trees the dist target bundles into the release tarball,
# alongside the binary and the assets above.
DIST_DOCS = cgitrc.5.txt README.txt LICENSE.txt AUTHORS
-DIST_TREES = $(EXTDIR) examples
+DIST_TREES = custom
DIST_NAME = cgit-$(CGIT_VERSION)
DIST_DIR = $(BUILDDIR)/$(DIST_NAME)
diff --git a/README.txt b/README.txt
index d385d31..b1ff14a 100644
--- a/README.txt
+++ b/README.txt
@@ -5,19 +5,6 @@ This is an attempt to create a fast web interface for the Git SCM, using a
built-in cache to decrease server I/O pressure.
-Repository layout
------------------
-
- source/ the C sources, the build fragment and the version script
- libraries/ the bundled Git tree, tracked as a submodule
- assets/ cgit.css, cgit.js and the images cgit serves
- extensions/ optional runtime filter scripts
- examples/ a commented cgitrc, git hooks and web server configs
- tools/ developer tooling (preview server and release build)
- tests/ the test suite
- build/ everything the build generates, and not tracked in git
-
-
Installation
------------
@@ -47,7 +34,7 @@ configure this location (and a few other things) by providing a `cgit.conf` file
(see the Makefile for details).
Lua is optional and only powers the lua: filter extensions (authentication,
-email and commit-message filters in extensions/). A plain build auto-detects a
+email and commit-message filters in custom/extensions/). A plain build auto-detects a
Lua through pkg-config, preferring LuaJIT, and falls back to a Lua-less binary
when none is found. Acceptable values are generally "luajit", "lua", "lua5.4",
"lua5.3", "lua5.2" and "lua5.1".
@@ -87,7 +74,7 @@ needed.
Filter extensions
-----------------
-The optional Lua filters in `extensions/` need extra Lua modules. Each script's
+The optional Lua filters in `custom/extensions/` need extra Lua modules. Each script's
header lists the exact install commands for its own dependencies.
* The auth filters (`auth-file.lua`, `auth-inline.lua`) need `luaossl` and
@@ -108,7 +95,7 @@ Web server configuration
------------------------
cgit is a CGI program. Complete, commented configurations for nginx, Apache and
-lighttpd live in `examples/servers/`, each explaining how that server routes
+lighttpd live in `custom/servers/`, each explaining how that server routes
requests to the binary and serves the static assets off disk.
@@ -118,7 +105,7 @@ Runtime configuration
The file `/etc/cgitrc` is read by cgit before handling a request. In addition to
runtime parameters, this file may also contain a list of repositories displayed
by cgit (see `cgitrc.5.txt` for further details). A fully commented starting
-point with every option at its default is in `examples/cgitrc`.
+point with every option at its default is in `custom/cgitrc`.
Securing an instance
@@ -131,11 +118,11 @@ documented in `cgitrc.5.txt`.
marker filename so only repositories that contain it are published.
* Gate the whole instance behind a login with `auth-filter`. Two example filters
- ship in `extensions/`, `auth-inline.lua` and `auth-file.lua`.
+ ship in `custom/extensions/`, `auth-inline.lua` and `auth-file.lua`.
* Terminate TLS at the web server in front of cgit.
-* The example configs in `examples/servers/` set a Content-Security-Policy and
+* The example configs in `custom/servers/` set a Content-Security-Policy and
related headers at the web server, where they also cover the static assets.
* `max-blob-size` bounds how much a single request reads into memory, and
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index e8e006a..ed11563 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -473,7 +473,7 @@ source-filter::
this can be used to implement e.g. syntax highlighting. When no
source-filter is configured, cgit serves the text plain. A ready
syntax highlighter using the Scintillua lexer collection ships as
- extensions/syntax-highlight.lua, see the comments in that file for
+ custom/extensions/syntax-highlight.lua, see the comments in that file for
its dependencies. Default value: none. See also: "FILTER API".
summary-branches::
@@ -754,8 +754,8 @@ auth filter::
with a 302 redirect, and write to output one or more "Set-Cookie"
HTTP headers, each followed by a newline.
- See `extensions/auth-inline.lua` for a ready to modify example that
- keeps its user list inline, or `extensions/auth-file.lua` for the
+ See `custom/extensions/auth-inline.lua` for a ready to modify example that
+ keeps its user list inline, or `custom/extensions/auth-file.lua` for the
same filter reading its users from files on disk.
commit filter::
diff --git a/examples/cgitrc b/custom/cgitrc
index 4a36149..85929d4 100644
--- a/examples/cgitrc
+++ b/custom/cgitrc
@@ -277,7 +277,7 @@ enable-http-clone=1
# Prefix the command with lua: to run it through the built-in Lua interpreter,
# which avoids a fork per call, or with exec: to run a normal program. The
# commands below that point at /usr/share/cgit/extensions/ use scripts this
-# repository ships under extensions/. The ones written as /path/to/your-command
+# repository ships under custom/extensions/. The ones written as /path/to/your-command
# mark where your own command goes.
# Allow filter settings to be overridden in per-repo cgitrc files. Values are
@@ -308,7 +308,7 @@ enable-filter-overrides=0
#source-filter=lua:/usr/share/cgit/extensions/syntax-highlight.lua
# Filter command invoked to authenticate access, gating repositories behind a
-# login. See extensions/auth-inline.lua and extensions/auth-file.lua. Value
+# login. See custom/extensions/auth-inline.lua and custom/extensions/auth-file.lua. Value
# is a command optionally prefixed with exec or lua. Default is none.
#auth-filter=lua:/usr/share/cgit/extensions/auth-inline.lua
diff --git a/extensions/about-render.lua b/custom/extensions/about-render.lua
index 073b531..073b531 100644
--- a/extensions/about-render.lua
+++ b/custom/extensions/about-render.lua
diff --git a/extensions/auth-file.lua b/custom/extensions/auth-file.lua
index 5415ca7..5415ca7 100644
--- a/extensions/auth-file.lua
+++ b/custom/extensions/auth-file.lua
diff --git a/extensions/auth-inline.lua b/custom/extensions/auth-inline.lua
index 168a444..168a444 100644
--- a/extensions/auth-inline.lua
+++ b/custom/extensions/auth-inline.lua
diff --git a/extensions/email-gravatar.lua b/custom/extensions/email-gravatar.lua
index 47c359e..47c359e 100644
--- a/extensions/email-gravatar.lua
+++ b/custom/extensions/email-gravatar.lua
diff --git a/extensions/email-libravatar.lua b/custom/extensions/email-libravatar.lua
index 812bef5..812bef5 100644
--- a/extensions/email-libravatar.lua
+++ b/custom/extensions/email-libravatar.lua
diff --git a/extensions/link-commits.lua b/custom/extensions/link-commits.lua
index e7b17cc..e7b17cc 100644
--- a/extensions/link-commits.lua
+++ b/custom/extensions/link-commits.lua
diff --git a/extensions/syntax-highlight.lua b/custom/extensions/syntax-highlight.lua
index 8310504..8310504 100644
--- a/extensions/syntax-highlight.lua
+++ b/custom/extensions/syntax-highlight.lua
diff --git a/examples/hooks/post-receive.agefile b/custom/hooks/post-receive.agefile
index 2f72ae9..2f72ae9 100755
--- a/examples/hooks/post-receive.agefile
+++ b/custom/hooks/post-receive.agefile
diff --git a/examples/hooks/post-update.update-server-info b/custom/hooks/post-update.update-server-info
index d499ce5..d499ce5 100755
--- a/examples/hooks/post-update.update-server-info
+++ b/custom/hooks/post-update.update-server-info
diff --git a/examples/servers/apache.conf b/custom/servers/apache.conf
index d042dd9..d042dd9 100644
--- a/examples/servers/apache.conf
+++ b/custom/servers/apache.conf
diff --git a/examples/servers/lighttpd.conf b/custom/servers/lighttpd.conf
index 3111ed0..3111ed0 100644
--- a/examples/servers/lighttpd.conf
+++ b/custom/servers/lighttpd.conf
diff --git a/examples/servers/nginx.conf b/custom/servers/nginx.conf
index 76ac260..76ac260 100644
--- a/examples/servers/nginx.conf
+++ b/custom/servers/nginx.conf
diff --git a/source/cgit.mk b/source/cgit.mk
index f864ecb..7852b99 100644
--- a/source/cgit.mk
+++ b/source/cgit.mk
@@ -1,14 +1,14 @@
-# This Makefile runs inside the bundled Git tree (libraries/git) so that it
+# This Makefile runs inside the bundled Git tree (vendor/git) so that it
# can reuse Git's build variables and platform detection. The top-level
# Makefile invokes it as:
#
-# make -C libraries/git -f ../../source/cgit.mk ../../build/cgit
+# make -C vendor/git -f ../../source/cgit.mk ../../build/cgit
#
# so every path back into the project reaches through CGIT_ROOT ("../.."):
# sources come from ../../source and all build output goes to ../../build.
include Makefile
-# Locations relative to libraries/git, where this file is run. SRCDIR and
+# Locations relative to vendor/git, where this file is run. SRCDIR and
# BUILDDIR name the root-relative subdirs (matching the top-level Makefile and
# used by the version recipe, which cds to the root); CGIT_SRC and CGIT_BUILD
# are their full paths from here.
diff --git a/source/ui-tree.c b/source/ui-tree.c
index 6507881..870ace2 100644
--- a/source/ui-tree.c
+++ b/source/ui-tree.c
@@ -65,7 +65,7 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size)
}
/* No source filter is configured, so serve the text plain. Syntax
- * highlighting ships as an optional source filter in extensions/,
+ * highlighting ships as an optional source filter in custom/extensions/,
* keeping language knowledge out of the core. */
html("<td class='lines'><pre><code>");
html_txt(buf);
diff --git a/tests/Makefile b/tests/Makefile
index a11aa74..e159487 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,4 +1,4 @@
-include ../libraries/git/config.mak.uname
+include ../vendor/git/config.mak.uname
-include ../cgit.conf
SHELL_PATH ?= $(SHELL)
diff --git a/tests/setup.sh b/tests/setup.sh
index a49a52b..39819e4 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -42,7 +42,7 @@ IFS=$LF
set -- $test_argv
IFS=$OLDIFS
-: ${TEST_DIRECTORY=$(pwd)/../libraries/git/t}
+: ${TEST_DIRECTORY=$(pwd)/../vendor/git/t}
: ${TEST_OUTPUT_DIRECTORY=$(pwd)}
TEST_NO_CREATE_REPO=YesPlease
. "$TEST_DIRECTORY"/test-lib.sh
diff --git a/tests/t0001-validate-git-versions.sh b/tests/t0001-validate-git-versions.sh
index acc412d..65c3c6a 100755
--- a/tests/t0001-validate-git-versions.sh
+++ b/tests/t0001-validate-git-versions.sh
@@ -20,22 +20,22 @@ test_expect_success 'extract Git version from Makefile' '
# must apply the same transformation to the version in the Makefile before
# comparing them.
test_expect_success 'test Git version matches Makefile' '
- ( cat ../../libraries/git/GIT-VERSION-FILE || echo "No GIT-VERSION-FILE" ) |
+ ( cat ../../vendor/git/GIT-VERSION-FILE || echo "No GIT-VERSION-FILE" ) |
sed -e "s/GIT_VERSION[ ]*=[ ]*//" -e "s/\\.dirty$//" >git_version &&
sed -e "s/-/./g" makefile_version >makefile_git_version &&
test_cmp git_version makefile_git_version
'
test_expect_success 'test submodule version matches Makefile' '
- if ! test -e ../../libraries/git/.git
+ if ! test -e ../../vendor/git/.git
then
- echo "libraries/git/ is not a Git repository" >&2
+ echo "vendor/git/ is not a Git repository" >&2
else
(
cd ../.. &&
- sm_oid=$(git ls-files --stage -- libraries/git |
+ sm_oid=$(git ls-files --stage -- vendor/git |
sed -e "s/^[0-9]* \\([0-9a-f]*\\) [0-9] .*$/\\1/") &&
- cd libraries/git &&
+ cd vendor/git &&
git describe --match "v[0-9]*" $sm_oid
) | sed -e "s/^v//" -e "s/-/./" >sm_version &&
test_cmp sm_version makefile_version
diff --git a/tests/t0201-limits.sh b/tests/t0201-limits.sh
index 5f04952..a8dce62 100755
--- a/tests/t0201-limits.sh
+++ b/tests/t0201-limits.sh
@@ -131,7 +131,7 @@ test_expect_success LUA 'highlight filter passes text through without scintillua
{
echo "virtual-root=/" &&
echo "cache-size=0" &&
- echo "source-filter=lua:$(cd ../../extensions && pwd)/syntax-highlight.lua" &&
+ echo "source-filter=lua:$(cd ../../custom/extensions && pwd)/syntax-highlight.lua" &&
echo "repo.url=limits" &&
echo "repo.path=$PWD/repos/limits/.git"
} >hlrc &&
diff --git a/libraries/git b/vendor/git
-Subproject 94f057755b7941b321fd11fec1b2e3ca5313a4e0
+Subproject 94f057755b7941b321fd11fec1b2e3ca5313a4e0