about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--cgit.c2
-rw-r--r--cgit.h1
-rw-r--r--cgitrc.5.txt7
-rw-r--r--scan-tree.c4
4 files changed, 14 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 96900bb..412fbf0 100644
--- a/cgit.c
+++ b/cgit.c
@@ -121,6 +121,8 @@ void config_cb(const char *name, const char *value)
 		ctx.cfg.logo_link = xstrdup(value);
 	else if (!strcmp(name, "module-link"))
 		ctx.cfg.module_link = xstrdup(value);
+	else if (!strcmp(name, "strict-export"))
+		ctx.cfg.strict_export = xstrdup(value);
 	else if (!strcmp(name, "virtual-root")) {
 		ctx.cfg.virtual_root = trim_end(value, '/');
 		if (!ctx.cfg.virtual_root && (!strcmp(value, "/")))
diff --git a/cgit.h b/cgit.h
index 8f5dd2a..a9896cf 100644
--- a/cgit.h
+++ b/cgit.h
@@ -176,6 +176,7 @@ struct cgit_config {
 	char *script_name;
 	char *section;
 	char *virtual_root;
+	char *strict_export;
 	int cache_size;
 	int cache_dynamic_ttl;
 	int cache_max_create_time;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index ce78d41..75b6584 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -317,6 +317,13 @@ summary-tags::
 	Specifies the number of tags to display in the repository "summary"
 	view. Default value: "10".
 
+strict-export::
+	Filename which, if specified, needs to be present within the repository
+	for cgit to allow access to that repository. This can be used to emulate
+	gitweb's EXPORT_OK and STRICT_EXPORT functionality and limit cgit's
+	repositories to match those exported by git-daemon. This option MUST come
+	before 'scan-path'.
+
 virtual-root::
 	Url which, if specified, will be used as root for all cgit links. It
 	will also cause cgit to generate 'virtual urls', i.e. urls like
diff --git a/scan-tree.c b/scan-tree.c
index b5b50f3..a0e09ce 100644
--- a/scan-tree.c
+++ b/scan-tree.c
@@ -81,6 +81,10 @@ static void add_repo(const char *base, const char *path, repo_config_fn fn)
 			path, strerror(errno), errno);
 		return;
 	}
+
+	if (ctx.cfg.strict_export && stat(fmt("%s/%s", path, ctx.cfg.strict_export), &st))
+		return;
+
 	if (!stat(fmt("%s/noweb", path), &st))
 		return;
 
-01-12 23:02:41 +0100'>2014-01-12ui-repolist: HTML-escape cgit_rooturl() responseJohn Keeping 2014-01-12ui-shared: URL-escape script_nameJohn Keeping 2014-01-12ui-refs: escape HTML chars in author and tagger namesJohn Keeping 2014-01-12filter: pass extra arguments via cgit_open_filterJohn Keeping 2014-01-12ui-snapshot: set unused cgit_filter fields to zeroJohn Keeping 2014-01-12html: remove redundant htmlfd variableJohn Keeping 2014-01-12tests: add Valgrind supportJohn Keeping 2014-01-12cache: don't leave cache_slot fields uninitializedJohn Keeping 2014-01-10filter: split filter functions into their own fileJason A. Donenfeld 2014-01-10filter: make exit status localJason A. Donenfeld 2014-01-10parsing: fix header typoJason A. Donenfeld 2014-01-10cgit.c: Fix comment on bit mask hackLukas Fleischer 2014-01-10cgit.c: Use "else" for mutually exclusive branchesLukas Fleischer 2014-01-10ui-snapshot.c: Do not reinvent suffixcmp()Lukas Fleischer 2014-01-10Refactor cgit_parse_snapshots_mask()Lukas Fleischer 2014-01-10Disallow use of undocumented snapshot delimitersLukas Fleischer 2014-01-10Replace most uses of strncmp() with prefixcmp()Lukas Fleischer 2014-01-09README: Fix dependenciesLukas Fleischer 2014-01-08README: Spelling and formatting fixesLukas Fleischer 2014-01-08Fix UTF-8 with syntax-highlighting.pyPřemysl Janouch 2014-01-08Add a suggestion to the manpagePřemysl Janouch 2014-01-08Fix the example configurationPřemysl Janouch 2014-01-08Fix about-formatting.shPřemysl Janouch 2014-01-08Fix some spelling errorsPřemysl Janouch 2014-01-08filters: highlight.sh: add css comments for highlight 2.6 and 3.8Ferry Huberts