Blame


1 2c251c14 2020-01-15 tracey /*
2 9460dac0 2020-01-15 tracey * Copyright (c) 2019, 2020 Tracey Emery <tracey@traceyemery.net>
3 2c251c14 2020-01-15 tracey * Copyright (c) 2018, 2019 Stefan Sperling <stsp@openbsd.org>
4 2c251c14 2020-01-15 tracey *
5 2c251c14 2020-01-15 tracey * Permission to use, copy, modify, and distribute this software for any
6 2c251c14 2020-01-15 tracey * purpose with or without fee is hereby granted, provided that the above
7 2c251c14 2020-01-15 tracey * copyright notice and this permission notice appear in all copies.
8 2c251c14 2020-01-15 tracey *
9 2c251c14 2020-01-15 tracey * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 2c251c14 2020-01-15 tracey * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 2c251c14 2020-01-15 tracey * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 2c251c14 2020-01-15 tracey * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 2c251c14 2020-01-15 tracey * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 2c251c14 2020-01-15 tracey * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 2c251c14 2020-01-15 tracey * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 2c251c14 2020-01-15 tracey */
17 2c251c14 2020-01-15 tracey
18 2c251c14 2020-01-15 tracey #ifndef GOTWEB_H
19 2c251c14 2020-01-15 tracey #define GOTWEB_H
20 2c251c14 2020-01-15 tracey
21 2c251c14 2020-01-15 tracey #include <stdbool.h>
22 2c251c14 2020-01-15 tracey
23 2c251c14 2020-01-15 tracey #include <got_error.h>
24 2c251c14 2020-01-15 tracey
25 2c251c14 2020-01-15 tracey #define GOTWEB_CONF "/etc/gotweb.conf"
26 2c251c14 2020-01-15 tracey #define GOTWEB_TMPL_DIR "/cgi-bin/gw_tmpl"
27 2c251c14 2020-01-15 tracey #define GOTWEB "/cgi-bin/gotweb/gotweb"
28 2c251c14 2020-01-15 tracey
29 2c251c14 2020-01-15 tracey #define GOTWEB_GOT_DIR ".got"
30 2c251c14 2020-01-15 tracey #define GOTWEB_GIT_DIR ".git"
31 2c251c14 2020-01-15 tracey
32 2c251c14 2020-01-15 tracey #define D_GOTPATH "/got/public"
33 2c251c14 2020-01-15 tracey #define D_SITENAME "Gotweb"
34 2c251c14 2020-01-15 tracey #define D_SITEOWNER "Got Owner"
35 2c251c14 2020-01-15 tracey #define D_SITELINK "Repos"
36 2c251c14 2020-01-15 tracey #define D_GOTLOGO "got.png"
37 2c251c14 2020-01-15 tracey #define D_GOTURL "https://gameoftrees.org"
38 2c251c14 2020-01-15 tracey
39 2c251c14 2020-01-15 tracey #define D_SHOWROWNER true
40 2c251c14 2020-01-15 tracey #define D_SHOWSOWNER true
41 2c251c14 2020-01-15 tracey #define D_SHOWAGE true
42 2c251c14 2020-01-15 tracey #define D_SHOWDESC true
43 2c251c14 2020-01-15 tracey #define D_SHOWURL true
44 2c251c14 2020-01-15 tracey #define D_MAXREPO 0
45 2c251c14 2020-01-15 tracey #define D_MAXREPODISP 25
46 2570478e 2020-01-15 tracey #define D_MAXSLCOMMDISP 10
47 2c251c14 2020-01-15 tracey #define D_MAXCOMMITDISP 25
48 2c251c14 2020-01-15 tracey
49 2c251c14 2020-01-15 tracey #define BUFFER_SIZE 2048
50 2c251c14 2020-01-15 tracey
51 2c251c14 2020-01-15 tracey struct gotweb_conf {
52 2c251c14 2020-01-15 tracey char *got_repos_path;
53 2c251c14 2020-01-15 tracey char *got_site_name;
54 2c251c14 2020-01-15 tracey char *got_site_owner;
55 2c251c14 2020-01-15 tracey char *got_site_link;
56 2c251c14 2020-01-15 tracey char *got_logo;
57 2c251c14 2020-01-15 tracey char *got_logo_url;
58 2c251c14 2020-01-15 tracey
59 2c251c14 2020-01-15 tracey size_t got_max_repos;
60 2c251c14 2020-01-15 tracey size_t got_max_repos_display;
61 2c251c14 2020-01-15 tracey size_t got_max_commits_display;
62 2c251c14 2020-01-15 tracey
63 2c251c14 2020-01-15 tracey bool got_show_site_owner;
64 2c251c14 2020-01-15 tracey bool got_show_repo_owner;
65 2c251c14 2020-01-15 tracey bool got_show_repo_age;
66 2c251c14 2020-01-15 tracey bool got_show_repo_description;
67 2c251c14 2020-01-15 tracey bool got_show_repo_cloneurl;
68 2c251c14 2020-01-15 tracey };
69 2c251c14 2020-01-15 tracey
70 2c251c14 2020-01-15 tracey const struct got_error* parse_conf(const char *, struct gotweb_conf *);
71 2c251c14 2020-01-15 tracey
72 2c251c14 2020-01-15 tracey #endif /* GOTWEB_H */