From d03619fc2ac6c7e66432277ae4098db9274cd0b1 Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Wed, 8 Jul 2026 19:33:13 -0400 Subject: cgit css --- configuration/cgit/cgitrc | 27 +++++ configuration/cgit/custom.css | 87 +++++++++++++++ configuration/cgit/head_include.html | 1 + configuration/cgitrc | 26 ----- configuration/gitolite.rc | 202 ----------------------------------- configuration/gitolite/gitolite.rc | 202 +++++++++++++++++++++++++++++++++++ configuration/homepage.conf | 69 ------------ configuration/nginx/homepage.conf | 69 ++++++++++++ scripts/redeploy.sh | 8 +- 9 files changed, 391 insertions(+), 300 deletions(-) create mode 100644 configuration/cgit/cgitrc create mode 100644 configuration/cgit/custom.css create mode 100644 configuration/cgit/head_include.html delete mode 100644 configuration/cgitrc delete mode 100644 configuration/gitolite.rc create mode 100644 configuration/gitolite/gitolite.rc delete mode 100644 configuration/homepage.conf create mode 100644 configuration/nginx/homepage.conf diff --git a/configuration/cgit/cgitrc b/configuration/cgit/cgitrc new file mode 100644 index 0000000..541c6c4 --- /dev/null +++ b/configuration/cgit/cgitrc @@ -0,0 +1,27 @@ +# resources +css=/cgit.css +logo=/cgit.png + +# settings +virtual-root=/ +clone-prefix=https://git.jackjamison.net +enable-index-owner=0 +source-filter=/usr/lib/cgit/filters/syntax-highlighting.py +head-include=/usr/share/cgit/head_include.html + +# about page +about-filter=/usr/lib/cgit/filters/about-formatting.sh +default-page=about +readme=:readme.md +readme=:README.md +readme=:README + +# homepage +root-title=Jack Jamison's Repositories +root-desc=get my free software, foo + +# repos +enable-git-config=1 +remove-suffix=1 +project-list=/var/git/projects.list +scan-path=/var/git/repositories \ No newline at end of file diff --git a/configuration/cgit/custom.css b/configuration/cgit/custom.css new file mode 100644 index 0000000..a6b60b8 --- /dev/null +++ b/configuration/cgit/custom.css @@ -0,0 +1,87 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +@import url("cgit.css"); + +* { line-height: 1.25em; } + +div#cgit { + max-width: 117ch; + margin: auto; + font-family: monospace; + -moz-tab-size: 4; + tab-size: 4; +} + +div#cgit table#header td.sub { + border-top: none; +} +div#cgit table#header td.sub.right { + padding-right: 1em; +} +div#cgit table.tabs { + border-bottom: none; +} +div#cgit div.content { + border-bottom: none; +} +div#cgit table.list th a { + color: inherit; +} +div#cgit table.list tr:nth-child(even) { + background: inherit; +} +div#cgit table.list tr:hover { + background: inherit; +} +div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { + background: inherit; +} + +div#cgit table.blob td.linenumbers a:target { + color: goldenrod; + text-decoration: underline; + outline: none; +} + +div#cgit div#summary { + max-width: 80ch; +} + +/* for hilex(1) */ +div#cgit pre .Ke { color: dimgray; } +div#cgit pre .Ma { color: green; } +div#cgit pre .Co { color: navy; } +div#cgit pre .St { color: teal; } +div#cgit pre .Fo { color: teal; font-weight: bold; } +div#cgit pre .Su { color: olive; } + +/* for htagml(1) */ +div#cgit pre a.tag { color: inherit; text-decoration: underline; } +div#cgit pre a.tag:target { color: goldenrod; outline: none; } + +/* for mandoc(1) */ +table.head, table.foot { width: 100%; } +td.head-rtitle, td.foot-os { text-align: right; } +td.head-vol { text-align: center; } +div.Pp { margin: 1ex 0ex; } +div.Nd, div.Bf, div.Op { display: inline; } +span.Pa, span.Ad { font-style: italic; } +span.Ms { font-weight: bold; } +dl.Bl-diag > dt { font-weight: bold; } +code.Nm, code.Fl, code.Cm, code.Ic, code.In, code.Fd, code.Fn, +code.Cd { font-weight: bold; font-family: inherit; } + +h1.Sh { font-size: 1.5em; } +table.Nm td:first-child { padding-right: 1ch; } +code.Fl { white-space: nowrap; } +span.RsT { font-style: italic; } +dl.Bl-tag:not(.Bl-compact) > dt { margin-top: 1em; } +ul.Bl-bullet:not(.Bl-compact) > li { margin-top: 1em; } +div.Bd-indent { margin-left: 4ch; } +table.Bl-column { width: 100%; } +table.foot { margin-top: 1em; } + +div#cgit a.permalink { color: inherit; } + diff --git a/configuration/cgit/head_include.html b/configuration/cgit/head_include.html new file mode 100644 index 0000000..b36aaa6 --- /dev/null +++ b/configuration/cgit/head_include.html @@ -0,0 +1 @@ + diff --git a/configuration/cgitrc b/configuration/cgitrc deleted file mode 100644 index 168cc67..0000000 --- a/configuration/cgitrc +++ /dev/null @@ -1,26 +0,0 @@ -# resources -css=/cgit.css -logo=/cgit.png - -# settings -virtual-root=/ -clone-prefix=https://git.jackjamison.net -enable-index-owner=0 -source-filter=/usr/lib/cgit/filters/syntax-highlighting.py - -# about page -about-filter=/usr/lib/cgit/filters/about-formatting.sh -default-page=about -readme=:readme.md -readme=:README.md -readme=:README - -# homepage -root-title=Jack Jamison's Repositories -root-desc=get my free software, foo - -# repos -enable-git-config=1 -remove-suffix=1 -project-list=/var/git/projects.list -scan-path=/var/git/repositories \ No newline at end of file diff --git a/configuration/gitolite.rc b/configuration/gitolite.rc deleted file mode 100644 index 581e923..0000000 --- a/configuration/gitolite.rc +++ /dev/null @@ -1,202 +0,0 @@ -# configuration variables for gitolite - -# This file is in perl syntax. But you do NOT need to know perl to edit it -- -# just mind the commas, use single quotes unless you know what you're doing, -# and make sure the brackets and braces stay matched up! - -# (Tip: perl allows a comma after the last item in a list also!) - -# HELP for commands can be had by running the command with "-h". - -# HELP for all the other FEATURES can be found in the documentation (look for -# "list of non-core programs shipped with gitolite" in the master index) or -# directly in the corresponding source file. - -%RC = ( - - # ------------------------------------------------------------------ - - # default umask gives you perms of '0700'; see the rc file docs for - # how/why you might change this - UMASK => 0027, - - # look for "git-config" in the documentation - GIT_CONFIG_KEYS => 'cgit\.ignore gitweb\.description', - - # comment out if you don't need all the extra detail in the logfile - LOG_EXTRA => 1, - # logging options - # 1. leave this section as is for 'normal' gitolite logging (default) - # 2. uncomment this line to log ONLY to syslog: - # LOG_DEST => 'syslog', - # 3. uncomment this line to log to syslog and the normal gitolite log: - # LOG_DEST => 'syslog,normal', - # 4. prefixing "repo-log," to any of the above will **also** log just the - # update records to "gl-log" in the bare repo directory: - # LOG_DEST => 'repo-log,normal', - # LOG_DEST => 'repo-log,syslog', - # LOG_DEST => 'repo-log,syslog,normal', - # syslog 'facility': defaults to 'local0', uncomment if needed. For example: - # LOG_FACILITY => 'local4', - - # roles. add more roles (like MANAGER, TESTER, ...) here. - # WARNING: if you make changes to this hash, you MUST run 'gitolite - # compile' afterward, and possibly also 'gitolite trigger POST_COMPILE' - ROLES => { - READERS => 1, - WRITERS => 1, - }, - - # enable caching (currently only Redis). PLEASE RTFM BEFORE USING!!! - # CACHE => 'Redis', - - # ------------------------------------------------------------------ - - # rc variables used by various features - - # the 'info' command prints this as additional info, if it is set - # SITE_INFO => 'Please see http://blahblah/gitolite for more help', - - # the CpuTime feature uses these - # display user, system, and elapsed times to user after each git operation - # DISPLAY_CPU_TIME => 1, - # display a warning if total CPU times (u, s, cu, cs) crosses this limit - # CPU_TIME_WARN_LIMIT => 0.1, - - # the Mirroring feature needs this - # HOSTNAME => "foo", - - # TTL for redis cache; PLEASE SEE DOCUMENTATION BEFORE UNCOMMENTING! - # CACHE_TTL => 600, - - # ------------------------------------------------------------------ - - # suggested locations for site-local gitolite code (see cust.html) - - # this one is managed directly on the server - # LOCAL_CODE => "$ENV{HOME}/local", - - # or you can use this, which lets you put everything in a subdirectory - # called "local" in your gitolite-admin repo. For a SECURITY WARNING - # on this, see http://gitolite.com/gitolite/non-core.html#using-the-gitolite-admin-repo-to-manage-non-core-code - # LOCAL_CODE => "$rc{GL_ADMIN_BASE}/local", - - # ------------------------------------------------------------------ - - # List of commands and features to enable - - ENABLE => [ - - # COMMANDS - - # These are the commands enabled by default - 'help', - 'desc', - 'info', - 'perms', - 'writable', - - # Uncomment or add new commands here. - # 'create', - # 'fork', - # 'mirror', - # 'readme', - # 'sskm', - # 'D', - - # These FEATURES are enabled by default. - - # essential (unless you're using smart-http mode) - 'ssh-authkeys', - - # creates git-config entries from gitolite.conf file entries like 'config foo.bar = baz' - 'git-config', - - # creates git-daemon-export-ok files; if you don't use git-daemon, comment this out - 'daemon', - - # creates projects.list file; if you don't use gitweb, comment this out - 'gitweb', - - # These FEATURES are disabled by default; uncomment to enable. If you - # need to add new ones, ask on the mailing list :-) - - # user-visible behaviour - - # prevent wild repos auto-create on fetch/clone - # 'no-create-on-read', - # no auto-create at all (don't forget to enable the 'create' command!) - # 'no-auto-create', - - # access a repo by another (possibly legacy) name - # 'Alias', - - # give some users direct shell access. See documentation in - # sts.html for details on the following two choices. - # "Shell $ENV{HOME}/.gitolite.shell-users", - # 'Shell alice bob', - - # set default roles from lines like 'option default.roles-1 = ...', etc. - # 'set-default-roles', - - # show more detailed messages on deny - # 'expand-deny-messages', - - # show a message of the day - # 'Motd', - - # system admin stuff - - # enable mirroring (don't forget to set the HOSTNAME too!) - # 'Mirroring', - - # allow people to submit pub files with more than one key in them - # 'ssh-authkeys-split', - - # selective read control hack - # 'partial-copy', - - # manage local, gitolite-controlled, copies of read-only upstream repos - # 'upstream', - - # updates 'description' file instead of 'gitweb.description' config item - # 'cgit', - - # allow repo-specific hooks to be added - # 'repo-specific-hooks', - - # performance, logging, monitoring... - - # be nice - # 'renice 10', - - # log CPU times (user, system, cumulative user, cumulative system) - # 'CpuTime', - - # syntactic_sugar for gitolite.conf and included files - - # allow backslash-escaped continuation lines in gitolite.conf - # 'continuation-lines', - - # create implicit user groups from directory names in keydir/ - # 'keysubdirs-as-groups', - - # allow simple line-oriented macros - # 'macros', - - # Kindergarten mode - - # disallow various things that sensible people shouldn't be doing anyway - # 'Kindergarten', - ], - -); - -# ------------------------------------------------------------------------------ -# per perl rules, this should be the last line in such a file: -1; - -# Local variables: -# mode: perl -# End: -# vim: set syn=perl: \ No newline at end of file diff --git a/configuration/gitolite/gitolite.rc b/configuration/gitolite/gitolite.rc new file mode 100644 index 0000000..581e923 --- /dev/null +++ b/configuration/gitolite/gitolite.rc @@ -0,0 +1,202 @@ +# configuration variables for gitolite + +# This file is in perl syntax. But you do NOT need to know perl to edit it -- +# just mind the commas, use single quotes unless you know what you're doing, +# and make sure the brackets and braces stay matched up! + +# (Tip: perl allows a comma after the last item in a list also!) + +# HELP for commands can be had by running the command with "-h". + +# HELP for all the other FEATURES can be found in the documentation (look for +# "list of non-core programs shipped with gitolite" in the master index) or +# directly in the corresponding source file. + +%RC = ( + + # ------------------------------------------------------------------ + + # default umask gives you perms of '0700'; see the rc file docs for + # how/why you might change this + UMASK => 0027, + + # look for "git-config" in the documentation + GIT_CONFIG_KEYS => 'cgit\.ignore gitweb\.description', + + # comment out if you don't need all the extra detail in the logfile + LOG_EXTRA => 1, + # logging options + # 1. leave this section as is for 'normal' gitolite logging (default) + # 2. uncomment this line to log ONLY to syslog: + # LOG_DEST => 'syslog', + # 3. uncomment this line to log to syslog and the normal gitolite log: + # LOG_DEST => 'syslog,normal', + # 4. prefixing "repo-log," to any of the above will **also** log just the + # update records to "gl-log" in the bare repo directory: + # LOG_DEST => 'repo-log,normal', + # LOG_DEST => 'repo-log,syslog', + # LOG_DEST => 'repo-log,syslog,normal', + # syslog 'facility': defaults to 'local0', uncomment if needed. For example: + # LOG_FACILITY => 'local4', + + # roles. add more roles (like MANAGER, TESTER, ...) here. + # WARNING: if you make changes to this hash, you MUST run 'gitolite + # compile' afterward, and possibly also 'gitolite trigger POST_COMPILE' + ROLES => { + READERS => 1, + WRITERS => 1, + }, + + # enable caching (currently only Redis). PLEASE RTFM BEFORE USING!!! + # CACHE => 'Redis', + + # ------------------------------------------------------------------ + + # rc variables used by various features + + # the 'info' command prints this as additional info, if it is set + # SITE_INFO => 'Please see http://blahblah/gitolite for more help', + + # the CpuTime feature uses these + # display user, system, and elapsed times to user after each git operation + # DISPLAY_CPU_TIME => 1, + # display a warning if total CPU times (u, s, cu, cs) crosses this limit + # CPU_TIME_WARN_LIMIT => 0.1, + + # the Mirroring feature needs this + # HOSTNAME => "foo", + + # TTL for redis cache; PLEASE SEE DOCUMENTATION BEFORE UNCOMMENTING! + # CACHE_TTL => 600, + + # ------------------------------------------------------------------ + + # suggested locations for site-local gitolite code (see cust.html) + + # this one is managed directly on the server + # LOCAL_CODE => "$ENV{HOME}/local", + + # or you can use this, which lets you put everything in a subdirectory + # called "local" in your gitolite-admin repo. For a SECURITY WARNING + # on this, see http://gitolite.com/gitolite/non-core.html#using-the-gitolite-admin-repo-to-manage-non-core-code + # LOCAL_CODE => "$rc{GL_ADMIN_BASE}/local", + + # ------------------------------------------------------------------ + + # List of commands and features to enable + + ENABLE => [ + + # COMMANDS + + # These are the commands enabled by default + 'help', + 'desc', + 'info', + 'perms', + 'writable', + + # Uncomment or add new commands here. + # 'create', + # 'fork', + # 'mirror', + # 'readme', + # 'sskm', + # 'D', + + # These FEATURES are enabled by default. + + # essential (unless you're using smart-http mode) + 'ssh-authkeys', + + # creates git-config entries from gitolite.conf file entries like 'config foo.bar = baz' + 'git-config', + + # creates git-daemon-export-ok files; if you don't use git-daemon, comment this out + 'daemon', + + # creates projects.list file; if you don't use gitweb, comment this out + 'gitweb', + + # These FEATURES are disabled by default; uncomment to enable. If you + # need to add new ones, ask on the mailing list :-) + + # user-visible behaviour + + # prevent wild repos auto-create on fetch/clone + # 'no-create-on-read', + # no auto-create at all (don't forget to enable the 'create' command!) + # 'no-auto-create', + + # access a repo by another (possibly legacy) name + # 'Alias', + + # give some users direct shell access. See documentation in + # sts.html for details on the following two choices. + # "Shell $ENV{HOME}/.gitolite.shell-users", + # 'Shell alice bob', + + # set default roles from lines like 'option default.roles-1 = ...', etc. + # 'set-default-roles', + + # show more detailed messages on deny + # 'expand-deny-messages', + + # show a message of the day + # 'Motd', + + # system admin stuff + + # enable mirroring (don't forget to set the HOSTNAME too!) + # 'Mirroring', + + # allow people to submit pub files with more than one key in them + # 'ssh-authkeys-split', + + # selective read control hack + # 'partial-copy', + + # manage local, gitolite-controlled, copies of read-only upstream repos + # 'upstream', + + # updates 'description' file instead of 'gitweb.description' config item + # 'cgit', + + # allow repo-specific hooks to be added + # 'repo-specific-hooks', + + # performance, logging, monitoring... + + # be nice + # 'renice 10', + + # log CPU times (user, system, cumulative user, cumulative system) + # 'CpuTime', + + # syntactic_sugar for gitolite.conf and included files + + # allow backslash-escaped continuation lines in gitolite.conf + # 'continuation-lines', + + # create implicit user groups from directory names in keydir/ + # 'keysubdirs-as-groups', + + # allow simple line-oriented macros + # 'macros', + + # Kindergarten mode + + # disallow various things that sensible people shouldn't be doing anyway + # 'Kindergarten', + ], + +); + +# ------------------------------------------------------------------------------ +# per perl rules, this should be the last line in such a file: +1; + +# Local variables: +# mode: perl +# End: +# vim: set syn=perl: \ No newline at end of file diff --git a/configuration/homepage.conf b/configuration/homepage.conf deleted file mode 100644 index 1095107..0000000 --- a/configuration/homepage.conf +++ /dev/null @@ -1,69 +0,0 @@ -# https server -server { - server_name jackjamison.net www.jackjamison.net; - - error_page 404 = /404.html; - location = /404.html { - internal; - root /var/www/homepage/404.html; - } - - location /interactive { - alias /var/www/interactive/; - } - - location / { - root /var/www/homepage; - index index.html; - } - - listen [::]:443 ssl; - listen 443 ssl; - ssl_certificate /etc/letsencrypt/live/jackjamison.net/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/jackjamison.net/privkey.pem; - include /etc/letsencrypt/options-ssl-nginx.conf; - ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; -} - -# git server -server { - server_name git.jackjamison.net; - root /usr/share/cgit; - try_files $uri @cgit; - - # http cloning - location ~ /.+/(info/refs|git-upload-pack) { - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; - fastcgi_param PATH_INFO $uri; - fastcgi_param GIT_PROJECT_ROOT /var/git/repositories; - fastcgi_param HOME /var/git/repositories; - fastcgi_pass unix:/run/fcgiwrap.socket; - } - - # else - location @cgit { - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; - fastcgi_param PATH_INFO $uri; - fastcgi_param QUERY_STRING $args; - fastcgi_param HTTP_HOST $server_name; - fastcgi_pass unix:/run/fcgiwrap.socket; - } - - listen [::]:443 ssl; - listen 443 ssl; - ssl_certificate /etc/letsencrypt/live/git.jackjamison.net/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/git.jackjamison.net/privkey.pem; - include /etc/letsencrypt/options-ssl-nginx.conf; - ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; -} - -# http redirect -server { - listen [::]:80 default_server; - listen 80 default_server; - server_name _; - - return 301 https://$host$request_uri; -} \ No newline at end of file diff --git a/configuration/nginx/homepage.conf b/configuration/nginx/homepage.conf new file mode 100644 index 0000000..1095107 --- /dev/null +++ b/configuration/nginx/homepage.conf @@ -0,0 +1,69 @@ +# https server +server { + server_name jackjamison.net www.jackjamison.net; + + error_page 404 = /404.html; + location = /404.html { + internal; + root /var/www/homepage/404.html; + } + + location /interactive { + alias /var/www/interactive/; + } + + location / { + root /var/www/homepage; + index index.html; + } + + listen [::]:443 ssl; + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/jackjamison.net/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/jackjamison.net/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; +} + +# git server +server { + server_name git.jackjamison.net; + root /usr/share/cgit; + try_files $uri @cgit; + + # http cloning + location ~ /.+/(info/refs|git-upload-pack) { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; + fastcgi_param PATH_INFO $uri; + fastcgi_param GIT_PROJECT_ROOT /var/git/repositories; + fastcgi_param HOME /var/git/repositories; + fastcgi_pass unix:/run/fcgiwrap.socket; + } + + # else + location @cgit { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; + fastcgi_param PATH_INFO $uri; + fastcgi_param QUERY_STRING $args; + fastcgi_param HTTP_HOST $server_name; + fastcgi_pass unix:/run/fcgiwrap.socket; + } + + listen [::]:443 ssl; + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/git.jackjamison.net/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/git.jackjamison.net/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; +} + +# http redirect +server { + listen [::]:80 default_server; + listen 80 default_server; + server_name _; + + return 301 https://$host$request_uri; +} \ No newline at end of file diff --git a/scripts/redeploy.sh b/scripts/redeploy.sh index 0cd5ed3..c335b8a 100755 --- a/scripts/redeploy.sh +++ b/scripts/redeploy.sh @@ -2,9 +2,11 @@ set -e # symlink configs -cp ./configuration/homepage.conf /etc/nginx/sites-enabled/homepage.conf -cp ./configuration/cgitrc /etc/cgitrc -install -o git -g git ./configuration/gitolite.rc /var/git/.gitolite.rc +cp ./configuration/nginx/homepage.conf /etc/nginx/sites-enabled/homepage.conf +cp ./configuration/cgit/cgitrc /etc/cgitrc +cp ./configuration/cgit/custom.css /usr/share/cgit/custom.css +cp ./configuration/cgit/head_include.html /usr/share/cgit/head_include.html +install -o git -g git ./configuration/gitolite/gitolite.rc /var/git/.gitolite.rc # build and sync zola static site (cd zola-static && zola build) -- cgit v1.2.3