aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
authorJason A. Donenfeld2016-01-14 14:53:28 +0100
committerJason A. Donenfeld2016-01-14 15:42:56 +0100
commitc326f3eb026d67650f79a6dda9a1a42c55d10a25 (patch)
tree51b94c63164ea924eb019c2e3c1e0b290509549b /cgit.c
parent9ca2566972db968df4479108b29bb92551138b57 (diff)
downloadcgit-c326f3eb026d67650f79a6dda9a1a42c55d10a25.tar.gz
cgit-c326f3eb026d67650f79a6dda9a1a42c55d10a25.tar.bz2
cgit-c326f3eb026d67650f79a6dda9a1a42c55d10a25.zip
ui-plain: add enable-html-serving flag
Unrestricts plain/ to contents likely to be executed by browser.
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 3ed1935..7f83a2d 100644
--- a/cgit.c
+++ b/cgit.c
@@ -55,6 +55,8 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va
55 repo->enable_remote_branches = atoi(value); 55 repo->enable_remote_branches = atoi(value);
56 else if (!strcmp(name, "enable-subject-links")) 56 else if (!strcmp(name, "enable-subject-links"))
57 repo->enable_subject_links = atoi(value); 57 repo->enable_subject_links = atoi(value);
58 else if (!strcmp(name, "enable-html-serving"))
59 repo->enable_html_serving = atoi(value);
58 else if (!strcmp(name, "branch-sort")) { 60 else if (!strcmp(name, "branch-sort")) {
59 if (!strcmp(value, "age")) 61 if (!strcmp(value, "age"))
60 repo->branch_sort = 1; 62 repo->branch_sort = 1;
@@ -170,6 +172,8 @@ static void config_cb(const char *name, const char *value)
170 ctx.cfg.enable_remote_branches = atoi(value); 172 ctx.cfg.enable_remote_branches = atoi(value);
171 else if (!strcmp(name, "enable-subject-links")) 173 else if (!strcmp(name, "enable-subject-links"))
172 ctx.cfg.enable_subject_links = atoi(value); 174 ctx.cfg.enable_subject_links = atoi(value);
175 else if (!strcmp(name, "enable-html-serving"))
176 ctx.cfg.enable_html_serving = atoi(value);
173 else if (!strcmp(name, "enable-tree-linenumbers")) 177 else if (!strcmp(name, "enable-tree-linenumbers"))
174 ctx.cfg.enable_tree_linenumbers = atoi(value); 178 ctx.cfg.enable_tree_linenumbers = atoi(value);
175 else if (!strcmp(name, "enable-git-config")) 179 else if (!strcmp(name, "enable-git-config"))
@@ -821,6 +825,7 @@ static void print_repo(FILE *f, struct cgit_repo *repo)
821 fprintf(f, "repo.logo-link=%s\n", repo->logo_link); 825 fprintf(f, "repo.logo-link=%s\n", repo->logo_link);
822 fprintf(f, "repo.enable-remote-branches=%d\n", repo->enable_remote_branches); 826 fprintf(f, "repo.enable-remote-branches=%d\n", repo->enable_remote_branches);
823 fprintf(f, "repo.enable-subject-links=%d\n", repo->enable_subject_links); 827 fprintf(f, "repo.enable-subject-links=%d\n", repo->enable_subject_links);
828 fprintf(f, "repo.enable-html-serving=%d\n", repo->enable_html_serving);
824 if (repo->branch_sort == 1) 829 if (repo->branch_sort == 1)
825 fprintf(f, "repo.branch-sort=age\n"); 830 fprintf(f, "repo.branch-sort=age\n");
826 if (repo->commit_sort) { 831 if (repo->commit_sort) {