aboutsummaryrefslogtreecommitdiff
path: root/gitserver-documentation.wiki
blob: be617b23d54ac369b778c4244a5d0019ca7d84e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
= Hooks =
Each repository is initialized with a hook directory which symlinks to
a global hooks directory. In the global hooks directory, each
(relevant) hook is symlinked to [[https://git.hornquist.se/githooks/about/|GitHooks dispatcher]], which
will run every hooks in `${HOOK_DIR}/${HOOK_NAME}.d` (non-recursively)

== Hook Dir ==
Hooks are searched for in
- `/etc/githooks/hooks` (configurable through `githooks.hook-dir`)
- `${GIT_REF}:.githooks/` for every ref affected by the push

== Default Hooks ==
[[https://git.hornquist.se/githooks-hooks/|The global hooks can be viewed here.]]

== Repo Configuration ==
A [[https://git.hornquist.se/githooks-hooks/tree/post-receive.d/gitconfig|gitconfig hook]] is run on post-receive.

It reads the git configuration file `${GIT_REF}:.gitconfig` from the
pushed ref, and updates the repos config file.

It's recommended to create a new orphan branch called `gitconfig`, and
handle all configuration from there.

=== Repo Description ===
Must be set through `gitweb.description`.

=== Configuration keys of interest ===
`gitweb.description` :: Displayed description of repo
`gitweb.category` :: Category, (unless in a subdirectory)
`gitweb.homepage` :: Will be added as a tab
`cgit.defbranch` :: Default branch to show
`cgit.logo` :: Will replace cgit logo for this repo, see [[#Logo]]

Read more: [[man:cgitrc#5]]

==== Logo ====
The prefered way to publish logo:s is thourgh the repo itself, set
`cgit.logo` to https://git.hornquist.se/REPO_NAME/plain/LOGO.PNG?h=*BRANCHNAME*

== Re-running hooks ==
The script `~git/rerun-hook.py` is available on the server. It takes
a path to a repo, and executes the post-receive hook as if an initial
push containing everything in the repo.

= Gitweb Categories =
[[https://git.hornquist.se/?q=Archive|Archive]] :: Repos which will probably never again get touched
[[https://git.hornquist.se/?q=doc|doc]] :: "Pure" text repos.
[[https://git.hornquist.se/?q=fork|fork]] :: Repos which are forked from elsewhere.

= Subdirectories =
[[https://git.hornquist.se/?q=archpkg|archpkg]] :: Arch PKGBUILD files.
[[https://git.hornquist.se/?q=houseOfMad|houseOfMad]] :: An old game
[[https://git.hornquist.se/?q=liu|liu]] :: Schoolwork from LiU
[[https://git.hornquist.se/?q=puppet|puppet]] :: Puppet Modules
[[https://git.hornquist.se/?q=scheme|scheme]] :: Misc scheme code
[[https://git.hornquist.se/?q=unity|unity]] :: Misc Unity (game engine) code

= Remaning Configuratino =

The cgit server is configuration is mostly contained in 
[[https://git.hornquist.se/puppet/cgit/|my Puppetmodule for CGit]]. It
is however populated by my (as of yet) unpublished Hiera data.

The various CGit filters which run are however available here
https://git.hornquist.se/cgit-filters/

{{{
 __________________________ 
< Den som bestämde gjorde >
 -------------------------- 
\                             .       .
 \                           / `.   .' " 
  \                  .---.  <    > <    >  .---.
   \                 |    \  \ - ~ ~ - /  /    |
         _____          ..-~             ~-..-~
        |     |   \~~~\.'                    `./~~~/
       ---------   \__/                        \__/
      .'  O    \     /               /       \  " 
     (_____,    `._.'               |         }  \/~~~/
      `----.          /       }     |        /    \__/
            `-.      |       /      |       /      `. ,~~|
                ~-.__|      /_ - ~ ^|      /- _      `..-'   
                     |     /        |     /     ~-.     `-. _  _  _
                     |_____|        |_____|         ~ - . _ _ _ _ _>
}}}