Skip to content

Commit

Permalink
Install git server on nas
Browse files Browse the repository at this point in the history
  • Loading branch information
ardumont committed Jul 31, 2015
1 parent 7b60ff3 commit 2101174
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
61 changes: 61 additions & 0 deletions git/git-server.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#+title: git server
#+author: ardumont

* Main use case

Create an unpriviledged user, `git` for example.

#+begin_src sh
adduser git
#+end_src

Connect with this user

Install the public key of the users of the repositories.

#+begin_src sh
cat /tmp/user-public-key.pub > ~git/.ssh/authorized_keys
#+end_src

Now create a bare repository

#+begin_src sh
mkdir repo.git
cd repo.git
git init --bare
#+end_src

Now the user should be able to access it

#+begin_src sh
git clone git@your-server:/path/to/repo.git
#+end_src

Or add a remote
#+begin_src sh
git remote add origin git@your-server:/path/to/repo.git
#+end_src

* Restriction
** /etc/shells

Edit /etc/shells' user entry to specify the /bin/git-shell
This way no interactive ssh connection is possible

** exotic box

You can specify where the git binaries are supposed to be found.

Through git commands:
#+begin_src sh
git config remote.origin.uploadpack /volume2/@appstore/git/bin/git-upload-pack
git config remote.origin.receivepack /volume2/@appstore/git/bin/git-receive-pack
#+end_src

or direct edition of .git/config file:

#+begin_src ini
[remote "origin"]
uploadpack = /volume2/@appstore/git/bin/git-upload-pack
receivepack = /volume2/@appstore/git/bin/git-receive-pack
#+end_src
4 changes: 4 additions & 0 deletions todo.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#+author: ardumont
#+options: hidestar

* DONE Install home git server on nas
CLOSED: [2015-07-31 Fri 20:39]
* TODO take a look at
https://github.com/travisbhartwell/nix-emacs
* DONE nas [4/4]
Expand Down Expand Up @@ -1875,3 +1877,5 @@ CLOSED: [2013-07-07 dim. 10:00]
* DONE DevOps
CLOSED: [2014-11-10 Mon 10:03]
- [X] https://en.wikipedia.org/wiki/DevOps
* TODO Review [[https://github.com/okulbilisim/awesome-datascience][okulbilisim/awesome-datascience]]
[2015-07-29 Wed 17:52]

0 comments on commit 2101174

Please sign in to comment.