{"id":16359140,"url":"https://github.com/valentindebon/git-host","last_synced_at":"2026-05-16T11:03:14.748Z","repository":{"id":69882934,"uuid":"512203414","full_name":"ValentinDebon/git-host","owner":"ValentinDebon","description":"Dedicated git server infrastructre","archived":false,"fork":false,"pushed_at":"2024-12-19T20:41:07.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T17:22:44.978Z","etag":null,"topics":["bloat-free","git","self-hosted","ssh"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ValentinDebon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-09T14:16:02.000Z","updated_at":"2024-12-19T20:51:37.000Z","dependencies_parsed_at":"2025-02-19T19:33:51.572Z","dependency_job_id":"0d3d20b8-4fb5-45ab-83fb-1659efc96c35","html_url":"https://github.com/ValentinDebon/git-host","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ValentinDebon/git-host","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinDebon%2Fgit-host","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinDebon%2Fgit-host/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinDebon%2Fgit-host/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinDebon%2Fgit-host/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ValentinDebon","download_url":"https://codeload.github.com/ValentinDebon/git-host/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinDebon%2Fgit-host/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33100319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bloat-free","git","self-hosted","ssh"],"created_at":"2024-10-11T02:07:36.352Z","updated_at":"2026-05-16T11:03:14.704Z","avatar_url":"https://github.com/ValentinDebon.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Host\n\nSimplify git server management.\n\nGit host is an infrastructure of configurations and binary executables around sshd(8) meant to integrate\nthe server's system users with the git(1) user usually used to handle repositories.\n\n## Simplify system administration\n\nGit's [guide on setting up a server](https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server) demonstrates how to manually create a git user to setup remote repositories.\nWith this default configuration, adding a new user and checking up if he/she doesn't mess with other's repositories might be a tedious and time-consuming process.\n\nGit host simplifies the process by just letting you add a system user to a dedicated group (the `git` group).\n\n## Configure, build and install\n\nDownload and extract a source release tarball.\nYou may need to tweak `--with-git-exec-path` for git-host to correctly finds git executables.\n```\n./configure\nmake\nmake install\n```\n\n## Setting up the server\n\nYou must create a git user and a git group first:\n```\nuseradd -Ur -md /srv/git -s /usr/local/bin/git-host git\ncp -R /usr/share/git-core/templates /srv/git\nmkdir /srv/git/repositories\ncat \u003e /srv/git/.gitconfig \u003c\u003cEOF\n[init]\n\tdefaultBranch = master\n\ttemplateDir = ~/templates\nEOF\n```\nYou can put whatever you want in the repository templates, and/or in the gitconfig, that's up to you.\n\nNow we must setup the sshd configuration for our new git user.\nYou might need to enable the `PermitUserEnvironment` configuration in your `/etc/ssh/sshd_config`\nto allow `ssh-host-authorized-keys` to forward the authorizing user's name through the `SSH_AUTHORIZED_BY` environment variable.\nThen, you'll need to create a `Match` rule for the `git` user, you can usually set up a dedicated configuration file in `/etc/ssh/sshd_config.d/99-git-host.conf`:\n```\nPermitUserEnvironment SSH_AUTHORIZED_BY\n\nMatch User git\n\tAuthorizedKeysCommand /usr/local/libexec/ssh-host-authorized-keys -G git -t %t -- %k\n\tAuthorizedKeysCommandUser nobody\n\tPasswordAuthentication no\n```\nObviously, you must replace `/usr/local` by the installation prefix of the git host binary executables, note that for the executables to work correctly,\nsshd(8) expects *the executable files and every parent directory up to the filesystem root to be owned by root* (the last condition isn't clearly stated in the sshd\\_config(5) manpages).\n\nNow, let's add user to the git server, let's say we want to let our user roger and all its ssh-authorized remote users use the git infrastructure:\n```\nusermod -G git roger\n```\nAnd that's it! Upon connection, the `ssh-host-authorized-keys` utility will scan all git's group users .ssh/authorized\\_keys for a corresponding key.\nThen, the `git-host` is executed and receives the `SSH_AUTHORIZED_BY` environment variable, which allows implementation of basic user-related access-control.\n\nImagine our server is named bob, and roger sat up its public keys from an alice host. From the alice host, and inside a repository, roger could setup a remote the following way:\n```\nssh git@bob init roger/repo\ngit remote add bob ssh://git@bob:/roger/repo\ngit push -u bob master\n```\nThis would create a new bare repository at location `~git/repositories/roger/repo` on bob.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalentindebon%2Fgit-host","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalentindebon%2Fgit-host","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalentindebon%2Fgit-host/lists"}