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