Blob


1 /*
2 * Copyright (c) 2019, 2020 Tracey Emery <tracey@traceyemery.net>
3 * Copyright (c) 2018, 2019 Stefan Sperling <stsp@openbsd.org>
4 *
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.
8 *
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.
16 */
18 #ifndef GOTWEB_H
19 #define GOTWEB_H
21 #include <stdbool.h>
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"
30 #define D_GOTPATH "/got/public"
31 #define D_SITENAME "Gotweb"
32 #define D_SITEOWNER "Got Owner"
33 #define D_SITELINK "Repos"
34 #define D_GOTLOGO "got.png"
35 #define D_GOTURL "https://gameoftrees.org"
37 #define D_SHOWROWNER true
38 #define D_SHOWSOWNER true
39 #define D_SHOWAGE true
40 #define D_SHOWDESC true
41 #define D_SHOWURL true
42 #define D_MAXREPO 0
43 #define D_MAXREPODISP 25
44 #define D_MAXSLCOMMDISP 10
45 #define D_MAXCOMMITDISP 25
47 #define BUFFER_SIZE 2048
49 struct gotweb_config {
50 char *got_repos_path;
51 char *got_site_name;
52 char *got_site_owner;
53 char *got_site_link;
54 char *got_logo;
55 char *got_logo_url;
57 size_t got_max_repos;
58 size_t got_max_repos_display;
59 size_t got_max_commits_display;
61 bool got_show_site_owner;
62 bool got_show_repo_owner;
63 bool got_show_repo_age;
64 bool got_show_repo_description;
65 bool got_show_repo_cloneurl;
66 };
68 /*
69 * Parse gotweb config file, if it exists
70 * Load gotweb_config struct
71 */
72 const struct got_error* parse_gotweb_config(struct gotweb_config **,
73 const char *);
75 #endif /* GOTWEB_H */