Showing 4 changed files with 121 additions and 156 deletions
+4
CHANGES
... ...
@@ -3,6 +3,10 @@
3 3
   - add --ignore-space-change feature in diff page by using w= query string
4 4
     for example, http://some.com/kimoto/gitprep_t/commit/3cf14ade5e28ee0cd83b9a3b1e1c332aed66df53?w=
5 5
   - remove password length limit
6
+  - improve CGI installation and change CGI script path. This is not backword compatible.
7
+    you need to change CGI script path, path/gitprep.cgi to path/gitprep/gitprep/cgi
8
+  - remove setup.php
9
+  
6 10
 1.9.2
7 11
   - fix atom feed entry url bug
8 12
 1.9.1
+115 -155
README.md
... ...
@@ -3,8 +3,7 @@
3 3
 Github clone. You can install portable github system into Unix/Linux.
4 4
 
5 5
 <img src="http://cdn-ak.f.st-hatena.com/images/fotolife/p/perlcodesample/20130421/20130421180903_original.png" width="850">
6
-
7
-# Features
6
+## Features
8 7
 
9 8
 * Github clone: GitPrep has the same interface as GitHub.
10 9
 * Portable: You can install GitPrep on your own Unix/Linux server.
... ...
@@ -14,216 +13,129 @@ Github clone. You can install portable github system into Unix/Linux.
14 13
 * CGI support, built-in web server, and reverse proxy support.
15 14
 * SSL support.
16 15
 
17
-# Installation into own Unix/Linux Server
18
-
19
-GitPrep has its own web server,
20
-so you can start using the application very easily.
21
-This is much better than the way shown above
22
-because you do not need to setup the Apache environment
23
-and performance will be much better.
24
-
25
-You can also install GitPrep into Cygwin.
26
-If you want to install GitPrep into Cygwin,
27
-gcc4 and make program are needed.
28
-
29
-## Create gitprep user
30
-
31
-Create a **gitprep** user. This is not necessary, but recommended:
32
-
33
-    useradd gitprep
34
-    su - gitprep
35
-    cd ~
36
-
37
-## Download
38
-
39
-Download tar.gz archive, expand it and change directory:
40
-
41
-    curl -kL https://github.com/yuki-kimoto/gitprep/archive/latest.tar.gz > gitprep-latest.tar.gz
42
-    tar xf gitprep-latest.tar.gz
43
-    mv gitprep-latest gitprep
44
-    cd gitprep
45
-
46
-## Setup
16
+## Check Perl Version
47 17
 
48
-To setup GitPrep, execute the following command. All of the needed modules will be installed:
18
+Check Perl version. You can use GitPrep if the Perl version is 5.8.7+;
49 19
 
50
-    ./setup.sh
51
-
52
-## Test
53
-
54
-Run the test to check if the setup process was successful or not:
55
-
56
-    prove t
57
-
58
-If "All tests successful" is shown, the setup process was successful.
20
+    perl -v
59 21
 
60 22
 ## Configuration
61 23
 
62 24
 GitPrep needs the git command. You must install git by yourself.
63 25
 If you haven't set user.name and user.email, you must set them.
26
+For example:
64 27
 
65 28
     git config --global user.name "gitprep"
66 29
     git config --global user.email "gitprep@example.com"
67 30
 
68
-You must add the correct git command path to the **gitprep.conf** config file.
31
+If you install git in your local directry,
32
+you must add the correct git command path to the **gitprep.conf** config file
69 33
 
70 34
     [basic]
71 35
     ;;; Git command path
72 36
     git_bin=/home/yourname/local/bin/git
73 37
 
