From f6ba0ab2f5e32f577a92be5af48aaba0bca37f77 Mon Sep 17 00:00:00 2001 From: Yuki Kimoto Date: Fri, 23 Aug 2013 09:52:41 +0900 Subject: [PATCH] cleanup and improve readme, use su instead of sudo, because of sudo don't work in not terminal --- README.md | 2 +- xt/need_login_always.t | 75 ------------------------------------------ 2 files changed, 1 insertion(+), 76 deletions(-) delete mode 100644 xt/need_login_always.t diff --git a/README.md b/README.md index a8b20665..a5fbc12e 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ then create a run script. mkdir -p /webapp echo '#!/bin/sh' > /webapp/gitprep - echo 'sudo -u gitprep /home/gitprep/gitprep/gitprep $*' >> /webapp/gitprep + echo 'su - gitprep -c "/home/gitprep/gitprep/gitprep $*"' >> /webapp/gitprep chmod 755 /webapp/gitprep You can start and stop the application with the following command. diff --git a/xt/need_login_always.t b/xt/need_login_always.t deleted file mode 100644 index dfce6663..00000000 --- a/xt/need_login_always.t +++ /dev/null @@ -1,75 +0,0 @@ -use Test::More 'no_plan'; -use strict; -use warnings; - -use FindBin; -use utf8; -use lib "$FindBin::Bin/../mojo/lib"; -use lib "$FindBin::Bin/../lib"; -use lib "$FindBin::Bin/../extlib/lib/perl5"; -use File::Path 'rmtree'; -use Encode qw/encode decode/; - -use Test::Mojo; - -$ENV{GITPREP_TEST} = 1; - -# Test DB -my $db_file = $ENV{GITPREP_DB_FILE} = "$FindBin::Bin/user.db"; - -# Test Repository home -my $rep_home = $ENV{GITPREP_REP_HOME} = "$FindBin::Bin/user"; - -$ENV{GITPREP_NO_MYCONFIG} = 1; - - -use Gitprep; - -# For perl 5.8 -{ - no warnings 'redefine'; - sub note { print STDERR "# $_[0]\n" unless $ENV{HARNESS_ACTIVE} } -} - -note 'Start page'; -{ - unlink $db_file; - rmtree $rep_home; - - my $app = Gitprep->new; - my $t = Test::Mojo->new($app); - $t->ua->max_redirects(3); - - $app->config->{basic}{need_login_always} = 1; - $app->config->{basic}{reset_password} = 1; - - # Access start page - $t->get_ok('/_start'); - $t->content_like(qr/Start page/); - - # Create admin user - $t->post_ok('/_start?op=create', form => {password => 'a', password2 => 'a'}); - $t->content_like(qr/Login page/); - - # Login as admin - $t->post_ok('/_login?op=login', form => {id => 'admin', password => 'a'}); - - # Create user - $t->post_ok('/_admin/user/create?op=create', form => {id => 'kimoto1', password => 'a', password2 => 'a'}); - $t->content_like(qr/kimoto1/); - - # Access reset password page - $t->get_ok('/reset-password'); - $t->content_like(qr/Reset password page/); - - # Access login page - $t->get_ok('/_login'); - $t->content_like(qr/Login page/); - - # Logout - $t->get_ok('/_logout'); - - # Redirect to login page from other page - $t->get_ok('/_new'); - $t->content_like(qr/Login page/); -}