blob: 31a18a0b0d3921becd2b6e3a315b7047a2d6d549 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
gitscripts
----------
Collection of scripts that make it easier to manager self-hosted git server.
If you have a git server, and you don't like the idea of running large web frontends, but still want
to be able to do something as basic as create a new remote (bare) repository this might be for you.
Install/Usage:
1. Create a 'git' user (or any other name, but you'll have to substitute henceforth)
I use git's $HOME to store my repositories, but you can either change git's $HOME on creation
or just change PREFIX in the scripts;
2. `chsh -s $(command -v git-shell) git` to change 'git' to use git-shell (this will restrict
the user to use only the git related commands we allow);
3. Clone this repository and `cp -r git-shell-commands /home/git`, without this folder and
scripts in it, git-shell won't be interactive (see git-shell(1) man page).
- help: just prints the contents of git-shell-commands directory;
- mkrepo: creates a new bare repository at given path and optionally provides description;
- setdesc: sets/changes a repository's description.
4. That's it for the remote, now copy (or `ln -s` from this repo) `git-description` and
`git-mkremote` to somewhere that is in your $PATH. Now you can access them by calling
`git mkremote/descremote`. All of them provide usage example when called without arguments;
Example:
```
$ git mkremote
Usage: git-mkremote <name> <server> <repo name> [description]
$ git mkremote local git@local.lan public/gitscripts collection of scripts for git
$ git push --set-upstream local master
```
5. That's it! Now you can create remotes easily from the comfort of your terminal, like a normal
terminally terminal person.
NOTICE:
The git-shell scripts provide access for anyone with ssh access to git user to create folders
and initialize repositories anywhere on your system with lax permissions! Maybe chroot(1)ing
your git server could be a good idea, or maybe if it's just a personal git sever this is okay.
|