about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-06-09 17:19:17 -0500
committerCase Duckworth2022-06-09 17:19:17 -0500
commit4bd20c0984b3a38283430ab355eef5dcfcea91dd (patch)
tree2706b1e4fe75b180f2b1162353c348734d08abc7
parentBump version to 1.4.1 (diff)
downloadcgit-4bd20c0984b3a38283430ab355eef5dcfcea91dd.tar.gz
cgit-4bd20c0984b3a38283430ab355eef5dcfcea91dd.zip
Apply my personal configurations to cgit
For easy deployment.  Actual code changes will go in master for sharing, but
then will be merged here.
-rw-r--r--Makefile18
-rw-r--r--avatar.pngbin0 -> 11785 bytes
-rwxr-xr-xcgit-about-filter.sh32
-rw-r--r--cgit.css81
-rw-r--r--cgitrc45
-rw-r--r--favicon.icobin0 -> 2462 bytes
6 files changed, 141 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
95SERVER = root@hetzner
96SERVER_ROOT_DIR = /usr/local/cgit
97SERVER_ROOT = $(SERVER):$(SERVER_ROOT_DIR)
98RSYNC = rsync -auvz
99STATIC_ASSETS = cgit.css cgit.png robots.txt avatar.png favicon.ico
100
101server-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
95install-doc: install-man install-html install-pdf 113install-doc: install-man install-html install-pdf
96 114
97install-man: doc-man 115install-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
16plaintext() {
17 echo "<pre><code>"
18 awk \
19 '{
20 gsub(/&/,"\\&amp;");
21 gsub(/</,"\\&lt;");
22 gsub(/>/,"\\&gt;");
23 print;
24 }'
25 echo "</pre></code>"
26}
27
28case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in
29 *.markdown|*.mdown|*.md|*.mkd) exec pandoc -thtml -fmarkdown ;;
30 *.htm|*.html) exec cat ;;
31 *) plaintext ;;
32esac
diff --git a/cgit.css b/cgit.css index 51ddbf8..ee2ab11 100644 --- a/cgit.css +++ b/cgit.css
@@ -1,10 +1,15 @@
1body {
2 max-width: 100ch;
3 padding: 2ch;
4 margin: 0 auto;
5 color: navy;
6 background: papayawhip;
7 font-size: 16pt;
8}
9
1div#cgit { 10div#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
58div#cgit table#header td.sub { 63div#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
64div#cgit table.tabs { 69div#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
77div#cgit table.tabs td a { 82div#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
83div#cgit table.tabs td a.active { 88div#cgit table.tabs td a.active {
84 color: #000; 89 background-color: goldenrod;
85 background-color: #ccc;
86} 90}
87 91
88div#cgit table.tabs a[href^="http://"]:after, div#cgit table.tabs a[href^="https://"]:after { 92div#cgit table.tabs a[href^="http://"]:after, div#cgit table.tabs a[href^="https://"]:after {
@@ -116,10 +120,11 @@ div#cgit div.path {
116div#cgit div.content { 120div#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
123div#cgit table.list { 128div#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
129div#cgit table.list tr { 134div#cgit table.list tr {
130 background: white; 135 background: #fff5e6;
131} 136}
132 137
133div#cgit table.list tr.logheader { 138div#cgit table.list tr.logheader {
134 background: #eee; 139 background: #fff5e6;
135} 140}
136 141
137div#cgit table.list tr:nth-child(even) { 142div#cgit table.list tr:nth-child(even) {
138 background: #f7f7f7; 143 background: #fff5e6;
139} 144}
140 145
141div#cgit table.list tr:nth-child(odd) { 146div#cgit table.list tr:nth-child(odd) {
142 background: white; 147 background: #fff5e6;
143} 148}
144 149
145div#cgit table.list tr:hover { 150div#cgit table.list tr:hover {
146 background: #eee; 151 background: papayawhip;
147} 152}
148 153
149div#cgit table.list tr.nohover { 154div#cgit table.list tr.nohover {
150 background: white; 155 background: #fff5e6;
151} 156}
152 157
153div#cgit table.list tr.nohover:hover { 158div#cgit table.list tr.nohover:hover {
154 background: white; 159 background: papayawhip;
155} 160}
156 161
157div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { 162div#cgit table.list tr.nohover-highlight:hover:nth-child(even) {
158 background: #f7f7f7; 163 background: #fff5e6;
159} 164}
160 165
161div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) { 166div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) {
162 background: white; 167 background: #fff5e6;
163} 168}
164 169
165div#cgit table.list th { 170div#cgit table.list th {
166 font-weight: bold; 171 font-weight: bold;
167 /* color: #888; 172 /* color: #888;
168 border-top: dashed 1px #888; 173border-top: dashed 1px #888;
169 border-bottom: dashed 1px #888; 174border-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 {
261div#cgit table#downloads { 266div#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
269div#cgit table#downloads th { 274div#cgit table#downloads th {
270 background-color: #ccc; 275 background-color: goldenrod;
271} 276}
272 277
273div#cgit div#blob { 278div#cgit div#blob {
@@ -346,11 +351,11 @@ div#cgit table.blame td.linenumbers div.alt {
346} 351}
347 352
348div#cgit table.blame div.alt:nth-child(even) { 353div#cgit table.blame div.alt:nth-child(even) {
349 background: #eee; 354 background: #fff5e6;
350} 355}
351 356
352div#cgit table.blame div.alt:nth-child(odd) { 357div#cgit table.blame div.alt:nth-child(odd) {
353 background: white; 358 background: #fff5e6;
354} 359}
355 360
356div#cgit table.blame td.lines > div { 361div#cgit table.blame td.lines > div {
@@ -375,14 +380,14 @@ div#cgit table.bin-blob {
375div#cgit table.bin-blob th { 380div#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
382div#cgit table.bin-blob td { 387div#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 {
403div#cgit div.cgit-panel table { 408div#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
409div#cgit div.cgit-panel th { 414div#cgit div.cgit-panel th {
@@ -605,7 +610,7 @@ div#cgit ul.pager li {
605} 610}
606 611
607div#cgit ul.pager a { 612div#cgit ul.pager a {
608 color: #777; 613 color: goldenrod;
609} 614}
610 615
611div#cgit ul.pager .current { 616div#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
655div#cgit div.footer a { 660div#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 {
730div#cgit table.stats td.sum { 735div#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
736div#cgit table.stats td.left { 741div#cgit table.stats td.left {
@@ -879,3 +884,9 @@ div#cgit table.ssdiff td.space {
879div#cgit table.ssdiff td.space div { 884div#cgit table.ssdiff td.space div {
880 min-height: 3em; 885 min-height: 3em;
881} 886}
887
888div#cgit div.content pre>code {
889 background-color: #ffe;
890 padding: 1ch;
891 display: block;
892}
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
3root-title=git.acdw.net
4root-desc=personal projects of acdw
5
6# Paths to static resource in Nginx root
7css=/cgit.css
8#logo=/cgit.png
9logo=/avatar.png
10
11clone-url=git://$HTTP_HOST/$CGIT_REPO_URL
12snapshots=tar.gz zip
13
14enable-commit-graph=1
15repository-sort=age
16branch-sort=age
17
18max-repodesc-length=100
19
20section-from-path=1
21max-repo-count=100
22
23mimetype.gif=image/gif
24mimetype.html=text/html
25mimetype.jpg=image/jpeg
26mimetype.jpeg=image/jpeg
27mimetype.pdf=application/pdf
28mimetype.png=image/png
29mimetype.svg=image/svg+xml
30
31# enable git config
32enable-git-config=1
33# remove .git from URLs and repo list
34remove-suffix=1
35# Root for all cgit links
36virtual-root=/
37
38# READMEs
39readme=:README.md
40readme=:readme.txt
41readme=:README
42about-filter=/usr/bin/cgit-about-filter.sh
43
44# Folder with all my repos
45scan-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