prime8dev

prime8dev
git clone https://git.prime8.dev/prime8dev.git
Log | Files | Refs | README | LICENSE

commit 5d4ac62c167e43a580a9df21d28c29c19184db2c
parent 1c7caca810400fab41573991939da9ac26588a14
Author: Damian Myrda <damian@prime8.dev>
Date:   Wed, 18 Sep 2024 12:52:53 -0500

feat(git): replace cgit with gitolite

Diffstat:
Mgit/.gitignore | 1-
Agit/.gitolite.rc | 204+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dgit/cgitrc | 141-------------------------------------------------------------------------------
Dgit/create.sh | 3---
Dgit/mirror.sh | 3---
Dgit/sync.sh | 3---
6 files changed, 204 insertions(+), 151 deletions(-)

diff --git a/git/.gitignore b/git/.gitignore @@ -1,4 +1,3 @@ /.gitolite -/.gitolite.rc /.ssh/ /repositories/ diff --git a/git/.gitolite.rc b/git/.gitolite.rc @@ -0,0 +1,204 @@ +# 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 => 0077, + + # look for "git-config" in the documentation + GIT_CONFIG_KEYS => ['gitweb.owner', '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#pushcode + # 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', + ], + +); + +POST_COMPILE => 'post-compile/update-description-file', + +# ------------------------------------------------------------------------------ +# per perl rules, this should be the last line in such a file: +1; + +# Local variables: +# mode: perl +# End: +# vim: set syn=perl: diff --git a/git/cgitrc b/git/cgitrc @@ -1,141 +0,0 @@ -# -## cgit config -# reference: https://linux.die.net/man/5/cgitrc -# -# -# Enable caching of up to 1000 output entries -# cache-size=5 - -## ttl for root page -cache-root-ttl=5 - -## ttl for repo summary page -cache-repo-ttl=5 - -## ttl for other dynamic pages -cache-dynamic-ttl=5 - -## ttl for static pages (addressed by SHA-1) -cache-static-ttl=-1 - -# css -css=/cgit/cgit.css -logo=/cgit/cgit.png - -# Enable ASCII art commit history graph on the log pages -enable-commit-graph=1 - -enable-follow-links=1 -enable-subject-links=1 -enable-index-links=1 - -enable-git-config=1 -enable-html-serving=1 - -enable-http-clone=1 -enable-git-clone=1 - -enable-index-owner=0 -enable-gitweb-owner=1 - -enable-log-filecount=1 -enable-log-linecount=1 - -enable-remote-branches=1 -enable-tree-linenumbers=1 - -# summary info -summary-branches=10 -summary-log=10 -summary-tags=10 - -# Sort by age/name -repository-sort=name -branch-sort=age -commit-sort=age - -# Enable statistics per week, month and quarter -max-stats=year - -# show local time not utc -local-time=1 - -root-title=cGit -root-desc=Keep ALL the stuff in VERSION CONTROL!! -root-readme=/var/www/about.html -# footer=/var/www/footer.html - -# if you do not want that webcrawler (like google) index your site -robots=noindex, nofollow - -# if cgit messes up links, use a virtual-root. For example has cgit.example.org/ this value: -virtual-root=/ - -side-by-side-diffs=0 - -# needs python-pygments -source-filter=/usr/lib/cgit/filters/syntax-highlighting.py - -# Format markdown, restructuredtext, manpages, text files, and html files through the right converters -about-filter=/usr/lib/cgit/filters/about-formatting.sh - -# available snaps -snapshots=tar.gz zip - -# Specify some default clone urls using macro expansion -clone-url=ssh://git@prime8.dev/home/git/repositories/$CGIT_REPO_URL - -## -## List of common mimetypes -## - -mimetype.gif=image/gif -mimetype.html=text/html -mimetype.jpg=image/jpeg -mimetype.jpeg=image/jpeg -mimetype.pdf=application/pdf -mimetype.png=image/png -mimetype.svg=image/svg+xml - -## -### Search for these files in the root of the default branch of repositories -### for coming up with the about page: -### -readme=:README.md -readme=:readme.md -readme=:README.mkd -readme=:readme.mkd -readme=:README.rst -readme=:readme.rst -readme=:README.html -readme=:readme.html -readme=:README.htm -readme=:readme.htm -readme=:README.txt -readme=:readme.txt -readme=:README -readme=:readme -readme=:INSTALL.md -readme=:install.md -readme=:INSTALL.mkd -readme=:install.mkd -readme=:INSTALL.rst -readme=:install.rst -readme=:INSTALL.html -readme=:install.html -readme=:INSTALL.htm -readme=:install.htm -readme=:INSTALL.txt -readme=:install.txt -readme=:INSTALL -readme=:install - -# sections -section-from-path=1 -section-sort=1 - -# repos -max-repo-count=99999 -remove-suffix=1 -scan-hidden-path=1 -scan-path=/home/git/repositories/ diff --git a/git/create.sh b/git/create.sh @@ -1,3 +0,0 @@ -#!/bin/sh - -docker compose exec -u git -it git /scripts/bareinit diff --git a/git/mirror.sh b/git/mirror.sh @@ -1,3 +0,0 @@ -#!/bin/sh - -docker compose exec -u git -it git /scripts/mirror diff --git a/git/sync.sh b/git/sync.sh @@ -1,3 +0,0 @@ -#!/bin/sh - -docker compose exec -u git -it git /scripts/sync