Showing 2 changed files with 491 additions and 0 deletions
+4
README.md
... ...
@@ -424,6 +424,10 @@ GitPrep 1.xx support Perl 5.8.7+. You can use GitPrep v1.12.
424 424
 
425 425
 https://github.com/yuki-kimoto/gitprep/archive/v1.12.tar.gz
426 426
 
427
+You can see version 1.12 document.
428
+
429
+[GitPrep version 1 Document](old/README_v1.md)
430
+
427 431
 **2. You can install your local perl by perlbrew.**
428 432
 
429 433
 http://perlbrew.pl/
+487
old/README_v1.md
... ...
@@ -0,0 +1,487 @@
1
+# GitPrep
2
+
3
+Github clone. You can install portable github system into Unix/Linux.
4
+
5
+**This is GitPrep version v1.12 document**
6
+
7
+See GitPrep example site. [GitPrep example site](http://perlcodesample.sakura.ne.jp/gitprep/gitprep.cgi/kimoto/gitprep)
8
+
9
+![GitPrep Image](gitprep_image.png "Gitprep image example")
10
+
11
+## Features
12
+
13
+* Github clone: GitPrep has the same interface as GitHub.
14
+* Portable: You can install GitPrep on your own Unix/Linux server.
15
+* Supports Windows installation via cygwin for Windows (need gcc4 package).
16
+* Only needs Perl 5.8.7+.
17
+* Smart HTTP support: you can pull and push via HTTP
18
+* CGI support, built-in web server, and reverse proxy support.
19
+* SSL support.
20
+
21
+## Check Perl Version
22
+
23
+Check Perl version. You can use GitPrep if the Perl version is 5.8.7+;
24
+
25
+    perl -v
26
+
27
+### Checki git command existance
28
+
29
+    git --version
30
+    
31
+## A. Installation when you run GitPrep as CGI script
32
+
33
+Download tar.gz archive, expand it and change directory:
34
+
35
+    curl -kL https://github.com/yuki-kimoto/gitprep/archive/latest.tar.gz > gitprep-latest.tar.gz
36
+    tar xf gitprep-latest.tar.gz
37
+    mv gitprep-latest gitprep
38
+    cd gitprep
39
+
40
+Setup. Needed module is installed.
41
+
42
+    ./setup.sh
43
+
44
+If you install git in your local directry,
45
+you must add the correct git command path to the **gitprep.conf** config file.
46
+
47
+    [basic]
48
+    ;;; Git command path
49
+    git_bin=/home/yourname/local/bin/git
50
+
51
+Check setup. Run the following command.
52
+
53
+    prove t
54
+
55
+If "syntax OK" is displayed, setup is sucseed.
56
+
57
+You can access the following URL.
58
+
59
+    http://yourhost/somepath/gitprep/gitprep.cgi
60
+
61
+### If you see Internal Server Error
62
+
63
+If you see an internal server error, look at the log file (gitprep/log/production.log)
64
+to see what problem has occurred.
65
+
66
+### Additional work when you don't run CGI script by your user.
67
+
68
+If CGI script isn't run by your user, you need the following work.
69
+For example, CGI script is run by apache user.
70
+
71
+Change user and group of all files in gitprep directory to apache 
72
+
73
+    chown -R apache:apache gitprep
74
+
75
+In this case, you server need to execute CGI.
76
+Check apache config file.
77
+
78
+For example, you need the following config.
79
+
80
+    <Directory /var/www/html>
81
+        Options +ExecCGI
82
+        AddHandler cgi-script .cgi
83
+    </Directory>
84
+
85
+## B. Installation when you run GitPrep as embdded web server
86
+
87
+GitPrep has its own web server,
88
+so you can start using the application very easily.
89
+In this way, performance is much better than CGI.
90
+
91
+### Create gitprep user
92
+
93
+Create a **gitprep** user. This is not necessary, but recommended:
94
+
95
+    useradd gitprep
96
+    su - gitprep
97
+    cd ~
98
+
99
+And config global git config
100
+
101
+    git config --global user.name "gitprep"
102
+    git config --global user.email "gitprep@example.com"
103
+
104
+### Download
105
+
106
+Download tar.gz archive, expand it and change directory:
107
+
108
+    curl -kL https://github.com/yuki-kimoto/gitprep/archive/latest.tar.gz > gitprep-latest.tar.gz
109
+    tar xf gitprep-latest.tar.gz
110
+    mv gitprep-latest gitprep
111
+    cd gitprep
112
+
113
+Setup. Needed module is installed.
114
+
115
+    ./setup.sh
116
+
117
+Check setup. Run the following command.
118
+
119
+    prove t
120
+
121
+If "syntax OK" is displayed, setup is sucseed.
122
+
123
+### Start
124
+
125
+You can start the application by running the provided gitprep script.
126
+The application is run in the background and the port is **10020** by default.
127
+
128
+    ./gitprep
129
+
130
+Then access the following URL.
131
+
132
+    http://localhost:10020
133
+
134
+If you want to change the port, edit gitprep.conf.
135
+If you cannot access this port, you might change the firewall settings.
136
+
137
+### Stop
138
+
139
+You can stop the application by adding the **--stop** option.
140
+
141
+    ./gitprep --stop
142
+
143
+## FAQ
144
+
145
+## Can't find git command from GitPrep
146
+
147
+If you install git into your local directry,
148
+you must add the correct git command path to the config file **gitprep.conf** .
149
+
150
+    [basic]
151
+    ;;; Git command path
152
+    git_bin=/home/yourname/local/bin/git
153
+
154
+### blame don't work
155
+
156
+In Gitprep, blame page use "git blame --line-porcelain". In old git, there is no --line-porcelain option.
157
+We don't know when --line-porcelain was added to git.
158
+At least, blame page work well in git 1.8.2.1.
159
+
160
+### How to upgrade GitPrep
161
+
162
+It is very easy. you only overwrite all files except for "gitprep.conf".
163
+
164
+If you want to upgrade by "git pull", you can do it.
165
+you create "gitprep.my.conf" copied from "gitprep.my.conf",
166
+and do "git pull"
167
+
168
+If you get a rainbow unicorn t-rex error after upgrading, you might be missing
169
+a new CPAN dependency. Run again "setup.sh".
170
+
171
+### I can't push large repository by http protocol
172
+
173
+There are some reasons.
174
+
175
+**1. Git version is old**
176
+
177
+If you see "error: RPC failed; result=56, HTTP code = 200" , your git maybe old.
178
+Please upgrade to latest git. I checked git version 1.8.5.5.
179
+
180
+**2. GitPrep restriction**
181
+
182
+GitPrep restrict max post message size 10MB(This is default of Mojolicious)
183
+
184
+You maybe see the following error
185
+
186
+    Delta compression using up to 4 threads.
187
+    Compressing objects: 100% (17830/17830), done.
188
+    Writing objects: 100% (18281/18281), 687.05 MiB | 129.92 MiB/s, done.
189
+    Total 18281 (delta 295), reused 18281 (delta 295)
190
+    error: RPC failed; result=22, HTTP code = 413
191
+    fatal: The remote end hung up unexpectedly
192
+    fatal: The remote end hung up unexpectedly
193
+
194
+Please increase increase the value of MOJO_MAX_MESSAGE_SIZE
195
+    
196
+    # 1GB
197
+    export MOJO_MAX_MESSAGE_SIZE=1024000000
198
+
199
+**3. git restriction**
200
+
201
+git restrict post max size via http protocol.
202
+http.postBuffer value of git config is maybe small.
203
+
204
+You maybe see the following error message.
205
+
206
+    error: RPC failed; result=56, HTTP code = 200
207
+    fatal: The remote end hung up unexpectedly
208
+    Counting objects: 18281, done.
209
+    Delta compression using up to 4 threads.
210
+    Compressing objects: 100% (17830/17830), done.
211
+    Writing objects: 100% (18281/18281), 687.05 MiB | 133.23 MiB/s, done.
212
+    Total 18281 (delta 295), reused 18281 (delta 295)
213
+    fatal: The remote end hung up unexpectedly
214
+    Everything up-to-date
215
+
216
+Please increase the value of http.postBuffer.
217
+    
218
+    # 1GB
219
+    git config http.postBuffer 1024000000
220
+
221
+### I can't create repository and see error message when I create repository with readme
222
+
223
+If you see the following error message in log/production.log
224
+
225
+    [Wed Feb 12 15:27:02 2014] [error] ... Can't execute git commit ...
226
+
227
+you need to set User name and Email of git.
228
+Please set user.name and user.email.
229
+
230
+    git config --global user.name "gitprep"
231
+    git config --global user.email "gitprep@example.com"
232
+
233
+### How to use reverse proxy?
234
+
235
+You can use GitPrep via reverse proxy access
236
+
237
+         ----------------------------     ------------
238
+    ---->| Web Server(Reverse proxy)|---->|GitPrep   |
239
+    <----| (Apache, etc)            |<----|          |
240
+         ----------------------------     ------------
241
+
242
+I show apache config example.
243
+You can use Name virtual host.
244
+    
245
+    # HTTP
246
+    <VirtualHost *:80>
247
+
248
+      ServerName myhost.com
249
+      <Proxy *>
250
+        Order deny,allow
251
+        Allow from all
252
+      </Proxy>
253
+      
254
+      ProxyRequests Off
255
+      ProxyPreserveHost On
256
+      ProxyPass / http://localhost:10020/ keepalive=On
257
+      ProxyPassReverse / http://localhost:10020/
258
+      RequestHeader set X-Forwarded-HTTPS "0"
259
+        
260
+    </VirtualHost>
261
+
262
+If you use GitPrep vis https, you should set X-Forwarded-HTTPS Request Header.
263
+
264
+    # HTTPS
265
+    <VirtualHost *:443>
266
+
267
+      ServerName myhost.com
268
+      <Proxy *>
269
+        Order deny,allow
270
+        Allow from all
271
+      </Proxy>
272
+      
273
+      ProxyRequests Off
274
+      ProxyPreserveHost On
275
+      ProxyPass / http://localhost:10020/ keepalive=On
276
+      ProxyPassReverse / http://localhost:10020/
277
+      RequestHeader set X-Forwarded-HTTPS "1"
278
+    </VirtualHost>
279
+
280
+### How to use reverse proxy with sub directory?
281
+
282
+GitPrep support reverse proxy with sub directory.
283
+
284
+At first, set [reverse_proxy]path_depth option.
285
+
286
+    [reverse_proxy]
287
+
288
+    ;;; Reverse proxy path depth (default: none)
289
+    ;;; If proxy path is http://somehost.com/foo, you set path_depth to 1.
290
+    ;;; If proxy path is http://somehost.com/foo/bar, you set path_depth to 2.
291
+    path_depth=1
292
+
293
+Next you set http server config file. The following is apache example.
294
+
295
+    <VirtualHost *:80>
296
+      ServerName perlcodesample.com
297
+      <Proxy *>
298
+        Order deny,allow
299
+        Allow from all
300
+      </Proxy>
301
+      ProxyRequests Off
302
+      ProxyPreserveHost On
303
+
304
+      ProxyPass /app1 http://localhost:10020/app1 keepalive=On
305
+      ProxyPassReverse /app1 http://localhost:3000/app1
306
+
307
+      ProxyPass /app2 http://localhost:10021/app2 keepalive=On
308
+      ProxyPassReverse /app2 http://localhost:3001/app2
309
+
310
+      RequestHeader set X-Forwarded-HTTPS "0"
311
+    </VirtualHost>
312
+
313
+### How to import already existing repositories?
314
+
315
+You can import already existing repositories by **script/import_rep** script.
316
+
317
+    cd script
318
+    ./import_rep -u kimoto rep_dir
319
+
320
+**-u** is user name. rep_dir must contains git respoitories like the following.
321
+
322
+    rep_dir/project1.git
323
+           /project2.git
324
+           /project3.git
325
+           /project3.git
326
+
327
+If **description** file exists in git repository, it is copied.
328
+
329
+### I can't add collabortor more than one
330
+
331
+This is GitPrep bug before version 1.5.1.
332
+Please use after version 1.5.2.
333
+
334
+If you continue to use GitPrep before version 1.5.1,
335
+collaboration table is broken.
336
+Please fix it by the following way.
337
+
338
+    # Run SQLite client
339
+    sqlite3 data/gitprep.db
340
+    
341
+    # drop collaboration table
342
+    drop table collaboration;
343
+    
344
+    # Restart
345
+    ./gitprep
346
+
347
+### I want to set time zone.
348
+
349
+OK. GitPrep suport time zone. You can set time_zone option in conig file.
350
+
351
+    [basic]
352
+    ;;; Time Zone
353
+    ;;; GitPrep time zone is GMT by default
354
+    ;;; You can set your local time zone.
355
+    time_zone=+9:00
356
+
357
+### How to hide user home directory in ssh repository URL?
358
+
359
+**1. Use symbolic link and ssh_rep_url_base option**
360
+
361
+At first, set [basic]ssh_rep_url_base option to /git
362
+
363
+    ;;; SSH repository url base
364
+    ; For exampke, If you set this value to /git, SSH repository url become
365
+    ; ssh://kimoto@59.106.185.196/git/kimoto/gitprep.git
366
+    ssh_rep_url_base=/git
367
+
368
+And you create symbolic link to /home/gitprep/gitprep/data/rep
369
+    
370
+    cd /
371
+    ln -s /home/gitprep/gitprep/data/rep /git
372
+    chown gitprep:gitprep /git
373
+
374
+**2. Use only public key authentication and set [basic]ssh_rep_url_base to empty**
375
+
376
+If you use only public key authentication, you can access ssh repository
377
+using the following url.
378
+
379
+    ssh://kimoto@59.106.185.196/kimoto/gitprep.git
380
+
381
+If you set [basic]ssh_rep_url_base to empty string, this URL is shown on Browser.
382
+
383
+    ;;; SSH repository url base
384
+    ; For exampke, If you set this value to /git, SSH repository url become
385
+    ; ssh://kimoto@59.106.185.196/git/kimoto/gitprep.git
386
+    ssh_rep_url_base=
387
+
388
+### How to get atom feed of commits page
389
+
390
+You can get atom feed of commits page by the following URL
391
+
392
+    http://somehost.com/kimoto/gitprep/commits/master.atom
393
+
394
+### How to run GitPrep from root user
395
+
396
+You can manage the application from the root user.
397
+
398
+Start the application
399
+
400
+    sudo -u gitprep /home/gitprep/gitprep/gitprep
401
+
402
+Stop the application
403
+
404
+    sudo -u gitprep /home/gitprep/gitprep/gitprep --stop
405
+
406
+If you want to start the application when the OS starts,
407
+add the start application command to **rc.local**(Linux).
408
+
409
+If you want to make it easy to manage gitprep,
410
+then create a run script.
411
+
412
+    mkdir -p /webapp
413
+    echo '#!/bin/sh' > /webapp/gitprep
414
+    echo 'su - gitprep -c "/home/gitprep/gitprep/gitprep $*"' >> /webapp/gitprep
415
+    chmod 755 /webapp/gitprep
416
+
417
+You can start and stop the application with the following command.
418
+
419
+    # Start or Restart
420
+    /webapp/gitprep
421
+
422
+    # Stop
423
+    /webapp/gitprep --stop
424
+
425
+## For Developer
426
+
427
+If you are a developer, you can start the application in development mode.
428
+
429
+    ./morbo
430
+
431
+Then access the following URL.
432
+
433
+    http://localhost:3000
434
+
435
+If you have git, it is easy to install from git.
436
+
437
+    git clone git://github.com/yuki-kimoto/gitprep.git
438
+
439
+It is useful to write configuration in ***gitprep.my.conf***, not gitprep.conf.
440
+
441
+## Web Site
442
+
443
+[GitPrep Web Site](http://gitprep.yukikimoto.com/)
444
+
445
+## Internally Using Library
446
+
447
+* [Config::Tiny](http://search.cpan.org/dist/Config-Tiny/lib/Config/Tiny.pm)
448
+* [DBD::SQLite](http://search.cpan.org/dist/DBD-SQLite/lib/DBD/SQLite.pm)
449
+* [DBI](http://search.cpan.org/dist/DBI/DBI.pm)
450
+* [DBIx::Connector](http://search.cpan.org/dist/DBIx-Connector/lib/DBIx/Connector.pm)
451
+* [DBIx::Custom](http://search.cpan.org/dist/DBIx-Custom/lib/DBIx/Custom.pm)
452
+* [Mojolicious](http://search.cpan.org/~sri/Mojolicious/lib/Mojolicious.pm)
453
+* [Mojolicious::Plugin::INIConfig](http://search.cpan.org/dist/Mojolicious-Plugin-INIConfig/lib/Mojolicious/Plugin/INIConfig.pm)
454
+* [mojo-legacy](https://github.com/jamadam/mojo-legacy)
455
+* [Object::Simple](http://search.cpan.org/dist/Object-Simple/lib/Object/Simple.pm)
456
+* [Text::Markdown::Hoedown](http://search.cpan.org/~tokuhirom/Text-Markdown-Hoedown-1.01/lib/Text/Markdown/Hoedown.pm)
457
+* [Validator::Custom](http://search.cpan.org/dist/Validator-Custom/lib/Validator/Custom.pm)
458
+
459
+
460
+## Sister project
461
+
462
+These are my Perl web application projects.
463
+
464
+* [WebDBViewer](https://github.com/yuki-kimoto/webdbviewer) - Database viewer to see database information on web browser.
465
+
466
+## Bug
467
+
468
+If you find bug, plese tell me on GitHub issue. 
469
+
470
+Please post only bug information.
471
+
472
+* [Github Issue](https://github.com/yuki-kimoto/gitprep/issues?state=open)
473
+
474
+## Mailing list (Asking questions and feature requests)
475
+
476
+* [Google GitPrep Group](https://groups.google.com/forum/#!forum/gitprep)
477
+
478
+You can ask questions about usage of GitPrep in this mailing list.
479
+
480
+If you want new features, please post the request to this mailing list.
481
+
482
+## Copyright & license
483
+
484
+Copyright 2012-2014 Yuki Kimoto. All rights reserved.
485
+
486
+This program is free software; you can redistribute it and/or modify it
487
+under the same terms as Perl itself.