{"id":15518379,"url":"https://github.com/c9s/gitorbit","last_synced_at":"2025-04-23T04:33:07.832Z","repository":{"id":66245284,"uuid":"143080219","full_name":"c9s/gitorbit","owner":"c9s","description":"GitHub-like Git Server, let you control the permission via mongodb or LDAP","archived":false,"fork":false,"pushed_at":"2018-08-02T06:36:19.000Z","size":21,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T11:14:18.444Z","etag":null,"topics":["git","github","ssh"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/c9s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-07-31T23:30:02.000Z","updated_at":"2024-07-10T07:34:52.000Z","dependencies_parsed_at":"2023-05-18T10:00:14.245Z","dependency_job_id":null,"html_url":"https://github.com/c9s/gitorbit","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"b6667d78d60e3ce7e0a511819a11349efee45216"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c9s%2Fgitorbit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c9s%2Fgitorbit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c9s%2Fgitorbit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c9s%2Fgitorbit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c9s","download_url":"https://codeload.github.com/c9s/gitorbit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372073,"owners_count":21419715,"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","github","ssh"],"created_at":"2024-10-02T10:16:41.808Z","updated_at":"2025-04-23T04:33:07.604Z","avatar_url":"https://github.com/c9s.png","language":"Go","readme":"# GitOrbit\n\n*WORKING IN PRRGRESS*\n\n## Features\n\n- MongoDB-based ssh public key authentication.\n- Multiple ssh public key support for each user.\n- Kubernetes deployment support.\n- Support permission customization.\n\n- LDAP support (WIP)\n- Default Permission Configuration (WIP)\n\n## Install\n\n### Setup with Docker \n\nBy default, the git-server image includes a config file:\n\n```json\n{\n    \"mongo\": {\n        \"url\": \"mongodb://mongo:27017/git\"\n    },\n    \"logger\": {\n        \"dir\": \"/var/log/git\",\n        \"level\": \"debug\",\n        \"maxAge\": \"720h\",\n        \"suffixPattern\": \".%Y%m%d\",\n        \"linkName\": \"access_log\"\n    }\n}\n```\n\nWhich uses `mongodb://mongo:27017/git` as the connection string for the mongo client.\n\nAnd so you will need to create a mongodb container instance with the name `mongo`, so that\nthe client can connect to your mongodb server.\n\nFirst, you need to create a network for sharing the mongodb network connection:\n\n```sh\ndocker network create docker\n```\n\nStart the mongodb server with the network that we just created:\n\n```sh\ndocker run --name mongo \\\n    --restart=always \\\n    --publish 27018:27017 \\\n    --network docker \\\n    --detach mongo\n```\n\nGet your public key footprint and the key:\n\n```sh\nSSH_PUBKEY=$(cat ~/.ssh/id_rsa.pub)\nSSH_PUBKEY_FINGERPRINT=$(ssh-keygen -lf ~/.ssh/id_rsa.pub | awk '{ print $2 }')\nGIT_USER_EMAIL=$(git config user.email)\n```\n\nInsert the user in the mongodb:\n\n```sh\nmongo mongodb://localhost:27018/git --eval \"\n    db.users.insert({\n        email: \\\"$GIT_USER_EMAIL\\\",\n        keys: [{\n                \\\"name\\\": \\\"dev\\\",\n                \\\"fingerprint\\\": \\\"$SSH_PUBKEY_FINGERPRINT\\\",\n                \\\"key\\\": \\\"$SSH_PUBKEY\\\"\n            }]\n    })\"\n```\n\nEnsure that you can find the user by the fingerprint:\n\n```sh\nmongo mongodb://localhost:27018/git --eval \"db.users.find({\n    \\\"keys.fingerprint\\\": \\\"$SSH_PUBKEY_FINGERPRINT\\\" }).pretty()\"\n```\n\nBuild and Run the git server:\n\n```sh\nmake stop build run\n```\n\nAdd an entry in your .ssh/config:\n\n```ssh\nHost git-server\n    HostName localhost\n    User git\n    Port 2022\n    LogLevel INFO\n    PreferredAuthentications publickey\n    IdentityFile ~/.ssh/id_rsa\n```\n\nNow you can try git clone:\n\n```sh\ngit clone git@git-server:test.git\n```\n\n### Kubernetes\n\nCopy the config from the template:\n\n```\ncp -v config/default.json k8s.json\n```\n\nConfigure your settings:\n\n```\nvim k8s.json\n```\n\nCreate configmap object in your cluster:\n\n```\nkubectl create configmap git-server-config --from-file=authorized_keys.json=k8s.json\n```\n\nTo be continued.\n\n\n\n## License\n\nMIT License\n\n## Author\n\nYo-An Lin \u003cyoanlin93@gmail.com\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc9s%2Fgitorbit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc9s%2Fgitorbit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc9s%2Fgitorbit/lists"}