gitlab-grack 2.0.0.rc1 → 2.0.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e58169aa1a220e55b89a028ccd0f404da9724959
4
- data.tar.gz: 2d6677fac1e708aad1fb9b635b429fedcdff2a2f
3
+ metadata.gz: f620ff134c43ad395371b842da7bbeb812cf0434
4
+ data.tar.gz: edb62816e986e9eb510d66d077bba78514c575f4
5
5
  SHA512:
6
- metadata.gz: 04add40340ee6c556e435e3908c32bf38f19f4e503f04f44a61b6a1574addef1b0d768cfb2f257c5879549918cd1e15b4482bf1e63ba3a7e9d536f1767b6b66c
7
- data.tar.gz: a87bdaac672b756b35aa7ea7e862c70b46ff0441a8d2cbb1c28604860ae3bae2190e41e4f199f67a47884014e8f656275b9f09a52e83300aa3536bb82a66a60f
6
+ metadata.gz: 662499bdfca3cb601ed8b64c14bde3160087f108e57062452610f47b1e34e873d4cb81131cc23be990e42ac2101f879015d06ee231fc87ace57b8eb8bf700505
7
+ data.tar.gz: 49a2126c89906af736b3bb4d4f3243dd8efa5656405ca0010f36f5a597ce5be4759d5bfa5166984a81d985f88e96648637e6299e325d9a68b069f8ea22bfd5a9
data/.gitignore CHANGED
@@ -1,22 +1,3 @@
1
- gitlab-shell/
2
- .ssh/
3
- gitlab-satellites/
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
@@ -0,0 +1,3 @@
1
+ [submodule "tests/example"]
2
+ path = tests/example
3
+ url = git://github.com/schacon/simplegit.git
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ env:
3
+ - TRAVIS=true
4
+ branches:
5
+ only:
6
+ - 'master'
7
+ rvm:
8
+ - 1.9.3-p327
9
+ - 2.0.0
10
+ before_script:
11
+ - "bundle install"
12
+ - "git submodule init"
13
+ - "git submodule update"
14
+ script: "bundle exec rake"
@@ -0,0 +1,2 @@
1
+ 1.1.0
2
+ - Modifies service_rpc to use chunked transfer (https://github.com/gitlabhq/grack/pull/1)
data/Gemfile CHANGED
@@ -1,3 +1,8 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- gem 'foreman'
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'rake'
7
+ gem 'rack-test'
8
+ end
@@ -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
- dotenv (0.11.1)
5
- dotenv-deployment (~> 0.0.2)
6
- dotenv-deployment (0.0.2)
7
- foreman (0.74.0)
8
- dotenv (~> 0.11.1)
9
- thor (~> 0.19.1)
10
- thor (0.19.1)
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
- foreman
22
+ gitlab-grack!
23
+ mocha (~> 0.11)
24
+ rack-test
25
+ rake
data/README.md CHANGED
@@ -1,292 +1,95 @@
1
- # GitLab Development Kit
2
-
3
- The GDK runs a GitLab development environment isolated in a directory.
4
- This environemnt contains GitLab CE, CI and Runner.
5
- This project uses Foreman to run dedicated Postgres and Redis processes for
6
- GitLab development. All data is stored inside the gitlab-development-kit
7
- directory. All connections to supporting services go through Unix domain
8
- sockets to avoid port conflicts.
9
-
10
- ## Design goals
11
-
12
- - Get the user started, do not try to take care of everything
13
- - Run everything as your 'desktop' user on your development machine
14
- - GitLab Development Kit itself does not run `sudo` commands
15
- - It is OK to leave some things to the user (e.g. installing Ruby)
16
-
17
- ## Installation
18
-
19
- The preferred way to use GitLab Development Kit is to install Ruby and dependencies on your 'native' OS.
20
- We strongly recommend the native install since it is much faster that a virtualized one.
21
- If you want to use [Vagrant](https://www.vagrantup.com/) instead please see [the instructions for our (experimental) Vagrantfile](#vagrant).
22
- **DO NOT** run the installation as a root user
23
-
24
- ### Install dependencies
25
-
26
- #### Prerequisites for all platforms
27
-
28
- If you do not have the dependencies below you will experience strange errors during installation.
29
-
30
- 1. Ruby 2.1.5 with your method of choice (RVM, ruby-build, rbenv, chruby, etc.)
31
- 1. Bundler `gem install bundler`
32
-
33
- #### OS X 10.9
34
-
35
- ```
36
- brew tap homebrew/dupes
37
- brew install redis postgresql phantomjs libiconv icu4c pkg-config cmake nodejs
38
- bundle config build.nokogiri --with-iconv-dir=/usr/local/opt/libiconv
39
- ```
40
-
41
- #### Ubuntu
42
-
43
- ```
44
- sudo apt-get install postgresql libpq-dev phantomjs redis-server libicu-dev cmake g++ nodejs libkrb5-dev
45
- ```
46
-
47
- #### Arch Linux
48
-
49
- ```
50
- sudo pacman -S postgresql phantomjs redis postgresql-libs icu nodejs
51
- ```
52
-
53
- #### Debian
54
-
55
- Please contribute this by sending a merge request.
56
-
57
- #### RedHat
58
-
59
- Please contribute this by sending a merge request.
60
-
61
- ### Clone GitLab Development Kit repository
62
-
63
- ```
64
- git clone https://gitlab.com/gitlab-org/gitlab-development-kit.git
65
- cd gitlab-development-kit
66
- ```
67
-
68
- ### Install the repositories and gems
69
-
70
- The Makefile will clone the repositories, install the Gem bundles and set up
71
- basic configuration files.
72
-
73
- ```
74
- # Clone the official repositories of gitlab and gitlab-shell
75
- make
76
- ```
77
-
78
- Alternatively, you can clone straight from your forked repositories or GitLab EE.
79
-
80
- ```
81
- # Clone your own forked repositories
82
- make gitlab_repo=git@gitlab.com:example/gitlab-ce.git gitlab_shell_repo=git@gitlab.com:example/gitlab-shell.git
83
- ```
84
-
85
- ### Post-installation
86
-
87
- Start Redis and PostgreSQL by running the command below.
88
-
89
- bundle exec foreman start
90
-
91
- Seed the main GitLab database:
92
-
93
- cd gitlab && bundle exec rake db:create dev:setup
94
-
95
- Finally, start the main GitLab rails application:
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.