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 #include <got_error.h>
25 #define GOTWEB_CONF "/etc/gotweb.conf"
26 #define GOTWEB_TMPL_DIR "/cgi-bin/gw_tmpl"
27 #define GOTWEB "/cgi-bin/gotweb/gotweb"
29 #define GOTWEB_GOT_DIR ".got"
30 #define GOTWEB_GIT_DIR ".git"
32 #define D_GOTPATH "/got/public"
33 #define D_SITENAME "Gotweb"
34 #define D_SITEOWNER "Got Owner"
35 #define D_SITELINK "Repos"
36 #define D_GOTLOGO "got.png"
37 #define D_GOTURL "https://gameoftrees.org"
39 #define D_SHOWROWNER true
40 #define D_SHOWSOWNER true
41 #define D_SHOWAGE true
42 #define D_SHOWDESC true
43 #define D_SHOWURL true
44 #define D_MAXREPO 0
45 #define D_MAXREPODISP 25
46 #define D_MAXSLCOMMDISP 10
47 #define D_MAXCOMMITDISP 25
49 #define BUFFER_SIZE 2048
51 struct gotweb_conf {
52 char *got_repos_path;
53 char *got_site_name;
54 char *got_site_owner;
55 char *got_site_link;
56 char *got_logo;
57 char *got_logo_url;
59 size_t got_max_repos;
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;
68 };
70 const struct got_error* parse_conf(const char *, struct gotweb_conf *);
72 #endif /* GOTWEB_H */