diff options
-rw-r--r-- | Makefile | 18 | ||||
-rw-r--r-- | avatar.png | bin | 0 -> 11785 bytes | |||
-rwxr-xr-x | cgit-about-filter.sh | 32 | ||||
-rw-r--r-- | cgit.css | 85 | ||||
-rw-r--r-- | cgitrc | 45 | ||||
-rw-r--r-- | favicon.ico | bin | 0 -> 2462 bytes |
6 files changed, 145 insertions, 35 deletions
diff --git a/Makefile b/Makefile index 5967a32..6d9eda9 100644 --- a/Makefile +++ b/Makefile | |||
@@ -92,6 +92,24 @@ install: all | |||
92 | $(INSTALL) -m 0755 -d $(DESTDIR)$(filterdir) | 92 | $(INSTALL) -m 0755 -d $(DESTDIR)$(filterdir) |
93 | $(COPYTREE) filters/* $(DESTDIR)$(filterdir) | 93 | $(COPYTREE) filters/* $(DESTDIR)$(filterdir) |
94 | 94 | ||
95 | SERVER = root@hetzner | ||
96 | SERVER_ROOT_DIR = /usr/local/cgit | ||
97 | SERVER_ROOT = $(SERVER):$(SERVER_ROOT_DIR) | ||
98 | RSYNC = rsync -auvz | ||
99 | STATIC_ASSETS = cgit.css cgit.png robots.txt avatar.png favicon.ico | ||
100 | |||
101 | server-install: all | ||
102 | $(RSYNC) cgit $(SERVER_ROOT)/bin/cgit.cgi | ||
103 | $(RSYNC) $(STATIC_ASSETS) $(SERVER_ROOT)/share/ | ||
104 | $(RSYNC) cgitrc $(SERVER):/etc/ | ||
105 | $(RSYNC) cgit-about-filter.sh $(SERVER):/usr/bin/ | ||
106 | ssh root@hetzner \ | ||
107 | chown root:root \ | ||
108 | $(SERVER_ROOT_DIR)/bin/cgit.cgi \ | ||
109 | $(SERVER_ROOT_DIR)/share/* \ | ||
110 | /etc/cgitrc \ | ||
111 | /usr/bin/cgit-about-filter.sh | ||
112 | |||
95 | install-doc: install-man install-html install-pdf | 113 | install-doc: install-man install-html install-pdf |
96 | 114 | ||
97 | install-man: doc-man | 115 | install-man: doc-man |
diff --git a/avatar.png b/avatar.png new file mode 100644 index 0000000..510b691 --- /dev/null +++ b/avatar.png | |||
Binary files differ | |||
diff --git a/cgit-about-filter.sh b/cgit-about-filter.sh new file mode 100755 index 0000000..ad2c4ce --- /dev/null +++ b/cgit-about-filter.sh | |||
@@ -0,0 +1,32 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # This may be used with the about-filter or repo.about-filter setting in cgitrc. | ||
4 | # It passes formatting of about pages to differing programs, depending on the usage. | ||
5 | |||
6 | # The following environment variables can be used to retrieve the configuration | ||
7 | # of the repository for which this script is called: | ||
8 | # CGIT_REPO_URL ( = repo.url setting ) | ||
9 | # CGIT_REPO_NAME ( = repo.name setting ) | ||
10 | # CGIT_REPO_PATH ( = repo.path setting ) | ||
11 | # CGIT_REPO_OWNER ( = repo.owner setting ) | ||
12 | # CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) | ||
13 | # CGIT_REPO_SECTION ( = section setting ) | ||
14 | # CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) | ||
15 | |||
16 | plaintext() { | ||
17 | echo "<pre><code>" | ||
18 | awk \ | ||
19 | '{ | ||
20 | gsub(/&/,"\\&"); | ||
21 | gsub(/</,"\\<"); | ||
22 | gsub(/>/,"\\>"); | ||
23 | print; | ||
24 | }' | ||
25 | echo "</pre></code>" | ||
26 | } | ||
27 | |||
28 | case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in | ||
29 | *.markdown|*.mdown|*.md|*.mkd) exec pandoc -thtml -fmarkdown ;; | ||
30 | *.htm|*.html) exec cat ;; | ||
31 | *) plaintext ;; | ||
32 | esac | ||
diff --git a/cgit.css b/cgit.css index 51ddbf8..4ece3a5 100644 --- a/cgit.css +++ b/cgit.css | |||
@@ -1,10 +1,15 @@ | |||
1 | body { | ||
2 | max-width: 100ch; | ||
3 | padding: 2ch; | ||
4 | margin: 0 auto; | ||
5 | color: navy; | ||
6 | background: papayawhip; | ||
7 | font-size: 16pt; | ||
8 | } | ||
9 | |||
1 | div#cgit { | 10 | div#cgit { |
2 | padding: 0em; | ||
3 | margin: 0em; | 11 | margin: 0em; |
4 | font-family: sans-serif; | 12 | font-family: sans-serif; |
5 | font-size: 10pt; | ||
6 | color: #333; | ||
7 | background: white; | ||
8 | padding: 4px; | 13 | padding: 4px; |
9 | } | 14 | } |
10 | 15 | ||
@@ -56,13 +61,13 @@ div#cgit table#header td.form select { | |||
56 | } | 61 | } |
57 | 62 | ||
58 | div#cgit table#header td.sub { | 63 | div#cgit table#header td.sub { |
59 | color: #777; | 64 | color: navy; |
60 | border-top: solid 1px #ccc; | 65 | border-top: solid 1px goldenrod; |
61 | padding-left: 10px; | 66 | padding-left: 10px; |
62 | } | 67 | } |
63 | 68 | ||
64 | div#cgit table.tabs { | 69 | div#cgit table.tabs { |
65 | border-bottom: solid 3px #ccc; | 70 | border-bottom: solid 3px goldenrod; |
66 | border-collapse: collapse; | 71 | border-collapse: collapse; |
67 | margin-top: 2em; | 72 | margin-top: 2em; |
68 | margin-bottom: 0px; | 73 | margin-bottom: 0px; |
@@ -76,13 +81,12 @@ div#cgit table.tabs td { | |||
76 | 81 | ||
77 | div#cgit table.tabs td a { | 82 | div#cgit table.tabs td a { |
78 | padding: 2px 0.25em; | 83 | padding: 2px 0.25em; |
79 | color: #777; | 84 | color: navy; |
80 | font-size: 110%; | 85 | font-size: 110%; |
81 | } | 86 | } |
82 | 87 | ||
83 | div#cgit table.tabs td a.active { | 88 | div#cgit table.tabs td a.active { |
84 | color: #000; | 89 | background-color: goldenrod; |
85 | background-color: #ccc; | ||
86 | } | 90 | } |
87 | 91 | ||
88 | div#cgit table.tabs a[href^="http://"]:after, div#cgit table.tabs a[href^="https://"]:after { | 92 | div#cgit table.tabs a[href^="http://"]:after, div#cgit table.tabs a[href^="https://"]:after { |
@@ -116,10 +120,11 @@ div#cgit div.path { | |||
116 | div#cgit div.content { | 120 | div#cgit div.content { |
117 | margin: 0px; | 121 | margin: 0px; |
118 | padding: 2em; | 122 | padding: 2em; |
119 | border-bottom: solid 3px #ccc; | 123 | background: #fff5e6; |
124 | font-size: 12pt; | ||
125 | border-bottom: solid 3px goldenrod; | ||
120 | } | 126 | } |
121 | 127 | ||
122 | |||
123 | div#cgit table.list { | 128 | div#cgit table.list { |
124 | width: 100%; | 129 | width: 100%; |
125 | border: none; | 130 | border: none; |
@@ -127,47 +132,47 @@ div#cgit table.list { | |||
127 | } | 132 | } |
128 | 133 | ||
129 | div#cgit table.list tr { | 134 | div#cgit table.list tr { |
130 | background: white; | 135 | background: #fff5e6; |
131 | } | 136 | } |
132 | 137 | ||
133 | div#cgit table.list tr.logheader { | 138 | div#cgit table.list tr.logheader { |
134 | background: #eee; | 139 | background: #fff5e6; |
135 | } | 140 | } |
136 | 141 | ||
137 | div#cgit table.list tr:nth-child(even) { | 142 | div#cgit table.list tr:nth-child(even) { |
138 | background: #f7f7f7; | 143 | background: #fff5e6; |
139 | } | 144 | } |
140 | 145 | ||
141 | div#cgit table.list tr:nth-child(odd) { | 146 | div#cgit table.list tr:nth-child(odd) { |
142 | background: white; | 147 | background: #fff5e6; |
143 | } | 148 | } |
144 | 149 | ||
145 | div#cgit table.list tr:hover { | 150 | div#cgit table.list tr:hover { |
146 | background: #eee; | 151 | background: papayawhip; |
147 | } | 152 | } |
148 | 153 | ||
149 | div#cgit table.list tr.nohover { | 154 | div#cgit table.list tr.nohover { |
150 | background: white; | 155 | background: #fff5e6; |
151 | } | 156 | } |
152 | 157 | ||
153 | div#cgit table.list tr.nohover:hover { | 158 | div#cgit table.list tr.nohover:hover { |
154 | background: white; | 159 | background: papayawhip; |
155 | } | 160 | } |
156 | 161 | ||
157 | div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { | 162 | div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { |
158 | background: #f7f7f7; | 163 | background: #fff5e6; |
159 | } | 164 | } |
160 | 165 | ||
161 | div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) { | 166 | div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) { |
162 | background: white; | 167 | background: #fff5e6; |
163 | } | 168 | } |
164 | 169 | ||
165 | div#cgit table.list th { | 170 | div#cgit table.list th { |
166 | font-weight: bold; | 171 | font-weight: bold; |
167 | /* color: #888; | 172 | /* color: #888; |
168 | border-top: dashed 1px #888; | 173 | border-top: dashed 1px #888; |
169 | border-bottom: dashed 1px #888; | 174 | border-bottom: dashed 1px #888; |
170 | */ | 175 | */ |
171 | padding: 0.1em 0.5em 0.05em 0.5em; | 176 | padding: 0.1em 0.5em 0.05em 0.5em; |
172 | vertical-align: baseline; | 177 | vertical-align: baseline; |
173 | } | 178 | } |
@@ -261,13 +266,13 @@ div#cgit div#summary { | |||
261 | div#cgit table#downloads { | 266 | div#cgit table#downloads { |
262 | float: right; | 267 | float: right; |
263 | border-collapse: collapse; | 268 | border-collapse: collapse; |
264 | border: solid 1px #777; | 269 | border: solid 1px goldenrod; |
265 | margin-left: 0.5em; | 270 | margin-left: 0.5em; |
266 | margin-bottom: 0.5em; | 271 | margin-bottom: 0.5em; |
267 | } | 272 | } |
268 | 273 | ||
269 | div#cgit table#downloads th { | 274 | div#cgit table#downloads th { |
270 | background-color: #ccc; | 275 | background-color: goldenrod; |
271 | } | 276 | } |
272 | 277 | ||
273 | div#cgit div#blob { | 278 | div#cgit div#blob { |
@@ -346,11 +351,11 @@ div#cgit table.blame td.linenumbers div.alt { | |||
346 | } | 351 | } |
347 | 352 | ||
348 | div#cgit table.blame div.alt:nth-child(even) { | 353 | div#cgit table.blame div.alt:nth-child(even) { |
349 | background: #eee; | 354 | background: #fff5e6; |
350 | } | 355 | } |
351 | 356 | ||
352 | div#cgit table.blame div.alt:nth-child(odd) { | 357 | div#cgit table.blame div.alt:nth-child(odd) { |
353 | background: white; | 358 | background: #fff5e6; |
354 | } | 359 | } |
355 | 360 | ||
356 | div#cgit table.blame td.lines > div { | 361 | div#cgit table.blame td.lines > div { |
@@ -375,14 +380,14 @@ div#cgit table.bin-blob { | |||
375 | div#cgit table.bin-blob th { | 380 | div#cgit table.bin-blob th { |
376 | font-family: monospace; | 381 | font-family: monospace; |
377 | white-space: pre; | 382 | white-space: pre; |
378 | border: solid 1px #777; | 383 | border: solid 1px goldenrod; |
379 | padding: 0.5em 1em; | 384 | padding: 0.5em 1em; |
380 | } | 385 | } |
381 | 386 | ||
382 | div#cgit table.bin-blob td { | 387 | div#cgit table.bin-blob td { |
383 | font-family: monospace; | 388 | font-family: monospace; |
384 | white-space: pre; | 389 | white-space: pre; |
385 | border-left: solid 1px #777; | 390 | border-left: solid 1px goldenrod; |
386 | padding: 0em 1em; | 391 | padding: 0em 1em; |
387 | } | 392 | } |
388 | 393 | ||
@@ -403,7 +408,7 @@ div#cgit div.cgit-panel { | |||
403 | div#cgit div.cgit-panel table { | 408 | div#cgit div.cgit-panel table { |
404 | border-collapse: collapse; | 409 | border-collapse: collapse; |
405 | border: solid 1px #aaa; | 410 | border: solid 1px #aaa; |
406 | background-color: #eee; | 411 | background-color: papayawhip; |
407 | } | 412 | } |
408 | 413 | ||
409 | div#cgit div.cgit-panel th { | 414 | div#cgit div.cgit-panel th { |
@@ -605,7 +610,7 @@ div#cgit ul.pager li { | |||
605 | } | 610 | } |
606 | 611 | ||
607 | div#cgit ul.pager a { | 612 | div#cgit ul.pager a { |
608 | color: #777; | 613 | color: goldenrod; |
609 | } | 614 | } |
610 | 615 | ||
611 | div#cgit ul.pager .current { | 616 | div#cgit ul.pager .current { |
@@ -649,11 +654,11 @@ div#cgit div.footer { | |||
649 | margin-top: 0.5em; | 654 | margin-top: 0.5em; |
650 | text-align: center; | 655 | text-align: center; |
651 | font-size: 80%; | 656 | font-size: 80%; |
652 | color: #ccc; | 657 | color: goldenrod; |
653 | } | 658 | } |
654 | 659 | ||
655 | div#cgit div.footer a { | 660 | div#cgit div.footer a { |
656 | color: #ccc; | 661 | color: goldenrod; |
657 | text-decoration: none; | 662 | text-decoration: none; |
658 | } | 663 | } |
659 | 664 | ||
@@ -730,7 +735,7 @@ div#cgit table.stats td.total { | |||
730 | div#cgit table.stats td.sum { | 735 | div#cgit table.stats td.sum { |
731 | color: #c00; | 736 | color: #c00; |
732 | font-weight: bold; | 737 | font-weight: bold; |
733 | /* background-color: #eee; */ | 738 | /*background-color: #eee; */ |
734 | } | 739 | } |
735 | 740 | ||
736 | div#cgit table.stats td.left { | 741 | div#cgit table.stats td.left { |
@@ -879,3 +884,13 @@ div#cgit table.ssdiff td.space { | |||
879 | div#cgit table.ssdiff td.space div { | 884 | div#cgit table.ssdiff td.space div { |
880 | min-height: 3em; | 885 | min-height: 3em; |
881 | } | 886 | } |
887 | |||
888 | div#cgit div.content pre>code { | ||
889 | background-color: #ffe; | ||
890 | padding: 1ch; | ||
891 | display: block; | ||
892 | } | ||
893 | |||
894 | /* Local Variables: */ | ||
895 | /* indent-tabs-mode: t */ | ||
896 | /* End: */ | ||
diff --git a/cgitrc b/cgitrc new file mode 100644 index 0000000..f58dcb7 --- /dev/null +++ b/cgitrc | |||
@@ -0,0 +1,45 @@ | |||
1 | # /etc/cgitrc -*- conf -*- | ||
2 | |||
3 | root-title=git.acdw.net | ||
4 | root-desc=personal projects of acdw | ||
5 | |||
6 | # Paths to static resource in Nginx root | ||
7 | css=/cgit.css | ||
8 | #logo=/cgit.png | ||
9 | logo=/avatar.png | ||
10 | |||
11 | clone-url=git://$HTTP_HOST/$CGIT_REPO_URL | ||
12 | snapshots=tar.gz zip | ||
13 | |||
14 | enable-commit-graph=1 | ||
15 | repository-sort=age | ||
16 | branch-sort=age | ||
17 | |||
18 | max-repodesc-length=100 | ||
19 | |||
20 | section-from-path=1 | ||
21 | max-repo-count=100 | ||
22 | |||
23 | mimetype.gif=image/gif | ||
24 | mimetype.html=text/html | ||
25 | mimetype.jpg=image/jpeg | ||
26 | mimetype.jpeg=image/jpeg | ||
27 | mimetype.pdf=application/pdf | ||
28 | mimetype.png=image/png | ||
29 | mimetype.svg=image/svg+xml | ||
30 | |||
31 | # enable git config | ||
32 | enable-git-config=1 | ||
33 | # remove .git from URLs and repo list | ||
34 | remove-suffix=1 | ||
35 | # Root for all cgit links | ||
36 | virtual-root=/ | ||
37 | |||
38 | # READMEs | ||
39 | readme=:README.md | ||
40 | readme=:readme.txt | ||
41 | readme=:README | ||
42 | about-filter=/usr/bin/cgit-about-filter.sh | ||
43 | |||
44 | # Folder with all my repos | ||
45 | scan-path=/git/ | ||
diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..72904ce --- /dev/null +++ b/favicon.ico | |||
Binary files differ | |||