{"id":16958039,"url":"https://github.com/joshnuss/git-ssh-server","last_synced_at":"2025-04-11T21:52:33.925Z","repository":{"id":50748931,"uuid":"265712812","full_name":"joshnuss/git-ssh-server","owner":"joshnuss","description":"A small git/ssh server for hosting repos","archived":false,"fork":false,"pushed_at":"2021-09-21T17:05:58.000Z","size":30,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T21:52:29.954Z","etag":null,"topics":["git","hosting","node","ssh"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/joshnuss.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}},"created_at":"2020-05-21T00:06:27.000Z","updated_at":"2024-03-28T01:40:30.000Z","dependencies_parsed_at":"2022-09-02T22:11:27.625Z","dependency_job_id":null,"html_url":"https://github.com/joshnuss/git-ssh-server","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/joshnuss%2Fgit-ssh-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Fgit-ssh-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Fgit-ssh-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Fgit-ssh-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshnuss","download_url":"https://codeload.github.com/joshnuss/git-ssh-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487733,"owners_count":21112188,"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","hosting","node","ssh"],"created_at":"2024-10-13T22:21:13.731Z","updated_at":"2025-04-11T21:52:33.897Z","avatar_url":"https://github.com/joshnuss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Example GIT+SSH Server\n----------------------\n\nA small git/ssh server for hosting repos and running custom logic after push.\n\n# Features\n\n- `git push`, `git pull` \u0026 `git clone` are supported.\n- Authentication is done via public keys exclusively. (no passwords allowed)\n- Repos \u0026 public keys are stored on disk.\n- Repos are automatically created on-demand (first push).\n- Server-side hooks like `pre-receive`, `update` \u0026 `post-receive` can be applied to all repos.\n\n## Setup\n\nGet the latest code:\n\n```bash\ngit clone joshnuss/git-ssh-server\ncd git-ssh-server\nyarn\n```\n\nCreate a host key with a passphrase:\n\n```bash\nssh-keygen host.key\n```\n\nAdd `.pub` public keys to the `keys` folder:\n\n```bash\n# if using locally\ncp ~/.ssh/id_rsa.pub keys/me.pub\n```\n\nAdd git hooks like `pre-receive`, `update` \u0026  `post-receive` to the `hooks` folder (optional).\n\nExample `post-receive` hook:\n\n```bash\n#!/bin/bash\n\nwhile read oldrev newrev ref\ndo\n    if [[ $ref =~ .*/master$ ]];\n    then\n        echo \"Master ref received.  Deploying master branch to production...\"\n        git --work-tree=/var/www/html --git-dir=/home/demo/proj checkout -f\n    else\n        echo \"Ref $ref successfully received.  Doing nothing: only the master branch may be deployed on this server.\"\n    fi\ndone\n```\n\nHooks are symlinked on first push.\n\n## Usage\n\nStart the server:\n\n```bash\nPORT=22755 ADDRESS=localhost PASSPHRASE=foobar yarn start\n```\n\nFor an existing repo:\n\n```bash\n# add a remote\ngit remote add hosting ssh://git@localhost:22755/your-repo-name\n\n# OR if you're using a standard SSH port 22\ngit remote add hosting git@mydomain.tld/your-repo-name\n\n# push to remote\ngit push hosting master\n\n# pull from remote\ngit pull hosting master\n```\n\nOr clone a new repo:\n\n```bash\n# clone from remote\ngit clone ssh://git@mydomain.tld:22755/your-repo-name\n\n# OR if using standard SSH port 22\ngit clone git@mydomain.tld/your-repo-name\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshnuss%2Fgit-ssh-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshnuss%2Fgit-ssh-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshnuss%2Fgit-ssh-server/lists"}