You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rewrite of primary gitolite interface for better resilience.
The primary "update_repositories" function is now largely self-correcting
against a variety of errors seen in the field. Also added a bunch of
error checking on functions called-out to the shell. Among other things,
this code attempts to reconnect the gitolite-admin public key when it
gets deleted (can happen).
Regular use of 'sys/fetch_changesets' will recorrect any errors in the
public key directory and gitolite.conf file. For example, orphan keys
that happen to be left behind in the public key directory will be removed,
missing keys will be added, etc.
One new piece of functionality is the 'recycle_bin' which is used to store
deleted repositories immediately after they are deleted (allowing them
to be recovered for up to 'gitRecycleExpireTime' hours after deletion).
You need to migrate plugins because there are new plugin settings:
rake db:migrate_plugins
Copy file name to clipboardExpand all lines: README.mkd
+58-14Lines changed: 58 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
-
# Redmine Git Hosting Plugin (v0.4.2)
1
+
# Redmine Git Hosting Plugin (v0.4.2x)
2
2
3
3
A ChiliProject / Redmine plugin which makes configuring your own git hosting easy. This plugin allows straightforward management
4
4
of gitolite and associated public keys, the git daemon, and integrates code from Scott Schacon's "grack" utility
5
5
to provide Git Smart HTTP access. Git repositories are automatically created when the repository is created in
6
-
redmine. There is also an option to automatically create a git repository for a project, when the project is created.
6
+
Redmine. There is also an option to automatically create a git repository for a project, when the project is created.
7
7
Caching functionality is also implemented to speed page-load times for viewing git repositories.
8
8
9
9
@@ -41,6 +41,9 @@ Note that this guide refers to the "web server user" as the user under which Rai
41
41
not always) the same as the user that runs the main web server. If you are running Rails under a different user, follow
42
42
these instructions using that user, not the one for the main web server.
43
43
44
+
As of the most recent set of patches, this plugin is compatible with running multiple Redmine installations on the same server, each
45
+
with the same *or* different gitolite users/repositories. The later configuration (multiple Redmine installations, each with a different
46
+
gitolite installation) is particularly useful for a web-hosting scenario with independent developers.
44
47
45
48
## Step-By-Step configuration instructions
46
49
@@ -101,12 +104,12 @@ variables are set correctly. To adjust these variables, open an editor and edit
101
104
Starting on line 22 you will see the settings definitions you should edit.
102
105
103
106
104
-
The *httpServer* variable should be set to the url used to access your redmine site, e.g. www.my-own-personal-git-host-server.com. Note that if Redmine is not
105
-
installed in the site root this should include the path to your redmine root, e.g. www.my-own-personal-git-host-server.com/path/to/redmine
107
+
The *httpServer* variable should be set to the url used to access your Redmine site, e.g. www.my-own-personal-git-host-server.com. Note that if Redmine is not
108
+
installed in the site root this should include the path to your Redmine root, e.g. www.my-own-personal-git-host-server.com/path/to/redmine
106
109
107
110
108
111
The *gitServer* will usually be the same as the the httpServer variable -- this is the server name to use to access the gitolite repositories via ssh. This should be
109
-
the hostname only, so this will be different from *httpServer* if Redmine is not installed in the site root. In other words, even if redmine is installed in
112
+
the hostname only, so this will be different from *httpServer* if Redmine is not installed in the site root. In other words, even if Redmine is installed in
110
113
www.my-own-personal-git-host-server.com/path/to/redmine, *gitServer* should be set to www.my-own-personal-git-host-server.com
111
114
112
115
@@ -146,12 +149,51 @@ you have both git and svn (or hg, or cvs etc.) repositories, this may cause prob
146
149
147
150
*Delete Git Repository When Project Is Deleted* can be enabled to let this plugin control repository deletion as well as repository creation. By default,
148
151
this feature is disabled and when a repository is deleted in ChiliProject / Redmine, it is not deleted in gitolite. This is a safety feature to prevent
149
-
the accidental loss of data. If this feature is enabled, the safety is turned off and the repository files will be permanently deleted when the Project/Repository is deleted in ChiliProject/Redmine.
152
+
the accidental loss of data. If this feature is enabled, the safety is turned off and the repository files will be deleted when the Project/Repository is
153
+
deleted in ChiliProject/Redmine. Note, however, that even when this feature is enabled, deleted repositories are placed into a "recycle_bin" for a configurable
154
+
amount of time (defaulting to 24 hours) and can be recovered by recreating the project in Redmine with the same Identifier. Details are placed in the log.
155
+
156
+
The *gitRecycleBasePath* is the path *relative to the git user root* where deleted repositories are placed. This path should end in a path separator, e.g. '/'.
157
+
Deleted repositories are kept here for up to *gitRecycleExpireTime* hours (configurable, defaults to 24.0 hours).
158
+
159
+
The *gitLockWaitTime* represents the amount of time that the plugin will wait in attempting to acquire its internal synchronization lock before giving up.
160
+
You probably will not need to change this value.
150
161
151
162
*Show Checkout URLs* can be disabled to hide the git URL bar in the repository tab. It is enabled by default.
152
163
153
164
See below in the "Caching" section of this readme for more information on caching and how the caching variables should be configured.
154
165
166
+
## Resychronization of gitolite configuration
167
+
168
+
Whenever a Redmine `fetch_changesets()` operation is executed (i.e. `http://REDMINE_ROOT/sys/fetch_changesets?key=xxx`), this plugin will check the
169
+
gitolite keydir and configuration file for consistency. It will correct any errors that it finds. Further, regular execution of a fetch_changesets operation
170
+
will make sure that repositories placed in the recycle_bin (during delete operations) will be expired and removed. Since there still seem to be some
171
+
phantom synchronization problems, it is recommended that you execute `fetch_changesets()` regularly (every 15 to 30 minutes).
172
+
173
+
Two rake tasks can additionally be used for resynchronization (although these are redundant with executing `fetch_changesets()` through other means).
174
+
175
+
**(1)** To fixup the gitolite configuration file, fix errors, and delete expired files in the recycle_bin, execute:
**(2)** To perform all the above operations while at the same time fetching changesets for all repositories, execute:
180
+
181
+
RAILS_ENV=production rake gitolite:fetch_changes
182
+
183
+
**Note that it is very important that these commands be run as *www-user* (or whatever your web server user happens to be), lest you get permission problems later.**
184
+
(The same is true of any `fetch_changesets()` operation initiated without using the web server, i.e. through the command line or from the cron daemon).
185
+
186
+
## Interaction with non-Redmine gitolite users
187
+
188
+
This plugin respects gitolite repositories that are managed outside of Redmine or managed by both Redmine and non-Redmine users:
189
+
190
+
* When performing a *fetch_changesets()* operation, this plugin will delete and reestablish all keys that are of the form "redmine_",
191
+
since it considers these to be under its exclusive control. A special token, called "redmine_dummy_key", is used as a placeholder when no access
192
+
is granted for a given repository.
193
+
* Keys other than "redmine_" are left untouched and can be in projects by themselves or mixed in with projects managed by redmine.
194
+
* When a Redmine-managed project is deleted (with the *Delete Git Repository When Project Is Deleted* option enabled), its corresponding git repository
195
+
*will not be deleted/recycled* if there are non-Redmine keys in the gitolite.conf file.
196
+
155
197
## A Note About PATH variables
156
198
157
199
One major source of issues with this plugin is that Rails needs to be able to run both *sudo* and *git*. Specifically, these programs need to be in one of the directories specified by
@@ -246,27 +288,27 @@ This library allows you to quickly deploy ChiliProject, with this plugin to an u
246
288
chili\_test.sh script, modifying the variables in those scripts as desired. This library is still under development,
247
289
so these instructions may need to be updated in the near future.
248
290
249
-
## Selinux Configuration for redmine
291
+
## Selinux Configuration for Redmine
250
292
251
293
This plugin can be configured to run with selinux. We have included a rakefile in tasks/selinux.rake to assist
252
294
with installing with selinux. You should start by editing init.rb and migrating as described above. Then, you
253
-
can execute one of the selinux rake tasks (from the redmine root). For instance, the simplest option installs
254
-
a selinux configuration for both redmine and the redmine_git_hosting plugin:
295
+
can execute one of the selinux rake tasks (from the Redmine root). For instance, the simplest option installs
296
+
a selinux configuration for both Redmine and the redmine_git_hosting plugin:
255
297
256
298
rake selinux:install RAILS_ENV=production
257
299
258
300
This will generate the redmine_git_hosting binaries in ./bin, install a selinux policy for these binaries (called
259
-
redmine_git.pp), then install a complete context for redmine as follows:
301
+
redmine_git.pp), then install a complete context for Redmine as follows:
260
302
261
-
**(1)** Most of redmine will be marked with "public_content_rw_t".
303
+
**(1)** Most of Redmine will be marked with "public_content_rw_t".
262
304
263
305
**(2)** The dispatch files in Rails.root/public/dispatch.* will be marked with "httpd_sys_script_exec_t"
264
306
265
307
**(3)** The redmine_git_hosting binaries in Rails.root/vendor/plugins/redmine_git_hosting/bin will be labeled
266
308
with "httpd_redmine_git_script_exec_t", which has been crafted to allow the sudo behavior required by these
267
309
binaries.
268
310
269
-
Note that this rake file has additional options. For instance, you can specify redmine roots with regular
311
+
Note that this rake file has additional options. For instance, you can specify Redmine roots with regular
270
312
expressions (not globbed expessions!) as follows (notice the use of double quotes):
0 commit comments