diff options
| -rwxr-xr-x | cgit/ssh/git-shell-commands/list | 15 | ||||
| -rwxr-xr-x | cgit/ssh/git-shell-commands/set-category | 28 | ||||
| -rw-r--r-- | cgit/static/cgit.css | 17 | ||||
| -rwxr-xr-x | setup.sh | 4 |
4 files changed, 44 insertions, 20 deletions
diff --git a/cgit/ssh/git-shell-commands/list b/cgit/ssh/git-shell-commands/list index 804a488..8a924c9 100755 --- a/cgit/ssh/git-shell-commands/list +++ b/cgit/ssh/git-shell-commands/list @@ -1,13 +1,8 @@ #!/usr/bin/env sh -ls -1 /git | while IPS="" read name; do - echo "$name" - printf " description: " - if [ -f "/git/${name}/description" ]; then - cat "/git/${name}/description" - else - echo "<no description>" - fi - echo "" -done +git_dir=/git + +ls -1 "$git_dir" | while IPS="" read name; do + echo "$name||||$(cat "${git_dir}/${name}/description" 2>/dev/null)" +done | column -t -d -s "||||" diff --git a/cgit/ssh/git-shell-commands/set-category b/cgit/ssh/git-shell-commands/set-category new file mode 100755 index 0000000..7f74b94 --- /dev/null +++ b/cgit/ssh/git-shell-commands/set-category @@ -0,0 +1,28 @@ +#!/usr/bin/env sh + +set -eu + +if [ $# -lt 1 ]; then + echo "Usage: set-category <name> [category]" 1>&2 + exit 1 +fi + +repo_name="$1"; +[ -z "$repo_name" ] && echo "Error: empty repo name" 1>&2 && exit 1 +(echo "$repo_name" | grep -q "^[A-Za-z0-9_-]\+$" 2>/dev/null) || (echo "Error: invalid repo name" 1>&2 && exit 1) + +category="${2:-""}"; +repo_dir="/git/${repo_name}.git" + +if ! [ -d "$repo_dir" ]; then + echo "Error: $repo_name doesn't exist" 1>&2 + exit 1; +fi + +if [ -z "$category" ]; then + git -C "$repo_dir" config unset gitweb.category +else + git -C "$repo_dir" config set gitweb.category "$category" +fi + +echo "Done" diff --git a/cgit/static/cgit.css b/cgit/static/cgit.css index 4ee370d..2fa54e2 100644 --- a/cgit/static/cgit.css +++ b/cgit/static/cgit.css @@ -173,9 +173,11 @@ div#cgit table.list tr.logheader { } div#cgit table.list tr:nth-child(even) { - background: #161616; + background: #181818; +} +div#cgit table.list tr:nth-child(odd) { + background: #121212; } -div#cgit table.list tr:nth-child(odd) { } div#cgit table.list tr:hover { background: #333; @@ -189,12 +191,8 @@ div#cgit table.list tr.nohover:hover { background: #222; } -div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { - background: #f7f7f7; -} - -div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) { - background: black; +div#cgit table.list tr.nohover-highlight { + background: #000; } div#cgit table.list th { @@ -618,7 +616,8 @@ div#cgit .right { div#cgit table.list td.reposection { font-style: italic; - color: #888; + color: var(--color-accent-2); + font-weight: bold; } div#cgit a.button { @@ -24,6 +24,8 @@ start() { # dc up nginx-proxy -d } +cache_clear() { services exec cgit sh -c 'rm -rf /var/cache/cgit/*'; } + startfg() { services build --pull stop || true @@ -86,7 +88,7 @@ update() { cmd="$1"; shift; case "$cmd" in - update|start|startfg|stop|services|core) "$cmd" "$@" ;; + update|start|startfg|stop|services|core|cache_clear) "$cmd" "$@" ;; configure|configure_firewall|configure_user|configure_fs|configure_packages|configure_git) "$cmd" "$@" ;; *) echo "Invalid command: $cmd"; exit 1 ;; esac |
