{"id":13902981,"url":"https://github.com/res0nat0r/gitosis","last_synced_at":"2025-07-18T00:32:47.837Z","repository":{"id":40523760,"uuid":"58859","full_name":"res0nat0r/gitosis","owner":"res0nat0r","description":"Manage git repositories, provide access to them over SSH, with tight access control and not needing shell accounts.","archived":false,"fork":false,"pushed_at":"2017-02-21T22:24:33.000Z","size":147,"stargazers_count":1323,"open_issues_count":9,"forks_count":384,"subscribers_count":77,"default_branch":"master","last_synced_at":"2024-08-07T22:35:30.402Z","etag":null,"topics":["git","git-addons"],"latest_commit_sha":null,"homepage":"http://eagain.net","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/res0nat0r.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-10-02T15:58:49.000Z","updated_at":"2024-08-02T01:57:16.000Z","dependencies_parsed_at":"2022-06-29T14:42:39.729Z","dependency_job_id":null,"html_url":"https://github.com/res0nat0r/gitosis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/res0nat0r%2Fgitosis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/res0nat0r%2Fgitosis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/res0nat0r%2Fgitosis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/res0nat0r%2Fgitosis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/res0nat0r","download_url":"https://codeload.github.com/res0nat0r/gitosis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226320809,"owners_count":17606364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["git","git-addons"],"created_at":"2024-08-06T22:01:32.369Z","updated_at":"2024-11-25T11:31:04.738Z","avatar_url":"https://github.com/res0nat0r.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"==========================================================\n ``gitosis`` -- software for hosting ``git`` repositories\n==========================================================\n\n\tManage ``git`` repositories, provide access to them over SSH,\n\twith tight access control and not needing shell accounts.\n\n.. note::\n\n\tDocumentation is still lacking, and non-default configurations\n\t(e.g. config file, repositories, installing in a location that\n\tis not in ``PATH``) basically have not been tested at all.\n\tBasic usage should be very reliable -- the project has been\n\thosting itself for a long time. Any help is welcome.\n\n``gitosis`` aims to make hosting ``git`` repos easier and safer. It\nmanages multiple repositories under one user account, using SSH keys\nto identify users. End users do not need shell accounts on the server,\nthey will talk to one shared account that will not let them run\narbitrary commands.\n\n``gitosis`` is licensed under the GPL, see the file ``COPYING`` for\nmore information.\n\nYou can get ``gitosis`` via ``git`` by saying::\n\n    git clone git://github.com/res0nat0r/gitosis.git\n\nAnd install it via::\n\n    python setup.py install\n\nThough you may want to use e.g. ``--prefix=``. For Debian/Ubuntu\nusers, the source is debianized.\n\n\nSetting up\n==========\n\nFirst, we will create the user that will own the repositories. This is\nusually called ``git``, but any name will work, and you can have more\nthan one per system if you really want to. The user does not need a\npassword, but does need a valid shell (otherwise, SSH will refuse to\nwork). Don't use an existing account unless you know what you're\ndoing.\n\nI usually store ``git`` repositories in the subtree\n``/srv/example.com/git`` (replace ``example.com`` with your own\ndomain). You may choose another location. Adjust to suit and run::\n\n\tsudo adduser \\\n\t    --system \\\n\t    --shell /bin/sh \\\n\t    --gecos 'git version control' \\\n\t    --group \\\n\t    --disabled-password \\\n\t    --home /srv/example.com/git \\\n\t    git\n\nThis command is known to work in Debian and Ubuntu. Your mileage may\nvary.  Under CentOS (and presumably RedHat) execute the \nfollowing commands as root instead::\n\n  useradd \\\n        -r \\\n        -s /bin/sh \\\n        -c 'git version control' \\\n        -d /home/git \\\n        git\n\n  mkdir -p /home/git\n\n  chown git:git /home/git\n\nYou will need an SSH public key to continue. If you don't have one,\nyou need to generate one. See the man page for ``ssh-keygen``, and you\nmay also be interested in ``ssh-agent``. Create it on your personal\ncomputer, and protect the *private* key well -- that includes not\ntransferring it over the network.\n\nNext, we need to set things up for this newly-created user. The\nfollowing command will create a ``~/repositories`` that will hold the\n``git`` repositories, a ``~/.gitosis.conf`` that will be a symlink to\nthe actual configuration file, and it will add the SSH public key to\n``~/.ssh/authorized_keys`` with a ``command=`` option that restricts\nit to running ``gitosis-serve``. Run::\n\n\t# sudo -iu git\n\tgit $ gitosis-init \u003cFILENAME.pub\n\tgit $ exit\n\t# (or just copy-paste the public key when prompted)\n\nthen just ``git clone git@SERVER:gitosis-admin.git``, and you get a\nrepository with SSH keys as ``keys/USER.pub`` and a ``gitosis.conf``\nwhere you can configure who has access to what.\n\n.. warning::\n\n\tFor now, ``gitosis`` uses the ``HOME`` environment variable to\n\tlocate where to write its files. If you use ``sudo -u``\n\twithout ``-H``, ``sudo`` will leave the old value of ``HOME``\n\tin place, and this will cause trouble. There will be a\n\tworkaround for that later on, but for now, always remember to\n\tuse ``-H`` if you're sudoing to the account. Alternatively, you\n\tcan use ``-i`` as above, which runs a full login shell.\n\nYou should always edit the configuration file via ``git``. The file\nsymlinked to ``~/.gitosis.conf`` on the server will be overwritten\nwhen pushing changes to the ``gitosis-admin.git`` repository.\n\nEdit the settings as you wish, commit and push. That's pretty much it!\nOnce you push, ``gitosis`` will immediately make your changes take\neffect on the server.\n\n\nManaging it\n===========\n\nTo add new users:\n\n- add a ``keys/USER.pub`` file\n- authorize them to read/write repositories as needed (or just\n  authorize the group ``@all``)\n\nTo create new repositories, just authorize writing to them and\npush. It's that simple! For example: let's assume your username is\n``jdoe`` and you want to create a repository ``myproject``.\nIn your clone of ``gitosis-admin``, edit ``gitosis.conf`` and add::\n\n\t[group myteam]\n\tmembers = jdoe\n\twritable = myproject\n\nCommit that change and push. Then create the initial commit and push\nit::\n\n\tmkdir myproject\n\tcd mypyroject\n\tgit init\n\tgit remote add myserver git@MYSERVER:myproject.git\n\t# do some work, git add and commit files\n\tgit push myserver master:refs/heads/master\n\nThat's it. If you now add others to ``members``, they can use that\nrepository too.\n\n\nExample configuration\n=====================\n\n.. include:: example.conf\n   :literal:\n\n\nUsing git-daemon\n================\n\nAnonymous read-only access to ``git`` repositories is provided by\n``git-daemon``, which is distributed as part of ``git``. But\n``gitosis`` will still help you manage it: setting ``daemon = yes`` in\nyour ``gitosis.conf``, either globally in ``[gitosis]`` or\nper-repository under ``[repo REPOSITORYNAME]``, makes ``gitosis``\ncreate the ``git-daemon-export-ok`` files in those repository, thus\ntelling ``git-daemon`` that publishing those repositories is ok.\n\nTo actually run ``git-daemon`` in Ubuntu, put this in\n``/etc/event.d/local-git-daemon``:\n\n.. include:: etc-event.d-local-git-daemon\n   :literal:\n\nFor other operating systems, use a similar invocation in an ``init.d``\nscript, ``/etc/inittab``, ``inetd.conf``, ``runit``, or something like\nthat (good luck).\n\nNote that this short snippet is not a substitute for reading and\nunderstanding the relevant documentation.\n\n\nUsing gitweb\n============\n\n``gitweb`` is a CGI script that lets one browse ``git`` repositories\non the web. It is most commonly used anonymously, but you could also\nrequire authentication in your web server, before letting people use\nit. ``gitosis`` can help here by generating a list of projects that\nare publicly visible. Simply add a section ``[repo REPOSITORYNAME]``\nto your ``gitosis.conf``, and allow publishing with ``gitweb = yes``\n(or globally under ``[gitosis]``). You should also set ``description``\nand ``owner`` for each repository.\n\nHere's a LightTPD_ config file snippet showing how to run ``gitweb``\nas a CGI:\n\n.. _LightTPD: http://www.lighttpd.net/\n\n.. include:: lighttpd-gitweb.conf\n   :literal:\n\nAnd a simple ``gitweb.conf`` file:\n\n.. include:: gitweb.conf\n   :literal:\n\nNote that this short snippet is not a substitute for reading and\nunderstanding the relevant documentation.\n\n\n\nContact\n=======\n\nYou can email the author at ``tv@eagain.net``, or hop on\n``irc.freenode.net`` channel ``#git`` and hope for the best.\n\nThere will be more, keep an eye on http://eagain.net/ and/or the git\nmailing list.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fres0nat0r%2Fgitosis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fres0nat0r%2Fgitosis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fres0nat0r%2Fgitosis/lists"}