Indefero

Indefero Commit Details


Date:2009-01-20 04:24:38 (15 years 11 months ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:1327e5f1e35bc07e4e84c0fc5843f2b0597077b8
Parents: ef197fc6abf767b757467fa279565fdbb5db7349
Message:Added the documentation for the git synchronization.

Changes:

File differences

doc/syncgit.mdtext
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Plugin SyncGit by CĂ©ondo Ltd
The SyncGit plugin allow the direct creation and synchronisation of
git repositories with the InDefero database. This requires giving
access to the repositories using a dedicated SSH account, usually the
`git` account.
## Prerequisites
A good understanding of:
* the security issues related to using a SSH account on a server;
* the principle of public/private SSH keys;
* the rights/ownership of files on a Linux/BSD/nix system;
Yes, what you are going to do has security implications.
## Git user configuration
On your system, you will need to create a new `git` account. This
account will only be used to access the git repositories and at the
moment cannot be shared for other use.
First create a new git account:
$ sudo adduser \
--system \
--shell /bin/sh \
--gecos 'git version control' \
--group \
--disabled-password \
--home /home/git \
git
Then, we need to create the base SSH files with the right permissions:
$ sudo su git
$ mkdir /home/git/.ssh
$ touch /home/git/.ssh/authorized_keys
$ chmod 0700 /home/git/.ssh
$ chmod 0600 /home/git/.ssh/authorized_keys
$ exit
## Creation of the repositories base
For each project using git in InDefero a corresponding bare repository
will be created in `/home/git/repositories`. For example, if the
shortname of your project is `wonder`, it will be created in
`/home/git/repositories/wonder.git`
$ sudo -H -u git mkdir /home/git/repositories
## InDefero Configuration
First, you need to have python installed on your system to be able to
run the very small python script `gitserve.py` in the `scripts`
folder. Here is a configuration example:
$cfg['git_repositories'] = '/home/git/repositories/%s.git';
$cfg['git_remote_url'] = 'git://yourdomain.com/%s.git';
$cfg['idf_plugin_syncgit_path_gitserve'] = '/home/www/indefero/scripts/gitserve.py'; # yes .py
$cfg['idf_plugin_syncgit_path_authorized_keys'] = '/home/git/.ssh/authorized_keys';
$cfg['idf_plugin_syncgit_sync_file'] = '/tmp/SYNC-GIT';
When someone will change his SSH key or add a new one, the
`/tmp/SYNC-GIT` file will be created. The cron job
`/home/www/indefero/scripts/gitcron.php` will see the file and update
the content of the `authorized_keys` file.
## Cron Job Configuration
You need to run a cron job every now and then to synchronize the SSH
keys. The command to run in the cron job is:
php /home/www/indefero/scripts/gitcron.php
The user of the cron job must be `git`.

Archive Download the corresponding diff file

Page rendered in 0.07346s using 13 queries.