summaryrefslogtreecommitdiff
path: root/Makefile
blob: 9d03294134f03cca3126918a3ecf7b4de070d339 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
PREFIX=/srv/git
USER=git
GIT_SHELL=/usr/bin/git-shell
HACKERS=$(PWD)

# Create the user
user: 
	useradd -d $(PREFIX) -m -r -s $(GIT_SHELL) -U $(USER)

# Create the hackers.git bare repo and clone as .ssh 
# Then create needed symlinks and add hooks to hackers.git
install: 
	cd $(PREFIX); \
	git clone --bare $(HACKERS) hackers.git && \
	git clone hackers.git .ssh && \
	chmod 700 .ssh && \
	chmod 600 .ssh/authorized_keys && \
	ln -s $(PREFIX)/.ssh/git-hooks/* hackers.git/hooks/ && \
	ln -s $(PREFIX)/.ssh/git-shell-commands