cleanup and improve readme, use su instead of sudo...
..., because of sudo don't work in...
... | ... |
@@ -165,7 +165,7 @@ then create a run script. |
165 | 165 |
|
166 | 166 |
mkdir -p /webapp |
167 | 167 |
echo '#!/bin/sh' > /webapp/gitprep |
168 |
- echo 'sudo -u gitprep /home/gitprep/gitprep/gitprep $*' >> /webapp/gitprep |
|
168 |
+ echo 'su - gitprep -c "/home/gitprep/gitprep/gitprep $*"' >> /webapp/gitprep |
|
169 | 169 |
chmod 755 /webapp/gitprep |
170 | 170 |
|
171 | 171 |
You can start and stop the application with the following command. |
... | ... |
@@ -1,75 +0,0 @@ |
1 |
-use Test::More 'no_plan'; |
|
2 |
-use strict; |
|
3 |
-use warnings; |
|
4 |
- |
|
5 |
-use FindBin; |
|
6 |
-use utf8; |
|
7 |
-use lib "$FindBin::Bin/../mojo/lib"; |
|
8 |
-use lib "$FindBin::Bin/../lib"; |
|
9 |
-use lib "$FindBin::Bin/../extlib/lib/perl5"; |
|
10 |
-use File::Path 'rmtree'; |
|
11 |
-use Encode qw/encode decode/; |
|
12 |
- |
|
13 |
-use Test::Mojo; |
|
14 |
- |
|
15 |
-$ENV{GITPREP_TEST} = 1; |
|
16 |
- |
|
17 |
-# Test DB |
|
18 |
-my $db_file = $ENV{GITPREP_DB_FILE} = "$FindBin::Bin/user.db"; |
|
19 |
- |
|
20 |
-# Test Repository home |
|
21 |
-my $rep_home = $ENV{GITPREP_REP_HOME} = "$FindBin::Bin/user"; |
|
22 |
- |
|
23 |
-$ENV{GITPREP_NO_MYCONFIG} = 1; |
|
24 |
- |
|
25 |
- |
|
26 |
-use Gitprep; |
|
27 |
- |
|
28 |
-# For perl 5.8 |
|
29 |
-{ |
|
30 |
- no warnings 'redefine'; |
|
31 |
- sub note { print STDERR "# $_[0]\n" unless $ENV{HARNESS_ACTIVE} } |
|
32 |
-} |
|
33 |
- |
|
34 |
-note 'Start page'; |
|
35 |
-{ |
|
36 |
- unlink $db_file; |
|
37 |
- rmtree $rep_home; |
|
38 |
- |
|
39 |
- my $app = Gitprep->new; |
|
40 |
- my $t = Test::Mojo->new($app); |
|
41 |
- $t->ua->max_redirects(3); |
|
42 |
- |
|
43 |
- $app->config->{basic}{need_login_always} = 1; |
|
44 |
- $app->config->{basic}{reset_password} = 1; |
|
45 |
- |
|
46 |
- # Access start page |
|
47 |
- $t->get_ok('/_start'); |
|
48 |
- $t->content_like(qr/Start page/); |
|
49 |
- |
|
50 |
- # Create admin user |
|
51 |
- $t->post_ok('/_start?op=create', form => {password => 'a', password2 => 'a'}); |
|
52 |
- $t->content_like(qr/Login page/); |
|
53 |
- |
|
54 |
- # Login as admin |
|
55 |
- $t->post_ok('/_login?op=login', form => {id => 'admin', password => 'a'}); |
|
56 |
- |
|
57 |
- # Create user |
|
58 |
- $t->post_ok('/_admin/user/create?op=create', form => {id => 'kimoto1', password => 'a', password2 => 'a'}); |
|
59 |
- $t->content_like(qr/kimoto1/); |
|
60 |
- |
|
61 |
- # Access reset password page |
|
62 |
- $t->get_ok('/reset-password'); |
|
63 |
- $t->content_like(qr/Reset password page/); |
|
64 |
- |
|
65 |
- # Access login page |
|
66 |
- $t->get_ok('/_login'); |
|
67 |
- $t->content_like(qr/Login page/); |
|
68 |
- |
|
69 |
- # Logout |
|
70 |
- $t->get_ok('/_logout'); |
|
71 |
- |
|
72 |
- # Redirect to login page from other page |
|
73 |
- $t->get_ok('/_new'); |
|
74 |
- $t->content_like(qr/Login page/); |
|
75 |
-} |