74
-## Operation
75
-
76
-### Start
77
-
78
-You can start the application by running the provided gitprep script.
79
-The application is run in the background and the port is **10020** by default.
80
-
81
-    ./gitprep
82
-
83
-Then access the following URL.
84
-
85
-    http://localhost:10020
86
-
87
-If you want to change the port, edit gitprep.conf.
88
-If you cannot access this port, you might change the firewall settings.
89
-
90
-### Stop
91
-
92
-You can stop the application by adding the **--stop** option.
93
-
94
-    ./gitprep --stop
95
-
96
-### Operation from root user
97
-
98
-You can manage the application from the root user.
99
-
100
-Start the application
101
-
102
-    sudo -u gitprep /home/gitprep/gitprep/gitprep
103
-
104
-Stop the application
105
-
106
-    sudo -u gitprep /home/gitprep/gitprep/gitprep --stop
107
-
108
-If you want to start the application when the OS starts,
109
-add the start application command to **rc.local**(Linux).
110
-
111
-If you want to make it easy to manage gitprep,
112
-then create a run script.
113
-
114
-    mkdir -p /webapp
115
-    echo '#!/bin/sh' > /webapp/gitprep
116
-    echo 'su - gitprep -c "/home/gitprep/gitprep/gitprep $*"' >> /webapp/gitprep
117
-    chmod 755 /webapp/gitprep
118
-
119
-You can start and stop the application with the following command.
120
-
121
-    # Start or Restart
122
-    /webapp/gitprep
123
-
124
-    # Stop
125
-    /webapp/gitprep --stop
126
-
127
-## Developer
128
-
129
-If you are a developer, you can start the application in development mode.
130
-
131
-    ./morbo
132
-
133
-Then access the following URL.
38
+## A. Installation when you run GitPrep as CGI script
134 39
 
135
-    http://localhost:3000
40
+Download tar.gz archive, expand it and change directory:
136 41
 
137
-If you have git, it is easy to install from git.
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
138 46
 
139
-    git clone git://github.com/yuki-kimoto/gitprep.git
47
+Setup. Needed module is installed.
140 48
 
141
-It is useful to write configuration in ***gitprep.my.conf***, not gitprep.conf.
49
+    ./setup.sh
142 50
 
143
-# Installation into Shared Server
51
+Check setup. Run the following command.
144 52
 
145
-Shared Server must support **Linux/Unix**, **Apache**, **SuExec**,
146
-**CGI**.
53
+    prove t
147 54
 
148
-**Note that CGI script only work on shared server which support CGI + SuExec.
149
-At first, you should check the shared server support CGI + SuExec.**
55
+If "syntax OK" is displayed, setup is sucseed.
150 56
 
151
-## Download
57
+You can access the following URL.
152 58
 
