2 * Copyright (c) 2019, 2020 Tracey Emery <tracey@traceyemery.net>
3 * Copyright (c) 2018, 2019 Stefan Sperling <stsp@openbsd.org>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 #define GOTWEB_CONF "/etc/gotweb.conf"
24 #define GOTWEB_TMPL_DIR "/cgi-bin/gw_tmpl"
25 #define GOTWEB "/cgi-bin/gotweb/gotweb"
27 #define GOTWEB_GOT_DIR ".got"
28 #define GOTWEB_GIT_DIR ".git"
31 #define D_GOTPATH "/got/public"
32 #define D_SITENAME "Gotweb"
33 #define D_SITEOWNER "Got Owner"
34 #define D_SITELINK "Repos"
35 #define D_GOTLOGO "got.png"
36 #define D_GOTURL "https://gameoftrees.org"
38 #define D_SHOWROWNER true
39 #define D_SHOWSOWNER true
40 #define D_SHOWAGE true
41 #define D_SHOWDESC true
42 #define D_SHOWURL true
44 #define D_MAXREPODISP 25
45 #define D_MAXSLCOMMDISP 10
46 #define D_MAXCOMMITDISP 25
48 #define BUFFER_SIZE 2048
50 struct gotweb_config {
60 size_t got_max_repos_display;
61 size_t got_max_commits_display;
63 bool got_show_site_owner;
64 bool got_show_repo_owner;
65 bool got_show_repo_age;
66 bool got_show_repo_description;
67 bool got_show_repo_cloneurl;
71 * Parse gotweb config file, if it exists
72 * Load gotweb_config struct
74 const struct got_error* parse_gotweb_config(struct gotweb_config **,