summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVineet Kumar <git@vineetk.net>2026-05-19 14:02:11 -0400
committerVineet Kumar <git@vineetk.net>2026-05-19 15:48:24 -0400
commit990454ec7eb549a0084ec7d88ba740ec796e2d02 (patch)
tree5efcfc9bdcc3b21cd94bbc4c44d012ff1e672301
parented385213ba26f9008802ef955548c0274d9fc437 (diff)
saklas: setup readonly git-http-backend for smart https cloning
required by libgit2 since they're not fully compatible with main git like not supporting dumb cloning
-rw-r--r--epistemia/systems/saklas.scm27
1 files changed, 27 insertions, 0 deletions
diff --git a/epistemia/systems/saklas.scm b/epistemia/systems/saklas.scm
index fa0fbc1..59c23b4 100644
--- a/epistemia/systems/saklas.scm
+++ b/epistemia/systems/saklas.scm
@@ -432,6 +432,20 @@ rpz:
432 activation-service-type 432 activation-service-type
433 #~(when (file-exists? "/data/src/bare") 433 #~(when (file-exists? "/data/src/bare")
434 (chmod "/data/src/bare" #o775))) 434 (chmod "/data/src/bare" #o775)))
435 (simple-service 'git-mirror-update
436 shepherd-root-service-type
437 (list (shepherd-timer
438 '(git-mirror-update)
439 "0 */8 * * *" ; vixie cron doesn't support random/tilde. I'm sorry codeberg and other mirrors :(
440 #~("/run/privileged/bin/su" "git" "-c"
441 "for i in $(dirname $(grep -l Mirrors /data/src/bare/*.git/cgitrc)); do (cd \"$i\"; git fetch upstream --prune); done")
442 #:requirement '(networking)
443 #:documentation "Update git mirrors every 8 hours.")))
444 (service fcgiwrap-service-type
445 (fcgiwrap-configuration
446 (user "git")
447 (group "git")
448 (socket "tcp:127.0.0.1:9000")))
435 (service cgit-service-type 449 (service cgit-service-type
436 (cgit-configuration 450 (cgit-configuration
437 (enable-index-links? #t) 451 (enable-index-links? #t)
@@ -457,6 +471,19 @@ rpz:
457 (locations 471 (locations
458 (list 472 (list
459 (nginx-location-configuration 473 (nginx-location-configuration
474 (uri "~ \"^/(?<repo>.+?)(\\.git)?/(?<gitpath>(?:HEAD|info/refs|objects/(?:info/[^/]+|[0-9a-f]{2}/[0-9a-f]{38}|pack/pack-[0-9a-f]{40}\\.(?:pack|idx))|git-upload-pack))$\"")
475 (body (list #~(string-append "fastcgi_param SCRIPT_FILENAME " #$(file-append git "/libexec/git-core/git-http-backend") ";")
476 "fastcgi_param GIT_PROJECT_ROOT /data/src/bare;"
477 "fastcgi_param PATH_INFO /$repo.git/$gitpath;"
478 "fastcgi_param GIT_HTTP_EXPORT_ALL \"\";"
479 "fastcgi_param REMOTE_USER $remote_user;"
480 "fastcgi_param QUERY_STRING $args;"
481 "fastcgi_param REQUEST_METHOD $request_method;"
482 "fastcgi_param CONTENT_TYPE $content_type;"
483 "fastcgi_param CONTENT_LENGTH $content_length;"
484 "fastcgi_param HTTP_HOST $server_name;"
485 "fastcgi_pass 127.0.0.1:9000;")))
486 (nginx-location-configuration
460 (uri "@cgit") 487 (uri "@cgit")
461 (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;" 488 (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;"
462 "fastcgi_param PATH_INFO $uri;" 489 "fastcgi_param PATH_INFO $uri;"