Skip to content

Commit

Permalink
improved install process
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-kimoto committed Apr 9, 2013
1 parent 9bd24d5 commit 9bc82ce
Show file tree
Hide file tree
Showing 203 changed files with 9,855 additions and 127 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ rep/*
gitprep.my.conf
rep/*
!rep/.gitignore
setup/log/*
!setup/log/.gitignore
setup/latest-build
setup/work/*
setup/build.log
102 changes: 85 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@ Github clone. you can install portable github system into unix/linux.
# Features

* Github clone
* Portable, you can install your unix/linux server
* Perl 5.8.7+ only needed
* CGI support
* Having built-in web werver, Reverse Proxy support

# Instllation into Shared Server (Linux or Unix/Apache/SuExec/CGI/PHP5)
# Installation into Shared Server

If you want to use GitPrep in Sahred Server,
you can use it.
Shared Server must support **Linux/Unix**, **Apache**, **SuExec**,
**CGI**, and **PHP5(CGI mode)**.

Sahred Server must support Linux/Unix, Apache, SuExec, CGI, PHP5.
Many shared server support these,
so you will find needed server easily.
(PHP is not necessary, if PHP exists, install process is easy
because you don't need to think about permission.)

you also need git.
Many shared server support these,
so you will find sutable server easily.

## Download

You donwload GitPrep.
You donwload gitprep.

https://github.com/yuki-kimoto/gitprep/archive/0.03.zip

Expand All @@ -32,7 +35,7 @@ Rename this gitprep-0.03 to gitprep.

gitprep-0.03 -> gitprep

## Add git command path
## Configuration

GitPrep need git command. you must install git by yourself.

Expand All @@ -52,7 +55,13 @@ Access the following URL by browser.

http://(Your host name)/gitprep/setup/setup.php

And click Setup button once and wail abount 5 minutes.
(If you don't access PHP file or don't have PHP,
you can use CGI script
please set this CGI script permission to 755)

http://(Your host name)/gitprep/setup/setup.cgi.

Click Setup button once and wait abount 5 minutes.

## Go to application

Expand All @@ -63,7 +72,13 @@ If you see result, click "Go to Application".
If you see internal server error, you see gitprep/log/production.log.
You know what error is happned.

# Instllation into your Unix/Linux system
# Instllation into own Unix/Linux Server

Web DB Viewer have own web server,
so you can execute application very easy.
This is much better than above way
because you don't need to setup Apache environment,
and performance is much much better.

## Create gitprep user

Expand All @@ -79,14 +94,26 @@ Download tar.gz archive and exapand it and change directory.

curl -kL https://github.com/yuki-kimoto/gitprep/archivegitprep-0.03.tar.gz > gitprep-0.03.tar.gz
tar xf gitprep-0.03.tar.gz
cd gitprep-0.03
mv gitprep-0.03 gitprep
cd gitprep

## Setup

You execute the following command. Needed moudles is installed.

perl cpanm -n -l extlib Module::CoreList
perl -Iextlib/lib/perl5 cpanm -n -L extlib --installdeps .
./setup.sh

## Test

Do test to check setup process is success or not.

prove t

If "All tests successful" is shown, setup process is success.

## Configuration

Same as Shared Server's Configuration section.

## Operation

Expand All @@ -102,6 +129,7 @@ You can access the following URL.
http://localhost:10020

If you change port, edit gitprep.conf.
If you can't access this port, you might change firewall setting.

### Stop

Expand All @@ -112,16 +140,42 @@ You can stop application by **--stop** option.
### Operation by root user

If you want to do operation by root user,
you must do some works for security.
you must do some configuration for security.

You add **user** and **group** to **hypnotoad** section in **gitprep.conf**.
You add **user** and **group** to **hypnotoad** section
in **gitprep.conf** to execute not root user for security.

[hypnotoad]
...
user=gitprep
group=gitprep

### Developer
Start application

/home/gitprep/gitprep/gitprep

Stop application

/home/gitprep/gitprep/gitprep --stop

If you want to start application when os start,
add the start application command to **rc.local**(Linux).

If you want to make easy to manage gitprep,
Let's create run script in /usr/local/sbin.

/home/gitprep/gitprep/create_run_script > /usr/local/sbin/run_gitprep
chmod 755 /usr/local/sbin/run_gitprep

You can start and stop application the following command.

# Start/Restart
run_gitprep

# Stop
run_gitprep --stop

## Developer

If you are developer, you can start application development mode

Expand All @@ -130,3 +184,17 @@ If you are developer, you can start application development mode
You can access the following URL.

http://localhost:3000

If you have git, it is easy to install from git.

git clone git://github.com/yuki-kimoto/gitprep.git

It is useful to write configuration in ***gitprep.my.conf***
, not gitprep.conf.

## Copyright & license

Copyright 2013-2013 Yuki Kimoto all rights reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
14 changes: 14 additions & 0 deletions create_run_script
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/env perl

use strict;
use warnings;
use FindBin;

my $app_path = "$FindBin::Bin/gitprep";

my $script = <<"EOS";
#!/bin/sh
$app_path \$*
EOS

print $script;
15 changes: 0 additions & 15 deletions devel/css_color.txt

This file was deleted.

10 changes: 0 additions & 10 deletions devel/memo.txt

This file was deleted.

4 changes: 2 additions & 2 deletions gitprep
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

DIR=$(dirname $0)
PERL5LIB="$DIR/mojolegacy/lib:$DIR/extlib/lib/perl5"
PERL5LIB="$DIR/mojo/lib:$DIR/extlib/lib/perl5"
export PERL5LIB
$DIR/mojolegacy/script/hypnotoad $DIR/script/gitprep "$*"
$DIR/mojo/script/hypnotoad $* $DIR/script/gitprep
7 changes: 4 additions & 3 deletions lib/Gitprep.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ sub startup {
$self->hook('before_dispatch' => sub {
my $self = shift;

if ( $self->req->headers->header('X-Forwarded-Host')) {
my $prefix = shift @{$self->req->url->path->parts};
push @{$self->req->url->base->path->parts}, $prefix;
if ($self->req->headers->header('X-Forwarded-Host')) {
my $prefix = shift @{$self->req->url->path->parts};
push @{$self->req->url->base->path->parts}, $prefix
if defined $prefix;
}
});

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions morbo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

DIR=$(dirname $0)
PERL5LIB="$DIR/mojolegacy/lib:$DIR/extlib/lib/perl5"
PERL5LIB="$DIR/mojo/lib:$DIR/extlib/lib/perl5"
export PERL5LIB
$DIR/mojolegacy/script/morbo $DIR/script/gitprep "$*"
$DIR/mojo/script/morbo $* $DIR/script/gitprep
4 changes: 2 additions & 2 deletions script/gitprep.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ BEGIN {
my $base_dir_name = $script_name;
$base_dir_name =~ s/\.cgi$//;
my @base_dir = (splitdir(dirname __FILE__), $base_dir_name);
my $mojolegacy = join('/', @base_dir, 'mojolegacy', 'lib');
my $mojo_lib = join('/', @base_dir, 'mojo', 'lib');
my $lib = join('/', @base_dir, 'lib');
my $extlib = join('/', @base_dir, 'extlib', 'lib', 'perl5');
eval 'use lib $mojolegacy, $extlib, $lib';
eval 'use lib $mojo_lib, $extlib, $lib';
croak $@ if $@;
}

Expand Down
3 changes: 3 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
perl cpanm -n -l extlib Module::CoreList
perl -Iextlib/lib/perl5 cpanm -n -L extlib --installdeps .
Empty file added setup/log/.gitignore
Empty file.
Loading

0 comments on commit 9bc82ce

Please sign in to comment.