{"id":16799607,"url":"https://github.com/tomplus/qnap-git-server","last_synced_at":"2025-04-11T00:23:09.335Z","repository":{"id":66171638,"uuid":"124684640","full_name":"tomplus/qnap-git-server","owner":"tomplus","description":"Host your own Git repositories on QNAP server","archived":false,"fork":false,"pushed_at":"2018-06-27T18:29:36.000Z","size":6,"stargazers_count":39,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T21:12:07.094Z","etag":null,"topics":["container-station","docker","git","qnap","repository","ssh","ubuntu"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomplus.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":"2018-03-10T18:08:06.000Z","updated_at":"2025-03-21T15:40:14.000Z","dependencies_parsed_at":"2023-04-13T18:17:06.665Z","dependency_job_id":null,"html_url":"https://github.com/tomplus/qnap-git-server","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fqnap-git-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fqnap-git-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fqnap-git-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fqnap-git-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomplus","download_url":"https://codeload.github.com/tomplus/qnap-git-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248319064,"owners_count":21083769,"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":["container-station","docker","git","qnap","repository","ssh","ubuntu"],"created_at":"2024-10-13T09:29:18.120Z","updated_at":"2025-04-11T00:23:09.325Z","avatar_url":"https://github.com/tomplus.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qnap-git-server\n\nHost your own Git repositories on QNAP server\n\n## Introduction\n\nQNAP is a linux-based Network Attached Storage. It has a lot of nice features but there is no option for hosting git repositories by default. Fortunately there is an application named _Container Station_ which allows you to run Docker or LXC images. So it’s pretty easy to extend functions and for example install _GitLab_ to host git repositories (it’s QNAP recommendation). _Gitlab_ is a quite big system and if you need a just simple git server you can use this [qnap-git-server](https://github.com/tomplus/qnap-git-server).\n\n## Instalation\n\nFirst, you have to prepare a directory which will be attached to Docker. This directory has to contain your ssh public key and it is also a place where your repositories will be stored.\n\n```\n$ ssh admin@my-qnap.local\n[~] cd /share\n[/share] mkdir -p git/.ssh\n[/share] mkdir git/pub\n[/share] echo “---your public key from ~/.ssh/id_rsa.pub---” \u003e git/.ssh/authorized_keys\n[/share] chown 1000:1000 -R git/\n[/share] chmod 700 git/\n[/share] chmod 700 git/.ssh/\n[/share] chmod 600 git/.ssh/authorized_keys\n```\n\nNow you can use _Container Station_ to start the image [tpimages/qnap-git-server](https://hub.docker.com/r/tpimages/qnap-git-server/). This image is prepared for arm32v7 only.\nYou have to mount prepared directory as /home/git and expose port 22 as for example 2222 to connect it from your local network. You can also start it from command line:\n\n```\n[~] docker run -d -v /share/git:/home/git -p 2222:22 --rm tpimages/qnap-git-server:latest\n```\n\nNow your server is up and running. You can connect to it via SSH to create a bare repository:\n\n```\n$ ssh -p 2222 git@my-qnap.local\n$ mkdir pub/project.git\n$ cd pub/project.git/\n$ git init --bare\nInitialized empty Git repository in /home/git/pub/project.git/\n```\n\nand then you can clone the repository\n```\n$ git clone ssh://git@my-qnap.local:2222/pub/project.git\n```\n\n\n## Building\n\nIf you want to build you own custom version of this image your can do it simple by docker build command:\n\n```\ndocker build -t qnap-git-server:my-own-version .\n```\n\n\n## Troubleshooting\n\nStructure of file `git/.ssh/authorized_keys` requires that each key is stored in separate lines.\nIf you store there only one key, ensure that there are not additional new lines `\\n`.\n\nTo check logs from syslogd you can use command `docker exec` to run `syslogd`. It'll start the deamon\nsyslogd and all logs will be writting to /var/log/messages.\n\nIf you get errors like `exec user process caused \"exec format error\"` it means that your qnap\nhas different architecture (eg. amd64) than the prepared image (arm32v7). It this case try to replace\nthe base image in `Dockerfile` from\n```\nFROM arm32v7/ubuntu:14.04\n```\nto for example:\n```\nFROM amd64/ubuntu:14.04\n```\nand build your own image.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomplus%2Fqnap-git-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomplus%2Fqnap-git-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomplus%2Fqnap-git-server/lists"}