Blob


1 /*
2 * Copyright (c) 2019 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_GOTWWW "/gotweb"
34 #define D_SITENAME "Gotweb"
35 #define D_SITEOWNER "Got Owner"
36 #define D_SITELINK "Repos"
37 #define D_GOTLOGO "got.png"
38 #define D_GOTURL "https://gameoftrees.org"
40 #define D_SHOWROWNER true
41 #define D_SHOWSOWNER true
42 #define D_SHOWAGE true
43 #define D_SHOWDESC true
44 #define D_SHOWURL true
45 #define D_MAXREPO 0
46 #define D_MAXREPODISP 25
47 #define D_MAXSLCOMMDISP 10
48 #define D_MAXCOMMITDISP 25
50 #define BUFFER_SIZE 2048
52 struct gotweb_conf {
53 char *got_repos_path;
54 char *got_www_path;
55 char *got_site_name;
56 char *got_site_owner;
57 char *got_site_link;
58 char *got_logo;
59 char *got_logo_url;
61 size_t got_max_repos;
62 size_t got_max_repos_display;
63 size_t got_max_commits_display;
65 bool got_show_site_owner;
66 bool got_show_repo_owner;
67 bool got_show_repo_age;
68 bool got_show_repo_description;
69 bool got_show_repo_cloneurl;
70 };
72 const struct got_error* parse_conf(const char *, struct gotweb_conf *);
74 #endif /* GOTWEB_H */