gitlab-grack 2.0.0.rc1 → 2.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -22
- data/.gitmodules +3 -0
- data/.travis.yml +14 -0
- data/CHANGELOG +2 -0
- data/Gemfile +7 -2
- data/Gemfile.lock +17 -8
- data/README.md +95 -292
- data/Rakefile +27 -0
- data/examples/dispatch.fcgi +9 -0
- data/grack.gemspec +20 -0
- data/install.txt +60 -0
- data/lib/grack.rb +5 -0
- data/lib/grack/auth.rb +37 -0
- data/lib/grack/bundle.rb +20 -0
- data/lib/grack/server.rb +346 -0
- data/lib/grack/version.rb +3 -0
- data/tests/main_test.rb +255 -0
- metadata +18 -22
- data/Makefile +0 -153
- data/Procfile.example +0 -3
- data/Vagrantfile +0 -41
- data/database.yml.example +0 -13
- data/gitlab-openldap/.gitignore +0 -1
- data/gitlab-openldap/Makefile +0 -40
- data/gitlab-openldap/README.md +0 -60
- data/gitlab-openldap/bootstrap.ldif +0 -36
- data/gitlab-openldap/frontend.alt.example.com.ldif +0 -109
- data/gitlab-openldap/frontend.example.com.ldif +0 -109
- data/gitlab-openldap/run-slapd +0 -3
- data/gitlab-openldap/run-slapd-alt +0 -3
- data/redis/redis.conf.example +0 -2
- data/redis/resque.yml.example +0 -2
- data/support/edit-gitlab.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f620ff134c43ad395371b842da7bbeb812cf0434
|
4
|
+
data.tar.gz: edb62816e986e9eb510d66d077bba78514c575f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 662499bdfca3cb601ed8b64c14bde3160087f108e57062452610f47b1e34e873d4cb81131cc23be990e42ac2101f879015d06ee231fc87ace57b8eb8bf700505
|
7
|
+
data.tar.gz: 49a2126c89906af736b3bb4d4f3243dd8efa5656405ca0010f36f5a597ce5be4759d5bfa5166984a81d985f88e96648637e6299e325d9a68b069f8ea22bfd5a9
|
data/.gitignore
CHANGED
@@ -1,22 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
repositories/
|
5
|
-
gitlab/
|
6
|
-
gitlab-ci/
|
7
|
-
gitlab-runner/
|
8
|
-
Procfile
|
9
|
-
postgresql/data
|
10
|
-
postgresql/.s.*
|
11
|
-
redis/*.conf
|
12
|
-
.bundle/
|
13
|
-
gitlab-openldap/bin/
|
14
|
-
gitlab-openldap/etc/
|
15
|
-
gitlab-openldap/include/
|
16
|
-
gitlab-openldap/lib/
|
17
|
-
gitlab-openldap/libexec/
|
18
|
-
gitlab-openldap/openldap-2.4.40.tgz
|
19
|
-
gitlab-openldap/openldap-2.4.40/
|
20
|
-
gitlab-openldap/sbin/
|
21
|
-
gitlab-openldap/share/
|
22
|
-
.vagrant/
|
1
|
+
coverage/
|
2
|
+
pkg/
|
3
|
+
*.gem
|
data/.gitmodules
ADDED
data/.travis.yml
ADDED
data/CHANGELOG
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,16 +1,25 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
gitlab-grack (2.0.0.pre)
|
5
|
+
rack (~> 1.5.1)
|
6
|
+
|
1
7
|
GEM
|
2
8
|
remote: https://rubygems.org/
|
3
9
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
10
|
+
metaclass (0.0.1)
|
11
|
+
mocha (0.14.0)
|
12
|
+
metaclass (~> 0.0.1)
|
13
|
+
rack (1.5.2)
|
14
|
+
rack-test (0.6.2)
|
15
|
+
rack (>= 1.0)
|
16
|
+
rake (10.1.0)
|
11
17
|
|
12
18
|
PLATFORMS
|
13
19
|
ruby
|
14
20
|
|
15
21
|
DEPENDENCIES
|
16
|
-
|
22
|
+
gitlab-grack!
|
23
|
+
mocha (~> 0.11)
|
24
|
+
rack-test
|
25
|
+
rake
|
data/README.md
CHANGED
@@ -1,292 +1,95 @@
|
|
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
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
bundle exec foreman start
|
98
|
-
|
99
|
-
Now you can go to http://localhost:3000 in your browser.
|
100
|
-
The development login credentials are `root` and `5iveL!fe`
|
101
|
-
|
102
|
-
If you want to work on GitLab CI, first seed the GitLab CI database:
|
103
|
-
|
104
|
-
cd gitlab-ci && bundle exec rake db:create db:setup
|
105
|
-
|
106
|
-
To start the GitLab CI rails application:
|
107
|
-
|
108
|
-
bundle exec foreman start
|
109
|
-
|
110
|
-
Setup the GitLab Runner:
|
111
|
-
|
112
|
-
cd gitlab-runner
|
113
|
-
CI_SERVER_URL=http://localhost:9000 bundle exec ./bin/setup
|
114
|
-
|
115
|
-
Start the GitLab Runner:
|
116
|
-
|
117
|
-
bundle exec ./bin/runner
|
118
|
-
|
119
|
-
To enable the OpenLDAP server, see the OpenLDAP instructions in this readme.
|
120
|
-
|
121
|
-
END Post-installation
|
122
|
-
|
123
|
-
Please do not delete the 'END Post-installation' line above. It is used to
|
124
|
-
print the post-installation message from the Makefile.
|
125
|
-
|
126
|
-
### Vagrant
|
127
|
-
|
128
|
-
[Vagrant](http://www.vagrantup.com) is a tool for setting up identical development
|
129
|
-
environments including all dependencies. Vagrant will default to using
|
130
|
-
[VirtualBox](http://www.virtualbox.org), but it has many plugins for different
|
131
|
-
environments.
|
132
|
-
|
133
|
-
Vagrant allows you to develop GitLab without affecting your host machine.
|
134
|
-
But we recommend developing GitLab on metal if you can.
|
135
|
-
Vagrant can be very slow since the NFS server is on the host OS.
|
136
|
-
And GitLab (testing) accesses a lot of files.
|
137
|
-
You can improve the speed by running NFS on the guest OS.
|
138
|
-
In this case you should take care to not lose the files when you shut down the VM.
|
139
|
-
|
140
|
-
Once you have Vagrant installed, simply type `vagrant up` in this directory. Vagrant
|
141
|
-
will download an OS image, bring it up, and install all the prerequisites. You then
|
142
|
-
type `vagrant ssh` to ssh into the box. This directory will be available as a shared
|
143
|
-
folder in `/vagrant/` and you can continue at *Install the repositories and gems*
|
144
|
-
below.
|
145
|
-
|
146
|
-
Typically you keep editing on the host machine but run `make`, `bundle exec` etc.
|
147
|
-
inside the `vagrant ssh` session.
|
148
|
-
|
149
|
-
Note: On some setups the shared folder will have the wrong user. This is detected
|
150
|
-
by the Vagrantfile and you should `sudo su - build` to switch to the correct user
|
151
|
-
in that case.
|
152
|
-
|
153
|
-
## Development
|
154
|
-
|
155
|
-
When doing development, you will need one shell session (terminal window)
|
156
|
-
running Postgres and Redis, and one or more other sessions to work on GitLab
|
157
|
-
itself.
|
158
|
-
|
159
|
-
### Example
|
160
|
-
|
161
|
-
First start Postgres and Redis.
|
162
|
-
|
163
|
-
```
|
164
|
-
# terminal window 1
|
165
|
-
# current directory: gitlab-development-kit
|
166
|
-
bundle exec foreman start
|
167
|
-
```
|
168
|
-
|
169
|
-
Next, start a Rails development server.
|
170
|
-
|
171
|
-
```
|
172
|
-
# terminal window 2
|
173
|
-
# current directory: gitlab-development-kit/gitlab
|
174
|
-
bundle exec foreman start
|
175
|
-
```
|
176
|
-
|
177
|
-
Now you can go to http://localhost:3000 in your browser.
|
178
|
-
The development login credentials are `root` and `5iveL!fe`
|
179
|
-
|
180
|
-
### Running the tests
|
181
|
-
|
182
|
-
In order to run the test you can use the following commands:
|
183
|
-
- `rake spinach` to run the spinach suite
|
184
|
-
- `rake spec` to run the rspec suite
|
185
|
-
- `rake jasmine:ci` to run the jasmine test suite
|
186
|
-
- `rake gitlab:test` to run all the tests
|
187
|
-
|
188
|
-
Note: You can't run `rspec .` since this will try to run all the `_spec.rb`
|
189
|
-
files it can find, also the ones in `/tmp`
|
190
|
-
|
191
|
-
To run a single test file you can use:
|
192
|
-
|
193
|
-
- `bundle exec rspec spec/controllers/commit_controller_spec.rb` for a rspec test
|
194
|
-
- `bundle exec spinach features/project/issues/milestones.feature` for a spinach test
|
195
|
-
|
196
|
-
## Update gitlab and gitlab-shell repositories
|
197
|
-
|
198
|
-
When working on a new feature, always check that your `gitlab` repository is up
|
199
|
-
to date with the upstream master branch.
|
200
|
-
|
201
|
-
In order to fetch the latest code, first make sure that `foreman` for
|
202
|
-
postgres is runnning (needed for db migration) and then run:
|
203
|
-
|
204
|
-
```
|
205
|
-
make update
|
206
|
-
```
|
207
|
-
|
208
|
-
This will update both `gitlab`, `gitlab-ci` and `gitlab-shell` and run any possible migrations.
|
209
|
-
You can also update them separately by running `make gitlab-update` `make gitlab-ci-update` and
|
210
|
-
`make gitlab-shell-update` respectively.
|
211
|
-
|
212
|
-
## OpenLDAP
|
213
|
-
|
214
|
-
To run the OpenLDAP installation included in the GitLab development kit do the following:
|
215
|
-
|
216
|
-
```
|
217
|
-
vim Procfile # remove the comment on the OpenLDAP line
|
218
|
-
cd gitlab-openldap
|
219
|
-
make # will setup the databases
|
220
|
-
```
|
221
|
-
|
222
|
-
in the gitlab repository edit config/gitlab.yml;
|
223
|
-
|
224
|
-
```yaml
|
225
|
-
ldap:
|
226
|
-
enabled: true
|
227
|
-
servers:
|
228
|
-
main:
|
229
|
-
label: LDAP
|
230
|
-
host: 127.0.0.1
|
231
|
-
port: 3890
|
232
|
-
uid: 'uid'
|
233
|
-
method: 'plain' # "tls" or "ssl" or "plain"
|
234
|
-
base: 'dc=example,dc=com'
|
235
|
-
user_filter: ''
|
236
|
-
group_base: 'ou=groups,dc=example,dc=com'
|
237
|
-
admin_group: ''
|
238
|
-
# Alternative server, multiple LDAP servers only work with GitLab-EE
|
239
|
-
# alt:
|
240
|
-
# label: LDAP-alt
|
241
|
-
# host: 127.0.0.1
|
242
|
-
# port: 3890
|
243
|
-
# uid: 'uid'
|
244
|
-
# method: 'plain' # "tls" or "ssl" or "plain"
|
245
|
-
# base: 'dc=example-alt,dc=com'
|
246
|
-
# user_filter: ''
|
247
|
-
# group_base: 'ou=groups,dc=example-alt,dc=com'
|
248
|
-
# admin_group: ''
|
249
|
-
```
|
250
|
-
|
251
|
-
The second database is optional, and will only work with Gitlab-EE.
|
252
|
-
|
253
|
-
## Troubleshooting
|
254
|
-
|
255
|
-
### Rails cannot connect to Postgres
|
256
|
-
|
257
|
-
- Check if foreman is running in the gitlab-development-kit directory.
|
258
|
-
- Check for custom Postgres connection settings defined via the environment; we
|
259
|
-
assume none such variables are set. Look for them with `set | grep '^PG'`.
|
260
|
-
|
261
|
-
### 'LoadError: dlopen' when starting Ruby apps
|
262
|
-
|
263
|
-
This can happen when you try to load a Ruby gem with native extensions that
|
264
|
-
were linked against a system library that is no longer there. A typical culprit
|
265
|
-
is Homebrew on OS X, which encourages frequent updates (`brew update && brew
|
266
|
-
upgrade`) which may break binary compatibility.
|
267
|
-
|
268
|
-
```
|
269
|
-
bundle exec rake db:create gitlab:setup
|
270
|
-
rake aborted!
|
271
|
-
LoadError: dlopen(/Users/janedoe/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/charlock_holmes-0.6.9.4/charlock_holmes/charlock_holmes.bundle, 9): Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.52.1.dylib
|
272
|
-
Referenced from: /Users/janedoe/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/charlock_holmes-0.6.9.4/charlock_holmes/charlock_holmes.bundle
|
273
|
-
Reason: image not found - /Users/janedoe/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/charlock_holmes-0.6.9.4/charlock_holmes/charlock_holmes.bundle
|
274
|
-
/Users/janedoe/gitlab-development-kit/gitlab/config/application.rb:6:in `<top (required)>'
|
275
|
-
/Users/janedoe/gitlab-development-kit/gitlab/Rakefile:5:in `require'
|
276
|
-
/Users/janedoe/gitlab-development-kit/gitlab/Rakefile:5:in `<top (required)>'
|
277
|
-
(See full trace by running task with --trace)
|
278
|
-
```
|
279
|
-
|
280
|
-
In the above example, you see that the charlock_holmes gem fails to load
|
281
|
-
`libicui18n.52.1.dylib`. You can try fixing this by re-installing
|
282
|
-
charlock_holmes:
|
283
|
-
|
284
|
-
```
|
285
|
-
# in /Users/janedoe/gitlab-development-kit
|
286
|
-
gem uninstall charlock_holmes
|
287
|
-
bundle install # should reinstall charlock_holmes
|
288
|
-
```
|
289
|
-
|
290
|
-
### Other problems
|
291
|
-
|
292
|
-
Please open an issue on the [GDK issue tracker](https://gitlab.com/gitlab-org/gitlab-development-kit/issues).
|
1
|
+
Grack - Ruby/Rack Git Smart-HTTP Server Handler
|
2
|
+
===============================================
|
3
|
+
|
4
|
+
[![Build Status](https://travis-ci.org/gitlabhq/grack.png)](https://travis-ci.org/gitlabhq/grack)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/gitlabhq/grack.png)](https://codeclimate.com/github/gitlabhq/grack)
|
6
|
+
|
7
|
+
This project aims to replace the builtin git-http-backend CGI handler
|
8
|
+
distributed with C Git with a Rack application. This reason for doing this
|
9
|
+
is to allow far more webservers to be able to handle Git smart http requests.
|
10
|
+
|
11
|
+
The default git-http-backend only runs as a CGI script, and specifically is
|
12
|
+
only targeted for Apache 2.x usage (it requires PATH_INFO to be set and
|
13
|
+
specifically formatted). So, instead of trying to get it to work with
|
14
|
+
other CGI capable webservers (Lighttpd, etc), we can get it running on nearly
|
15
|
+
every major and minor webserver out there by making it Rack capable. Rack
|
16
|
+
applications can run with the following handlers:
|
17
|
+
|
18
|
+
* CGI
|
19
|
+
* FCGI
|
20
|
+
* Mongrel (and EventedMongrel and SwiftipliedMongrel)
|
21
|
+
* WEBrick
|
22
|
+
* SCGI
|
23
|
+
* LiteSpeed
|
24
|
+
* Thin
|
25
|
+
|
26
|
+
These web servers include Rack handlers in their distributions:
|
27
|
+
|
28
|
+
* Ebb
|
29
|
+
* Fuzed
|
30
|
+
* Phusion Passenger (which is mod_rack for Apache and for nginx)
|
31
|
+
* Unicorn
|
32
|
+
* Puma
|
33
|
+
|
34
|
+
With [Warbler](http://caldersphere.rubyforge.org/warbler/classes/Warbler.html),
|
35
|
+
and JRuby, we can also generate a WAR file that can be deployed in any Java
|
36
|
+
web application server (Tomcat, Glassfish, Websphere, JBoss, etc).
|
37
|
+
|
38
|
+
Since the git-http-backend is really just a simple wrapper for the upload-pack
|
39
|
+
and receive-pack processes with the '--stateless-rpc' option, it does not
|
40
|
+
actually re-implement very much.
|
41
|
+
|
42
|
+
Dependencies
|
43
|
+
========================
|
44
|
+
* Ruby - http://www.ruby-lang.org
|
45
|
+
* Rack - http://rack.rubyforge.org
|
46
|
+
* A Rack-compatible web server
|
47
|
+
* Git >= 1.7 (currently the 'pu' branch)
|
48
|
+
* Mocha (only for running the tests)
|
49
|
+
|
50
|
+
Quick Start
|
51
|
+
========================
|
52
|
+
$ gem install rack
|
53
|
+
$ (edit config.ru to set git project path)
|
54
|
+
$ rackup --host 127.0.0.1 -p 8080 config.ru
|
55
|
+
$ git clone http://127.0.0.1:8080/schacon/grit.git
|
56
|
+
|
57
|
+
Contributing
|
58
|
+
========================
|
59
|
+
If you would like to contribute to the Grack project, I prefer to get
|
60
|
+
pull-requests via GitHub. You should include tests for whatever functionality
|
61
|
+
you add. Just fork this project, push your changes to your fork and click
|
62
|
+
the 'pull request' button. To run the tests, you first need to install the
|
63
|
+
'mocha' mocking library and initialize the submodule.
|
64
|
+
|
65
|
+
$ sudo gem install mocha
|
66
|
+
$ git submodule init
|
67
|
+
$ git submodule update
|
68
|
+
|
69
|
+
Then you should be able to run the tests with a 'rake' command. You can also
|
70
|
+
run coverage tests with 'rake rcov' if you have rcov installed.
|
71
|
+
|
72
|
+
License
|
73
|
+
========================
|
74
|
+
(The MIT License)
|
75
|
+
|
76
|
+
Copyright (c) 2009 Scott Chacon <schacon@gmail.com>
|
77
|
+
|
78
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
79
|
+
a copy of this software and associated documentation files (the
|
80
|
+
'Software'), to deal in the Software without restriction, including
|
81
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
82
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
83
|
+
permit persons to whom the Software is furnished to do so, subject to
|
84
|
+
the following conditions:
|
85
|
+
|
86
|
+
The above copyright notice and this permission notice shall be
|
87
|
+
included in all copies or substantial portions of the Software.
|
88
|
+
|
89
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
90
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
91
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
92
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
93
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
94
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
95
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|