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 #define GOTWEB_CONF "/etc/gotweb.conf"
24 2c251c14 2020-01-15 tracey #define GOTWEB_TMPL_DIR "/cgi-bin/gw_tmpl"
25 2c251c14 2020-01-15 tracey #define GOTWEB "/cgi-bin/gotweb/gotweb"
26 2c251c14 2020-01-15 tracey
27 2c251c14 2020-01-15 tracey #define GOTWEB_GOT_DIR ".got"
28 2c251c14 2020-01-15 tracey #define GOTWEB_GIT_DIR ".git"
29 2c251c14 2020-01-15 tracey
30 75c1763d 2022-06-15 stsp #define D_GOTWWW "/gotweb"
31 2c251c14 2020-01-15 tracey #define D_GOTPATH "/got/public"
32 2c251c14 2020-01-15 tracey #define D_SITENAME "Gotweb"
33 2c251c14 2020-01-15 tracey #define D_SITEOWNER "Got Owner"
34 2c251c14 2020-01-15 tracey #define D_SITELINK "Repos"
35 2c251c14 2020-01-15 tracey #define D_GOTLOGO "got.png"
36 2c251c14 2020-01-15 tracey #define D_GOTURL "https://gameoftrees.org"
37 2c251c14 2020-01-15 tracey
38 2c251c14 2020-01-15 tracey #define D_SHOWROWNER true
39 2c251c14 2020-01-15 tracey #define D_SHOWSOWNER true
40 2c251c14 2020-01-15 tracey #define D_SHOWAGE true
41 2c251c14 2020-01-15 tracey #define D_SHOWDESC true
42 2c251c14 2020-01-15 tracey #define D_SHOWURL true
43 2c251c14 2020-01-15 tracey #define D_MAXREPO 0
44 2c251c14 2020-01-15 tracey #define D_MAXREPODISP 25
45 2570478e 2020-01-15 tracey #define D_MAXSLCOMMDISP 10
46 2c251c14 2020-01-15 tracey #define D_MAXCOMMITDISP 25
47 2c251c14 2020-01-15 tracey
48 2c251c14 2020-01-15 tracey #define BUFFER_SIZE 2048
49 2c251c14 2020-01-15 tracey
50 c34ec417 2020-06-22 tracey struct gotweb_config {
51 2c251c14 2020-01-15 tracey char *got_repos_path;
52 9f6f3943 2020-09-24 tracey char *got_www_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 c34ec417 2020-06-22 tracey /*
71 c34ec417 2020-06-22 tracey * Parse gotweb config file, if it exists
72 c34ec417 2020-06-22 tracey * Load gotweb_config struct
73 c34ec417 2020-06-22 tracey */
74 c34ec417 2020-06-22 tracey const struct got_error* parse_gotweb_config(struct gotweb_config **,
75 c34ec417 2020-06-22 tracey const char *);
76 2c251c14 2020-01-15 tracey
77 2c251c14 2020-01-15 tracey #endif /* GOTWEB_H */