153
-First you need to [download gitprep](https://github.com/yuki-kimoto/gitprep/archive/latest.zip).
59
+    http://yourhost/somepath/gitprep/gitprep.cgi
154 60
 
155
-Expand the zip file. You will see the following directory:
61
+### If you see Internal Server Error
156 62
 
157
-    gitprep-latest
63
+If you see an internal server error, look at the log file (gitprep/log/production.log)
64
+to see what problem has occurred.
158 65
 
159
-Rename the gitprep-latest directory to gitprep.
66
+### Additional work when you don't run CGI script by your user authority.
160 67
 
161
-    gitprep-latest -> gitprep
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.
162 70
 
163
-If you know latest gitprep release, I inform you in the following blog
164
-or mailing list.
71
+Change user and group of all files in gitprep directory to apache 
165 72
 
166
-[Yuki Kimoto Perl Blog](http://blogs.perl.org/users/yuki_kimoto/)
73
+    chown -R apache:apache gitprep
167 74
 
168
-[Google GitPrep Group](https://groups.google.com/forum/#!forum/gitprep)
75
+In this case, you server need to execute CGI.
76
+Check apache config file.
169 77
 
170
-## Configuration
78
+For example, you need the following config.
171 79
 
172
-Same as "Installation into own Unix/Linux Server" Configuration section.
80
+    <Directory /var/www/html>
81
+        Options +ExecCGI
82
+        AddHandler cgi-script .cgi
83
+    </Directory>
173 84
 
174
-## Upload Server by FTP
85
+## B. Installation when you run GitPrep as embdded web server
175 86
 
176
-You should upload these directories into server document root by FTP.
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.
177 90
 
178
-## Setup
91
+### Create gitprep user
179 92
 
180
-Access the following URL by browser:
93
+Create a **gitprep** user. This is not necessary, but recommended:
181 94
 
182
-    http://(Your host name)/gitprep/setup/setup.php
95
+    useradd gitprep
96
+    su - gitprep
97
+    cd ~
183 98
 
184
-If you don't access PHP file or don't have PHP,
185
-you can use CGI script. Please set this CGI script permission to `755`.
99
+### Download
186 100
 
187
-    http://(Your host name)/gitprep/setup/setup.cgi
101
+Download tar.gz archive, expand it and change directory:
188 102
 
189
-Click the Setup button once and wait about 5 minutes.
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
190 107
 
191
-## Go to application
108
+Setup. Needed module is installed.
192 109
 
193
-If you see the result screen, click "Go to Application".
110
+    ./setup.sh
194 111
 
195
-## Getting started
112
+Check setup. Run the following command.
196 113
 
197
-On a fresh install, you will be asked to create the admin user.
114
+    prove t
198 115
 
199
-Log in as the admin user, then create a new regular user.
116
+If "syntax OK" is displayed, setup is sucseed.
200 117
 
201
-Logout and log in as the regular user. Create repos and use the system!
118
+### Start
202 119
 
203
-Note: the admin user cannot create repos.
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.
204 122
 
205
-## Importing data
123
+    ./gitprep
206 124
 
207
-One way to import data:
125
+Then access the following URL.
208 126
 
209
-1. Create your new repo in gitprep.
210
-2. In your local git repo, add a new remote target: 
211
-```
212
-git remote add gitprep git@my.gitprep.server:new-repo.git 
213
-```
214
-3. Push all your repo content up in to this new gitprep target.
215
-4. Update your local git repo config such that gitprep is now the origin.
127
+    http://localhost:10020
216 128
 
217
-Copy from `/var/lib/gitolite` or `/var/lib/gitosis`
129
+If you want to change the port, edit gitprep.conf.
130
+If you cannot access this port, you might change the firewall settings.
218 131
 
219
-TBD
132
+### Stop
220 133
 
221
-## Internal Server Error
134
+You can stop the application by adding the **--stop** option.
222 135
 
223
-If you receive an internal server error, look at the log file (gitprep/log/production.log)
224
-to see what problem has occurred.
136
+    ./gitprep --stop
225 137
 
226
-# FAQ
138
+## FAQ
227 139
 
228 140
 ### blame don't work
229 141
 
... ...
@@ -466,6 +378,53 @@ You can get atom feed of commits page by the following URL
466 378
 
467 379
     http://somehost.com/kimoto/gitprep/commits/master.atom
468 380
 
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
+
469 428
 ## Web Site
470 429
 
471 430
 [GitPrep Web Site](http://perlcodesample.sakura.ne.jp/gitprep-site/)
... ...
@@ -484,6 +443,7 @@ You can get atom feed of commits page by the following URL
484 443
 * [Text::Markdown::Hoedown](http://search.cpan.org/~tokuhirom/Text-Markdown-Hoedown-1.01/lib/Text/Markdown/Hoedown.pm)
485 444
 * [Validator::Custom](http://search.cpan.org/dist/Validator-Custom/lib/Validator/Custom.pm)
486 445
 
446
+
487 447
 ## Sister project
488 448
 
489 449
 These are my Perl web application projects.
+1 -1
lib/Gitprep.pm
... ...
@@ -17,7 +17,7 @@ use Mojolicious::Plugin::AutoRoute::Util 'template';
17 17
   eval {require Digest::SHA; import Digest::SHA qw(sha1 sha1_hex)};
18 18
 }
19 19
 
20
-our $VERSION = 'v1.10_dev';
20
+our $VERSION = 'v1.10';
21 21
 
22 22
 has 'dbi';
23 23
 has 'git';
+1
script/gitprep
... ...
@@ -1,4 +1,5 @@
1 1
 #!/usr/bin/env perl
2
+
2 3
 use Mojo::Base -strict;
3 4
 
4 5
 use File::Basename 'dirname';